Skip to content

Commit

Permalink
[AMDGPU] New test case where we should not form FMA
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfoad committed Jun 1, 2023
1 parent 0213c6d commit 9290199
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions llvm/test/CodeGen/AMDGPU/dagcombine-fma-fmad.ll
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ define amdgpu_ps float @fma_vs_output_modifier(float %x, i32 %n) #0 {
ret float %r
}

define amdgpu_ps float @fma_vs_output_modifier_2(float %x) #0 {
; GCN-LABEL: fma_vs_output_modifier_2:
; GCN: ; %bb.0:
; GCN-NEXT: v_mul_f32_e32 v1, v0, v0
; GCN-NEXT: v_fmac_f32_e32 v1, v0, v0
; GCN-NEXT: v_mov_b32_e32 v0, v1
; GCN-NEXT: ; return to shader part epilog
%m = fmul contract float %x, %x
%a = fadd nsz contract float %m, %m
ret float %a
}

; Function Attrs: nofree nosync nounwind readnone speculatable willreturn
declare float @llvm.maxnum.f32(float, float) #1

Expand Down

0 comments on commit 9290199

Please sign in to comment.