MemoryLocations can only be retrieved from certain arguments of intrinsic calls.
For instance, MemoryLocation::getForArgument would only work on lifetime.end's
second argument.
Currently, getModRefInfo avoids MemoryLocation-ing the wrong argument by
first checking that the argument type is a pointer. This check is inadequate.
For instance, invariant.end has two pointer arguments:
declare void @llvm.invariant.end.p0i8(
{}* <start>,
i64 <size>,
i8* nocapture <ptr>
)This patch attempts to address this discrepancy.
I'm missing something here. *Why* is it problematic to ask for a memory location of the parameter to invariant_end? I would expect that to just work.