[PATCH] D33086: [AMDGPU] Fix incorrect register pressure calculation

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 11 08:42:08 PDT 2017


rampitec updated this revision to Diff 98636.
rampitec marked an inline comment as done.
rampitec added a comment.

Changed to use skipDebugInstructionsForward().


Repository:
  rL LLVM

https://reviews.llvm.org/D33086

Files:
  lib/Target/AMDGPU/GCNSchedStrategy.cpp


Index: lib/Target/AMDGPU/GCNSchedStrategy.cpp
===================================================================
--- lib/Target/AMDGPU/GCNSchedStrategy.cpp
+++ lib/Target/AMDGPU/GCNSchedStrategy.cpp
@@ -422,9 +422,10 @@
   unsigned SGPRs = 0;
   unsigned VGPRs = 0;
 
-  auto &MI = *begin()->getParent()->getFirstNonDebugInstr();
+  auto I = begin();
+  I = skipDebugInstructionsForward(I, I->getParent()->end());
   const SIRegisterInfo *SRI = static_cast<const SIRegisterInfo*>(TRI);
-  SlotIndex SI = LIS->getInstructionIndex(MI).getBaseIndex();
+  SlotIndex SI = LIS->getInstructionIndex(*I).getBaseIndex();
   assert (SI.isValid());
 
   DEBUG(dbgs() << "Region live-ins:");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33086.98636.patch
Type: text/x-patch
Size: 681 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170511/8320ebe4/attachment.bin>


More information about the llvm-commits mailing list