[llvm] [DSE] Introduce `eliminateRedundantStoresViaDominatingConditions` (PR #181709)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 2 01:27:46 PST 2026
================
@@ -0,0 +1,196 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt < %s -aa-pipeline=basic-aa -passes='dse,verify<memoryssa>' -S | FileCheck %s
+
+; There exists a dominating condition in the entry block, not the immediate
+; dominator for the store, the edge entry->if.eq dominates the store, no
+; clobber in between, the store is redundant.
+define void @remove_tautological_store_via_dom_condition(ptr %x, i1 %c) {
----------------
antoniofrighetto wrote:
Hmm, right. Looking at the counterexample, `%y` and `%val` share indeed the same integral value (`#x06`), but granted different underlying memory blocks (may have different provenance). I assume once pointer provenance semantics gets properly formalized, we may afterwards expect AA to receive provenance-aware support for determining whether this store of a pointer is no operation (maybe cc/ @nikic).
https://github.com/llvm/llvm-project/pull/181709
More information about the llvm-commits
mailing list