yonghong-song
5686786c55
[BPF] Fix BitCast Assertion with NonZero AddrSpace ( #130722 )
...
Alexei reported a bpf selftest failure with recent llvm for bpf prog
file progs/arena_spin_lock.c. The failure only happens when clang is
built with cmake option LLVM_ENABLE_ASSERTIONS=ON.
The error message looks like:
```
clang: /home/yhs/work/yhs/llvm-project/llvm/lib/IR/Instructions.cpp:3460:
llvm::BitCastInst::BitCastInst(Value *, Type *, const Twine &, InsertPosition):
Assertion `castIsValid(getOpcode(), S, Ty) && "Illegal BitCast"' failed.
```
Further investigation shows that the problem is triggered in
BPF/BPFAbstractMemberAccess.cpp
for code
```
auto *BCInst =
new BitCastInst(Base, PointerType::getUnqual(BB->getContext()));
```
For the above BitCastInst, Since 'Base' has non-zero AddrSapce, the
compiler expects the type also has the same AddrSpace. But the above
PointerType::getUnqual(...) does not have AddrSpace and hence causes the
assertion failure.
Providing the proper AddrSpace for the BitCast type fixed the issue.
Co-authored-by: Yonghong Song <yonghong.song@linux.dev >
2025-03-11 11:23:53 -07:00
..
2024-12-15 11:04:24 -08:00
2025-03-11 11:23:53 -07:00
2025-01-29 16:56:47 +01:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-03-13 02:27:25 +02:00
2024-12-15 11:04:24 -08:00
2025-03-04 09:19:39 -08:00
2024-03-13 02:27:25 +02:00
2025-03-04 09:19:39 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2023-12-13 13:41:52 +08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2022-12-19 12:46:54 +01:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2025-02-05 23:29:02 +07:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2025-01-29 16:56:47 +01:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2025-01-28 15:19:05 -08:00
2025-01-28 15:19:05 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-10-18 09:35:42 +04:00
2024-12-15 11:04:24 -08:00
2024-09-03 07:15:18 -07:00
2023-09-11 14:42:37 -07:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-10-01 14:20:54 -07:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-10-01 14:20:54 -07:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2022-08-18 19:11:50 -07:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00
2024-12-15 11:04:24 -08:00