[IndVarSimplify][NFC] Removed mayThrow from if-condition in predicateLoopExits of...
authorPhilip Reames <listmail@philipreames.com>
Tue, 4 May 2021 01:23:41 +0000 (18:23 -0700)
committerPhilip Reames <listmail@philipreames.com>
Tue, 4 May 2021 01:25:07 +0000 (18:25 -0700)
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

llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

index 64ae2b3..9ee2a2d 100644 (file)
@@ -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;