[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
Tue Sep 9 10:54:14 PDT 2025


efriedma-quic wrote:

Consider:

```
void f(int*);
void g() {
  for (int i = 0; i < 10; ++i) {
    const int j = i;
    f(&j);
  }
}
```

There's "one store"... but consider what happens if the loop is unrolled.

-----

There's also more subtle issues; we don't guarantee "one store" actually remains a single store instruction.

https://github.com/llvm/llvm-project/pull/157676


More information about the llvm-commits mailing list