[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG481d67d310a7: [Clang][BPF] Support record argument with direct values (authored by yonghong-song). Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song updated this revision to Diff 453835. yonghong-song added a comment. Herald added a project: LLVM. Herald added a subscriber: llvm-commits. add two llvm/test/CodeGen/BPF tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132144/new/

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > but if the function is always_inline it can have more than 5 arguments, > right? That is correct. Will add a test case for this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132144/new/ https://reviews.llvm.org

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Alexei Starovoitov via Phabricator via cfe-commits
ast added a comment. clang -target bpf -O2 -S t3.c t3.c:1:5: error: defined with too many args this will be the case when backend needs to emit the code, but if the function is always_inline it can have more than 5 arguments, right? Would be good to have a test for that to make sure when BPF_KPRO

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. > Kernel changes were assuming at most 2 My new version code allows all 5 parameters to be a structure argument. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132144/new/ https://reviews.llvm.org/D132144 ___

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. The compiler only counted the total number of registers won't exceed 5. You could have 5 struct arguments (each one register), or 2 struct arguments (with two registers each) and one integer register. Whether to pass by value or by reference is a ABI issue, not rel

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song added a comment. In D132144#3732685 , @anakryiko wrote: > Are there any restrictions about number of struct arguments that can be > passed in? Kernel changes were assuming at most 2, should we have a test that > tests passing 3 structs tha

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Andrii Nakryiko via Phabricator via cfe-commits
anakryiko added a comment. Are there any restrictions about number of struct arguments that can be passed in? Kernel changes were assuming at most 2, should we have a test that tests passing 3 structs that fit into 5 input registers and another test that passes 3 structs that do not fit in 5 in

[PATCH] D132144: [Clang][BPF] Support record argument with direct values

2022-08-18 Thread Yonghong Song via Phabricator via cfe-commits
yonghong-song created this revision. yonghong-song added a reviewer: ast. Herald added subscribers: pengfei, kristof.beyls. Herald added a project: All. yonghong-song requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Currently, record argumen