This patch exploits the following instructions:
mtvsrws
lxvwsx
mtvsrdd
mfvsrld
In order to improve some build_vector and extractelement patterns.
Paths
| Differential D21135
Power9 Instructions for build_vector improvements ClosedPublic Authored by nemanjai on Jun 8 2016, 7:04 AM.
Details
Diff Detail
Event Timelinenemanjai updated this object.
Comment Actions Added the missing check for only one use of the load when deciding whether to eliminate the splat when building a vector of i32's on Power9.
Comment Actions As we discussed, before you commit the change, please add -verify-machineinstrs to your regression tests. No need to upload the patch again. Thanks. nemanjai edited edge metadata. Comment ActionsSome of the new instructions were being emitted for unintended code patterns (such as materializing a vector of zeros). The new sequences were inferior so this update ensures that we emit the better code sequence. For example, due to the "AddedComplexity", the initial patch emitted a load-immediate followed by a direct move for materializing ones or zeros into a vector. A vector of zeros can be produced with a single XXLXOR. A vector of ones can be produced by a splat-immediate (especially now that we have a VSX version of it). This patch was functionally tested on the Power9 simulator. kbarton edited edge metadata. Comment ActionsThis is perhaps minor, but we should rethink the change in PPCInstPrinter.cpp. If this change is needed, then we should change all the print routines in a similar manner.
This revision now requires changes to proceed.Aug 31 2016, 9:43 AM
nemanjai edited edge metadata. Comment ActionsUpdated the truncation of the 32-bit unsigned value to 8-bits in PPCInstrPrinter.cpp. This revision is now accepted and ready to land.Sep 21 2016, 10:56 AM
Revision Contents
Diff 71406 lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCInstrFormats.td
lib/Target/PowerPC/PPCInstrInfo.td
lib/Target/PowerPC/PPCInstrVSX.td
test/CodeGen/PowerPC/power9-moves-and-splats.ll
|
I'm not sure about this change.
Why are we printing as unsigned int, instead of unsigned char?
It seems like this method, and the method above (printU7ImmOperand) should be using (unsigned char) instead of (unsigned int). It looks like this was done with the printU10ImmOperand below (and probably others, but I didn't look exhaustively).