[all-commits] [llvm/llvm-project] 10f5e9: [DSE] Delay deleting non-memory-defs until end of ...

Florian Hahn via All-commits all-commits at lists.llvm.org
Sat Mar 2 04:34:49 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 10f5e983a9e3162a569cbebeb32168716e391340
      https://github.com/llvm/llvm-project/commit/10f5e983a9e3162a569cbebeb32168716e391340
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2024-03-02 (Sat, 02 Mar 2024)

  Changed paths:
    M llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
    A llvm/test/Transforms/DeadStoreElimination/batchaa-caching-new-pointers.ll

  Log Message:
  -----------
  [DSE] Delay deleting non-memory-defs until end of DSE. (#83411)

DSE uses BatchAA, which caches queries using pairs of MemoryLocations.
At the moment, DSE may remove instructions that are used as pointers in
cached MemoryLocations. If a new instruction used by a new MemoryLoation
and this instruction gets allocated at the same address as a previosuly
cached and then removed instruction, we may access an incorrect entry in
the cache.

To avoid this delay removing all instructions except MemoryDefs until
the end of DSE. This should avoid removing any values used in BatchAA's
cache.

Test case by @vporpo from
https://github.com/llvm/llvm-project/pull/83181.
(Test not precommitted because the results are non-determinstic - memset
only sometimes gets removed)

PR: https://github.com/llvm/llvm-project/pull/83411



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