]> granicus.if.org Git - llvm/commitdiff
[NFC] Replace equivalent condition for better readability
authorMax Kazantsev <max.kazantsev@azul.com>
Mon, 4 Feb 2019 09:55:18 +0000 (09:55 +0000)
committerMax Kazantsev <max.kazantsev@azul.com>
Mon, 4 Feb 2019 09:55:18 +0000 (09:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353032 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GuardWidening.cpp

index cb0ee7b741a9b08902f0734554c5aaaf927ad5c8..e7da37ebf8c4ad50faf49819616e0487936f332e 100644 (file)
@@ -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);