[PowerPC] Fix crash for shuffle canonicalization with elt 0 from RHS
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Mon, 29 Jun 2020 16:37:03 +0000 (11:37 -0500)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Mon, 29 Jun 2020 17:26:08 +0000 (12:26 -0500)
commitd2533d96e14118a86904a69fd2a192c008642f14
tree45a1f31b7bdf88c13215a8c12a3aab032f5ecf5a
parente73c3bb06b5a35d13cf96d574ce3b849c5d3d56d
[PowerPC] Fix crash for shuffle canonicalization with elt 0 from RHS

Commit 1fed131660b2 assumed that shuffle vector canonicalization will
always ensure that the shuffle mask will be ordered so that element
zero comes from the LHS vector. However there is code out there for
which this is not the case. This patch simply removes that unsafe
assumption and makes the code work regardless of the source of the
first element.
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/canonical-merge-shuffles.ll