[PATCH] D16838: [LoopUnrolling] Try harder to avoid rebuilding LCSSA when possible.

Michael Zolotukhin via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 2 19:49:06 PST 2016


mzolotukhin created this revision.
mzolotukhin added reviewers: chandlerc, hfinkel, dexonsmith, bogner, joker.eph.
mzolotukhin added a subscriber: llvm-commits.

In r255133 (reapplied r253126) we started to avoid redundant recomputation of LCSSA after loop-unrolling. This patch moves one step further in this direction - now we can avoid it for much wider range of loops, as we start to look at IR and try to figure out if the transformation actually breaks LCSSA phis or makes it necessary to insert new ones.

In future we might go even further and try to fix LCSSA in-place rather than rebuilding it, but I'm not quite sure yet that it's always possible (and computationally cheaper). Anyway, this patch seems to be aligned with that direction.

One of the most important use-cases that previous implementation didn't handle is loops with calls that might throw an exception. Such loops have exits from entire loop nest, but we still don't need to recompute LCSSA after unrolling, as such exits usually don't contain LCSSA phis.

The patch was tested on LNT testsuite + SPECS, neither failures nor significant compile time changes were spotted.

http://reviews.llvm.org/D16838

Files:
  lib/Transforms/Utils/LoopUnroll.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16838.46734.patch
Type: text/x-patch
Size: 4667 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160203/fbfbafaa/attachment.bin>


More information about the llvm-commits mailing list