[llvm] [RISCV] Add areInlineCompatible for riscv target (PR #86639)
Jianjian Guan via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 26 19:23:30 PDT 2024
jacquesguan wrote:
> Does this mean we'll inline a function even if it we disabled an extension via an overriding target attribute arch string? e.g.
>
> ```c
> __attribute__((target("arch=rv64i")))
> float foo(float x) {
> return x + 42;
> }
>
> float bar(float x) {
> return foo(x);
> }
> ```
>
> foo will now be inlined if we compile with `-march=rv64if`. But I presume that's fine given that this seems to be inline with what other targets do
Yes, in my work, there are some similar cases. I have some common tool functions and want to inline them into some users with
different target attributes.
https://github.com/llvm/llvm-project/pull/86639
More information about the llvm-commits
mailing list