@@ -387,8 +387,8 @@ class WaitcntBrackets {
387
387
return LDSDMAStores;
388
388
}
389
389
390
- void print (raw_ostream &);
391
- void dump () { print (dbgs ()); }
390
+ void print (raw_ostream &) const ;
391
+ void dump () const { print (dbgs ()); }
392
392
393
393
private:
394
394
struct MergeInfo {
@@ -645,9 +645,9 @@ class SIInsertWaitcnts {
645
645
(void )ForceVMCounter;
646
646
}
647
647
648
- bool shouldFlushVmCnt (MachineLoop *ML, WaitcntBrackets &Brackets);
648
+ bool shouldFlushVmCnt (MachineLoop *ML, const WaitcntBrackets &Brackets);
649
649
bool isPreheaderToFlush (MachineBasicBlock &MBB,
650
- WaitcntBrackets &ScoreBrackets);
650
+ const WaitcntBrackets &ScoreBrackets);
651
651
bool isVMEMOrFlatVMEM (const MachineInstr &MI) const ;
652
652
bool run (MachineFunction &MF);
653
653
@@ -990,7 +990,7 @@ void WaitcntBrackets::updateByEvent(const SIInstrInfo *TII,
990
990
}
991
991
}
992
992
993
- void WaitcntBrackets::print (raw_ostream &OS) {
993
+ void WaitcntBrackets::print (raw_ostream &OS) const {
994
994
OS << ' \n ' ;
995
995
for (auto T : inst_counter_types (MaxCounter)) {
996
996
unsigned SR = getScoreRange (T);
@@ -2390,8 +2390,8 @@ bool SIInsertWaitcnts::insertWaitcntInBlock(MachineFunction &MF,
2390
2390
2391
2391
// Return true if the given machine basic block is a preheader of a loop in
2392
2392
// 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) {
2395
2395
auto [Iterator, IsInserted] = PreheadersToFlush.try_emplace (&MBB, false );
2396
2396
if (!IsInserted)
2397
2397
return Iterator->second ;
@@ -2427,7 +2427,7 @@ bool SIInsertWaitcnts::isVMEMOrFlatVMEM(const MachineInstr &MI) const {
2427
2427
// loop, and at least one use of a vgpr containing a value that is loaded
2428
2428
// outside of the loop.
2429
2429
bool SIInsertWaitcnts::shouldFlushVmCnt (MachineLoop *ML,
2430
- WaitcntBrackets &Brackets) {
2430
+ const WaitcntBrackets &Brackets) {
2431
2431
bool HasVMemLoad = false ;
2432
2432
bool HasVMemStore = false ;
2433
2433
bool UsesVgprLoadedOutside = false ;
0 commit comments