[llvm-dev] Status of llvm.invariant.{start|end}

Anna Thomas via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 31 08:18:36 PDT 2017


Hi Yichao,

We at Azul have been using invariant.start for marking objects as immutable after a certain point.
Also, upstream changes to teach relevant optimizations about invariant.start and end were added 
last year.

With respect to store to load forwarding, this is handled in GVN. I think the test cases in test/Transforms/GVN/invariant.start.ll  
handle what you’re looking for.


Hope this helps,
Anna 

> On Oct 29, 2017, at 9:01 PM, Yichao Yu via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hi,
> 
> From LangRef, these intrinsics seems really useful for letting LLVM
> know about certain higher level immutability guarantee, e.g. for
> objects that are not allowed to be mutated after construction.
> However, it doesn't seem to work[1] and a quick code search suggests
> that there's not a single optimization pass that's currently using it
> for store to load forwarding, only very few that use it to eliminate
> stores. The issue linked is marked as resolved-later and mentioned
> that it "probably have to be redesigned before they work out right".
> What has to be redesigned to make it work and is there a better way
> that works currently to mark an object as immutable after a certain
> point/in certain region?
> 
> Yichao Yu
> 
> [1] https://bugs.llvm.org/show_bug.cgi?id=5441
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list