harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r478745 - in /harmony/enhanced/drlvm/trunk/vm/jitrino/src: optimizer/FlowGraph.cpp optimizer/FlowGraph.h optimizer/hashvaluenumberer.cpp optimizer/simplifier.cpp optimizer/tailduplicator.cpp shared/ControlFlowGraph.cpp
Date Fri, 24 Nov 2006 01:54:45 GMT
Author: gshimansky
Date: Thu Nov 23 17:54:44 2006
New Revision: 478745

URL: http://svn.apache.org/viewvc?view=rev&rev=478745
Log:
Applied HARMONY-1986 fix for bug in simplifier

Tests passed on win32 and ubuntu


Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FlowGraph.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FlowGraph.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/hashvaluenumberer.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/tailduplicator.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/ControlFlowGraph.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FlowGraph.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FlowGraph.cpp?view=diff&rev=478745&r1=478744&r2=478745
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FlowGraph.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FlowGraph.cpp Thu Nov 23 17:54:44
2006
@@ -66,10 +66,11 @@
 
 
 void         
-FlowGraph::foldBranch(ControlFlowGraph& fg, Node* block, BranchInst* br, bool isTaken)
+FlowGraph::foldBranch(ControlFlowGraph& fg, BranchInst* br, bool isTaken)
 {
-    assert(br == block->getLastInst());
-    assert(block->getOutDegree() == 2);
+	Node* block = br->getNode();
+	assert(block->getOutDegree() == 2);
+	
     fg.removeEdge(block->getOutEdge(isTaken ? Edge::Kind_False : Edge::Kind_True));
     br->unlink();
 }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FlowGraph.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FlowGraph.h?view=diff&rev=478745&r1=478744&r2=478745
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FlowGraph.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FlowGraph.h Thu Nov 23 17:54:44
2006
@@ -57,7 +57,7 @@
     // If !isTaken, then the false edge is converted, and the true edge
     // is deleted.  In either case, the branch instruction br is removed
     // from block.
-    static void  foldBranch(ControlFlowGraph& fg, Node* block, BranchInst* br, bool isTaken);
+    static void  foldBranch(ControlFlowGraph& fg, BranchInst* br, bool isTaken);
 
     static void  foldSwitch(ControlFlowGraph& fg, Node* block, SwitchInst* sw, uint32
target);
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/hashvaluenumberer.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/hashvaluenumberer.cpp?view=diff&rev=478745&r1=478744&r2=478745
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/hashvaluenumberer.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/hashvaluenumberer.cpp Thu Nov 23
17:54:44 2006
@@ -2520,9 +2520,9 @@
             BranchInst *branchi = inst->asBranchInst();
             if (branchi) {
                 if (optimizedOpcode == Op_TauUnsafe) {
-                    FlowGraph::foldBranch(fg, block, branchi, false); // not taken
+                    FlowGraph::foldBranch(fg, branchi, false); // not taken
                 } else {
-                    FlowGraph::foldBranch(fg, block, branchi, true); // taken
+                    FlowGraph::foldBranch(fg, branchi, true); // taken
                 }
                 return;
             }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp?view=diff&rev=478745&r1=478744&r2=478745
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.cpp Thu Nov 23 17:54:44
2006
@@ -21,6 +21,7 @@
  *
  */
 
+
 #include "Opcode.h"
 #include "Opnd.h"
 #include "Type.h"
@@ -3821,7 +3822,7 @@
 
 void  
 SimplifierWithInstFactory::foldBranch(BranchInst* br, bool isTaken) {
-    FlowGraph::foldBranch(flowGraph, currentCfgNode,br,isTaken);
+    FlowGraph::foldBranch(flowGraph, br,isTaken);
 }
 
 void  

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/tailduplicator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/tailduplicator.cpp?view=diff&rev=478745&r1=478744&r2=478745
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/tailduplicator.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/tailduplicator.cpp Thu Nov 23 17:54:44
2006
@@ -116,8 +116,8 @@
 
     ControlFlowGraph& fg = _irm.getFlowGraph();
     Node* copy = FlowGraph::tailDuplicate(_irm, t2, tail, defUses);
-    FlowGraph::foldBranch(fg, copy, ((Inst*)copy->getLastInst())->asBranchInst(), true);
-    FlowGraph::foldBranch(fg, tail, ((Inst*)tail->getLastInst())->asBranchInst(), false);
+    FlowGraph::foldBranch(fg, ((Inst*)copy->getLastInst())->asBranchInst(), true);
+    FlowGraph::foldBranch(fg, ((Inst*)tail->getLastInst())->asBranchInst(), false);
 }
 
 void

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/ControlFlowGraph.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/ControlFlowGraph.cpp?view=diff&rev=478745&r1=478744&r2=478745
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/ControlFlowGraph.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/ControlFlowGraph.cpp Thu Nov 23 17:54:44
2006
@@ -223,13 +223,14 @@
 void ControlFlowGraph::removeNode(Nodes::iterator pos, bool erase) {
     Node* node = *pos;
     
-    assert(node!=entryNode);
+	if (node == entryNode) {
+		entryNode=NULL;
+	}
     if (node == returnNode) {
         returnNode = NULL;
     } else if(node == unwindNode) {
         unwindNode = NULL;
     } else  if (node == exitNode) {
-        assert(0);
         exitNode = NULL;
     }
     



Mime
View raw message