[PPC] Fix assertion failure during binary encoding with -mcpu=pwr9
authorHiroshi Inoue <inouehrs@jp.ibm.com>
Mon, 29 May 2017 07:12:39 +0000 (07:12 +0000)
committerHiroshi Inoue <inouehrs@jp.ibm.com>
Mon, 29 May 2017 07:12:39 +0000 (07:12 +0000)
commite3c14ebbfa41160120b11ced9f30e47a81693f91
tree9955d0ea9d1e7c97d4263fdf88c85fcfb97178cd
parent8cca8cb0ce05298b117f2b020a359cd5dd34b6ca
[PPC] Fix assertion failure during binary encoding with -mcpu=pwr9

Summary
clang -c -mcpu=pwr9 test/CodeGen/PowerPC/build-vector-tests.ll causes an assertion failure during the binary encoding.
The failure occurs when a D-form load instruction takes two register operands instead of a register + an immediate.

This patch fixes the problem and also adds an assertion to catch this failure earlier before the binary encoding (i.e. during lit test).
The fix is from Nemanja Ivanovic @nemanjai.

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

llvm-svn: 304133
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
llvm/lib/Target/PowerPC/PPCInstrVSX.td