DAGCombiner: Pass the correct type to TargetLowering::isF(Abs|Neg)Free
[oota-llvm.git] / test / CodeGen / R600 / fabs.ll
1 ; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s --check-prefix=R600-CHECK
2 ; RUN: llc < %s -march=r600 -mcpu=SI | FileCheck %s --check-prefix=SI-CHECK
3
4 ; DAGCombiner will transform:
5 ; (fabs (f32 bitcast (i32 a))) => (f32 bitcast (and (i32 a), 0x7FFFFFFF))
6 ; unless isFabsFree returns true
7
8 ; R600-CHECK: @fabs_free
9 ; R600-CHECK-NOT: AND
10 ; R600-CHECK: |PV.{{[XYZW]}}|
11 ; SI-CHECK: @fabs_free
12 ; SI-CHECK: V_ADD_F32_e64 VGPR{{[0-9]}}, SGPR{{[0-9]}}, 0, 1, 0, 0, 0
13
14 define void @fabs_free(float addrspace(1)* %out, i32 %in) {
15 entry:
16   %0 = bitcast i32 %in to float
17   %1 = call float @fabs(float %0)
18   store float %1, float addrspace(1)* %out
19   ret void
20 }
21
22 declare float @fabs(float ) readnone