I just came across a difference in GCC and LLVM w.r.t. propagation of function attributes when inlining.
E.g., consider the following code (built with -O3 -march=rv64gc):
#define always_inline __attribute__((always_inline))
always_inline inline int get_elem(int *p, int n)
{
return p[n];
}
__attribute__((target("arch=+zba")))
int get_elem_fast(int *p, int n)
{
return get_elem(p, n);
}
Could you open a bugzilla entry to GCC? I think it should fix on GCC 14 branch as well, having a bugzilla entry will make sure we remember to do that :)
I just came across a difference in GCC and LLVM w.r.t. propagation of function attributes when inlining. E.g., consider the following code (built with
-O3 -march=rv64gc
):LLVM inlines as advised and produces:
GCC errors out with:
error: inlining failed in call to 'always_inline' 'get_elem': target specific option mismatch
.Probably there is nothing that can be done here. Still, I wanted to raise attention about that.