[PATCH] D91682: [LoopInterchange] Fix the checking of tightly nested loop

Ettore Tiotto via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 11:41:31 PST 2020


etiotto added inline comments.


================
Comment at: llvm/lib/Analysis/LoopNestAnalysis.cpp:126
+      // loop guard compare instruction and the outer loop latch compare
+      // instruction.  For binary operations, if both of the operands are
+      // invariants of the inner loop, the corresponding operation can be
----------------
I think that removing this restriction (allow binary operators that have loop invariant values) is not necessary and would make the definition of a perfect loop nest too loose. 

In order to handle a loop with binary opcodes that have loop invariant values in the inner loop you could add a transformation that sink that instruction into the inner loop (therefore making the resulting loop nest perfect). Then loop interchange will be able to handle the resulting perfect loop nest.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91682/new/

https://reviews.llvm.org/D91682



More information about the llvm-commits mailing list