[PATCH] D79907: [AMDGPU] Peephole adjacent equivalent S_SET_GPR_IDX_ON

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 14 15:15:18 PDT 2020


arsenm accepted this revision.
arsenm added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp:225-228
+      if (Count == Threshold)
+        SetGPRMI = nullptr;
+      else
+        ++Count;
----------------
rampitec wrote:
> arsenm wrote:
> > I'm confused by this usage of threshold. You never break from the loop on it and it's not part of the loop condition
> Right, the block will be scanned once. However, it will not send two S_SET_GPR_IDX_ON instructions into the optimizeSetGPR() if they are too far apart. That is the loop from the first to next S_SET_GPR_IDX_ON in the optimizeSetGPR() which performs expensive checks.
This could uses a comment


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79907/new/

https://reviews.llvm.org/D79907





More information about the llvm-commits mailing list