[llvm] r353038 - [NFC] Make a check in GuardWidening more obvious

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 4 02:41:17 PST 2019


Author: mkazantsev
Date: Mon Feb  4 02:41:17 2019
New Revision: 353038

URL: http://llvm.org/viewvc/llvm-project?rev=353038&view=rev
Log:
[NFC] Make a check in GuardWidening more obvious

Modified:
    llvm/trunk/lib/Transforms/Scalar/GuardWidening.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/GuardWidening.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GuardWidening.cpp?rev=353038&r1=353037&r2=353038&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GuardWidening.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GuardWidening.cpp Mon Feb  4 02:41:17 2019
@@ -375,7 +375,7 @@ bool GuardWideningImpl::eliminateInstrVi
 
     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);




More information about the llvm-commits mailing list