summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/ConstProp/overflow-ops.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/ConstProp/overflow-ops.ll')
-rw-r--r--llvm/test/Transforms/ConstProp/overflow-ops.ll71
1 files changed, 71 insertions, 0 deletions
diff --git a/llvm/test/Transforms/ConstProp/overflow-ops.ll b/llvm/test/Transforms/ConstProp/overflow-ops.ll
index b0abd9df405..087a806a340 100644
--- a/llvm/test/Transforms/ConstProp/overflow-ops.ll
+++ b/llvm/test/Transforms/ConstProp/overflow-ops.ll
@@ -29,6 +29,15 @@ define {i8, i1} @uadd_2() nounwind {
ret {i8, i1} %t
}
+define {i8, i1} @uadd_undef() nounwind {
+; CHECK-LABEL: @uadd_undef(
+; CHECK-NEXT: [[T:%.*]] = call { i8, i1 } @llvm.uadd.with.overflow.i8(i8 -114, i8 undef)
+; CHECK-NEXT: ret { i8, i1 } [[T]]
+;
+ %t = call {i8, i1} @llvm.uadd.with.overflow.i8(i8 142, i8 undef)
+ ret {i8, i1} %t
+}
+
;;-----------------------------
;; usub
;;-----------------------------
@@ -49,6 +58,15 @@ define {i8, i1} @usub_2() nounwind {
ret {i8, i1} %t
}
+define {i8, i1} @usub_undef() nounwind {
+; CHECK-LABEL: @usub_undef(
+; CHECK-NEXT: [[T:%.*]] = call { i8, i1 } @llvm.usub.with.overflow.i8(i8 4, i8 undef)
+; CHECK-NEXT: ret { i8, i1 } [[T]]
+;
+ %t = call {i8, i1} @llvm.usub.with.overflow.i8(i8 4, i8 undef)
+ ret {i8, i1} %t
+}
+
;;-----------------------------
;; umul
;;-----------------------------
@@ -69,6 +87,24 @@ define {i8, i1} @umul_2() nounwind {
ret {i8, i1} %t
}
+define {i8, i1} @umul_undef() nounwind {
+; CHECK-LABEL: @umul_undef(
+; CHECK-NEXT: [[T:%.*]] = call { i8, i1 } @llvm.umul.with.overflow.i8(i8 undef, i8 2)
+; CHECK-NEXT: ret { i8, i1 } [[T]]
+;
+ %t = call {i8, i1} @llvm.umul.with.overflow.i8(i8 undef, i8 2)
+ ret {i8, i1} %t
+}
+
+define {i8, i1} @umul_both_undef() nounwind {
+; CHECK-LABEL: @umul_both_undef(
+; CHECK-NEXT: [[T:%.*]] = call { i8, i1 } @llvm.umul.with.overflow.i8(i8 undef, i8 undef)
+; CHECK-NEXT: ret { i8, i1 } [[T]]
+;
+ %t = call {i8, i1} @llvm.umul.with.overflow.i8(i8 undef, i8 undef)
+ ret {i8, i1} %t
+}
+
;;-----------------------------
;; sadd
;;-----------------------------
@@ -113,6 +149,14 @@ define {i8, i1} @sadd_5() nounwind {
ret {i8, i1} %t
}
+define {i8, i1} @sadd_undef() nounwind {
+; CHECK-LABEL: @sadd_undef(
+; CHECK-NEXT: [[T:%.*]] = call { i8, i1 } @llvm.sadd.with.overflow.i8(i8 undef, i8 -10)
+; CHECK-NEXT: ret { i8, i1 } [[T]]
+;
+ %t = call {i8, i1} @llvm.sadd.with.overflow.i8(i8 undef, i8 -10)
+ ret {i8, i1} %t
+}
;;-----------------------------
;; ssub
@@ -174,6 +218,15 @@ define {i8, i1} @ssub_5() nounwind {
ret {i8, i1} %t
}
+define {i8, i1} @ssub_undef() nounwind {
+; CHECK-LABEL: @ssub_undef(
+; CHECK-NEXT: [[T:%.*]] = call { i8, i1 } @llvm.ssub.with.overflow.i8(i8 undef, i8 -10)
+; CHECK-NEXT: ret { i8, i1 } [[T]]
+;
+ %t = call {i8, i1} @llvm.ssub.with.overflow.i8(i8 undef, i8 -10)
+ ret {i8, i1} %t
+}
+
;;-----------------------------
;; smul
;;-----------------------------
@@ -185,3 +238,21 @@ define {i8, i1} @smul_1() nounwind {
%t = call {i8, i1} @llvm.smul.with.overflow.i8(i8 -20, i8 -10)
ret {i8, i1} %t
}
+
+define {i8, i1} @smul_undef() nounwind {
+; CHECK-LABEL: @smul_undef(
+; CHECK-NEXT: [[T:%.*]] = call { i8, i1 } @llvm.smul.with.overflow.i8(i8 -20, i8 undef)
+; CHECK-NEXT: ret { i8, i1 } [[T]]
+;
+ %t = call {i8, i1} @llvm.smul.with.overflow.i8(i8 -20, i8 undef)
+ ret {i8, i1} %t
+}
+
+define {i8, i1} @smul_both_undef() nounwind {
+; CHECK-LABEL: @smul_both_undef(
+; CHECK-NEXT: [[T:%.*]] = call { i8, i1 } @llvm.smul.with.overflow.i8(i8 undef, i8 undef)
+; CHECK-NEXT: ret { i8, i1 } [[T]]
+;
+ %t = call {i8, i1} @llvm.smul.with.overflow.i8(i8 undef, i8 undef)
+ ret {i8, i1} %t
+}
OpenPOWER on IntegriCloud