OSDN Git Service

AMDGPU/InsertWaitcnts: Some more const-correctness
authorNicolai Haehnle <nhaehnle@gmail.com>
Mon, 19 Nov 2018 12:03:11 +0000 (12:03 +0000)
committerNicolai Haehnle <nhaehnle@gmail.com>
Mon, 19 Nov 2018 12:03:11 +0000 (12:03 +0000)
Reviewers: msearles, rampitec, scott.linder, kanarayan

Subscribers: arsenm, kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits, hakzsam

Differential Revision: https://reviews.llvm.org/D54225

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347192 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/SIInsertWaitcnts.cpp

index eb39984..13b2ee1 100644 (file)
@@ -178,14 +178,14 @@ public:
     }
   }
 
-  int32_t getScoreLB(InstCounterType T) {
+  int32_t getScoreLB(InstCounterType T) const {
     assert(T < NUM_INST_CNTS);
     if (T >= NUM_INST_CNTS)
       return 0;
     return ScoreLBs[T];
   }
 
-  int32_t getScoreUB(InstCounterType T) {
+  int32_t getScoreUB(InstCounterType T) const {
     assert(T < NUM_INST_CNTS);
     if (T >= NUM_INST_CNTS)
       return 0;
@@ -268,7 +268,7 @@ public:
     return EventUBs[W];
   }
 
-  bool counterOutOfOrder(InstCounterType T);
+  bool counterOutOfOrder(InstCounterType T) const;
   unsigned int updateByWait(InstCounterType T, int ScoreToWait);
   void updateByEvent(const SIInstrInfo *TII, const SIRegisterInfo *TRI,
                      const MachineRegisterInfo *MRI, WaitEventType E,
@@ -755,7 +755,7 @@ unsigned int BlockWaitcntBrackets::updateByWait(InstCounterType T,
 
 // Where there are multiple types of event in the bracket of a counter,
 // the decrement may go out of order.
-bool BlockWaitcntBrackets::counterOutOfOrder(InstCounterType T) {
+bool BlockWaitcntBrackets::counterOutOfOrder(InstCounterType T) const {
   switch (T) {
   case VM_CNT:
     return false;