[llvm] [Offload] Add type information to device info nodes (PR #144535)

Ross Brunton via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 20 06:34:05 PDT 2025


RossBrunton wrote:

@jhuber6 
> I'm not exactly sure what this nets us. Usually for these lookups you just do type erasure on a void pointer and expect the user to provide the proper size.

This is primarily a response to your concerns here: https://github.com/llvm/llvm-project/pull/143718#discussion_r2143051933

I figure rather than fiddling around using conversion functions between int and strings, if we know the data type is an int we may as well just store it as an int.

We could store it as a `void *` and cast it to whatever type we need when we use it, but type information is required for `llvm-offload-device-info` to print it correctly and provides us with some free error checking.

https://github.com/llvm/llvm-project/pull/144535


More information about the llvm-commits mailing list