[PATCH] D22630: Loop rotation

Michael Zolotukhin via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 12:30:43 PDT 2016


mzolotukhin added a comment.

Hi Aditya,

Thanks for working on this! I've been working on some improvements in loop-rotation too, though it looks like we're targeting slightly different cases.

I have a question inspired by the test `pr7447.ll`: I don't understand why we should rotate these loops (looking at just CFG). My guess is that helping GVN/LICM/etc would be just a luck in this case, and e.g. if you run loop-rotate twice on this test, you'd get the original IR, or something similar. What I'm getting at is that if we want to prepare IR for some other passes, we need to make sure we only touch cases where these passes would benefit. We can't just blindly rotate more loops. Or am I missing something? What is the current motivation to rotate or not rotate the loop?

FWIW, this is the CFG of the test from `pr7447.ll`:

        |
        v
  (  for.cond  )
   |    |    ^
   |    |    |
   |    v    |
   | ( for.cond1 )
   |    |    ^
   |    |    |
   |    v    |
   | ( land.rhs )
   |     |
   |     |
   v     v
  ( return )

Thanks,
Michael


https://reviews.llvm.org/D22630





More information about the llvm-commits mailing list