[llvm] [LLVM][TableGen] Check overloaded intrinsic mangling suffix conflicts (PR #110324)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 1 07:10:07 PDT 2024


jurahul wrote:

> TBH, if we can't forbid this generically due to existing intrinsics, I'm not sure it's really worthwhile to do this kind of heuristic matching. This looks like a decent bit of complexity to solve a theoretical problem.
> 
> I think I'd prefer doing nothing over doing this. Another alternative would be to grandfather in the handful of existing intrinsics that wouldn't pass a stricter prefix check.

I agree that this is a theoretical problem, in the sense, the origin is not that someone ran into this. Though it's possible folks may have run into this and figured out the issue and fixed it in their intrinsic definitions, so this would avoid potential debug cycles in such cases. Having a stricter check and then grandfathering in a few intrinsics we have also sounds reasonable. Let me see how many intrinsics we are talking about (IIRC, > a dozen). If we just have a whitelist of intrinsics for which we skip this check, this will work upstream, I wonder what happens for downstream backends. I guess they will have to maintain a diff in their downstream code for additional intrinsics that should skip this check. If we really wanted to make this generic, we could add a new property to Intrinsics.td to specify that this check can be skipped (something like NoNameConflict) and then add it to all the whitelisted ones, so there is no list maintained in the code, but that would be even more heavy weight mechanism to handle this.

Let me prototype the whitelist approach and see how it looks.

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


More information about the llvm-commits mailing list