Skip to content

Commit 6f93c06

Browse files
authored
[AMDGPU] Make a few WaitcntBrackets methods const. NFC. (llvm#134824)
1 parent a5509d6 commit 6f93c06

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ class WaitcntBrackets {
387387
return LDSDMAStores;
388388
}
389389

390-
void print(raw_ostream &);
391-
void dump() { print(dbgs()); }
390+
void print(raw_ostream &) const;
391+
void dump() const { print(dbgs()); }
392392

393393
private:
394394
struct MergeInfo {
@@ -645,9 +645,9 @@ class SIInsertWaitcnts {
645645
(void)ForceVMCounter;
646646
}
647647

648-
bool shouldFlushVmCnt(MachineLoop *ML, WaitcntBrackets &Brackets);
648+
bool shouldFlushVmCnt(MachineLoop *ML, const WaitcntBrackets &Brackets);
649649
bool isPreheaderToFlush(MachineBasicBlock &MBB,
650-
WaitcntBrackets &ScoreBrackets);
650+
const WaitcntBrackets &ScoreBrackets);
651651
bool isVMEMOrFlatVMEM(const MachineInstr &MI) const;
652652
bool run(MachineFunction &MF);
653653

@@ -990,7 +990,7 @@ void WaitcntBrackets::updateByEvent(const SIInstrInfo *TII,
990990
}
991991
}
992992

993-
void WaitcntBrackets::print(raw_ostream &OS) {
993+
void WaitcntBrackets::print(raw_ostream &OS) const {
994994
OS << '\n';
995995
for (auto T : inst_counter_types(MaxCounter)) {
996996
unsigned SR = getScoreRange(T);
@@ -2390,8 +2390,8 @@ bool SIInsertWaitcnts::insertWaitcntInBlock(MachineFunction &MF,
23902390

23912391
// Return true if the given machine basic block is a preheader of a loop in
23922392
// which we want to flush the vmcnt counter, and false otherwise.
2393-
bool SIInsertWaitcnts::isPreheaderToFlush(MachineBasicBlock &MBB,
2394-
WaitcntBrackets &ScoreBrackets) {
2393+
bool SIInsertWaitcnts::isPreheaderToFlush(
2394+
MachineBasicBlock &MBB, const WaitcntBrackets &ScoreBrackets) {
23952395
auto [Iterator, IsInserted] = PreheadersToFlush.try_emplace(&MBB, false);
23962396
if (!IsInserted)
23972397
return Iterator->second;
@@ -2427,7 +2427,7 @@ bool SIInsertWaitcnts::isVMEMOrFlatVMEM(const MachineInstr &MI) const {
24272427
// loop, and at least one use of a vgpr containing a value that is loaded
24282428
// outside of the loop.
24292429
bool SIInsertWaitcnts::shouldFlushVmCnt(MachineLoop *ML,
2430-
WaitcntBrackets &Brackets) {
2430+
const WaitcntBrackets &Brackets) {
24312431
bool HasVMemLoad = false;
24322432
bool HasVMemStore = false;
24332433
bool UsesVgprLoadedOutside = false;

0 commit comments

Comments
 (0)