According to include/llvm/IR/Intrinsics.td, InstrReadMem property indicates that the intrinsic only reads from and does not write to memory.
Does this mean that it can read anywhere in the memory? Because we already have ‘InstrArgMemOnly’ for intrinsics which only access memory that its argument(s) point(s) to.
If ‘InstrReadMem’ really means read from anywhere in the memory, this should imply that, if there’s an intrinsic having this property after a dead store, the latter should not be eliminated by optimizations?
This is not the current behavior of LLVM though, so it seems that my guesses are wrong… But at least, can someone show me the mistake here?
Thanks for your time,
Son Tuan Vu