[clang] [llvm] [clang-tools-extra] [CodeGen] Mark mem intrinsic loads and stores as dereferenceable (PR #80184)

Derek Schuff via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 11:31:04 PST 2024


dschuff wrote:

I am getting one local test failure here, in `/test/CodeGen/BPF/undef.ll`:
The test has a bunch of [stores](https://github.com/llvm/llvm-project/blob/cdd9221489ec4ed6afc0e5146c2fae4daa8ab260/llvm/test/CodeGen/BPF/undef.ll#L44-L54) into an alloca, which i think are supposed to get converted to a single memset, so the test calls for
```
; EL: r1 = 11033905661445 ll
; CHECK: *(u64 *)(r10 - 8) = r1
```
(where 11033905661445 is 0xA0908070605, i.e. the stored values). With this change the output is
```
	r1 = 2569
	*(u16 *)(r10 - 4) = r1
	r1 = 134678021
	*(u32 *)(r10 - 8) = r1
```
i.e. the 0x0A09 has been split out from the 0x8070605. I have no idea yet why this change would do that. 
Also, there is actually a memset on the next line, which seem to be zeroing the memory *after* the alloca'd pointer (which I think is UB?). Removing it doesn't seem to affect the output, but maybe something weird is going on. 

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


More information about the cfe-commits mailing list