[PATCH] D33105: [AMDGPU] Turn register pressure estimation into forward tracker

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 08:36:27 PDT 2017


rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/GCNRegPressure.cpp:305
+  MachineBasicBlock::const_iterator I = MI.getIterator();
+  I = skipDebugInstructionsForward(I, I->getParent()->end());
+  LiveRegs = LiveRegsCopy ? *LiveRegsCopy : getLiveRegsBefore(*I, LIS);
----------------
rampitec wrote:
> vpykhtin wrote:
> > I think this should be the responsibility of the caller to account valid instructions, it would look unexpected that reset moves somewhere else.
> Caller will always need to do it, otherwise reset will just crash. Then advance itself skips debug instructions, so they are consistent. If a caller resets tracker to the debug instruction and then just calls advance increasing the iterator it will not notice any difference. There is nothing good in letting caller to easily crash, there is no additional benefit of it besides the crash.
BTW, reset does not record any state besides live set, and live set is the same if you skip debug or not.


Repository:
  rL LLVM

https://reviews.llvm.org/D33105





More information about the llvm-commits mailing list