[llvm] [llvm][Inliner] Don't inline functions referencing local COMDAT globals (PR #202687)
Alexis Engelke via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 10 06:19:39 PDT 2026
aengelke wrote:
> I don't think that works, since the comdat key needs to be a non-local symbol, and even if you allow that, you would still get the same error if we happen to do the same in another module and their names collide.
Give it linkonce_odr linkage? Similar to how Clang generates static constants for comdat (C++ inline) functions. Alternatively instead of changing this during inlining, could SimplifyCFG give the new lookup table a new comdat from the start to avoid the entire problem?
I wouldn't care about blockaddress: functions with a block whose address is taken are never inlined. And, although technically possible, using blockaddress from a different function is buggy anyway and users shouldn't rely on this.
> Edit: I see the opposite direction being more effective, but why after the clone? We do have the current callee available so couldn't we search for uses there?
We might prune some branches during inlining.
https://github.com/llvm/llvm-project/pull/202687
More information about the llvm-commits
mailing list