From 74291297a22f02e1144c35035deddb15cf04761d Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Mon, 4 Feb 2019 10:41:17 +0000 Subject: [PATCH] [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 --- lib/Transforms/Scalar/GuardWidening.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.40.0