diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-02-13 01:30:55 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-02-13 01:30:55 +0000 |
commit | 0c9f92e1ff64ee56724eae444a0442b02f83d0a8 (patch) | |
tree | 654898221db77c9cdb0787d57342f16b85901dd5 /lib/CodeGen/LiveVariables.cpp | |
parent | 818d42f1e81db75300223fedb75227c17ec0ef83 (diff) |
Allow any MachineBasicBlock (not just the entry block) to have live-in physical
registers. Make sure liveinterval analysis is correctly creating live ranges
for them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34217 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index e0713c87c9..c0da92c658 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -254,14 +254,6 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) { /// Get some space for a respectable number of registers... VirtRegInfo.resize(64); - // Mark live-in registers as live-in. - for (MachineFunction::livein_iterator I = MF.livein_begin(), - E = MF.livein_end(); I != E; ++I) { - assert(MRegisterInfo::isPhysicalRegister(I->first) && - "Cannot have a live-in virtual register!"); - HandlePhysRegDef(I->first, 0); - } - analyzePHINodes(MF); // Calculate live variable information in depth first order on the CFG of the @@ -275,6 +267,14 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &MF) { E = df_ext_end(Entry, Visited); DFI != E; ++DFI) { MachineBasicBlock *MBB = *DFI; + // Mark live-in registers as live-in. + for (MachineBasicBlock::livein_iterator II = MBB->livein_begin(), + EE = MBB->livein_end(); II != EE; ++II) { + assert(MRegisterInfo::isPhysicalRegister(*II) && + "Cannot have a live-in virtual register!"); + HandlePhysRegDef(*II, 0); + } + // Loop over all of the instructions, processing them. for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E; ++I) { |