[llvm] [AMDGPU] Register allocation anti-hints to reduce MFMA hazard NOPs (PR #156943)

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 6 03:36:31 PDT 2025


================
@@ -860,6 +867,56 @@ class MachineRegisterInfo {
     return RegAllocHints.inBounds(VReg) ? &RegAllocHints[VReg] : nullptr;
   }
 
+  /// setRegAllocationAntiHint - Add a register allocation anti-hint for the
+  /// specified virtual register. This tells the allocator to avoid allocating
+  /// VReg to the same physical register as AntiHintVReg (or overlapping ones).
+  void setRegAllocationAntiHint(Register VReg, Register AntiHintVReg) {
----------------
rovka wrote:

```suggestion
  void addRegAllocAntiHint(Register VReg, Register AntiHintVReg) {
```

`set` makes it sound like you can only have one.

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


More information about the llvm-commits mailing list