[DAGCombiner] Fix DAG combine store elimination, different address space.
authorHendrik Greving <hgreving@google.com>
Tue, 11 May 2021 15:57:18 +0000 (08:57 -0700)
committerHendrik Greving <hgreving@google.com>
Wed, 12 May 2021 14:14:22 +0000 (07:14 -0700)
commit762ac725bf9775536dda5b3dda13574f14a8c2b9
treec65354ff247f8d07cdfac6013778b4e3d014b658
parent4b00ffa767fc8a71c2eaf544cb6397f6db34eb6a
[DAGCombiner] Fix DAG combine store elimination, different address space.

Fixes a bug in the DAG combiner that eliminates the stores because it missed
to inspect the address space of the pointers.

%v = load %ptr_as1
// no chain side effect
store %v, %ptr_as2

As well as

store %v, %ptr_as1
store %v, %ptr_as2

Fixes a test for above in X86.

Differential Revision: https://reviews.llvm.org/D102096
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/dagcombine-dead-store.ll