[PATCH] D108910: [IndVars] Break backedge and replace PHIs if loop exits on 1st iteration

Dmitry Makogon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 30 02:28:08 PDT 2021


dmakogon created this revision.
dmakogon added a reviewer: mkazantsev.
Herald added a subscriber: hiraditya.
dmakogon requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Implement TODO in optimizeLoopExits. Now if we have proved that some loop exit is taken on 1st iteration, we make all branches in the following exiting blocks always branch to their exits and also we replace all loop header PHI nodes with the values from the loop preheader (because the backedge is never taken and the loop is in the Loop Simplify Form).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108910

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108910.369404.patch
Type: text/x-patch
Size: 5514 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210830/1f797c01/attachment-0001.bin>


More information about the llvm-commits mailing list