[PATCH] D31194: [InstSimplify] Try to Constant Fold the Instruction before simplification
Joey Gouly via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 21 02:56:33 PDT 2017
joey added a comment.
In https://reviews.llvm.org/D31194#725318, @craig.topper wrote:
> I wonder if you should just call ConstantFoldInstOperands where we currently call ConstantExpr::getElementPtr? I think that will try to constant fold it before falling back to ConstantExpr::getElementPtr.
Unless I'm misunderstanding, 'ConstantFoldInstOperands' requires an Instruction as an argument and at the point inside 'SimplifyGEPInst', I don't have an Instruction just the operands.
I could create an Instruction and pass it to 'ConstantFoldInstOperands', but that seems just the same as what I suggested.
Repository:
rL LLVM
https://reviews.llvm.org/D31194
More information about the llvm-commits
mailing list