summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/JumpThreading.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@codeaurora.org>2017-08-01 20:18:54 +0000
committerChad Rosier <mcrosier@codeaurora.org>2017-08-01 20:18:54 +0000
commitdfd1de687dd0665c507e0d6b9f819eb619135021 (patch)
tree2662d923e2bdf5202de759f73f2872c944043dd3 /llvm/lib/Transforms/Scalar/JumpThreading.cpp
parent31b52d635bd13df615ace815144e8bf0e4b45671 (diff)
downloadbcm5719-llvm-dfd1de687dd0665c507e0d6b9f819eb619135021.tar.gz
bcm5719-llvm-dfd1de687dd0665c507e0d6b9f819eb619135021.zip
[Value Tracking] Default argument to true and rename accordingly. NFC.
IMHO this is a bit more readable. llvm-svn: 309739
Diffstat (limited to 'llvm/lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/JumpThreading.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index dc9143bebc4..1c65c6c5659 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -1036,9 +1036,9 @@ bool JumpThreadingPass::ProcessImpliedCondition(BasicBlock *BB) {
if (PBI->getSuccessor(0) != CurrentBB && PBI->getSuccessor(1) != CurrentBB)
return false;
- bool FalseDest = PBI->getSuccessor(1) == CurrentBB;
+ bool CondIsTrue = PBI->getSuccessor(0) == CurrentBB;
Optional<bool> Implication =
- isImpliedCondition(PBI->getCondition(), Cond, DL, FalseDest);
+ isImpliedCondition(PBI->getCondition(), Cond, DL, CondIsTrue);
if (Implication) {
BI->getSuccessor(*Implication ? 1 : 0)->removePredecessor(BB);
BranchInst::Create(BI->getSuccessor(*Implication ? 0 : 1), BI);
@@ -2331,8 +2331,7 @@ bool JumpThreadingPass::ThreadGuard(BasicBlock *BB, IntrinsicInst *Guard,
TrueDestIsSafe = true;
else {
// False dest is safe if !BranchCond => GuardCond.
- Impl =
- isImpliedCondition(BranchCond, GuardCond, DL, /* InvertAPred */ true);
+ Impl = isImpliedCondition(BranchCond, GuardCond, DL, /* LHSIsTrue */ false);
if (Impl && *Impl)
FalseDestIsSafe = true;
}
OpenPOWER on IntegriCloud