[llvm] 9ba452b - [JumpThreading] Don't pass DT to isGuaranteedNotToBeUndefOrPoison()

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 02:53:57 PDT 2022


Author: Nikita Popov
Date: 2022-05-17T11:53:49+02:00
New Revision: 9ba452b08eb5368bd89126102031b687d0ecdbaf

URL: https://github.com/llvm/llvm-project/commit/9ba452b08eb5368bd89126102031b687d0ecdbaf
DIFF: https://github.com/llvm/llvm-project/commit/9ba452b08eb5368bd89126102031b687d0ecdbaf.diff

LOG: [JumpThreading] Don't pass DT to isGuaranteedNotToBeUndefOrPoison()

JumpThreading intentionally does not force updating of the DT
during optimization, because this may be expensive when many CFG
updates and DT calculations are interleaved.

We shouldn't be fetching the DT just for the purpose of calling
isGuaranteedNotToBeUndefOrPoison(), especially as DT availability
doesn't even show benefit in tests.

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/JumpThreading.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index 5ae670c002fd..4a64ada1b538 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -2911,8 +2911,7 @@ bool JumpThreadingPass::tryToUnfoldSelectInCurrBB(BasicBlock *BB) {
     // Expand the select.
     Value *Cond = SI->getCondition();
     if (InsertFreezeWhenUnfoldingSelect &&
-        !isGuaranteedNotToBeUndefOrPoison(Cond, nullptr, SI,
-                                          &DTU->getDomTree()))
+        !isGuaranteedNotToBeUndefOrPoison(Cond, nullptr, SI))
       Cond = new FreezeInst(Cond, "cond.fr", SI);
     Instruction *Term = SplitBlockAndInsertIfThen(Cond, SI, false);
     BasicBlock *SplitBB = SI->getParent();


        


More information about the llvm-commits mailing list