summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/JumpThreading.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-12 04:57:13 +0000
committerChris Lattner <sabre@nondot.org>2009-11-12 04:57:13 +0000
commitf496e79f44f13ac80564f5f8e69aa648033e7889 (patch)
treedb7e4b17f8e5deaf91fb6e67427d4fb80abc1805 /lib/Transforms/Scalar/JumpThreading.cpp
parent0e0ff29271df58e3bc545e40f5432c436e8bd76b (diff)
downloadllvm-f496e79f44f13ac80564f5f8e69aa648033e7889.tar.gz
llvm-f496e79f44f13ac80564f5f8e69aa648033e7889.tar.bz2
llvm-f496e79f44f13ac80564f5f8e69aa648033e7889.tar.xz
various fixes to the lattice transfer functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86952 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r--lib/Transforms/Scalar/JumpThreading.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp
index e7a87e098d..1bfad2d5d7 100644
--- a/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/lib/Transforms/Scalar/JumpThreading.cpp
@@ -275,6 +275,12 @@ ComputeValueKnownInPredecessors(Value *V, BasicBlock *BB,PredValueInfo &Result){
/// predecessor based on its terminator.
//
if (LVI) {
+ // FIXME: change this to use the more-rich 'getPredicateOnEdge' method if
+ // "I" is a non-local compare-with-a-constant instruction. This would be
+ // able to handle value inequalities better, for example if the compare is
+ // "X < 4" and "X < 3" is known true but "X < 4" itself is not available.
+ // Perhaps getConstantOnEdge should be smart enough to do this?
+
for (pred_iterator PI = pred_begin(BB), E = pred_end(BB); PI != E; ++PI) {
// If the value is known by LazyValueInfo to be a constant in a
// predecessor, use that information to try to thread this block.