[llvm] Co-issue packed instructions by unpacking (PR #151704)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 4 14:47:38 PDT 2025


================
@@ -225,6 +247,313 @@ bool GCNPreRAOptimizationsImpl::processReg(Register Reg) {
   return true;
 }
 
+bool GCNPreRAOptimizationsImpl::isUnpackingSupportedInstr(MachineInstr &MI) const {
+  unsigned Opcode = MI.getOpcode();
+  switch (Opcode) {
+    case AMDGPU::V_PK_ADD_F32:
+    case AMDGPU::V_PK_MUL_F32:
+      return true;
+
+    default:
+      return false;
+
+  }
+}
+
+uint16_t GCNPreRAOptimizationsImpl::mapToUnpackedOpcode(MachineInstr &I) {
----------------
bcahoon wrote:

Does it make sense to use InstrMapping in the td files rather than a switch statement? Do we think there are other instructions where this optimization may apply in the future. If it's only these, then probably not.

https://github.com/llvm/llvm-project/pull/151704


More information about the llvm-commits mailing list