Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SelectionDAG] Flags are dropped when creating a new FMUL #66701

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2990,8 +2990,9 @@ bool TargetLowering::SimplifyDemandedVectorElts(
SDValue NewOp1 = SimplifyMultipleUseDemandedVectorElts(Op1, DemandedElts,
TLO.DAG, Depth + 1);
if (NewOp0 || NewOp1) {
SDValue NewOp = TLO.DAG.getNode(
Opcode, SDLoc(Op), VT, NewOp0 ? NewOp0 : Op0, NewOp1 ? NewOp1 : Op1);
SDValue NewOp =
TLO.DAG.getNode(Opcode, SDLoc(Op), VT, NewOp0 ? NewOp0 : Op0,
NewOp1 ? NewOp1 : Op1, Op->getFlags());
return TLO.CombineTo(Op, NewOp);
}
return false;
Expand Down
9 changes: 4 additions & 5 deletions llvm/test/CodeGen/AMDGPU/fma.ll
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,14 @@ define float @fold_fmul_distributive(float %x, float %y) {
define amdgpu_kernel void @vec_mul_scalar_add_fma(<2 x float> %a, <2 x float> %b, float %c1, ptr addrspace(1) %inptr) {
; GFX906-LABEL: vec_mul_scalar_add_fma:
; GFX906: ; %bb.0:
; GFX906-NEXT: s_load_dword s8, s[0:1], 0x34
; GFX906-NEXT: s_load_dwordx4 s[4:7], s[0:1], 0x24
; GFX906-NEXT: s_waitcnt lgkmcnt(0)
; GFX906-NEXT: s_load_dword s5, s[0:1], 0x34
; GFX906-NEXT: s_load_dwordx2 s[2:3], s[0:1], 0x3c
; GFX906-NEXT: v_mov_b32_e32 v0, 0
; GFX906-NEXT: v_mov_b32_e32 v1, s6
; GFX906-NEXT: v_mul_f32_e32 v1, s4, v1
; GFX906-NEXT: s_waitcnt lgkmcnt(0)
; GFX906-NEXT: v_add_f32_e32 v1, s5, v1
; GFX906-NEXT: v_mov_b32_e32 v1, s8
; GFX906-NEXT: v_mov_b32_e32 v2, s6
; GFX906-NEXT: v_fmac_f32_e32 v1, s4, v2
; GFX906-NEXT: global_store_dword v0, v1, s[2:3] offset:4
; GFX906-NEXT: s_endpgm
%gep = getelementptr float, ptr addrspace(1) %inptr, i32 1
Expand Down