[llvm-dev] invariant.load metadata semantics

Sanjoy Das via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 30 17:15:48 PDT 2016


Hi Eli,

Friedman, Eli wrote:
 > LICM performs precisely this transformation... see "If this is a thread
 > local location" etc. in LICM.cpp. That said, I doubt this case matters;
 > nobody is going to use invariant.load on the result of calloc().

IIRC LICM will not introduce a dead store in the way I mentioned
above.  I think it uses thread-locality as an excuse for inserting a
store on every exit of the value that the memory location in question
would have held at that exit (even on exits that didn't have a store),
so it should not _change_ the value held by a location at any point in
the trace of the program.

But this ^ is going off of memory.

-- Sanjoy


More information about the llvm-dev mailing list