llvm-project
34d381f3 - [NewGVN] Fix lifetime coercion (#141477)

Commit
129 days ago
[NewGVN] Fix lifetime coercion (#141477) Before commit 14dee0a, NewGVN would not miscompile the function foo, because `isMustAlias` would return false for non-pointers, particularly for `lifetime.start`. We need to check whether the loaded pointer is defined by`lifetime.start` in order to safely simplify the load to uninitialized memory. For `getInitialValueOfAllocation`, the behavior depends on the allocation function. Therefore, we take a conservative approach: we check whether it's a pointer type. If it is, then—based on the earlier check—we know that the allocation function defines the loaded pointer.
Author
Parents
Loading