mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 18:42:46 +02:00
[ConstantFold] Push extractelement into getelementptr's operands
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.
This commit is contained in:
parent
edca512d29
commit
a5da59e9b1
@ -808,7 +808,7 @@ Constant *llvm::ConstantFoldExtractElementInstruction(Constant *Val,
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user