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.

llvm-svn: 141578
This commit is contained in:
Jakob Stoklund Olesen 2011-10-10 20:34:28 +00:00
parent 698f019efb
commit add0c43ebb
1 changed files with 12 additions and 4 deletions

View File

@ -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;
}
}
}