2020-05-19 13:37:25 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=+vsx -disable-ppc-vsx-fma-mutation=false | FileCheck %s
|
2014-10-21 21:02:37 +08:00
|
|
|
|
|
|
|
declare double @llvm.sqrt.f64(double)
|
|
|
|
|
2020-05-19 13:37:25 +08:00
|
|
|
; Test several VSX FMA mutation opportunities.
|
|
|
|
|
|
|
|
; This is reasonable transformation since it eliminates extra register copy.
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
define double @foo3_fmf(double %a) nounwind {
|
2020-05-19 13:37:25 +08:00
|
|
|
; CHECK-LABEL: foo3_fmf:
|
|
|
|
; CHECK: # %bb.0:
|
2020-11-25 13:37:15 +08:00
|
|
|
; CHECK-NEXT: xstsqrtdp 0, 1
|
|
|
|
; CHECK-NEXT: bc 12, 2, .LBB0_2
|
2020-05-19 13:37:25 +08:00
|
|
|
; CHECK-NEXT: # %bb.1:
|
|
|
|
; CHECK-NEXT: xsrsqrtedp 0, 1
|
|
|
|
; CHECK-NEXT: addis 3, 2, .LCPI0_0@toc@ha
|
|
|
|
; CHECK-NEXT: lfs 3, .LCPI0_0@toc@l(3)
|
|
|
|
; CHECK-NEXT: addis 3, 2, .LCPI0_1@toc@ha
|
|
|
|
; CHECK-NEXT: lfs 4, .LCPI0_1@toc@l(3)
|
|
|
|
; CHECK-NEXT: xsmuldp 2, 1, 0
|
|
|
|
; CHECK-NEXT: xsmaddmdp 2, 0, 3
|
|
|
|
; CHECK-NEXT: xsmuldp 0, 0, 4
|
|
|
|
; CHECK-NEXT: xsmuldp 0, 0, 2
|
|
|
|
; CHECK-NEXT: xsmuldp 1, 1, 0
|
|
|
|
; CHECK-NEXT: xsmaddadp 3, 1, 0
|
|
|
|
; CHECK-NEXT: xsmuldp 0, 1, 4
|
2020-11-27 10:10:55 +08:00
|
|
|
; CHECK-NEXT: xsmuldp 1, 0, 3
|
|
|
|
; CHECK-NEXT: blr
|
2020-05-19 13:37:25 +08:00
|
|
|
; CHECK-NEXT: .LBB0_2:
|
2020-11-27 10:10:55 +08:00
|
|
|
; CHECK-NEXT: xssqrtdp 1, 1
|
2020-05-19 13:37:25 +08:00
|
|
|
; CHECK-NEXT: blr
|
2020-05-13 17:21:31 +08:00
|
|
|
%r = call reassoc afn ninf double @llvm.sqrt.f64(double %a)
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
ret double %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @foo3_safe(double %a) nounwind {
|
2020-05-19 13:37:25 +08:00
|
|
|
; CHECK-LABEL: foo3_safe:
|
|
|
|
; CHECK: # %bb.0:
|
|
|
|
; CHECK-NEXT: xssqrtdp 1, 1
|
|
|
|
; CHECK-NEXT: blr
|
Migrate some more fadd and fsub cases away from UnsafeFPMath control to utilize NoSignedZerosFPMath options control
Summary: Honoring no signed zeroes is also available as a user control through clang separately regardless of fastmath or UnsafeFPMath context, DAG guards should reflect this context.
Reviewers: spatel, arsenm, hfinkel, wristow, craig.topper
Reviewed By: spatel
Subscribers: rampitec, foad, nhaehnle, wuzish, nemanjai, jvesely, wdng, javed.absar, MaskRay, jsji
Differential Revision: https://reviews.llvm.org/D65170
llvm-svn: 367486
2019-08-01 05:57:28 +08:00
|
|
|
%r = call double @llvm.sqrt.f64(double %a)
|
|
|
|
ret double %r
|
2014-10-21 21:02:37 +08:00
|
|
|
}
|
|
|
|
|