[PATCH] D42739: [InstCombine] allow multi-use values in canEvaluate* if all uses are in 1 inst
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 5 08:08:01 PST 2018
spatel added inline comments.
================
Comment at: llvm/trunk/lib/Transforms/InstCombine/InstCombineCasts.cpp:189
+ Value *LHS, *RHS;
+ if (I->getOperand(0) == I->getOperand(1)) {
+ // Don't create an unnecessary value if the operands are repeated.
----------------
aaboud wrote:
> Sorry, I did not notice this before.
> But should not we do the same check also for the "Select" and "PHI" below?
> Could that be related to the infinite loop caused by this patch?
Yes, certainly for the select. I'm not sure about PHI though. A PHI with identical operands would be an invalid instruction?
'PHINode should have one entry for each predecessor of its parent basic block!'
Repository:
rL LLVM
https://reviews.llvm.org/D42739
More information about the llvm-commits
mailing list