summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-12-17 22:42:29 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-12-17 22:42:29 +0000
commit250b119d98d78b63870dc1258a9e55615ae4b10e (patch)
tree8981aa1ffad5ae7f8747008078c6bec66e572da5 /llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll
parent050672ab8440565ea7e06ca9622a5ce819ca58ac (diff)
downloadbcm5719-llvm-250b119d98d78b63870dc1258a9e55615ae4b10e.tar.gz
bcm5719-llvm-250b119d98d78b63870dc1258a9e55615ae4b10e.zip
Allow instcombine to combine "sext(a) >u const" to "a >u trunc(const)".
llvm-svn: 91631
Diffstat (limited to 'llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll32
1 files changed, 32 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll b/llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll
index 187e2f594d6..6672b6c6d4e 100644
--- a/llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll
+++ b/llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll
@@ -33,6 +33,14 @@ define i1 @lt_signed_to_large_negative(i8 %SB) {
; CHECK: ret i1 false
}
+define i1 @lt_signed_to_small_unsigned(i8 %SB) {
+ %Y = sext i8 %SB to i32
+ %C = icmp ult i32 %Y, 17
+ ret i1 %C
+; CHECK: %C = icmp ult i8 %SB, 17
+; CHECK: ret i1 %C
+}
+
define i1 @lt_signed_to_small_signed(i8 %SB) {
%Y = sext i8 %SB to i32 ; <i32> [#uses=1]
%C = icmp slt i32 %Y, 17 ; <i1> [#uses=1]
@@ -77,6 +85,14 @@ define i1 @lt_unsigned_to_small_unsigned(i8 %SB) {
; CHECK: ret i1 %C
}
+define i1 @lt_unsigned_to_small_signed(i8 %SB) {
+ %Y = zext i8 %SB to i32
+ %C = icmp slt i32 %Y, 17
+ ret i1 %C
+; CHECK: %C = icmp ult i8 %SB, 17
+; CHECK: ret i1 %C
+}
+
define i1 @lt_unsigned_to_small_negative(i8 %SB) {
%Y = zext i8 %SB to i32 ; <i32> [#uses=1]
%C = icmp slt i32 %Y, -17 ; <i1> [#uses=1]
@@ -106,6 +122,14 @@ define i1 @gt_signed_to_large_negative(i8 %SB) {
; CHECK: ret i1 true
}
+define i1 @gt_signed_to_small_unsigned(i8 %SB) {
+ %Y = sext i8 %SB to i32
+ %C = icmp ugt i32 %Y, 17
+ ret i1 %C
+; CHECK: %C = icmp ugt i8 %SB, 17
+; CHECK: ret i1 %C
+}
+
define i1 @gt_signed_to_small_signed(i8 %SB) {
%Y = sext i8 %SB to i32 ; <i32> [#uses=1]
%C = icmp sgt i32 %Y, 17 ; <i1> [#uses=1]
@@ -151,6 +175,14 @@ define i1 @gt_unsigned_to_small_unsigned(i8 %SB) {
; CHECK: ret i1 %C
}
+define i1 @gt_unsigned_to_small_signed(i8 %SB) {
+ %Y = zext i8 %SB to i32
+ %C = icmp sgt i32 %Y, 17
+ ret i1 %C
+; CHECK: %C = icmp ugt i8 %SB, 17
+; CHECK: ret i1 %C
+}
+
define i1 @gt_unsigned_to_small_negative(i8 %SB) {
%Y = zext i8 %SB to i32 ; <i32> [#uses=1]
%C = icmp sgt i32 %Y, -17 ; <i1> [#uses=1]
OpenPOWER on IntegriCloud