diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp --- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp +++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp @@ -3000,7 +3000,7 @@ removeModOperands(UseMI); UseMI.setDesc(get(NewOpc)); - bool DeleteDef = MRI->hasOneNonDBGUse(Reg); + bool DeleteDef = MRI->use_nodbg_empty(Reg); if (DeleteDef) DefMI.eraseFromParent(); @@ -3083,7 +3083,7 @@ // constant and SGPR are illegal. legalizeOperands(UseMI); - bool DeleteDef = MRI->hasOneNonDBGUse(Reg); + bool DeleteDef = MRI->use_nodbg_empty(Reg); if (DeleteDef) DefMI.eraseFromParent(); diff --git a/llvm/test/CodeGen/AMDGPU/madak-inline-constant.mir b/llvm/test/CodeGen/AMDGPU/madak-inline-constant.mir --- a/llvm/test/CodeGen/AMDGPU/madak-inline-constant.mir +++ b/llvm/test/CodeGen/AMDGPU/madak-inline-constant.mir @@ -2,7 +2,6 @@ # GCN-LABEL: bb.0: -# GCN: V_MOV_B32_e32 1092616192 # GCN: S_MOV_B32 1082130432 # GCN: %3:vgpr_32 = V_MADAK_F32 1082130432, killed %0, 1092616192, implicit $mode, implicit $exec @@ -21,7 +20,6 @@ # GCN-LABEL: bb.0: -# GCN: V_MOV_B32_e32 1092616192 # GCN: S_MOV_B32 1082130432 # GCN: %3:vgpr_32 = V_MADAK_F32 1082130432, killed %0, 1092616192, implicit $mode, implicit $exec @@ -39,7 +37,6 @@ ... # GCN-LABEL: bb.0: -# GCN: V_MOV_B32_e32 1092616192 # GCN: S_MOV_B32 1082130432 # GCN: %3:vgpr_32 = V_MADAK_F32 killed %0, killed %0, 1092616192, implicit $mode, implicit $exec @@ -57,7 +54,6 @@ ... # GCN-LABEL: bb.0: -# GCN: V_MOV_B32_e32 1092616192 # GCN: V_MOV_B32_e32 1082130432 # GCN: %3:vgpr_32 = V_MADAK_F32 1082130432, killed %0, 1092616192, implicit $mode, implicit $exec @@ -76,7 +72,6 @@ # GCN-LABEL: bb.0: -# GCN: V_MOV_B32_e32 1092616192 # GCN: V_MOV_B32_e32 1082130432 # GCN: %3:vgpr_32 = V_MADAK_F32 1082130432, killed %0, 1092616192, implicit $mode, implicit $exec @@ -94,7 +89,6 @@ ... # GCN-LABEL: bb.0: -# GCN: V_MOV_B32_e32 1092616192, implicit $exec # GCN: S_MOV_B32 1082130432 # GCN: V_MADAK_F32 1082130432, killed $vgpr1, 1092616192, implicit $mode, implicit $exec @@ -113,7 +107,6 @@ ... # GCN-LABEL: bb.0: -# GCN: V_MOV_B32_e32 1092616192, implicit $exec # GCN: S_MOV_B32 1082130432 # GCN: V_MADAK_F32 1082130432, killed $vgpr0, 1092616192, implicit $mode, implicit $exec @@ -166,7 +159,6 @@ ... # GCN-LABEL: bb.0: -# GCN: V_MOV_B32_e32 1092616192, implicit $exec # GCN: $sgpr2 = S_MOV_B32 1082130432 # GCN: V_MADAK_F32 1082130432, killed %0, 1092616192, implicit $mode, implicit $exec