[PATCH] D143762: [AMDGPU] Enable whole wave register copy

Christudasan Devadasan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 11:16:24 PDT 2023


cdevadas added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:8004
+  if (MFI->checkFlag(SrcReg, AMDGPU::VirtRegFlag::WWM_REG))
+    return AMDGPU::PRED_COPY;
+
----------------
arsenm wrote:
> I guess the name is wrong now. It's technically an unpredicated copy. Rename to WWM_COPY or COPY_WWM?
Make sense. I prefer WWM_COPY.


================
Comment at: llvm/lib/Target/AMDGPU/SILowerPredicatedCopies.cpp:82
+bool SILowerPredicatedCopies::isWWMCopy(const MachineInstr &MI,
+                                        const TargetInstrInfo &TII) {
+  // Skip if it is a subreg copy.
----------------
arsenm wrote:
> SIInstrInfo
This function is no longer needed. Now the PRED_COPY is inserted only for wwm-regs after we fine-tuned AMDGPU's `getLiveRangeSplitOpcode` implementation.


================
Comment at: llvm/lib/Target/AMDGPU/SILowerPredicatedCopies.cpp:151
+      assert(TII->isVGPRCopy(MI));
+      if (MI.getOperand(0).getReg().isVirtual() && isWWMCopy(MI, *TII)) {
+        // For WWM vector copies, manipulate the exec mask around the copy
----------------
I guess this whole check now can be entirely avoided. PRED_COPY is inserted only for wwm-regs. If we see any such copy, insert the EXEC mask manipulation unconditionally.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143762



More information about the llvm-commits mailing list