[DAGCombine] Skip PostInc combine with later users
authorSam Parker <sam.parker@arm.com>
Mon, 23 Mar 2020 08:39:53 +0000 (08:39 +0000)
committerSam Parker <sam.parker@arm.com>
Mon, 23 Mar 2020 08:39:53 +0000 (08:39 +0000)
commit62fdb1f534b73589187f2dca243c1e30865a734f
treeef7996d9985d7c6b16af84d39771ae53cd59ca22
parent8e45eaf1da56d895a74fb2689590c8b76479b484
[DAGCombine] Skip PostInc combine with later users

When decided whether to generate a post-inc load/store, look at the
other memory nodes that use the same base address and, if any proceed
the current node, then don't do the combine.
The change only seems to be affecting the Arm backend, which I was
surprised at, but it appears to fix a lot of our issues around MVE
masked load/stores having to store a temporary address after an early
post-increment on a shared base address.

Differential Revision: https://reviews.llvm.org/D75847
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/Thumb/frame-access.ll
llvm/test/CodeGen/Thumb2/LowOverheadLoops/cond-vector-reduce-mve-codegen.ll
llvm/test/CodeGen/Thumb2/LowOverheadLoops/extending-loads.ll
llvm/test/CodeGen/Thumb2/mve-postinc-lsr.ll