[PATCH] D82753: Correctly report Changed status in FoldBranchToCommonDest

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 04:17:18 PDT 2020


serge-sans-paille created this revision.
serge-sans-paille added a reviewer: foad.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

It's possible for the first loop trip to set the Changed Status, and to another
one to early exit, so take that into account.


https://reviews.llvm.org/D82753

Files:
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp


Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp
===================================================================
--- llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -2645,7 +2645,7 @@
             }
             // Quit if we can't remove this instruction.
             if (!tryCSEWithPredecessor(Curr, PB))
-              return false;
+              return Changed;
             Changed = true;
           }
         }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82753.274044.patch
Type: text/x-patch
Size: 468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200629/4b3d0736/attachment-0001.bin>


More information about the llvm-commits mailing list