[llvm-commits] [llvm] r141578 - /llvm/trunk/lib/CodeGen/ExpandPostRAPseudos.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Mon Oct 10 13:34:28 PDT 2011
Author: stoklund
Date: Mon Oct 10 15:34:28 2011
New Revision: 141578
URL: http://llvm.org/viewvc/llvm-project?rev=141578&view=rev
Log:
Give targets a chance to expand even standard pseudos.
Allow targets to expand COPY and other standard pseudo-instructions
before they are expanded with copyPhysReg().
This allows the target to examine the COPY instruction for extra
operands indicating it can be widened to a preferable super-register
copy. See the ARM -widen-vmovs option.
Modified:
llvm/trunk/lib/CodeGen/ExpandPostRAPseudos.cpp
Modified: llvm/trunk/lib/CodeGen/ExpandPostRAPseudos.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ExpandPostRAPseudos.cpp?rev=141578&r1=141577&r2=141578&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ExpandPostRAPseudos.cpp (original)
+++ llvm/trunk/lib/CodeGen/ExpandPostRAPseudos.cpp Mon Oct 10 15:34:28 2011
@@ -205,6 +205,18 @@
MachineInstr *MI = mi;
// Advance iterator here because MI may be erased.
++mi;
+
+ // Only expand pseudos.
+ if (!MI->getDesc().isPseudo())
+ continue;
+
+ // Give targets a chance to expand even standard pseudos.
+ if (TII->expandPostRAPseudo(MI)) {
+ MadeChange = true;
+ continue;
+ }
+
+ // Expand standard pseudos.
switch (MI->getOpcode()) {
case TargetOpcode::SUBREG_TO_REG:
MadeChange |= LowerSubregToReg(MI);
@@ -217,10 +229,6 @@
case TargetOpcode::INSERT_SUBREG:
case TargetOpcode::EXTRACT_SUBREG:
llvm_unreachable("Sub-register pseudos should have been eliminated.");
- default:
- if (MI->getDesc().isPseudo())
- MadeChange |= TII->expandPostRAPseudo(MI);
- break;
}
}
}
More information about the llvm-commits
mailing list