[llvm] [LLVM] Change Intrinsic::ID to encode target and intrinsic index (PR #113576)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 25 08:10:24 PDT 2024
jurahul wrote:
> > This change is in preparation for being able to disable intrinsics for targets that are not enabled.
>
> Why is it required for that? Is there some requirement that LLVM builds with different targets enabled use the same IDs?
please see discourse thread here: https://discourse.llvm.org/t/rfc-compress-intrinsic-name-table/82412/20
It seems there is a desire to not "rock the boat" too much and keep the enum values stable atleast with different targets enabled but built from the same source. The choice was to use an indirection table, or this. This scheme helps derive a linear index from the ID enum without an additional LUT and additionally, it keeps target ID's stable within a target prefix as well if no new intrinsics are added with that prefix. Currently, any new prefix in another target can change all ID enum values.
I do not completely understand the use case of building LLVM with different targets and have the 2 builds interoperate, but given that it was not too involved, this is the result.
https://github.com/llvm/llvm-project/pull/113576
More information about the llvm-commits
mailing list