[PowerPC] Don't run BV DAG Combine before legalization if it assumes legal types
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Wed, 15 Aug 2018 12:58:13 +0000 (12:58 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Wed, 15 Aug 2018 12:58:13 +0000 (12:58 +0000)
commit8b4bd09e2276aaa2bf5f074e71c04a911fdf4117
treef984ebde12c5f922123beaff15f1542982e0e71d
parenta03f2a77f8ef84aa8339a3da51400792f61804d3
[PowerPC] Don't run BV DAG Combine before legalization if it assumes legal types

When trying to combine a DAG that builds a vector out of sign-extensions of
vector extracts, the code assumes legal input types. Due to that, we have to
disable this combine prior to legalization.
In some cases, the DAG will look slightly different after legalization so
account for that in the matching code.

This is a fix for https://bugs.llvm.org/show_bug.cgi?id=38087

Differential Revision: https://reviews.llvm.org/D49080

llvm-svn: 339769
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/test/CodeGen/PowerPC/pr38087.ll [new file with mode: 0644]