Title: [171152] branches/ftlopt/Source/_javascript_Core
- Revision
- 171152
- Author
- [email protected]
- Date
- 2014-07-16 14:31:39 -0700 (Wed, 16 Jul 2014)
Log Message
[ftlopt] Identity replacement in CSE shouldn't create a Phantom over the Identity's children
https://bugs.webkit.org/show_bug.cgi?id=134893
Reviewed by Oliver Hunt.
Replace Identity with Check instead of Phantom. Phantom means that the child of the
Identity should be unconditionally live. The liveness semantics of Identity are such that
if the parents of Identity are live then the child is live. Removing the Identity entirely
preserves such liveness semantics. So, the only thing that should be left behind is the
type check on the child, which is what Check means: do the check but don't keep the child
alive if the check isn't needed.
* dfg/DFGCSEPhase.cpp:
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToCheck):
Modified Paths
Diff
Modified: branches/ftlopt/Source/_javascript_Core/ChangeLog (171151 => 171152)
--- branches/ftlopt/Source/_javascript_Core/ChangeLog 2014-07-16 20:51:19 UTC (rev 171151)
+++ branches/ftlopt/Source/_javascript_Core/ChangeLog 2014-07-16 21:31:39 UTC (rev 171152)
@@ -1,3 +1,21 @@
+2014-07-15 Filip Pizlo <[email protected]>
+
+ [ftlopt] Identity replacement in CSE shouldn't create a Phantom over the Identity's children
+ https://bugs.webkit.org/show_bug.cgi?id=134893
+
+ Reviewed by Oliver Hunt.
+
+ Replace Identity with Check instead of Phantom. Phantom means that the child of the
+ Identity should be unconditionally live. The liveness semantics of Identity are such that
+ if the parents of Identity are live then the child is live. Removing the Identity entirely
+ preserves such liveness semantics. So, the only thing that should be left behind is the
+ type check on the child, which is what Check means: do the check but don't keep the child
+ alive if the check isn't needed.
+
+ * dfg/DFGCSEPhase.cpp:
+ * dfg/DFGNode.h:
+ (JSC::DFG::Node::convertToCheck):
+
2014-07-13 Filip Pizlo <[email protected]>
[ftlopt] DFG should be able to do GCSE in SSA and this should be unified with the CSE in CPS, and both of these things should use abstract heaps for reasoning about effects
Modified: branches/ftlopt/Source/_javascript_Core/dfg/DFGCSEPhase.cpp (171151 => 171152)
--- branches/ftlopt/Source/_javascript_Core/dfg/DFGCSEPhase.cpp 2014-07-16 20:51:19 UTC (rev 171151)
+++ branches/ftlopt/Source/_javascript_Core/dfg/DFGCSEPhase.cpp 2014-07-16 21:31:39 UTC (rev 171152)
@@ -233,7 +233,8 @@
m_graph.performSubstitution(m_node);
if (m_node->op() == Identity) {
- m_node->replaceWith(m_node->child1().node());
+ m_node->convertToCheck();
+ m_node->replacement = m_node->child1().node();
m_changed = true;
} else {
// This rule only makes sense for local CSE, since in SSA form we have already
@@ -436,7 +437,8 @@
m_graph.performSubstitution(m_node);
if (m_node->op() == Identity) {
- m_node->replaceWith(m_node->child1().node());
+ m_node->convertToCheck();
+ m_node->replacement = m_node->child1().node();
m_changed = true;
} else
clobberize(m_graph, m_node, *this);
Modified: branches/ftlopt/Source/_javascript_Core/dfg/DFGNode.h (171151 => 171152)
--- branches/ftlopt/Source/_javascript_Core/dfg/DFGNode.h 2014-07-16 20:51:19 UTC (rev 171151)
+++ branches/ftlopt/Source/_javascript_Core/dfg/DFGNode.h 2014-07-16 21:31:39 UTC (rev 171152)
@@ -374,6 +374,11 @@
setOpAndDefaultFlags(Phantom);
}
+ void convertToCheck()
+ {
+ setOpAndDefaultFlags(Check);
+ }
+
void replaceWith(Node* other)
{
convertToPhantom();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes