aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/JumpThreading.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-12 01:37:43 +0000
committerChris Lattner <sabre@nondot.org>2009-11-12 01:37:43 +0000
commit1c96b4187be7589492dccf33e9fe7679ac61023d (patch)
tree939438e5c14f1a61b929333d014a757119f9025c /lib/Transforms/Scalar/JumpThreading.cpp
parent38392bbeb81233d0b342ad33166fc82ad922bc34 (diff)
this argument can be an arbitrary value, it doesn't need to be an instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86923 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r--lib/Transforms/Scalar/JumpThreading.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp
index a380857235..e7ca0f4b50 100644
--- a/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/lib/Transforms/Scalar/JumpThreading.cpp
@@ -95,7 +95,7 @@ namespace {
bool ComputeValueKnownInPredecessors(Value *V, BasicBlock *BB,
PredValueInfo &Result);
- bool ProcessThreadableEdges(Instruction *CondInst, BasicBlock *BB);
+ bool ProcessThreadableEdges(Value *Cond, BasicBlock *BB);
bool ProcessBranchOnDuplicateCond(BasicBlock *PredBB, BasicBlock *DestBB);
@@ -927,15 +927,14 @@ FindMostPopularDest(BasicBlock *BB,
return MostPopularDest;
}
-bool JumpThreading::ProcessThreadableEdges(Instruction *CondInst,
- BasicBlock *BB) {
+bool JumpThreading::ProcessThreadableEdges(Value *Cond, BasicBlock *BB) {
// If threading this would thread across a loop header, don't even try to
// thread the edge.
if (LoopHeaders.count(BB))
return false;
SmallVector<std::pair<ConstantInt*, BasicBlock*>, 8> PredValues;
- if (!ComputeValueKnownInPredecessors(CondInst, BB, PredValues))
+ if (!ComputeValueKnownInPredecessors(Cond, BB, PredValues))
return false;
assert(!PredValues.empty() &&
"ComputeValueKnownInPredecessors returned true with no values");