Files
clang-p2996/llvm/test/Transforms/Mem2Reg
Nikita Popov f58930f705 [Mem2Reg] Don't use single store optimization for potentially poison value (#97711)
If there is a single store, then loads must either load the stored value
or uninitialized memory (undef). If the stored value may be poison, then
replacing an uninitialized memory load with it would be incorrect. Fall
back to the generic code in that case.

This PR only fixes the case where there is a literal poison store -- the
case where the value is non-trivially poison will still get miscompiled
by phi simplification later, see #96631.

Fixes https://github.com/llvm/llvm-project/issues/97702.
2024-07-04 14:41:12 +02:00
..