[llvm] [AMDGPU] Remove s_delay_alu for VALU->SGPR->SALU (PR #127212)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 20 05:30:28 PST 2025
================
@@ -371,12 +376,51 @@ class AMDGPUInsertDelayAlu : public MachineFunctionPass {
for (MCRegUnit Unit : TRI->regunits(Op.getReg())) {
auto It = State.find(Unit);
if (It != State.end()) {
- Delay.merge(It->second);
- State.erase(Unit);
+ if (SII->isSALU(MI.getOpcode()) &&
+ AMDGPU::isSGPR(Op.getReg(), TRI) &&
+ It->second.VALUCycles > 0) {
+ deletedCyclesNum = It->second.VALUCycles;
+ State.erase(Unit);
+ VALUSALUStall = true;
+ } else {
+ Delay.merge(It->second);
+ State.erase(Unit);
+ }
}
}
}
}
+ unsigned maxCycles = 0;
+ unsigned lastWrite = 0;
+ if (Type != OTHER) {
+ for (const auto &Op : MI.defs()) {
+ for (MCRegUnit Unit : TRI->regunits(Op.getReg())) {
+ if (AMDGPU::isSGPR(Op.getReg(), TRI)) {
----------------
arsenm wrote:
This is a loop constant over the regunits
https://github.com/llvm/llvm-project/pull/127212
More information about the llvm-commits
mailing list