Skip to content

Commit 57a3788

Browse files
committed
[x86] Assert that the new reduction does not depend on the converted one
1 parent 93df21f commit 57a3788

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47279,9 +47279,12 @@ static SDValue combineExtractVectorEltAndOperand(SDNode* N, SelectionDAG& DAG,
4727947279
// resulted from a reduction, then we need to replace all uses of V with
4728047280
// scalar_to_vector(Op) to make sure that we eliminated the binop + shuffle
4728147281
// pyramid. This is safe to do, because the elements of V are undefined except
47282-
// for the zeroth element.
47282+
// for the zeroth element and Op does not depend on V.
4728347283

4728447284
auto OldV = N->getOperand(0);
47285+
assert(!Op.getNode()->hasPredecessor(OldV.getNode()) &&
47286+
"Op must not depend on the converted reduction");
47287+
4728547288
auto NewV = DAG.getNode(ISD::SCALAR_TO_VECTOR, SDLoc(N), OldV->getValueType(0), Op);
4728647289

4728747290
auto NV = DCI.CombineTo(N, Op);

0 commit comments

Comments
 (0)