<div dir="ltr"><div>I think DAG combine misses to check the address space when eliminating a store in one optimization case that I've filed as <a href="https://bugs.llvm.org/show_bug.cgi?id=50267">https://bugs.llvm.org/show_bug.cgi?id=50267</a>.</div><div><br></div><div>A suggested fix is <a href="https://reviews.llvm.org/D102096">https://reviews.llvm.org/D102096</a>.</div><div><br></div><div>I've attached a test case for x86 to the bug and patch, though it should affect all backends. A simple reproducer is this: <a href="https://www.godbolt.org/z/deT9d7z4K">https://www.godbolt.org/z/deT9d7z4K</a>.</div><div><br></div><div>I believe that DAG combine should not eliminate a store at this point. Though the pointer values might be the same, the address space may have been different, so it should be left to the target's backend. Most likely, such stores would end up as different instructions.</div><div><br></div><div>If somebody could review this that would be great, thanks in advance.</div></div>