[PATCH] D104513: [AMDGPU] Simplify getReservedNumSGPRs

Madhur Amilkanthwar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 23 03:26:43 PDT 2021


madhur13490 added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp:733-735
+  if (hasFlatAddressSpace() && isEntry && !flatScratchIsArchitected() &&
+      (isAmdHsaOrMesa(F) || enableFlatScratch())) {
+    if (enableFlatScratch())
----------------
sebastian-ne wrote:
> The nested if can be merged into one.
Actually optimizing it a bit more, checking `isAmdHsaOrMesa()` is nugatory here. Setting the flag requires `enableFlatScratch()` to be true always. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104513



More information about the llvm-commits mailing list