[PATCH] D61922: [IndVarSimplify] Rotate exit comparisons to make them more invariant

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 15:20:41 PDT 2019


reames created this revision.
reames added reviewers: sanjoy, apilipenko, skatkov.
Herald added subscribers: bollu, mcrosier.
Herald added a project: LLVM.

(If anyone has better terminology for this than "rotation", please throw it out.)

If we have a loop exit test which involves a loop varying binary op compared to a loop invariant value, see if we can invert that binary op on both sides of the comparison.  This doesn't directly remove any instructions, but does make more of the computation loop invariant.  This both helps directly for long running loops, and also simplifies the loop structure such that other transforms may run.


Repository:
  rL LLVM

https://reviews.llvm.org/D61922

Files:
  lib/Transforms/Scalar/IndVarSimplify.cpp
  test/Transforms/IndVarSimplify/rotate-exit-test.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61922.199523.patch
Type: text/x-patch
Size: 11294 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190514/88c869db/attachment.bin>


More information about the llvm-commits mailing list