[clang] [llvm] Add metadata for const C/C++ scalar types to track initial values of escaped alloca (PR #157676)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 10 11:26:48 PDT 2025
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
More information about the llvm-commits
mailing list