[PATCH] D69379: [ConstantFold] Fold extractelement of getelementptr
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 29 03:37:43 PDT 2019
foad marked an inline comment as done.
foad added inline comments.
================
Comment at: llvm/lib/IR/ConstantFold.cpp:811
+ if (Op->getType()->isVectorTy()) {
+ Constant *ScalarOp = ConstantFoldExtractElementInstruction(Op, Idx);
+ if (!ScalarOp)
----------------
efriedma wrote:
> This should probably be ConstantExpr::getExtractElement(), not ConstantFoldExtractElementInstruction. Pushing the extractelement into the operands should always be canonical. Granted, it's hard to come up with an example where that should make a difference.
Agreed and fixed in dc63d6175aa.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69379/new/
https://reviews.llvm.org/D69379
More information about the llvm-commits
mailing list