summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-07-11 04:20:58 +0000
committerChris Lattner <sabre@nondot.org>2008-07-11 04:20:58 +0000
commit6af608b8cecaf85ec0c0c670fbe79023e0a0bf45 (patch)
tree16d1a0c220c96c8542b8069972f4f954f7276515 /llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll
parent4fa8bb343016b2f5913128c473a614bc5fd289f0 (diff)
downloadbcm5719-llvm-6af608b8cecaf85ec0c0c670fbe79023e0a0bf45.tar.gz
bcm5719-llvm-6af608b8cecaf85ec0c0c670fbe79023e0a0bf45.zip
Fix folding of icmp's of i1 where the comparison is signed. The code
was using the algorithm for folding unsigned comparisons which is completely wrong. This has been broken since the signless types change. llvm-svn: 53444
Diffstat (limited to 'llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll11
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll b/llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll
index f5efefb0a0b..205e57d7973 100644
--- a/llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll
+++ b/llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll
@@ -1,8 +1,17 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {%C = xor i1 %A, true}
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {ret i1 false}
; PR2539
-define i1 @test(i1 %A) {
+define i1 @test1(i1 %A) {
%B = zext i1 %A to i32
%C = icmp slt i32 %B, 1
ret i1 %C
}
+
+
+define i1 @test2(i1 zeroext %b) {
+entry:
+ %cmptmp = icmp slt i1 %b, true ; <i1> [#uses=1]
+ ret i1 %cmptmp
+}
+
OpenPOWER on IntegriCloud