[PATCH] D139832: [IndVars] Support AND/OR in optimizeLoopExitWithUnknownExitCount
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 10 03:51:08 PST 2023
mkazantsev added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1464
+ // Avoid instruction duplication.
+ if (isa<Instruction>(Curr) && !Curr->hasOneUse())
+ return false;
----------------
nikic wrote:
> I don't think we need to check `isa<Instruction>(Curr) &&` here (I guess you could have a constant expression icmp or something, but the whole transform doesn't make sense for that case).
Method parameter with one use?
================
Comment at: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1480
+ NCI->setName(OldCond->getName() + ".first_iter");
+ NCI->moveBefore(cast<Instruction>(OldCond));
+ }
----------------
nikic wrote:
> Should we be setting the insert point on Rewriter instead? Mainly wondering if we might generate multiple insts and this then only moves one of them.
Interesting point, will check.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139832/new/
https://reviews.llvm.org/D139832
More information about the llvm-commits
mailing list