summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-10-10 20:34:28 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-10-10 20:34:28 +0000
commit735fe0f9d00facc5961fbb8b822844f5088cd81d (patch)
tree845acd9ab939328d9154b49a6776cacdc35e0049
parent6b50bc9d88538c155503582b095fdba518070257 (diff)
downloadllvm-735fe0f9d00facc5961fbb8b822844f5088cd81d.tar.gz
llvm-735fe0f9d00facc5961fbb8b822844f5088cd81d.tar.bz2
llvm-735fe0f9d00facc5961fbb8b822844f5088cd81d.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141578 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/ExpandPostRAPseudos.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/CodeGen/ExpandPostRAPseudos.cpp b/lib/CodeGen/ExpandPostRAPseudos.cpp
index 623b67ddcd..e2a14a8dfd 100644
--- a/lib/CodeGen/ExpandPostRAPseudos.cpp
+++ b/lib/CodeGen/ExpandPostRAPseudos.cpp
@@ -205,6 +205,18 @@ bool ExpandPostRA::runOnMachineFunction(MachineFunction &MF) {
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 @@ bool ExpandPostRA::runOnMachineFunction(MachineFunction &MF) {
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;
}
}
}