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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits