[PowerPC] Fix the splat immediate in PPCMIPeephole depending on if we have an Altivec...
authorAmy Kwan <amy.kwan1@ibm.com>
Mon, 12 Jul 2021 21:19:15 +0000 (16:19 -0500)
committerAmy Kwan <amy.kwan1@ibm.com>
Mon, 12 Jul 2021 21:20:11 +0000 (16:20 -0500)
commit35909ff6cf27373efa6f1974d4ad349beb6959a0
treeebb0ed8c6068740b1712a632eee37d5b72d498d6
parent15df9c9881aebf58dd54fb4e8dd1c1a77684fd7f
[PowerPC] Fix the splat immediate in PPCMIPeephole depending on if we have an Altivec and VSX splat instruction.

An assertion of the following can occur because Altivec and VSX splats use a different operand number for the immediate:
```
int64_t llvm::MachineOperand::getImm() const: Assertion `isImm() && "Wrong MachineOperand accessor"' failed.
```
This patch updates PPCMIPeephole.cpp assign the correct splat immediate.

Differential Revision: https://reviews.llvm.org/D105790
llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
llvm/test/CodeGen/PowerPC/aix-vsx-splatimm.ll [new file with mode: 0644]