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

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 10:02:47 PDT 2016


jlebar added a comment.

> The original text says, "invariant across the function", and it seems important that invariance here is restricted to during the execution of the current function body.


If the comment is correct, I agree it's important to keep that part, but I'm not sure it is correct.

The function returns true if, for each load L done by the instruction,

- L is MMO-invariant (meaning here that it is dereferenceable and has the !invariant.load IR annotation -- this patch comes before the one where we split out the notions of MMO-invariance and MMO-dereferenceability), or
- L loads from a PseudoSourceValue that's constant, or
- The address L is loading from points to constant memory.

I think this means that the load is invariant period, not invariant within the function?


https://reviews.llvm.org/D23370





More information about the llvm-commits mailing list