[llvm] [BPF] Allow libcalls behind a feature gate (PR #168442)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 11:18:28 PST 2025


================
@@ -1,6 +1,6 @@
 ; RUN: not llc -mtriple=bpf < %s 2> %t1
 ; RUN: FileCheck %s < %t1
-; CHECK: only small returns
+; CHECK: aggregate returns are not supported
----------------
yonghong-song wrote:

For struct_ret2.ll, the following is the error message:

```
$ llc -march=bpf test/CodeGen/BPF/struct_ret2.ll
error: <unknown>:0:0: in function foo { i64, i32 } (i32, i32, i32): 0x3d86ac0: i64 = GlobalAddress<ptr @bar> 0 too many arguments

error: <unknown>:0:0: in function foo { i64, i32 } (i32, i32, i32): aggregate returns are not supported
```
I suggest to have the first error message for CHECK, i.e., 'too many arguments" which is caused by CanLowerReturn().

Please also update struct_ret1.ll like below:
```
$ llc -march=bpf test/CodeGen/BPF/struct_ret1.ll
error: <unknown>:0:0: in function bar { i64, i32 } (i32, i32, i32, i32, i32): stack arguments are not supported

error: <unknown>:0:0: in function bar { i64, i32 } (i32, i32, i32, i32, i32): aggregate returns are not supported

error: <unknown>:0:0: in function baz void (ptr): aggregate returns are not supported
```
Similarly, I would like the error message in CHECK should be the first error message.

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


More information about the llvm-commits mailing list