[PATCH] D88460: Strlen loop idiom recognition
Aditya Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 16 11:00:10 PST 2021
hiraditya added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1657
+ PHINode *PN = dyn_cast<PHINode>(&I);
+ if (PN) {
+ for (unsigned PredBB = 0, E = PN->getNumIncomingValues(); PredBB != E;
----------------
break when I != PN because PNs are in the beginning of a basic block.
```
if (!PN)
break;
================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1719
+ deleteDeadInstruction(cast<Instruction>(IncPtr));
+ SE->forgetLoop(CurLoop);
+
----------------
Should we call `forgetLoop` before deleting the loop?
================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1721
+
+ LLVM_DEBUG(dbgs() << " Formed strlen: " << *Strlen << "\n");
+
----------------
Shouldn't be necessary as ORE is already there.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88460/new/
https://reviews.llvm.org/D88460
More information about the llvm-commits
mailing list