efriedma-quic wrote:

> Since there are multiple store operations to immutable alloca here, the 
> optimization will conservatively not be performed at all.

In the trivial case I showed, you can find all the stores.  More generally, 
other optimizations can hide stores, so iterating over the use list of the 
alloca won't find them all.

When you're considering IR extensions that introduce undefined behavior, you 
need to be very careful: you need to define the extension in a way that results 
in consistent semantics for LLVM IR.  That means you need to consider not only 
transforms that are likely to happen, but also unlikely combinations of 
transforms, and even transforms that don't exist yet.

https://github.com/llvm/llvm-project/pull/157676
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to