2 ; RUN: llc -mtriple=x86_64-unknown-unknown -debug-only=isel < %s -o /dev/null 2>&1 | FileCheck %s
4 ; This tests the propagation of fast-math-flags from IR instructions to SDNodeFlags.
6 ; CHECK-LABEL: Initial selection DAG: %bb.0 'fmf_transfer:'
8 ; CHECK: t5: f32 = fadd nsz t2, t4
9 ; CHECK-NEXT: t6: f32 = fadd arcp t5, t4
10 ; CHECK-NEXT: t7: f32 = fadd nnan t6, t4
11 ; CHECK-NEXT: t8: f32 = fadd ninf t7, t4
12 ; CHECK-NEXT: t9: f32 = fadd contract t8, t4
13 ; CHECK-NEXT: t10: f32 = fadd afn t9, t4
14 ; CHECK-NEXT: t11: f32 = fadd reassoc t10, t4
15 ; CHECK-NEXT: t12: f32 = fadd nnan ninf nsz arcp contract afn reassoc t11, t4
17 ; CHECK: Optimized lowered selection DAG: %bb.0 'fmf_transfer:'
19 define float @fmf_transfer(float %x, float %y) {
20 %f1 = fadd nsz float %x, %y
21 %f2 = fadd arcp float %f1, %y
22 %f3 = fadd nnan float %f2, %y
23 %f4 = fadd ninf float %f3, %y
24 %f5 = fadd contract float %f4, %y
25 %f6 = fadd afn float %f5, %y
26 %f7 = fadd reassoc float %f6, %y
27 %f8 = fadd fast float %f7, %y
31 ; CHECK: Optimized type-legalized selection DAG: %bb.0 'fmf_setcc:'
32 ; CHECK: t13: i8 = setcc nnan ninf nsz arcp contract afn reassoc t2, ConstantFP:f32<0.000000e+00>, setlt:ch
34 define float @fmf_setcc(float %x, float %y) {
35 %cmp = fcmp fast ult float %x, 0.0
36 %ret = select i1 %cmp, float %x, float %y