DFG CSE should be more honest about when it changed the IR
https://bugs.webkit.org/show_bug.cgi?id=94408
Reviewed by Geoffrey Garen.
The CSE phase now always returns true if it changed the IR.
* dfg/DFGCSEPhase.cpp:
(JSC::DFG::CSEPhase::setReplacement):
(JSC::DFG::CSEPhase::eliminate):
(JSC::DFG::CSEPhase::performNodeCSE):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125964 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 2522b03..695778a 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,5 +1,19 @@
2012-08-17 Filip Pizlo <fpizlo@apple.com>
+ DFG CSE should be more honest about when it changed the IR
+ https://bugs.webkit.org/show_bug.cgi?id=94408
+
+ Reviewed by Geoffrey Garen.
+
+ The CSE phase now always returns true if it changed the IR.
+
+ * dfg/DFGCSEPhase.cpp:
+ (JSC::DFG::CSEPhase::setReplacement):
+ (JSC::DFG::CSEPhase::eliminate):
+ (JSC::DFG::CSEPhase::performNodeCSE):
+
+2012-08-17 Filip Pizlo <fpizlo@apple.com>
+
DFG is still too pessimistic about what constitutes a side-effect on array accesses
https://bugs.webkit.org/show_bug.cgi?id=94309
diff --git a/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp b/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
index a5215cc..2bf1ef9d 100644
--- a/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp
@@ -843,6 +843,8 @@
// At this point we will eliminate all references to this node.
m_replacements[m_compileIndex] = replacement;
+ m_changed = true;
+
return true;
}
@@ -856,6 +858,8 @@
ASSERT(node.refCount() == 1);
ASSERT(node.mustGenerate());
node.setOpAndDefaultFlags(Phantom);
+
+ m_changed = true;
}
void eliminate(NodeIndex nodeIndex, NodeType phantomType = Phantom)
@@ -867,6 +871,8 @@
return;
ASSERT(node.mustGenerate());
node.setOpAndDefaultFlags(phantomType);
+
+ m_changed = true;
}
void performNodeCSE(Node& node)
@@ -982,7 +988,7 @@
case GetLocalUnlinked: {
NodeIndex relevantLocalOpIgnored;
- m_changed |= setReplacement(getLocalLoadElimination(node.unlinkedLocal(), relevantLocalOpIgnored, true));
+ setReplacement(getLocalLoadElimination(node.unlinkedLocal(), relevantLocalOpIgnored, true));
break;
}