[PATCH] D143705: [LoopBoundSplit] Delete redundant loop guard

Allen zhong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 00:37:30 PST 2023


Allen created this revision.
Allen added reviewers: jaykang10, mkazantsev, reames, sanwou01, wwei, efriedma.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
Allen requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This changes try to remove the redundant loop guard,

  For example, it transforms left code to right code:
  ```
      newbound = min(n, c)                    newbound = min(n, c)
      while(iv < newbound) {                  while(iv < newbound) {
         A                                      A
         B                                      B
         C                                      C
       }                                      }
       if (iv != n) {
          while (iv < n) {                    while (iv < n) {
             A                                  A
             C                                  C
           }                                  }
       }
  ```
  
  Depand on D102234


https://reviews.llvm.org/D143705

Files:
  llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp
  llvm/test/Transforms/LoopBoundSplit/bug-loop-bound-split-phi-in-exit-block.ll
  llvm/test/Transforms/LoopBoundSplit/bug51866.ll
  llvm/test/Transforms/LoopBoundSplit/loop-bound-split.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143705.496354.patch
Type: text/x-patch
Size: 18222 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230210/555a0ef0/attachment.bin>


More information about the llvm-commits mailing list