From 65970aa24dd32328d00cf6560c21f2c5ff876c2d Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Mon, 4 Feb 2019 09:55:18 +0000 Subject: [PATCH] [NFC] Replace equivalent condition for better readability llvm-svn: 353032 --- llvm/lib/Transforms/Scalar/GuardWidening.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Scalar/GuardWidening.cpp b/llvm/lib/Transforms/Scalar/GuardWidening.cpp index cb0ee7b741a9..e7da37ebf8c4 100644 --- a/llvm/lib/Transforms/Scalar/GuardWidening.cpp +++ b/llvm/lib/Transforms/Scalar/GuardWidening.cpp @@ -380,7 +380,8 @@ bool GuardWideningImpl::eliminateGuardViaWidening( assert((i == (e - 1)) == (GuardInst->getParent() == CurBB) && "Bad DFS?"); - if (i == (e - 1) && CurBB->getTerminator() != GuardInst) { + if (GuardInst->getParent() == CurBB && + CurBB->getTerminator() != GuardInst) { // Corner case: make sure we're only looking at guards strictly dominating // GuardInst when visiting GuardInst->getParent(). auto NewEnd = std::find(I, E, GuardInst);