[llvm] 11326cb - [IndVarSimplify][NFC] Removed mayThrow from if-condition in predicateLoopExits of IndVarSimplify

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon May 3 18:25:18 PDT 2021


Author: Philip Reames
Date: 2021-05-03T18:25:07-07:00
New Revision: 11326cbcdb9710311832774ccb08e69a607813ef

URL: https://github.com/llvm/llvm-project/commit/11326cbcdb9710311832774ccb08e69a607813ef
DIFF: https://github.com/llvm/llvm-project/commit/11326cbcdb9710311832774ccb08e69a607813ef.diff

LOG: [IndVarSimplify][NFC] Removed mayThrow from if-condition in predicateLoopExits of IndVarSimplify

Instruction has mayHaveSideEffects method that returns true if mayThrow return true because this is called internally in the first method.  As such, the call being removed is redundant.

Patch By: vdsered (Daniil Seredkin)
Differential Revision: https://reviews.llvm.org/D101685

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 64ae2b3138fbd..9ee2a2d0bf080 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -1668,7 +1668,7 @@ bool IndVarSimplify::predicateLoopExits(Loop *L, SCEVExpander &Rewriter) {
   for (BasicBlock *BB : L->blocks())
     for (auto &I : *BB)
       // TODO:isGuaranteedToTransfer
-      if (I.mayHaveSideEffects() || I.mayThrow())
+      if (I.mayHaveSideEffects())
         return false;
 
   bool Changed = false;


        


More information about the llvm-commits mailing list