From: Philip Reames Date: Tue, 4 May 2021 01:23:41 +0000 (-0700) Subject: [IndVarSimplify][NFC] Removed mayThrow from if-condition in predicateLoopExits of... X-Git-Tag: llvmorg-14-init~7722 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11326cbcdb9710311832774ccb08e69a607813ef;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 64ae2b3..9ee2a2d 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;