[PATCH] D43736: [AMDGPU] Remove use of OpenCL triple environment and replace with function attribute for AMDGPU

Tony Tye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 20 15:23:28 PDT 2018


t-tye added inline comments.


================
Comment at: lib/Target/AMDGPU/AMDGPUSubtarget.h:540-541
       return 16;
-    if (isAmdHsaOS() && isOpenCLEnv())
-      return 32;
-    return 0;
+    return AMDGPU::getIntegerAttribute(
+      MF.getFunction(), "amdgpu-implicitarg-num-bytes", 0);
   }
----------------
arsenm wrote:
> t-tye wrote:
> > arsenm wrote:
> > > Is there a maximum value we could default this to instead of 0? I'm a bit worried that if this attribute is missing or mis-specified the program will be broken, i.e. this attribute could only reduce the amount used
> > I spoke to @scchan  and HCC does not use any implicit arguments, so defaulting to 0 seems the right thing.
> I don't see how what hcc wants is related? What is the maximum value this could be? In general attributes should make things less conservative, not more
If a language runtime does not need any implicit arguments why would we want to add some space for arguments that are never used? The original code never added implicit arguments unless it was being explicitly requested. Conceptually the maximum number is maxint since a different runtime/OS ABI may want a different set of implicit arguments.


https://reviews.llvm.org/D43736





More information about the llvm-commits mailing list