@@ -75,8 +75,7 @@ LiveVars::LVInfo::findKill(const BasicBlock* MBB) const {
7575
7676void LiveVars::LVInfo::print (raw_ostream& OS) const {
7777 OS << " Alive in blocks: " ;
78- for (SmallPtrSet<BasicBlock*, 8 >::iterator I = AliveBlocks.begin (),
79- E = AliveBlocks.end (); I != E; ++I) {
78+ for (auto I = AliveBlocks.begin (), E = AliveBlocks.end (); I != E; ++I) {
8079 (*I)->print (OS);
8180 OS << " , " ;
8281 }
@@ -162,8 +161,8 @@ void LiveVars::dump(Function* F)
162161 OS << " \n {" ;
163162 V->print (OS);
164163 OS << " \n Alive in blocks: " ;
165- for (SmallPtrSet<BasicBlock*, 8 >::iterator I = LVI->AliveBlocks .begin (),
166- E = LVI-> AliveBlocks . end (); I != E; ++I) {
164+ for (auto I = LVI->AliveBlocks .begin (), E = LVI-> AliveBlocks . end ();
165+ I != E; ++I) {
167166 BasicBlock* BB = *I;
168167 if (BBIds.count (BB) > 0 )
169168 {
@@ -236,6 +235,9 @@ void LiveVars::MarkVirtRegAliveInBlock(LiveVars::LVInfo& VRInfo,
236235 BasicBlock* MBB,
237236 std::vector<BasicBlock*>& WorkList) {
238237
238+ if (VRInfo.AliveBlocks .count (MBB))
239+ return ; // We already know the block is live
240+
239241 // Check to see if this basic block is one of the killing blocks. If so,
240242 // remove it.
241243 for (unsigned i = 0 , e = VRInfo.Kills .size (); i != e; ++i)
@@ -249,9 +251,6 @@ void LiveVars::MarkVirtRegAliveInBlock(LiveVars::LVInfo& VRInfo,
249251 if (MBB == DefBlock)
250252 return ; // Terminate recursion
251253
252- if (VRInfo.AliveBlocks .count (MBB))
253- return ; // We already know the block is live
254-
255254 // Mark the variable known alive in this bb
256255 VRInfo.AliveBlocks .insert (MBB);
257256
@@ -293,7 +292,6 @@ void LiveVars::MarkVirtRegAliveInBlock(LiveVars::LVInfo& VRInfo,
293292 BasicBlock* MBB) {
294293 std::vector<BasicBlock*> WorkList;
295294 MarkVirtRegAliveInBlock (VRInfo, DefBlock, MBB, WorkList);
296-
297295 while (!WorkList.empty ()) {
298296 BasicBlock* Pred = WorkList.back ();
299297 WorkList.pop_back ();
0 commit comments