[PowerPC] Use a small cleanup pass to remove VSX self copies

As explained in r204976, because of how the allocation of VSX registers
interacts with the call-lowering code, we sometimes end up generating self VSX
copies. Specifically, things like this:
  %VSL2<def> = COPY %F2, %VSL2<imp-use,kill>
(where %F2 is really a sub-register of %VSL2, and so this copy is a nop)

This adds a small cleanup pass to remove these prior to post-RA scheduling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204980 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Hal Finkel
2014-03-27 23:12:31 +00:00
parent d9524d66cd
commit e2ee98ab16
4 changed files with 105 additions and 0 deletions
+3
View File
@@ -182,6 +182,9 @@ bool PPCPassConfig::addPreRegAlloc() {
}
bool PPCPassConfig::addPreSched2() {
if (getPPCSubtarget().hasVSX())
addPass(createPPCVSXCopyCleanupPass());
if (getOptLevel() != CodeGenOpt::None)
addPass(&IfConverterID);