* We were forgetting to pass varargs arguments through a call
[oota-llvm.git] / lib / Transforms / Scalar / PRE.cpp
index 367b0f5c8d04c4fc624e89c86d48fe193d75aa06..fad5789d5ade327d3d251932605e9cfb8aa1f7f4 100644 (file)
@@ -1,4 +1,11 @@
 //===- PRE.cpp - Partial Redundancy Elimination ---------------------------===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
 //
 // This file implements the well-known Partial Redundancy Elimination
 // optimization, using an SSA formulation based on e-paths.  See this paper for
@@ -165,7 +172,7 @@ bool PRE::ProcessBlock(BasicBlock *BB) {
 void PRE::MarkPostDominatingBlocksAnticipatible(PostDominatorTree::Node *N,
                                                 std::vector<char> &AntBlocks,
                                                 Instruction *Occurrence) {
-  unsigned BlockNo = BlockNumbering[N->getNode()];
+  unsigned BlockNo = BlockNumbering[N->getBlock()];
 
   if (AntBlocks[BlockNo]) return;  // Already known to be anticipatible??
 
@@ -174,7 +181,7 @@ void PRE::MarkPostDominatingBlocksAnticipatible(PostDominatorTree::Node *N,
   // "transparency".
   for (unsigned i = 0, e = Occurrence->getNumOperands(); i != e; ++i)
     if (Instruction *I = dyn_cast<Instruction>(Occurrence->getOperand(i)))
-      if (I->getParent() == N->getNode())  // Operand is defined in this block!
+      if (I->getParent() == N->getBlock())  // Operand is defined in this block!
         return;
 
   if (isa<LoadInst>(Occurrence))
@@ -246,14 +253,14 @@ void PRE::MarkOccurrenceAvailableInAllDominatedBlocks(Instruction *Occurrence,
   DominatorTree::Node *N = DT->getNode(Occurrence->getParent());
   for (df_iterator<DominatorTree::Node*> DI = df_begin(N), E = df_end(N);
        DI != E; ++DI)
-    AvailableBlocks[(*DI)->getNode()] = Occurrence;
+    AvailableBlocks[(*DI)->getBlock()] = Occurrence;
 }
 
 /// ReplaceDominatedAvailableOccurrencesWith - This loops over the region
 /// dominated by N, replacing any available expressions with NewOcc.
 void PRE::ReplaceDominatedAvailableOccurrencesWith(Instruction *NewOcc,
                                                    DominatorTree::Node *N) {
-  BasicBlock *BB = N->getNode();
+  BasicBlock *BB = N->getBlock();
   Instruction *&ExistingAvailableVal = AvailableBlocks[BB];
 
   // If there isn't a definition already active in this node, make this the new
@@ -280,7 +287,7 @@ void PRE::ReplaceDominatedAvailableOccurrencesWith(Instruction *NewOcc,
     // Mark NewOCC as the Available expression in all blocks dominated by BB
     for (df_iterator<DominatorTree::Node*> DI = df_begin(N), E = df_end(N);
          DI != E; ++DI)
-      AvailableBlocks[(*DI)->getNode()] = NewOcc;
+      AvailableBlocks[(*DI)->getBlock()] = NewOcc;
   }  
 }