[llvm] [RISCV] Don't use pointer operand in MemoryLocation for RISC-V strided and indexed load/store intrinsics. (PR #79890)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 09:49:45 PST 2024


topperc wrote:

> Do you have a test case for this you can share? I'm fine with this as a workaround, but AA should have correct handling for an unknown size (i.e. both before and after, and inprecise). The fact that you have a case which shows otherwise, I'd like to investigate.

I don't have a test case currently, but I can point you towards where I think the issue is. Though I haven't confirmed.

MemOperandsHaveAlias in MachineInstrInfo creates a `MemoryLocation`. This requires passing the `UnknownSize`(a large unsigned value) to the `LocationSize` constructor. This invokes this constructor

```
  constexpr LocationSize(uint64_t Raw)                                           
      : Value(Raw > MaxValue ? AfterPointer : Raw) {}
```

The large value is interpreted as being more than `MaxValue` so it picks `AfterPointer`.

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


More information about the llvm-commits mailing list