[llvm-dev] invariant.load metadata semantics

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 30 17:25:55 PDT 2016


On 8/30/2016 5:15 PM, Sanjoy Das wrote:
> 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

Yes, that's right, I think.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project



More information about the llvm-dev mailing list