[PATCH] D120815: [AMDGPU] Fix deleting of move-immediate instructions after folding

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 2 08:11:38 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5ddfedc9569f: [AMDGPU] Fix deleting of move-immediate instructions after folding (authored by foad).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120815/new/

https://reviews.llvm.org/D120815

Files:
  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
  llvm/test/CodeGen/AMDGPU/madak-inline-constant.mir


Index: llvm/test/CodeGen/AMDGPU/madak-inline-constant.mir
===================================================================
--- llvm/test/CodeGen/AMDGPU/madak-inline-constant.mir
+++ 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
 
Index: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ 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();
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120815.412424.patch
Type: text/x-patch
Size: 2659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220302/172d8604/attachment.bin>


More information about the llvm-commits mailing list