[PATCH] D69009: [IndVars] Eliminate loop exits with equivalent exit counts

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 15:00:41 PDT 2019


reames created this revision.
reames added reviewers: nikic, ebrevnov, apilipenko.
Herald added subscribers: mgrang, bollu, mcrosier.
Herald added a project: LLVM.

We can end up with two loop exits whose exit counts are equivalent, but whose textual representation is different and non-obvious.  For the sub-case where we have a series of exits which dominate one another (common), eliminate any exits which would iterate *after* a previous exit on the exiting iteration.

As noted in the TODO being removed, I'd always thought this was a good idea, but I've now seen this in a real workload as well.  This needs to be rebased on D68956 <https://reviews.llvm.org/D68956> as both need the same dominance order check.


Repository:
  rL LLVM

https://reviews.llvm.org/D69009

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69009.225121.patch
Type: text/x-patch
Size: 4880 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191015/f862c799/attachment-0001.bin>


More information about the llvm-commits mailing list