[phc-internals] [phc commit] r1793 - in branches/dataflow: src/optimize src/optimize/ssa test/framework

codesite-noreply at google.com codesite-noreply at google.com
Thu Oct 16 19:19:23 IST 2008


Author: paul.biggar
Date: Thu Oct 16 11:18:15 2008
New Revision: 1793

Modified:
    branches/dataflow/src/optimize/CFG.cpp
    branches/dataflow/src/optimize/ssa/SSA_ops.cpp
    branches/dataflow/test/framework/driver.php

Log:
Fix some bugs. We were losing Phi edges, and its OK for multiple SSA_* to  
have the same value.


Modified: branches/dataflow/src/optimize/CFG.cpp
==============================================================================
--- branches/dataflow/src/optimize/CFG.cpp	(original)
+++ branches/dataflow/src/optimize/CFG.cpp	Thu Oct 16 11:18:15 2008
@@ -1003,11 +1003,12 @@

  			foreach (Basic_block* pred, *bb->get_predecessors ())
  			{
-				Edge* pred_edge = get_edge (pred, bb);
+				Edge* pred_edge = get_edge (pred, eb);

  				// Add edge and copy attributes
  				Edge* new_edge = add_edge (pred, succ);
  				new_edge->direction = pred_edge->direction;
+				new_edge->copy_phi_map (pred_edge);
  				new_edge->copy_phi_map (succ_edge);
  			}


Modified: branches/dataflow/src/optimize/ssa/SSA_ops.cpp
==============================================================================
--- branches/dataflow/src/optimize/ssa/SSA_ops.cpp	(original)
+++ branches/dataflow/src/optimize/ssa/SSA_ops.cpp	Thu Oct 16 11:18:15 2008
@@ -86,8 +86,6 @@
  	}
  	if (isa<SSA_stmt> (op1) || isa<SSA_branch> (op1))
  	{
-		assert (op1 == op2);
-		
  		// They are the same BB.
  		return false;
  	}

Modified: branches/dataflow/test/framework/driver.php
==============================================================================
--- branches/dataflow/test/framework/driver.php	(original)
+++ branches/dataflow/test/framework/driver.php	Thu Oct 16 11:18:15 2008
@@ -81,7 +81,7 @@
  $tests[] = new CompareBackwards ("mir",			"dump-uppered",	"cb_hir");
  $tests[] = new Pass_dump (			"HIR-to-MIR",	"dump",	"cb_hir");
  $tests[] = new Pass_dump (			"mir",			"dump",	"cb_mir");
-$tests[] = new CompareWithPHP ("InterpretOptimized", "-O1  
--udump=generate-c", "cb_mir");
+$tests[] = new CompareWithPHP ("InterpretOptimized", "-O1  
--dump-uppered=generate-c", "cb_mir");
  $tests[] = new CompareWithPHP ("InterpretCanonicalUnparsed", "--run  
plugins/tests/canonical_unparser.la", "BasicParseTest"); // not necessarily  
dependent of InterpretUnparsed
  $tests[] = new CompareWithPHP ("InterpretStrippedIncludes", "--include  
--dump=sua --run plugins/tests/strip_includes.la", "cb_sua");
  $tests[] = new CompareWithPHP  
("InterpretObfuscated", "--obfuscate", "cb_mir");


More information about the phc-internals mailing list