[all-commits] [llvm/llvm-project] 88fbc0: [DSE] Restrict partial-overlap store merging to ma...

Justin Lebar via All-commits all-commits at lists.llvm.org
Tue May 26 12:49:38 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 88fbc0614e826d09c986fd1b6e80eb2435e97d6c
      https://github.com/llvm/llvm-project/commit/88fbc0614e826d09c986fd1b6e80eb2435e97d6c
  Author: Justin Lebar <justin.lebar at gmail.com>
  Date:   2026-05-26 (Tue, 26 May 2026)

  Changed paths:
    M llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
    M llvm/test/Transforms/DeadStoreElimination/merge-stores.ll

  Log Message:
  -----------
  [DSE] Restrict partial-overlap store merging to matching orderings. (#199728)

Partial-overlap store merging folds the later killing store into the
earlier dead store and erases the killing store. That is invalid if the
killing store is volatile or has stronger-than-unordered atomic
ordering, because erasing it drops an observable write. It is also invalid
if the killing and dead stores have different atomic orderings, because
the bytes originally written by the killing store would inherit the dead
store's atomicity after the merge -- silently dropping (or adding)
atomicity for those bytes.

Require both stores to be unordered (i.e. non-volatile with ordering at
most unordered) and to share the same ordering. This preserves the
existing fold for two simple stores or two unordered-atomic stores
(e.g. simple.ll's test43a) while leaving volatile, ordered-atomic, and
atomicity-mismatched cases in place.

This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply at anthropic.com>



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