[llvm] [X86][Inline] Check correct function for target feature check (PR #152515)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 8 06:21:33 PDT 2025
nikic wrote:
> > > I think `NestedCallee` check is necessary. Once inlined, `NestedCallee` will be new callees of the caller. We need to make sure there's no ABI differences among them. Checking the currect callee is not enough, because it may happen to not use vector arguments.
> >
> >
> > Situation before inlining:
> > ```
> > caller calls callee (uses target-features of caller)
> > callee calls nested_callee (uses target-features of callee)
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Situation after inlining:
> > ```
> > caller calls nested_callee (uses target-features of caller)
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > So the call to nested_callee goes from using the target-features of callee to using the target features of caller. The target features of nested_callee are never used by call lowering.
> > So I think it's correct to do the ABI compatibility check between caller and callee, not caller and nested_callee.
>
> Here is an artificial one: https://godbolt.org/z/EhcdWE393. `callee2` cannot be inlined to `caller2` because of `nested_callee2`.
Right, we can't inline callee2 into caller2 -- but this patch will not inline it either, due to the target feature mismatch between caller2 and callee2.
https://github.com/llvm/llvm-project/pull/152515
More information about the llvm-commits
mailing list