[llvm] [Offload] Add `olGetGlobalVariable` (PR #147944)
Ross Brunton via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 11 03:31:06 PDT 2025
RossBrunton wrote:
@jhuber6 To follow up on the discussion at https://github.com/llvm/llvm-project/pull/147972#pullrequestreview-3006221976 , I don't think it's worth doing the type lookup. The caller presumably knows whether it's requesting a global variable or a kernel, so poking around and querying the binary just feels like wasted cycles.
There's also the chance that a binary could have both a global variable and a kernel with the same name, although I'm not sure whether in practice that's a thing to be concerned about.
Shall I replace `olGetGlobalVariable(Program, Name, Out)` and `olGetKernel(Program, Name, Out)` with a single `olGetSymbol(Program, Name, Kind, Out)` API, or does having to pass `Kind` make it not worth it?
https://github.com/llvm/llvm-project/pull/147944
More information about the llvm-commits
mailing list