[PATCH] D47345: [InstructionCombining] Replace small allocations with local/global variable

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 25 11:46:00 PDT 2018


xbolva00 added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:2299
+
+  if (LI->getLoopFor(Malloc->getParent())) {
+    // Do not optimize if malloc is in loop
----------------
efriedma wrote:
> This isn't sufficient to guarantee malloc will be called once; getLoopFor won't find irreducible loops.
How can we fix it and detect them?

I read some comments about irreducible loops in getNearestLoop...


https://reviews.llvm.org/D47345





More information about the llvm-commits mailing list