Yingwei Zheng 30434bab1a
[Reland][llubi] Add support for load/store/lifetime markers (#185196)
This patch relands https://github.com/llvm/llvm-project/pull/182532. The
original version causes test failures related undef bits since it
incorrectly assumes `std::uniform_int_distribution` yields the same
results across different stdlib vendors. This patch simply uses low bits
to avoid the issue. I am not sure whether it still generates uniformly
distributed random numbers. But abseil also uses this trick:
e72b94a2f2/absl/random/uniform_int_distribution.h (L203-L206)

I have confirmed all tests passed with libstdc++ and libc++.

Original PR description:
Bytes are adjusted to respect the incoming byte type proposed in
https://discourse.llvm.org/t/rfc-add-a-new-byte-type-to-llvm-ir/89522.

Note that the current implementation of constant folding doesn't handle
bitcasts with weird types like `<8 x i3> to <3 x i8>`:

49de34459c/llvm/lib/Analysis/ConstantFolding.cpp (L223-L232)
So I take the result from Alive2 as reference:
https://alive2.llvm.org/ce/z/ZGA_xP
2026-03-08 00:00:09 +08:00
..
2026-02-25 08:47:28 +01:00