Skip to content

Commit f910dd2

Browse files
committed
[LiveDebugValues] Disable spill tracking on AMDGPU
The spill tracking in MLocTracker has quite poor performance on AMDGPU because of the large number of subregister indices. Futhermore, range extension doesn't even work on spills since AMDGPU currently doesn't implement is{LoadFrom,StoreTo}StackSlotPostFE. Disable it for now until we can come up with a better way of handling this. Fixes SWDEV-511880
1 parent 13a65d4 commit f910dd2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ static cl::opt<unsigned>
156156
cl::desc("livedebugvalues-stack-ws-limit"),
157157
cl::init(250));
158158

159+
// Limit for the maximum number of stack slot indexes. On targets where this is
160+
// exceeded, this effectivly disables tracking debug locations across spills.
161+
// The spill tracking in MLocTracker performs quite poorly in terms of memory
162+
// and time on targets with a more complicated register file (FIXME).
163+
static cl::opt<unsigned>
164+
StackSlotIdxesLimit("livedebugvalues-max-stack-slot-idxes", cl::Hidden,
165+
cl::desc("livedebugvalues-max-stack-slot-idxes"),
166+
cl::init(128));
167+
159168
DbgOpID DbgOpID::UndefID = DbgOpID(0xffffffff);
160169

161170
/// Tracker for converting machine value locations and variable values into
@@ -1122,6 +1131,10 @@ void MLocTracker::writeRegMask(const MachineOperand *MO, unsigned CurBB,
11221131
}
11231132

11241133
std::optional<SpillLocationNo> MLocTracker::getOrTrackSpillLoc(SpillLoc L) {
1134+
// Disable spill tracking on targets with a large number of slot idxes.
1135+
if (NumSlotIdxes >= StackSlotIdxesLimit)
1136+
return std::nullopt;
1137+
11251138
SpillLocationNo SpillID(SpillLocs.idFor(L));
11261139

11271140
if (SpillID.id() == 0) {

0 commit comments

Comments
 (0)