diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-10-10 20:34:28 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-10-10 20:34:28 +0000 |
commit | add0c43ebba86540aca1d6961e2965573492cb83 (patch) | |
tree | 10c13f2f8cdf13fbd6f0d16b8d72d16001880d44 /llvm/lib/CodeGen/ExpandPostRAPseudos.cpp | |
parent | 698f019efb1ac5c5e28abe63114a2e95be51a90e (diff) | |
download | bcm5719-llvm-add0c43ebba86540aca1d6961e2965573492cb83.tar.gz bcm5719-llvm-add0c43ebba86540aca1d6961e2965573492cb83.zip |
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
Diffstat (limited to 'llvm/lib/CodeGen/ExpandPostRAPseudos.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ExpandPostRAPseudos.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp b/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp index 623b67ddcd6..e2a14a8dfd9 100644 --- a/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp +++ b/llvm/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; } } } |