[PATCH] D134780: [AMDGPU] Add MIMG NSA threshold configuration attribute

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 01:39:59 PDT 2022


foad accepted this revision.
foad added a comment.
This revision is now accepted and ready to land.

Seems reasonable.

I would also be in favour of changing the default to 2. That would tend to introduce fewer "mov"s to shuffle data around, at the expense of using a larger encoding on average for mimg instructions. But I think that is a good trade-off to make for the sake of performance.



================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp:959
+  if (NSAThreshold.getNumOccurrences() > 0)
+    return NSAThreshold > 2 ? NSAThreshold : 2;
+
----------------
Use max()


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp:963
+  if (Value > 0)
+    return Value > 2 ? Value : 2;
+
----------------
Use max()


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134780



More information about the llvm-commits mailing list