[PowerPC] Fix single-use check and update chain users for ld-splat
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Tue, 27 Oct 2020 21:43:11 +0000 (16:43 -0500)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Tue, 27 Oct 2020 21:49:38 +0000 (16:49 -0500)
commit5459d08795e370321beb9e50c3b73e9fcd2dd7de
treedaabe5cee06b3ac699fe4ecc8476e52aa91956c7
parentd981c7b7581efc3ef378709042100e75da0185a0
[PowerPC] Fix single-use check and update chain users for ld-splat

When converting a BUILD_VECTOR or VECTOR_SHUFFLE to a splatting load
as of 1461fb6e783cb946b061f66689b419f74f7fad63, we inaccurately check
for a single user of the load and neglect to update the users of the
output chain of the original load. As a result, we can emit a new
load when the original load is kept and the new load can be reordered
after a dependent store. This patch fixes those two issues.

Fixes https://bugs.llvm.org/show_bug.cgi?id=47891
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/pr47891.ll [new file with mode: 0644]