This fixes a minor oversight mentioned in the review of D69379:
we should push extractelement into the operands of getelementptr
regardless of whether that enables further folding.
for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) {
Constant *Op = CE->getOperand(i);
if (Op->getType()->isVectorTy()) {
- Constant *ScalarOp = ConstantFoldExtractElementInstruction(Op, Idx);
+ Constant *ScalarOp = ConstantExpr::getExtractElement(Op, Idx);
if (!ScalarOp)
return nullptr;
Ops.push_back(ScalarOp);