[all-commits] [llvm/llvm-project] 34d381: [NewGVN] Fix lifetime coercion (#141477)

ManuelJBrito via All-commits all-commits at lists.llvm.org
Mon May 26 09:34:49 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 34d381f39d5b3831aee30fe2be0e723dace82297
      https://github.com/llvm/llvm-project/commit/34d381f39d5b3831aee30fe2be0e723dace82297
  Author: ManuelJBrito <59119670+ManuelJBrito at users.noreply.github.com>
  Date:   2025-05-26 (Mon, 26 May 2025)

  Changed paths:
    M llvm/lib/Transforms/Scalar/NewGVN.cpp
    M llvm/test/Transforms/NewGVN/coercion-different-ptr.ll

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list