[llvm] r347851 - AMDGPU/InsertWaitcnt: Remove unused WaitAtBeginning

Nicolai Haehnle via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 29 03:06:18 PST 2018


Author: nha
Date: Thu Nov 29 03:06:18 2018
New Revision: 347851

URL: http://llvm.org/viewvc/llvm-project?rev=347851&view=rev
Log:
AMDGPU/InsertWaitcnt: Remove unused WaitAtBeginning

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/D54229

Modified:
    llvm/trunk/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

Modified: llvm/trunk/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIInsertWaitcnts.cpp?rev=347851&r1=347850&r2=347851&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIInsertWaitcnts.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIInsertWaitcnts.cpp Thu Nov 29 03:06:18 2018
@@ -293,9 +293,6 @@ public:
                    const SIRegisterInfo *TRI, const MachineRegisterInfo *MRI,
                    unsigned OpNo, int32_t Val);
 
-  void setWaitAtBeginning() { WaitAtBeginning = true; }
-  void clearWaitAtBeginning() { WaitAtBeginning = false; }
-  bool getWaitAtBeginning() const { return WaitAtBeginning; }
   int32_t getMaxVGPR() const { return VgprUB; }
   int32_t getMaxSGPR() const { return SgprUB; }
 
@@ -343,7 +340,6 @@ public:
 
 private:
   const GCNSubtarget *ST = nullptr;
-  bool WaitAtBeginning = false;
   bool RevisitLoop = false;
   int32_t PostOrder = 0;
   int32_t ScoreLBs[NUM_INST_CNTS] = {0};
@@ -867,18 +863,9 @@ void SIInsertWaitcnts::generateWaitcntIn
 
   AMDGPU::Waitcnt Wait;
 
-  // See if an s_waitcnt is forced at block entry, or is needed at
-  // program end.
-  if (ScoreBrackets->getWaitAtBeginning()) {
-    // Note that we have already cleared the state, so we don't need to update
-    // it.
-    ScoreBrackets->clearWaitAtBeginning();
-    Wait = AMDGPU::Waitcnt::allZero();
-  }
-
   // See if this instruction has a forced S_WAITCNT VM.
   // TODO: Handle other cases of NeedsWaitcntVmBefore()
-  else if (MI.getOpcode() == AMDGPU::BUFFER_WBINVL1 ||
+  if (MI.getOpcode() == AMDGPU::BUFFER_WBINVL1 ||
            MI.getOpcode() == AMDGPU::BUFFER_WBINVL1_SC ||
            MI.getOpcode() == AMDGPU::BUFFER_WBINVL1_VOL) {
     Wait.VmCnt = 0;
@@ -1274,9 +1261,8 @@ void SIInsertWaitcnts::mergeInputScoreBr
     BlockWaitcntBrackets *PredScoreBrackets =
         BlockWaitcntBracketsMap[Pred].get();
     bool Visited = BlockVisitedSet.count(Pred);
-    if (!Visited || PredScoreBrackets->getWaitAtBeginning()) {
+    if (!Visited)
       continue;
-    }
     for (auto T : inst_counter_types()) {
       int span =
           PredScoreBrackets->getScoreUB(T) - PredScoreBrackets->getScoreLB(T);
@@ -1287,17 +1273,6 @@ void SIInsertWaitcnts::mergeInputScoreBr
     }
   }
 
-#if 0
-  // LC does not (unlike) add a waitcnt at beginning. Leaving it as marker.
-  // TODO: how does LC distinguish between function entry and main entry?
-  // If this is the entry to a function, force a wait.
-  MachineBasicBlock &Entry = Block.getParent()->front();
-  if (Entry.getNumber() == Block.getNumber()) {
-    ScoreBrackets->setWaitAtBeginning();
-    return;
-  }
-#endif
-
   // Now set the current Block's brackets to the largest ending bracket.
   for (auto T : inst_counter_types()) {
     ScoreBrackets->setScoreUB(T, MaxPending[T]);




More information about the llvm-commits mailing list