[NFC] [PowerPC] Add FMA flag propagation test

This commit is contained in:
Qiu Chaofan 2020-09-02 23:09:48 +08:00
parent 042179924b
commit f85832972d

View File

@ -239,4 +239,26 @@ define double @getNegatedExpression_crash(double %x, double %y) {
%fma1 = call reassoc nsz double @llvm.fma.f64(double %fma, double %y, double %add)
ret double %fma1
}
define double @fma_flag_propagation(double %a) {
; CHECK-FAST-LABEL: fma_flag_propagation:
; CHECK-FAST: # %bb.0: # %entry
; CHECK-FAST-NEXT: xssubdp 1, 1, 1
; CHECK-FAST-NEXT: blr
;
; CHECK-FAST-NOVSX-LABEL: fma_flag_propagation:
; CHECK-FAST-NOVSX: # %bb.0: # %entry
; CHECK-FAST-NOVSX-NEXT: fsub 1, 1, 1
; CHECK-FAST-NOVSX-NEXT: blr
;
; CHECK-LABEL: fma_flag_propagation:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: xssubdp 1, 1, 1
; CHECK-NEXT: blr
entry:
%0 = fneg double %a
%1 = call reassoc nnan double @llvm.fma.f64(double %0, double 1.0, double %a)
ret double %1
}
declare double @llvm.fma.f64(double, double, double) nounwind readnone