diff options
| author | Michael Berg <michael_c_berg@apple.com> | 2018-05-04 18:48:20 +0000 |
|---|---|---|
| committer | Michael Berg <michael_c_berg@apple.com> | 2018-05-04 18:48:20 +0000 |
| commit | 7acc81b74428660efa5156815eebaee8a2ebe075 (patch) | |
| tree | 43d5e80f2e186315ec3bdabe7635c905e792ae5c /llvm/test/CodeGen | |
| parent | 0e51a125ea091955a1f5e7a7390a3b7953a3e314 (diff) | |
| download | bcm5719-llvm-7acc81b74428660efa5156815eebaee8a2ebe075.tar.gz bcm5719-llvm-7acc81b74428660efa5156815eebaee8a2ebe075.zip | |
Fast Math Flag mapping into SDNode
Summary: Adding support for Fast flags in the SDNode to leverage fast math sub flag usage.
Reviewers: spatel, arsenm, jbhateja, hfinkel, escha, qcolombet, echristo, wristow, javed.absar
Reviewed By: spatel
Subscribers: llvm-commits, rampitec, nhaehnle, tstellar, FarhanaAleen, nemanjai, javed.absar, jbhateja, hfinkel, wdng
Differential Revision: https://reviews.llvm.org/D45710
llvm-svn: 331547
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/PowerPC/fmf-propagation.ll | 21 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/fmf-propagation.ll | 8 |
2 files changed, 13 insertions, 16 deletions
diff --git a/llvm/test/CodeGen/PowerPC/fmf-propagation.ll b/llvm/test/CodeGen/PowerPC/fmf-propagation.ll index 03b6a0ba950..3550b09bbeb 100644 --- a/llvm/test/CodeGen/PowerPC/fmf-propagation.ll +++ b/llvm/test/CodeGen/PowerPC/fmf-propagation.ll @@ -63,7 +63,7 @@ define float @fmul_fadd_contract2(float %x, float %y, float %z) { ; FMFDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fmul_fadd_reassoc1:' ; FMFDEBUG: fmul {{t[0-9]+}}, {{t[0-9]+}} -; FMFDEBUG: fadd {{t[0-9]+}}, {{t[0-9]+}} +; FMFDEBUG: fadd reassoc {{t[0-9]+}}, {{t[0-9]+}} ; FMFDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fadd_reassoc1:' define float @fmul_fadd_reassoc1(float %x, float %y, float %z) { @@ -86,15 +86,14 @@ define float @fmul_fadd_reassoc1(float %x, float %y, float %z) { ; This shouldn't change anything - the intermediate fmul result is now also flagged. ; FMFDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fmul_fadd_reassoc2:' -; FMFDEBUG: fmul {{t[0-9]+}}, {{t[0-9]+}} -; FMFDEBUG: fadd {{t[0-9]+}}, {{t[0-9]+}} +; FMFDEBUG: fma {{t[0-9]+}}, {{t[0-9]+}} ; FMFDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fadd_reassoc2:' define float @fmul_fadd_reassoc2(float %x, float %y, float %z) { ; FMF-LABEL: fmul_fadd_reassoc2: ; FMF: # %bb.0: -; FMF-NEXT: xsmulsp 0, 1, 2 -; FMF-NEXT: xsaddsp 1, 0, 3 +; FMF-NEXT: xsmaddasp 3, 1, 2 +; FMF-NEXT: fmr 1, 3 ; FMF-NEXT: blr ; ; GLOBAL-LABEL: fmul_fadd_reassoc2: @@ -161,7 +160,7 @@ define float @fmul_fadd_fast2(float %x, float %y, float %z) { ; FMFDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_reassoc1:' ; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fmul_fma_reassoc1:' -; GLOBALDEBUG: fmul unsafe {{t[0-9]+}} +; GLOBALDEBUG: fmul reassoc {{t[0-9]+}} ; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_reassoc1:' define float @fmul_fma_reassoc1(float %x) { @@ -197,7 +196,7 @@ define float @fmul_fma_reassoc1(float %x) { ; FMFDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_reassoc2:' ; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fmul_fma_reassoc2:' -; GLOBALDEBUG: fmul unsafe {{t[0-9]+}} +; GLOBALDEBUG: fmul reassoc {{t[0-9]+}} ; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_reassoc2:' define float @fmul_fma_reassoc2(float %x) { @@ -233,7 +232,7 @@ define float @fmul_fma_reassoc2(float %x) { ; FMFDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_fast1:' ; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fmul_fma_fast1:' -; GLOBALDEBUG: fmul unsafe {{t[0-9]+}} +; GLOBALDEBUG: fmul reassoc {{t[0-9]+}} ; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_fast1:' define float @fmul_fma_fast1(float %x) { @@ -269,7 +268,7 @@ define float @fmul_fma_fast1(float %x) { ; FMFDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_fast2:' ; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'fmul_fma_fast2:' -; GLOBALDEBUG: fmul unsafe {{t[0-9]+}} +; GLOBALDEBUG: fmul reassoc {{t[0-9]+}} ; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'fmul_fma_fast2:' define float @fmul_fma_fast2(float %x) { @@ -305,7 +304,7 @@ define float @fmul_fma_fast2(float %x) { ; FMFDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_afn:' ; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_afn:' -; GLOBALDEBUG: fmul unsafe {{t[0-9]+}} +; GLOBALDEBUG: fmul reassoc {{t[0-9]+}} ; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_afn:' define float @sqrt_afn(float %x) { @@ -345,7 +344,7 @@ define float @sqrt_afn(float %x) { ; FMFDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_fast:' ; GLOBALDEBUG-LABEL: Optimized lowered selection DAG: %bb.0 'sqrt_fast:' -; GLOBALDEBUG: fmul unsafe {{t[0-9]+}} +; GLOBALDEBUG: fmul reassoc {{t[0-9]+}} ; GLOBALDEBUG: Type-legalized selection DAG: %bb.0 'sqrt_fast:' define float @sqrt_fast(float %x) { diff --git a/llvm/test/CodeGen/X86/fmf-propagation.ll b/llvm/test/CodeGen/X86/fmf-propagation.ll index 294a2952c76..56e813f371c 100644 --- a/llvm/test/CodeGen/X86/fmf-propagation.ll +++ b/llvm/test/CodeGen/X86/fmf-propagation.ll @@ -3,8 +3,6 @@ ; This tests the propagation of fast-math-flags from IR instructions to SDNodeFlags. -; FIXME: 'afn' and 'reassoc' were dropped. With 'fast', 'reassoc' got renamed to 'unsafe'. - ; CHECK-LABEL: Initial selection DAG: %bb.0 'fmf_transfer:' ; CHECK: t5: f32 = fadd nsz t2, t4 @@ -12,9 +10,9 @@ ; CHECK-NEXT: t7: f32 = fadd nnan t6, t4 ; CHECK-NEXT: t8: f32 = fadd ninf t7, t4 ; CHECK-NEXT: t9: f32 = fadd contract t8, t4 -; CHECK-NEXT: t10: f32 = fadd t9, t4 -; CHECK-NEXT: t11: f32 = fadd t10, t4 -; CHECK-NEXT: t12: f32 = fadd unsafe nnan ninf nsz arcp contract t11, t4 +; CHECK-NEXT: t10: f32 = fadd afn t9, t4 +; CHECK-NEXT: t11: f32 = fadd reassoc t10, t4 +; CHECK-NEXT: t12: f32 = fadd nnan ninf nsz arcp contract afn reassoc t11, t4 ; CHECK: Optimized lowered selection DAG: %bb.0 'fmf_transfer:' |

