[AMDGPU] Fix bug with tracking processed blocks in SIInsertWaitcnts
authorScott Linder <scott@scottlinder.com>
Thu, 21 Jun 2018 18:48:48 +0000 (18:48 +0000)
committerScott Linder <scott@scottlinder.com>
Thu, 21 Jun 2018 18:48:48 +0000 (18:48 +0000)
BlockWaitcntProcessedSet was not being cleared between calls, so it was
producing incorrect counts in cases where MBB addresses happened to coincide
across multiple calls.

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

llvm-svn: 335268

llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

index fb24d52..7f75098 100644 (file)
@@ -1868,6 +1868,7 @@ bool SIInsertWaitcnts::runOnMachineFunction(MachineFunction &MF) {
   BlockVisitedSet.clear();
   VCCZBugHandledSet.clear();
   LoopWaitcntDataMap.clear();
+  BlockWaitcntProcessedSet.clear();
 
   // Walk over the blocks in reverse post-dominator order, inserting
   // s_waitcnt where needed.