[PATCH] D29798: [AMDGPU] Override PSet for M0

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 17:23:30 PST 2017


rampitec marked an inline comment as done.
rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/SIRegisterInfo.cpp:1336-1337
+
+  if (hasRegUnit(AMDGPU::M0, RegUnit))
+    return Empty;
+  return AMDGPURegisterInfo::getRegUnitPressureSets(RegUnit);
----------------
rampitec wrote:
> arsenm wrote:
> > rampitec wrote:
> > > arsenm wrote:
> > > > Is == M0 sufficient? m0 should be its own regunit since it can't be a subregister
> > > Yes, it is in its own RegUnit, and RegUnit is what we get here. This test yields true for M0 and only for M0 because it does not share a RegUnit with any other register.
> > I mean it's simpler to do just return RegUnit == AMDGPU::M0 instead of doing the whole regunit iterator test
> AMDGPU::M0 == 89, its RegUnit == 81.
Here, gdb log:

```
(gdb) p (int)AMDGPU::M0
$9 = 89
(gdb) call TRI->hasRegUnit(AMDGPU::M0, 81)
$12 = true
(gdb) call TRI->hasRegUnit(AMDGPU::M0, 89)
$13 = false
(gdb) call TRI->hasRegUnit(AMDGPU::M0, AMDGPU::M0)
$14 = false
```



Repository:
  rL LLVM

https://reviews.llvm.org/D29798





More information about the llvm-commits mailing list