[PATCH] D30225: [LIR] re-enable generation of memmove with runtime checks

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 11:48:02 PST 2017


efriedma added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1090
+    SmallVector<BasicBlock*, 8> ExitBlocks;
+    CurLoop->getUniqueExitBlocks(ExitBlocks);
+    if (ExitBlocks.size() != 1)
----------------
getUniqueExitBlock?


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1111
+  if (Instruction *In = dyn_cast<Instruction>(NumBytes))
+    if (Value *Simp = SimplifyInstruction(In, *DL, TLI, DT))
+      NumBytes = Simp;
----------------
Why do we need to call SimplifyInstruction here?


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1192
+      ExitD = DT->findNearestCommonDominator(ExitD, PB);
+      if (!ExitD)
+        break;
----------------
Can we simplify this code by requiring LoopSimplify?  (hasDedicatedExits() makes updating the domtree much more straightforward.)


https://reviews.llvm.org/D30225





More information about the llvm-commits mailing list