yaxunl added inline comments.
================ Comment at: clang/lib/CodeGen/TargetInfo.cpp:9436 + CGM.getModule(), Type, true, + llvm::GlobalValue::LinkageTypes::LinkOnceODRLinkage, + llvm::ConstantInt::get(Type, Value), Name, nullptr, ---------------- jhuber6 wrote: > yaxunl wrote: > > This does not support per-TU control variables. Probably should use > > internal linkage. > The AMDGPU device libraries use `linkone_odr` so I figured it was the most > appropriate here. It should mean that we can have multiple identical > definitions and they don't clash. There's also no requirement for these to be > emitted as symbols AFAIK. > The AMDGPU device libraries use `linkone_odr` so I figured it was the most > appropriate here. It should mean that we can have multiple identical > definitions and they don't clash. There's also no requirement for these to be > emitted as symbols AFAIK. clang uses -mlink-builtin-bitcode to link these device libraries for HIP and OpenCL. Then the linkage of these variables becomes internal linkage. That's why it works for per-TU control. 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