Skip to content

Commit b35f6e2

Browse files
authored
Revert "[AMDGPU][Scheduler] Refactor ArchVGPR rematerialization during scheduling (#125885)" (#139341)
And related "[AMDGPU] Regenerate mfma-loop.ll test" Introduce memory error detected by Asan #125885. This reverts commit 382a085. This reverts commit 067caaa.
1 parent 436504c commit b35f6e2

13 files changed

+678
-4825
lines changed

llvm/include/llvm/CodeGen/MachineRegisterInfo.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "llvm/ADT/iterator_range.h"
2424
#include "llvm/CodeGen/MachineBasicBlock.h"
2525
#include "llvm/CodeGen/MachineFunction.h"
26-
#include "llvm/CodeGen/MachineInstr.h"
2726
#include "llvm/CodeGen/MachineInstrBundle.h"
2827
#include "llvm/CodeGen/MachineOperand.h"
2928
#include "llvm/CodeGen/RegisterBank.h"
@@ -586,9 +585,6 @@ class MachineRegisterInfo {
586585
/// multiple uses.
587586
bool hasOneNonDBGUser(Register RegNo) const;
588587

589-
/// If the register has a single non-Debug instruction using the specified
590-
/// register, returns it; otherwise returns nullptr.
591-
MachineInstr *getOneNonDBGUser(Register RegNo) const;
592588

593589
/// hasAtMostUses - Return true if the given register has at most \p MaxUsers
594590
/// non-debug user instructions.

llvm/lib/CodeGen/MachineRegisterInfo.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,6 @@ bool MachineRegisterInfo::hasOneNonDBGUser(Register RegNo) const {
432432
return hasSingleElement(use_nodbg_instructions(RegNo));
433433
}
434434

435-
MachineInstr *MachineRegisterInfo::getOneNonDBGUser(Register RegNo) const {
436-
auto RegNoDbgUsers = use_nodbg_instructions(RegNo);
437-
return hasSingleElement(RegNoDbgUsers) ? &*RegNoDbgUsers.begin() : nullptr;
438-
}
439-
440435
bool MachineRegisterInfo::hasAtMostUserInstrs(Register Reg,
441436
unsigned MaxUsers) const {
442437
return hasNItemsOrLess(use_instr_nodbg_begin(Reg), use_instr_nodbg_end(),

llvm/lib/Target/AMDGPU/GCNRegPressure.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,11 @@ struct GCNRegPressure {
5353
/// UnifiedVGPRFile
5454
unsigned getVGPRNum(bool UnifiedVGPRFile) const {
5555
if (UnifiedVGPRFile) {
56-
return Value[AGPR32] ? getUnifiedVGPRNum(Value[VGPR32], Value[AGPR32])
56+
return Value[AGPR32] ? alignTo(Value[VGPR32], 4) + Value[AGPR32]
5757
: Value[VGPR32] + Value[AGPR32];
5858
}
5959
return std::max(Value[VGPR32], Value[AGPR32]);
6060
}
61-
62-
/// Returns the aggregated VGPR pressure, assuming \p NumArchVGPRs ArchVGPRs
63-
/// and \p NumAGPRs AGPRS, for a target with a unified VGPR file.
64-
inline static unsigned getUnifiedVGPRNum(unsigned NumArchVGPRs,
65-
unsigned NumAGPRs) {
66-
return alignTo(NumArchVGPRs, AMDGPU::IsaInfo::getArchVGPRAllocGranule()) +
67-
NumAGPRs;
68-
}
69-
7061
/// \returns the ArchVGPR32 pressure
7162
unsigned getArchVGPRNum() const { return Value[VGPR32]; }
7263
/// \returns the AccVGPR32 pressure

0 commit comments

Comments
 (0)