[PATCH] D23370: [CodeGen] Rename MachineInstr::isInvariantLoad to isDereferenceableInvariantLoad. NFC

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 13:55:11 PDT 2016


jlebar added a comment.

> I think this is the point: These PseudoSourceValues can be things like addresses of things on the caller's stack


Ah, right, okay, thanks for clarifying that.

> In general, dereferenceability is a context-sensative property. In this query, the dereferenceable property is not context sensative and can only return true if the location is dereferenceable for any possible context. That should be clarified.


I'm happy to clarify this, but I'm not sure how.  The comment talks about a load instruction never trapping, so clearly we're talking about the memory location being dereferenceable within the context of the function?

Maybe it would be helpful if you could give a specific suggestion?

> The "any possible context" bit is the issue Hal raises about function scope vs global scope. I believe we want function scope, but that implies we have to strip the relevant flag if we ever inline at the MI level. Do we actually do that?


AIUI (and I've been wrong now at least once, so take it fwiw) there's nothing to strip, because if we inline at the MI level and a load that once referenced constant memory no longer references constant memory, we'll notice that and the function will dtrt.


https://reviews.llvm.org/D23370





More information about the llvm-commits mailing list