From: Max Kazantsev Date: Mon, 4 Feb 2019 10:41:17 +0000 (+0000) Subject: [NFC] Make a check in GuardWidening more obvious X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=74291297a22f02e1144c35035deddb15cf04761d;p=llvm [NFC] Make a check in GuardWidening more obvious git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353038 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/GuardWidening.cpp b/lib/Transforms/Scalar/GuardWidening.cpp index 33597705cae..d2cde52ee7e 100644 --- a/lib/Transforms/Scalar/GuardWidening.cpp +++ b/lib/Transforms/Scalar/GuardWidening.cpp @@ -375,7 +375,7 @@ bool GuardWideningImpl::eliminateInstrViaWidening( assert((i == (e - 1)) == (Instr->getParent() == CurBB) && "Bad DFS?"); - if (Instr->getParent() == CurBB && CurBB->getTerminator() != Instr) { + if (Instr->getParent() == CurBB && isGuard(Instr)) { // Corner case: make sure we're only looking at guards strictly dominating // GuardInst when visiting GuardInst->getParent(). auto NewEnd = std::find(I, E, Instr);