summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-09-27 18:38:51 +0000
committerSanjay Patel <spatel@rotateright.com>2019-09-27 18:38:51 +0000
commit1b40402aa2bec5948ca64f5fa257ee010e89287f (patch)
tree6e6e4a19d4e1b92ef21d59e394a6b09f1226bf0a /llvm/test
parent750bdda6388668b4fea655ced20bd4e59fe6c968 (diff)
downloadbcm5719-llvm-1b40402aa2bec5948ca64f5fa257ee010e89287f.tar.gz
bcm5719-llvm-1b40402aa2bec5948ca64f5fa257ee010e89287f.zip
[InstSimplify] add tests for fma/fmuladd with undef operand; NFC
llvm-svn: 373109
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstSimplify/call.ll54
1 files changed, 54 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/call.ll b/llvm/test/Transforms/InstSimplify/call.ll
index cc98502ff2e..3083e60cd90 100644
--- a/llvm/test/Transforms/InstSimplify/call.ll
+++ b/llvm/test/Transforms/InstSimplify/call.ll
@@ -745,6 +745,60 @@ define i9 @fshr_shift_undef(i9 %x, i9 %y) {
declare double @llvm.fma.f64(double,double,double)
declare double @llvm.fmuladd.f64(double,double,double)
+define double @fma_undef_op0(double %x, double %y) {
+; CHECK-LABEL: @fma_undef_op0(
+; CHECK-NEXT: [[R:%.*]] = call double @llvm.fma.f64(double undef, double [[X:%.*]], double [[Y:%.*]])
+; CHECK-NEXT: ret double [[R]]
+;
+ %r = call double @llvm.fma.f64(double undef, double %x, double %y)
+ ret double %r
+}
+
+define double @fma_undef_op1(double %x, double %y) {
+; CHECK-LABEL: @fma_undef_op1(
+; CHECK-NEXT: [[R:%.*]] = call double @llvm.fma.f64(double [[X:%.*]], double undef, double [[Y:%.*]])
+; CHECK-NEXT: ret double [[R]]
+;
+ %r = call double @llvm.fma.f64(double %x, double undef, double %y)
+ ret double %r
+}
+
+define double @fma_undef_op2(double %x, double %y) {
+; CHECK-LABEL: @fma_undef_op2(
+; CHECK-NEXT: [[R:%.*]] = call double @llvm.fma.f64(double [[X:%.*]], double [[Y:%.*]], double undef)
+; CHECK-NEXT: ret double [[R]]
+;
+ %r = call double @llvm.fma.f64(double %x, double %y, double undef)
+ ret double %r
+}
+
+define double @fmuladd_undef_op0(double %x, double %y) {
+; CHECK-LABEL: @fmuladd_undef_op0(
+; CHECK-NEXT: [[R:%.*]] = call double @llvm.fmuladd.f64(double undef, double [[X:%.*]], double [[Y:%.*]])
+; CHECK-NEXT: ret double [[R]]
+;
+ %r = call double @llvm.fmuladd.f64(double undef, double %x, double %y)
+ ret double %r
+}
+
+define double @fmuladd_undef_op1(double %x, double %y) {
+; CHECK-LABEL: @fmuladd_undef_op1(
+; CHECK-NEXT: [[R:%.*]] = call double @llvm.fmuladd.f64(double [[X:%.*]], double undef, double [[Y:%.*]])
+; CHECK-NEXT: ret double [[R]]
+;
+ %r = call double @llvm.fmuladd.f64(double %x, double undef, double %y)
+ ret double %r
+}
+
+define double @fmuladd_undef_op2(double %x, double %y) {
+; CHECK-LABEL: @fmuladd_undef_op2(
+; CHECK-NEXT: [[R:%.*]] = call double @llvm.fmuladd.f64(double [[X:%.*]], double [[Y:%.*]], double undef)
+; CHECK-NEXT: ret double [[R]]
+;
+ %r = call double @llvm.fmuladd.f64(double %x, double %y, double undef)
+ ret double %r
+}
+
define double @fma_nan_op0(double %x, double %y) {
; CHECK-LABEL: @fma_nan_op0(
; CHECK-NEXT: [[R:%.*]] = call double @llvm.fma.f64(double 0x7FF8000000000000, double [[X:%.*]], double [[Y:%.*]])
OpenPOWER on IntegriCloud