summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-10 22:53:04 +0000
committerChris Lattner <sabre@nondot.org>2007-12-10 22:53:04 +0000
commitd2265b45ae58c2c26fb12035df1e3900ef37e5b8 (patch)
tree2d97b40f1282b0566509c19fb788da69f715eb7a /llvm/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll
parent91f78080e3727d4472f9aac4b401938ce2195c80 (diff)
downloadbcm5719-llvm-d2265b45ae58c2c26fb12035df1e3900ef37e5b8.tar.gz
bcm5719-llvm-d2265b45ae58c2c26fb12035df1e3900ef37e5b8.zip
Fix PR1850 by removing an unsafe transformation from VMCore/ConstantFold.cpp.
Reimplement the xform in Analysis/ConstantFolding.cpp where we can use targetdata to validate that it is safe. While I'm in there, fix some const correctness issues and generalize the interface to the "operand folder". llvm-svn: 44817
Diffstat (limited to 'llvm/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll b/llvm/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll
new file mode 100644
index 00000000000..80df6fbdce3
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/2007-12-10-ConstFoldCompare.ll
@@ -0,0 +1,9 @@
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
+target triple = "i686-pc-linux-gnu"
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep {ret i1 0}
+; PR1850
+
+define i1 @test() {
+ %cond = icmp ule i8* inttoptr (i64 4294967297 to i8*), inttoptr (i64 5 to i8*)
+ ret i1 %cond
+}
OpenPOWER on IntegriCloud