diff options
| author | Venkatraman Govindaraju <venkatra@cs.wisc.edu> | 2013-07-30 19:53:10 +0000 |
|---|---|---|
| committer | Venkatraman Govindaraju <venkatra@cs.wisc.edu> | 2013-07-30 19:53:10 +0000 |
| commit | fee76fac2f626baea2e5cc4b69fe3859a53680eb (patch) | |
| tree | 50c1995f51484f4d983244babbebb5bd118a7bd9 /llvm/lib/Target/Sparc/SparcFrameLowering.cpp | |
| parent | 8742add4b1ec0bcf0c503bb8e03e319b549025aa (diff) | |
| download | bcm5719-llvm-fee76fac2f626baea2e5cc4b69fe3859a53680eb.tar.gz bcm5719-llvm-fee76fac2f626baea2e5cc4b69fe3859a53680eb.zip | |
[Sparc] Rewrite MBB's live-in registers for leaf functions. Also, add
register i7 as a live-in if current function's return address is taken.
This revision fixes PR16269.
llvm-svn: 187433
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcFrameLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/Sparc/SparcFrameLowering.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/Sparc/SparcFrameLowering.cpp b/llvm/lib/Target/Sparc/SparcFrameLowering.cpp index 7e91bc38d42..536e466ca3d 100644 --- a/llvm/lib/Target/Sparc/SparcFrameLowering.cpp +++ b/llvm/lib/Target/Sparc/SparcFrameLowering.cpp @@ -188,6 +188,17 @@ void SparcFrameLowering::remapRegsForLeafProc(MachineFunction &MF) const { MRI.setPhysRegUnused(reg); } + // Rewrite MBB's Live-ins. + for (MachineFunction::iterator MBB = MF.begin(), E = MF.end(); + MBB != E; ++MBB) { + for (unsigned reg = SP::I0; reg <= SP::I7; ++reg) { + if (!MBB->isLiveIn(reg)) + continue; + MBB->removeLiveIn(reg); + MBB->addLiveIn(reg - SP::I0 + SP::O0); + } + } + assert(verifyLeafProcRegUse(&MRI)); #ifdef XDEBUG MF.verify(0, "After LeafProc Remapping"); |

