[PATCH] D69379: [ConstantFold] Fold extractelement of getelementptr
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 28 17:16:51 PDT 2019
efriedma added inline comments.
================
Comment at: llvm/lib/IR/ConstantFold.cpp:811
+ if (Op->getType()->isVectorTy()) {
+ Constant *ScalarOp = ConstantFoldExtractElementInstruction(Op, Idx);
+ if (!ScalarOp)
----------------
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.
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