[llvm] [AMDGPU] Support wide register or subregister access when emitting s_singleuse_vdst instructions. (PR #88520)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 17 04:56:42 PDT 2024
================
@@ -64,13 +64,15 @@ class AMDGPUInsertSingleUseVDST : public MachineFunctionPass {
bool InstructionEmitted = false;
for (MachineBasicBlock &MBB : MF) {
- DenseMap<MCPhysReg, unsigned> RegisterUseCount; // TODO: MCRegUnits
+ DenseMap<MCRegUnit, unsigned> RegisterUseCount;
// Handle boundaries at the end of basic block separately to avoid
// false positives. If they are live at the end of a basic block then
// assume it has more uses later on.
- for (const auto &Liveouts : MBB.liveouts())
- RegisterUseCount[Liveouts.PhysReg] = 2;
+ for (const auto &Liveout : MBB.liveouts()) {
+ for (const MCRegUnit &Unit : TRI->regunits(Liveout.PhysReg))
----------------
jayfoad wrote:
Really this ought to use `MCRegUnitMaskIterator` to iterate over only the regunits of `Liveout.PhysReg` that are enabled in `Liveout.LaneMask`. See other uses of `MCRegUnitMaskIterator` in `lib/CodeGen/` for examples. Or you can just leave a TODO if you don't want to implement that now.
https://github.com/llvm/llvm-project/pull/88520
More information about the llvm-commits
mailing list