[PATCH] D130096: [Clang][AMDGPU] Emit AMDGPU library control constants in clang
Yaxun Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 19 11:15:56 PDT 2022
yaxunl added a comment.
There is no constant propagation for globals with weak linage, right? Otherwise, it won't work. My concern is that there may be optimization passes which do not respect the weak linkage and uses the incorrect default value for OpenCL or HIP. Therefore I am not very confident to enable this for OpenCL or HIP unless these variables have the correct value based on the compilation options.
================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:9480
+ AddGlobal("__oclc_ISA_version", Minor + Major * 1000, 32);
+ AddGlobal("__oclc_ABI_version", 400, 32);
+}
----------------
should be determined by the code object version option.
================
Comment at: clang/test/CodeGen/amdgcn-occl-constants.c:8
+// CHECK: @__oclc_daz_opt = weak_odr hidden local_unnamed_addr addrspace(4) constant i8 0, align 1
+// CHECK: @__oclc_wavefrontsize64 = weak_odr hidden local_unnamed_addr addrspace(4) constant i8 1, align 1
+// CHECK: @__oclc_finite_only_opt = weak_odr hidden local_unnamed_addr addrspace(4) constant i8 0, align 1
----------------
need a check for __oclc_wavefrontsize64=0 for gfx1030
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130096/new/
https://reviews.llvm.org/D130096
More information about the cfe-commits
mailing list