[PowerPC] Add a late MI-level pass for QPX load/splat simplification
authorHal Finkel <hfinkel@anl.gov>
Thu, 31 Mar 2016 20:39:41 +0000 (20:39 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 31 Mar 2016 20:39:41 +0000 (20:39 +0000)
commitfc35391f2b4c36ec1a35d6e464ad972cf7117cdb
tree026da57fa59dce0a2c65203543f5e5c01e23d310
parent132cd621216b7b09a170b9f10aa7494a87ce82fc
[PowerPC] Add a late MI-level pass for QPX load/splat simplification

Chapter 3 of the QPX manual states that, "Scalar floating-point load
instructions, defined in the Power ISA, cause a replication of the source data
across all elements of the target register." Thus, if we have a load followed
by a QPX splat (from the first lane), the splat is redundant. This adds a late
MI-level pass to remove the redundant splats in some of these cases
(specifically when both occur in the same basic block).

This optimization is scheduled just prior to post-RA scheduling. It can't happen
before anything that might replace the load with some already-computed quantity
(i.e. store-to-load forwarding).

llvm-svn: 265047
llvm/lib/Target/PowerPC/CMakeLists.txt
llvm/lib/Target/PowerPC/PPC.h
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/PowerPC/PPCQPXLoadSplat.cpp [new file with mode: 0644]
llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
llvm/test/CodeGen/PowerPC/qpx-load-splat.ll [new file with mode: 0644]