[PATCH] D108830: [AMDGPU] Propagate defining src reg for AGPR to AGPR Copys

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 20 15:59:38 PDT 2021


rampitec added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/GCNPreRAOptimizations.cpp:96
+    case AMDGPU::V_ACCVGPR_WRITE_B32_e64:
+      break;
+    case AMDGPU::COPY: {
----------------
I do not think you need this case. This is a single 32 bit register, it will have a single def.


================
Comment at: llvm/lib/Target/AMDGPU/GCNPreRAOptimizations.cpp:101
+      // accvgpr_write to avoid temporary registers.
+      Register DstReg = I.getOperand(0).getReg();
+      Register SrcReg = I.getOperand(1).getReg();
----------------
You know you are dealing with an AGPR or SGPR right at the beginning of the function. You can quickly bail from here based on that.


================
Comment at: llvm/lib/Target/AMDGPU/GCNPreRAOptimizations.cpp:141
+          // Found the defining accvgpr_write, stop looking any further.
+          break;
+        }
----------------
You can just return false here.


================
Comment at: llvm/lib/Target/AMDGPU/GCNPreRAOptimizations.cpp:144
+      }
       break;
+    }
----------------
... and here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108830



More information about the llvm-commits mailing list