[NFC] Make a check in GuardWidening more obvious
authorMax Kazantsev <max.kazantsev@azul.com>
Mon, 4 Feb 2019 10:41:17 +0000 (10:41 +0000)
committerMax Kazantsev <max.kazantsev@azul.com>
Mon, 4 Feb 2019 10:41:17 +0000 (10:41 +0000)
llvm-svn: 353038

llvm/lib/Transforms/Scalar/GuardWidening.cpp

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