[DAGCombine] Fix splitting indexed loads in ForwardStoreValueToDirectLoad()
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 27 Mar 2020 22:29:05 +0000 (17:29 -0500)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 27 Mar 2020 23:03:47 +0000 (18:03 -0500)
commit482141134729237072cb94248381dab96ce34374
tree4807077ac0ce8ca43eb55e4b6d9b14004a064b6c
parentd0af43816193aac382276c878deb4e33ed76be1d
[DAGCombine] Fix splitting indexed loads in ForwardStoreValueToDirectLoad()

In DAGCombiner::visitLOAD() we perform some checks before breaking up an indexed
load. However, we don't do the same checking in ForwardStoreValueToDirectLoad()
which can lead to failures later during combining
(see: https://bugs.llvm.org/show_bug.cgi?id=45301).

This patch just adds the same checks to this function as well.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=45301

Differential revision: https://reviews.llvm.org/D76778
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/PowerPC/pr45301.ll [new file with mode: 0644]