[PATCH] D101633: [AMDGPU] Set number vgprs used in PS shaders based on input registers actually used

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 7 03:50:56 PDT 2021


sebastian-ne added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:1154-1155
   if (isShader(F.getCallingConv())) {
+    bool ProcessingPS =
+        F.getCallingConv() == CallingConv::AMDGPU_PS && !STM.isAmdHsaOS();
+
----------------
dstuttard wrote:
> sebastian-ne wrote:
> > Checking for AMDGPU_PS is enough, having this calling convention in AmdHsaOS would throw an error in SITargetLowering::LowerFormalArguments.
> > Also, maybe the name `IsPixelShader` is clearer? (It’s called that in AMDGPUAtomicOptimizer.cpp.)
> Actually, removing the AmdHsaOS check causes one of the lit tests to fail: no-hsa-graphics-shaders.ll
The lit test fails because the assertion `assert((InputEna || InputAddr))` fails and the error message that amdgpu_ps is unsupported in HSA is not printed anymore. So amdgpu_ps in HSA is illegal. Not sure if there’s a better way to handle this though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101633



More information about the llvm-commits mailing list