[PATCH] D59295: [AMDGPU] Pre-allocate WWM registers to reduce VGPR pressure.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 1 08:19:26 PDT 2019


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:454-458
+  const unsigned Reg = FirstDst->getReg();
+
+  const TargetRegisterClass *DstRC = TargetRegisterInfo::isVirtualRegister(Reg)
+                                         ? MRI.getRegClass(Reg)
+                                         : RI.getPhysRegClass(Reg);
----------------
This is a separate change


================
Comment at: lib/Target/AMDGPU/SIMachineFunctionInfo.h:260
 
+  SparseBitVector<> WWMReservedRegs;
+
----------------
This should be serialized into YAML. Maybe this should also be in terms of RegUnits?


================
Comment at: lib/Target/AMDGPU/SIPreAllocateWWMRegs.cpp:103
+  for (unsigned PhysReg : RegClassInfo.getOrder(MRI->getRegClass(Reg))) {
+    if (!MRI->isPhysRegUsed(PhysReg) &&
+        Matrix->checkInterference(LI, PhysReg) == LiveRegMatrix::IK_Free) {
----------------
Is the isPhysRegUsed check really necessary? It's going to break if you have multiple WWM sections


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59295





More information about the llvm-commits mailing list