Among others, BPF currently supports the type-exists CO-RE relocation
(e.g., see D83878 & D83242). Its intention, as the name tries to convey,
is to be used for checking existence of a type in a target.
While that check is useful and has its place, we would also like to
be able to perform stricter type queries: instead of just checking mere
existence, we want to make sure that members match up in composite
types, that enum variants are present, etc. We refer to this as "type
match".
This change proposes the addition of a new relocation variant/value that
we intend to use for establishing this match relation.
Details
Diff Detail
Event Timeline
llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-match.ll | ||
---|---|---|
71–101 | I am unsure how that blob is created or whether I need to adjust it. I just copied it from an existing file for now. |
llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-match.ll | ||
---|---|---|
71–101 | As mentioned in the test itself, it is generated with clang -target bpf -S -O2 -g -emit-llvm -Xclang -disable-llvm-passes t1.c Let us use latest llvm-project to generate IR for this test. The test you are copied using llvm12 which is not correct for this patch as this patch will apply to llvm15. Also please add '/tmp' as the prefix to the path in the below IR, !1 = !DIFile(filename: "t1.c", directory: "/tmp/home/yhs/tmp1") The reason is to avoid test failures when merging the tests. The reason is the path will be actually used by llvm, so adding /tmp will make sure both your local run and also sanity run after merging will have the same behavior. |
llvm/test/CodeGen/BPF/CORE/intrinsic-typeinfo-type-match.ll | ||
---|---|---|
71–101 | Makes sense, thanks for the explanation. Done. |
I am unsure how that blob is created or whether I need to adjust it. I just copied it from an existing file for now.