[PATCH] D14908: [IndVars] Preserve LCSSA on inner loops

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 22 11:39:54 PST 2015


sanjoy created this revision.
sanjoy added reviewers: majnemer, mzolotukhin, chandlerc, atrick.
sanjoy added a subscriber: llvm-commits.

Currently IndVarSimplify breaks LCSSA on inner loops even though it says
it preserves LCSSA.  Fix this by running `formLCSSARecursively`
explictly on the inner loops.

Fixes PR25578 and PR24804.

There are couple of ways we can make this logic more frugal if needed:

 - Inspect only newly inserted / moved instructions for possible LCSSA
   breakage
 - Teach SCEVExpander to not break LCSSA for any loop in the loop nest

Test cases courtesy of David Majnemer and Michael Zolotukhin!

http://reviews.llvm.org/D14908

Files:
  lib/Transforms/Scalar/IndVarSimplify.cpp
  test/Transforms/IndVarSimplify/pr24804.ll
  test/Transforms/IndVarSimplify/pr25578.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14908.40883.patch
Type: text/x-patch
Size: 3418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151122/37911051/attachment.bin>


More information about the llvm-commits mailing list