Move the code for initialing the entry block livein set out of
authorDan Gohman <gohman@apple.com>
Wed, 14 Apr 2010 17:05:00 +0000 (17:05 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 14 Apr 2010 17:05:00 +0000 (17:05 +0000)
SelectionDAGISel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101258 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineRegisterInfo.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index 6c0b454b13b484a2d60317789d6c4f1374cbd8a4..850ade25da5c57084d570d285fdbb1c72de7773a 100644 (file)
@@ -248,6 +248,11 @@ MachineRegisterInfo::EmitLiveInCopies(MachineBasicBlock *EntryMBB,
         (void) Emitted;
       }
   }
+
+  // Add function live-ins to entry block live-in set.
+  for (MachineRegisterInfo::livein_iterator I = livein_begin(),
+       E = livein_end(); I != E; ++I)
+    EntryMBB->addLiveIn(I->first);
 }
 
 #ifndef NDEBUG
index 2f89aa04a9cd7c4fe249bd53506b3ace0e76836c..a17119be1168952f8b134d555266114fca975752 100644 (file)
@@ -221,11 +221,6 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
   // emitting the code for the block.
   RegInfo->EmitLiveInCopies(MF->begin(), TRI, TII);
 
-  // Add function live-ins to entry block live-in set.
-  for (MachineRegisterInfo::livein_iterator I = RegInfo->livein_begin(),
-         E = RegInfo->livein_end(); I != E; ++I)
-    MF->begin()->addLiveIn(I->first);
-
 #ifndef NDEBUG
   assert(FuncInfo->CatchInfoFound.size() == FuncInfo->CatchInfoLost.size() &&
          "Not all catch info was assigned to a landing pad!");