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

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 13 16:26:03 PDT 2020


rampitec marked an inline comment as done.
rampitec added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp:225-228
+      if (Count == Threshold)
+        SetGPRMI = nullptr;
+      else
+        ++Count;
----------------
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.


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

https://reviews.llvm.org/D79907





More information about the llvm-commits mailing list