[llvm] r368447 - [NFC] Added tests for D65898
David Bolvansky via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 9 08:52:26 PDT 2019
Author: xbolva00
Date: Fri Aug 9 08:52:26 2019
New Revision: 368447
URL: http://llvm.org/viewvc/llvm-project?rev=368447&view=rev
Log:
[NFC] Added tests for D65898
Modified:
llvm/trunk/test/Transforms/InstCombine/fabs-copysign.ll
Modified: llvm/trunk/test/Transforms/InstCombine/fabs-copysign.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/fabs-copysign.ll?rev=368447&r1=368446&r2=368447&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/fabs-copysign.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/fabs-copysign.ll Fri Aug 9 08:52:26 2019
@@ -19,6 +19,17 @@ define double @fabs_copysign(double %x)
ret double %div
}
+define double @fabs_copysign_commuted(double %x) {
+; CHECK-LABEL: @fabs_copysign_commuted(
+; CHECK-NEXT: [[F:%.*]] = tail call double @llvm.fabs.f64(double [[X:%.*]])
+; CHECK-NEXT: [[DIV:%.*]] = fdiv nnan ninf double [[F]], [[X]]
+; CHECK-NEXT: ret double [[DIV]]
+;
+ %f = tail call double @llvm.fabs.f64(double %x)
+ %div = fdiv nnan ninf double %f, %x
+ ret double %div
+}
+
define float @fabs_copysignf(float %x) {
; CHECK-LABEL: @fabs_copysignf(
@@ -34,10 +45,12 @@ define float @fabs_copysignf(float %x) {
define double @fabs_copysign_use(double %x) {
; CHECK-LABEL: @fabs_copysign_use(
; CHECK-NEXT: [[F:%.*]] = tail call double @llvm.fabs.f64(double [[X:%.*]])
+; CHECK-NEXT: call void @use(double [[F]])
; CHECK-NEXT: [[DIV:%.*]] = fdiv nnan ninf double [[X]], [[F]]
; CHECK-NEXT: ret double [[DIV]]
;
%f = tail call double @llvm.fabs.f64(double %x)
+ call void @use(double %f)
%div = fdiv nnan ninf double %x, %f
ret double %div
}
@@ -55,6 +68,17 @@ define double @fabs_copysign_mismatch(do
ret double %div
}
+define double @fabs_copysign_commuted_mismatch(double %x, double %y) {
+; CHECK-LABEL: @fabs_copysign_commuted_mismatch(
+; CHECK-NEXT: [[F:%.*]] = tail call double @llvm.fabs.f64(double [[Y:%.*]])
+; CHECK-NEXT: [[DIV:%.*]] = fdiv double [[F]], [[X:%.*]]
+; CHECK-NEXT: ret double [[DIV]]
+;
+ %f = tail call double @llvm.fabs.f64(double %y)
+ %div = fdiv double %f, %x
+ ret double %div
+}
+
define double @fabs_copysign_no_nnan(double %x) {
; CHECK-LABEL: @fabs_copysign_no_nnan(
; CHECK-NEXT: [[F:%.*]] = tail call double @llvm.fabs.f64(double [[X:%.*]])
More information about the llvm-commits
mailing list