[llvm-commits] [llvm] r85779 - in /llvm/trunk/lib/Analysis: ProfileInfoLoaderPass.cpp ProfileVerifierPass.cpp

Edward O'Callaghan eocallaghan at auroraux.org
Sun Nov 1 18:55:39 PST 2009


Author: evocallaghan
Date: Sun Nov  1 20:55:39 2009
New Revision: 85779

URL: http://llvm.org/viewvc/llvm-project?rev=85779&view=rev
Log:
Apply fix for PR5135, Credit to Andreas Neustifter.

Modified:
    llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp
    llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp

Modified: llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp?rev=85779&r1=85778&r2=85779&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp (original)
+++ llvm/trunk/lib/Analysis/ProfileInfoLoaderPass.cpp Sun Nov  1 20:55:39 2009
@@ -60,7 +60,7 @@
     // recurseBasicBlock() - Calculates the edge weights for as much basic
     // blocks as possbile.
     virtual void recurseBasicBlock(const BasicBlock *BB);
-    virtual void readEdgeOrRemember(Edge, Edge&, unsigned &, unsigned &);
+    virtual void readEdgeOrRemember(Edge, Edge&, unsigned &, double &);
     virtual void readEdge(ProfileInfo::Edge, std::vector<unsigned>&);
 
     /// run - Load the profile information from the specified file.
@@ -84,7 +84,7 @@
 }
 
 void LoaderPass::readEdgeOrRemember(Edge edge, Edge &tocalc, 
-                                    unsigned &uncalc, unsigned &count) {
+                                    unsigned &uncalc, double &count) {
   double w;
   if ((w = getEdgeWeight(edge)) == MissingValue) {
     tocalc = edge;
@@ -117,7 +117,7 @@
 
   // collect weights of all incoming and outgoing edges, rememer edges that
   // have no value
-  unsigned incount = 0;
+  double incount = 0;
   SmallSet<const BasicBlock*,8> pred_visited;
   pred_const_iterator bbi = pred_begin(BB), bbe = pred_end(BB);
   if (bbi==bbe) {
@@ -129,7 +129,7 @@
     }
   }
 
-  unsigned outcount = 0;
+  double outcount = 0;
   SmallSet<const BasicBlock*,8> succ_visited;
   succ_const_iterator sbbi = succ_begin(BB), sbbe = succ_end(BB);
   if (sbbi==sbbe) {

Modified: llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp?rev=85779&r1=85778&r2=85779&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp (original)
+++ llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp Sun Nov  1 20:55:39 2009
@@ -229,7 +229,8 @@
   // to debug printers.
   DetailedBlockInfo DI;
   DI.BB = BB;
-  DI.outCount = DI.inCount = DI.inWeight = DI.outWeight = 0;
+  DI.outCount = DI.inCount = 0;
+  DI.inWeight = DI.outWeight = 0.0;
 
   // Read predecessors.
   std::set<const BasicBlock*> ProcessedPreds;





More information about the llvm-commits mailing list