diff --git a/llvm/test/CodeGen/AMDGPU/dagcombine-fma-fmad.ll b/llvm/test/CodeGen/AMDGPU/dagcombine-fma-fmad.ll index 485b3790a9cb1..68cc2a1681151 100644 --- a/llvm/test/CodeGen/AMDGPU/dagcombine-fma-fmad.ll +++ b/llvm/test/CodeGen/AMDGPU/dagcombine-fma-fmad.ll @@ -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