2017-06-02 16:53:19 +08:00
|
|
|
; REQUIRES: asserts
|
2017-06-09 17:19:09 +08:00
|
|
|
; RUN: llc < %s -mtriple=armv8r-eabi -mcpu=cortex-a57 -enable-misched -verify-misched -debug-only=machine-scheduler -o - 2>&1 > /dev/null | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-DEFAULT
|
|
|
|
; RUN: llc < %s -mtriple=armv8r-eabi -mcpu=cortex-a57 -enable-misched -verify-misched -debug-only=machine-scheduler -o - 2>&1 > /dev/null -fp-contract=fast | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-FAST
|
2017-06-02 16:53:19 +08:00
|
|
|
; Check latencies of vmul/vfma accumulate chains.
|
|
|
|
|
|
|
|
define float @Test1(float %f1, float %f2, float %f3, float %f4, float %f5, float %f6) {
|
|
|
|
; CHECK: ********** MI Scheduling **********
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: Test1:%bb.0
|
2017-06-02 16:53:19 +08:00
|
|
|
|
|
|
|
; CHECK: VMULS
|
|
|
|
; > VMULS common latency = 5
|
|
|
|
; CHECK: Latency : 5
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-02 16:53:19 +08:00
|
|
|
; > VMULS read-advanced latency to VMLAS = 0
|
|
|
|
; CHECK-SAME: Latency=0
|
|
|
|
|
2017-06-09 17:19:09 +08:00
|
|
|
; CHECK-DEFAULT: VMLAS
|
|
|
|
; CHECK-FAST: VFMAS
|
2017-06-02 16:53:19 +08:00
|
|
|
; > VMLAS common latency = 9
|
|
|
|
; CHECK: Latency : 9
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-02 16:53:19 +08:00
|
|
|
; > VMLAS read-advanced latency to the next VMLAS = 4
|
|
|
|
; CHECK-SAME: Latency=4
|
|
|
|
|
2017-06-09 17:19:09 +08:00
|
|
|
; CHECK-DEFAULT: VMLAS
|
|
|
|
; CHECK-FAST: VFMAS
|
2017-06-02 16:53:19 +08:00
|
|
|
; CHECK: Latency : 9
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-02 16:53:19 +08:00
|
|
|
; > VMLAS not-optimized latency to VMOVRS = 9
|
|
|
|
; CHECK-SAME: Latency=9
|
|
|
|
|
|
|
|
; f1 * f2 + f3 * f4 + f5 * f6 ==> VMULS, VMLAS, VMLAS
|
|
|
|
%mul1 = fmul float %f1, %f2
|
|
|
|
%mul2 = fmul float %f3, %f4
|
|
|
|
%mul3 = fmul float %f5, %f6
|
|
|
|
%add1 = fadd float %mul1, %mul2
|
|
|
|
%add2 = fadd float %add1, %mul3
|
|
|
|
ret float %add2
|
|
|
|
}
|
|
|
|
|
|
|
|
; ASIMD form
|
|
|
|
define <2 x float> @Test2(<2 x float> %f1, <2 x float> %f2, <2 x float> %f3, <2 x float> %f4, <2 x float> %f5, <2 x float> %f6) {
|
|
|
|
; CHECK: ********** MI Scheduling **********
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: Test2:%bb.0
|
2017-06-02 16:53:19 +08:00
|
|
|
|
|
|
|
; CHECK: VMULfd
|
|
|
|
; > VMULfd common latency = 5
|
|
|
|
; CHECK: Latency : 5
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-02 16:53:19 +08:00
|
|
|
; VMULfd read-advanced latency to VMLAfd = 0
|
|
|
|
; CHECK-SAME: Latency=0
|
|
|
|
|
2017-06-09 17:19:09 +08:00
|
|
|
; CHECK-DEFAULT: VMLAfd
|
|
|
|
; CHECK-FAST: VFMAfd
|
2017-06-02 16:53:19 +08:00
|
|
|
; > VMLAfd common latency = 9
|
|
|
|
; CHECK: Latency : 9
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-02 16:53:19 +08:00
|
|
|
; > VMLAfd read-advanced latency to the next VMLAfd = 4
|
|
|
|
; CHECK-SAME: Latency=4
|
|
|
|
|
2017-06-09 17:19:09 +08:00
|
|
|
; CHECK-DEFAULT: VMLAfd
|
|
|
|
; CHECK-FAST: VFMAfd
|
2017-06-02 16:53:19 +08:00
|
|
|
; CHECK: Latency : 9
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-02 16:53:19 +08:00
|
|
|
; > VMLAfd not-optimized latency to VMOVRRD = 9
|
|
|
|
; CHECK-SAME: Latency=9
|
|
|
|
|
|
|
|
; f1 * f2 + f3 * f4 + f5 * f6 ==> VMULS, VMLAS, VMLAS
|
|
|
|
%mul1 = fmul <2 x float> %f1, %f2
|
|
|
|
%mul2 = fmul <2 x float> %f3, %f4
|
|
|
|
%mul3 = fmul <2 x float> %f5, %f6
|
|
|
|
%add1 = fadd <2 x float> %mul1, %mul2
|
|
|
|
%add2 = fadd <2 x float> %add1, %mul3
|
|
|
|
ret <2 x float> %add2
|
|
|
|
}
|
|
|
|
|
2017-06-09 17:19:09 +08:00
|
|
|
define float @Test3(float %f1, float %f2, float %f3, float %f4, float %f5, float %f6) {
|
|
|
|
; CHECK: ********** MI Scheduling **********
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: Test3:%bb.0
|
2017-06-09 17:19:09 +08:00
|
|
|
|
|
|
|
; CHECK: VMULS
|
|
|
|
; > VMULS common latency = 5
|
|
|
|
; CHECK: Latency : 5
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-09 17:19:09 +08:00
|
|
|
; > VMULS read-advanced latency to VMLSS = 0
|
|
|
|
; CHECK-SAME: Latency=0
|
|
|
|
|
|
|
|
; CHECK-DEFAULT: VMLSS
|
|
|
|
; CHECK-FAST: VFMSS
|
|
|
|
; > VMLSS common latency = 9
|
|
|
|
; CHECK: Latency : 9
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-09 17:19:09 +08:00
|
|
|
; > VMLSS read-advanced latency to the next VMLSS = 4
|
|
|
|
; CHECK-SAME: Latency=4
|
|
|
|
|
|
|
|
; CHECK-DEFAULT: VMLSS
|
|
|
|
; CHECK-FAST: VFMSS
|
|
|
|
; CHECK: Latency : 9
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-09 17:19:09 +08:00
|
|
|
; > VMLSS not-optimized latency to VMOVRS = 9
|
|
|
|
; CHECK-SAME: Latency=9
|
|
|
|
|
|
|
|
; f1 * f2 + f3 * f4 + f5 * f6 ==> VMULS, VMLSS, VMLSS
|
|
|
|
%mul1 = fmul float %f1, %f2
|
|
|
|
%mul2 = fmul float %f3, %f4
|
|
|
|
%mul3 = fmul float %f5, %f6
|
|
|
|
%sub1 = fsub float %mul1, %mul2
|
|
|
|
%sub2 = fsub float %sub1, %mul3
|
|
|
|
ret float %sub2
|
|
|
|
}
|
|
|
|
|
|
|
|
; ASIMD form
|
|
|
|
define <2 x float> @Test4(<2 x float> %f1, <2 x float> %f2, <2 x float> %f3, <2 x float> %f4, <2 x float> %f5, <2 x float> %f6) {
|
|
|
|
; CHECK: ********** MI Scheduling **********
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: Test4:%bb.0
|
2017-06-09 17:19:09 +08:00
|
|
|
|
|
|
|
; CHECK: VMULfd
|
|
|
|
; > VMULfd common latency = 5
|
|
|
|
; CHECK: Latency : 5
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-09 17:19:09 +08:00
|
|
|
; VMULfd read-advanced latency to VMLSfd = 0
|
|
|
|
; CHECK-SAME: Latency=0
|
|
|
|
|
|
|
|
; CHECK-DEFAULT: VMLSfd
|
|
|
|
; CHECK-FAST: VFMSfd
|
|
|
|
; > VMLSfd common latency = 9
|
|
|
|
; CHECK: Latency : 9
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-09 17:19:09 +08:00
|
|
|
; > VMLSfd read-advanced latency to the next VMLSfd = 4
|
|
|
|
; CHECK-SAME: Latency=4
|
|
|
|
|
|
|
|
; CHECK-DEFAULT: VMLSfd
|
|
|
|
; CHECK-FAST: VFMSfd
|
|
|
|
; CHECK: Latency : 9
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-09 17:19:09 +08:00
|
|
|
; > VMLSfd not-optimized latency to VMOVRRD = 9
|
|
|
|
; CHECK-SAME: Latency=9
|
|
|
|
|
|
|
|
; f1 * f2 + f3 * f4 + f5 * f6 ==> VMULS, VMLSS, VMLSS
|
|
|
|
%mul1 = fmul <2 x float> %f1, %f2
|
|
|
|
%mul2 = fmul <2 x float> %f3, %f4
|
|
|
|
%mul3 = fmul <2 x float> %f5, %f6
|
|
|
|
%sub1 = fsub <2 x float> %mul1, %mul2
|
|
|
|
%sub2 = fsub <2 x float> %sub1, %mul3
|
|
|
|
ret <2 x float> %sub2
|
|
|
|
}
|
2017-06-13 21:04:32 +08:00
|
|
|
|
|
|
|
define float @Test5(float %f1, float %f2, float %f3) {
|
|
|
|
; CHECK: ********** MI Scheduling **********
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: Test5:%bb.0
|
2017-06-13 21:04:32 +08:00
|
|
|
|
|
|
|
; CHECK-DEFAULT: VNMLS
|
|
|
|
; CHECK-FAST: VFNMS
|
|
|
|
; CHECK: Latency : 9
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-13 21:04:32 +08:00
|
|
|
; > VMLAS not-optimized latency to VMOVRS = 9
|
|
|
|
; CHECK-SAME: Latency=9
|
|
|
|
|
|
|
|
; f1 * f2 - f3 ==> VNMLS/VFNMS
|
|
|
|
%mul = fmul float %f1, %f2
|
|
|
|
%sub = fsub float %mul, %f3
|
|
|
|
ret float %sub
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
define float @Test6(float %f1, float %f2, float %f3) {
|
|
|
|
; CHECK: ********** MI Scheduling **********
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: Test6:%bb.0
|
2017-06-13 21:04:32 +08:00
|
|
|
|
|
|
|
; CHECK-DEFAULT: VNMLA
|
|
|
|
; CHECK-FAST: VFNMA
|
|
|
|
; CHECK: Latency : 9
|
|
|
|
; CHECK: Successors:
|
2017-07-12 23:30:59 +08:00
|
|
|
; CHECK: Data
|
2017-06-13 21:04:32 +08:00
|
|
|
; > VMLAS not-optimized latency to VMOVRS = 9
|
|
|
|
; CHECK-SAME: Latency=9
|
|
|
|
|
|
|
|
; f1 * f2 - f3 ==> VNMLA/VFNMA
|
|
|
|
%mul = fmul float %f1, %f2
|
|
|
|
%sub1 = fsub float -0.0, %mul
|
|
|
|
%sub2 = fsub float %sub1, %f2
|
|
|
|
ret float %sub2
|
|
|
|
}
|