< prev index next >

src/share/vm/opto/subnode.hpp

Print this page
rev 8739 : 8004073: Implement C2 Ideal node specific dump() method
Summary: add Node::dump_rel() to dump a node and its related nodes (the notion of "related" depends on the node at hand); add Node::dump_comp() to dump a node in compact representation; add Node::dump_rel_comp() to dump a node and its related nodes in compact representation; add the required machinery; extend some C2 IR nodes with compact and related dumping
Reviewed-by:

*** 1,7 **** /* ! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 59,68 **** --- 59,76 ---- // Supplied function to return the additive identity type. // This is returned whenever the subtracts inputs are the same. virtual const Type *add_id() const = 0; + #ifndef PRODUCT + // For most subclasses of SubNode, it makes sense to take the standard + // approach to related nodes computation: take all data inputs until control + // boundaries are hit, and take the outputs till depth 1. This will be varied + // for certain nodes that have a connection to control in themselves (such as + // CmpNode and subclasses). + REL_IN_DATA_OUT_1; + #endif }; // NOTE: SubINode should be taken away and replaced by add and negate //------------------------------SubINode---------------------------------------
*** 138,147 **** --- 146,162 ---- } virtual Node *Identity( PhaseTransform *phase ); const Type *add_id() const { return TypeInt::ZERO; } const Type *bottom_type() const { return TypeInt::CC; } virtual uint ideal_reg() const { return Op_RegFlags; } + + #ifndef PRODUCT + // CmpNode and subclasses include all data inputs (until hitting a control + // boundary) in their related node set, as well as all outputs until and + // including eventual control nodes and their projections. + virtual void rel(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const; + #endif }; //------------------------------CmpINode--------------------------------------- // Compare 2 signed values, returning condition codes (-1, 0 or 1). class CmpINode : public CmpNode {
*** 309,327 **** --- 324,347 ---- virtual uint ideal_reg() const { return Op_RegI; } bool is_counted_loop_exit_test(); #ifndef PRODUCT virtual void dump_spec(outputStream *st) const; + virtual void rel(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const; #endif }; //------------------------------AbsNode---------------------------------------- // Abstract class for absolute value. Mostly used to get a handy wrapper // for finding this pattern in the graph. class AbsNode : public Node { public: AbsNode( Node *value ) : Node(0,value) {} + + #ifndef PRODUCT + REL_IN_DATA_OUT_1; + #endif }; //------------------------------AbsINode--------------------------------------- // Absolute value an integer. Since a naive graph involves control flow, we // "match" it in the ideal world (so the control flow can be removed).
*** 371,380 **** --- 391,404 ---- //------------------------------NegNode---------------------------------------- class NegNode : public Node { public: NegNode( Node *in1 ) : Node(0,in1) {} + + #ifndef PRODUCT + REL_IN_DATA_OUT_1; + #endif }; //------------------------------NegFNode--------------------------------------- // Negate value a float. Negating 0.0 returns -0.0, but subtracting from // zero returns +0.0 (per JVM spec on 'fneg' bytecode). As subtraction
*** 411,420 **** --- 435,448 ---- } virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } virtual const Type *Value( PhaseTransform *phase ) const; + + #ifndef PRODUCT + REL_IN_DATA_OUT_1; + #endif }; //------------------------------CosDNode--------------------------------------- // Sinus of a double class SinDNode : public Node {
*** 425,434 **** --- 453,466 ---- } virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } virtual const Type *Value( PhaseTransform *phase ) const; + + #ifndef PRODUCT + REL_IN_DATA_OUT_1; + #endif }; //------------------------------TanDNode--------------------------------------- // tangens of a double
*** 440,449 **** --- 472,485 ---- } virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } virtual const Type *Value( PhaseTransform *phase ) const; + + #ifndef PRODUCT + REL_IN_DATA_OUT_1; + #endif }; //------------------------------AtanDNode-------------------------------------- // arcus tangens of a double
*** 451,460 **** --- 487,500 ---- public: AtanDNode(Node *c, Node *in1, Node *in2 ) : Node(c, in1, in2) {} virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } + + #ifndef PRODUCT + REL_IN_DATA_OUT_1; + #endif }; //------------------------------SqrtDNode-------------------------------------- // square root a double
*** 466,475 **** --- 506,519 ---- } virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } virtual const Type *Value( PhaseTransform *phase ) const; + + #ifndef PRODUCT + REL_IN_DATA_OUT_1; + #endif }; //------------------------------ExpDNode--------------------------------------- // Exponentiate a double class ExpDNode : public Node {
*** 480,489 **** --- 524,537 ---- } virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } virtual const Type *Value( PhaseTransform *phase ) const; + + #ifndef PRODUCT + REL_IN_DATA_OUT_1; + #endif }; //------------------------------LogDNode--------------------------------------- // Log_e of a double class LogDNode : public Node {
*** 494,503 **** --- 542,555 ---- } virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } virtual const Type *Value( PhaseTransform *phase ) const; + + #ifndef PRODUCT + REL_IN_DATA_OUT_1; + #endif }; //------------------------------Log10DNode--------------------------------------- // Log_10 of a double class Log10DNode : public Node {
*** 508,517 **** --- 560,573 ---- } virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } virtual const Type *Value( PhaseTransform *phase ) const; + + #ifndef PRODUCT + REL_IN_DATA_OUT_1; + #endif }; //------------------------------PowDNode--------------------------------------- // Raise a double to a double power class PowDNode : public Node {
*** 522,531 **** --- 578,591 ---- } virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } virtual const Type *Value( PhaseTransform *phase ) const; + + #ifndef PRODUCT + REL_IN_DATA_OUT_1; + #endif }; //-------------------------------ReverseBytesINode-------------------------------- // reverse bytes of an integer class ReverseBytesINode : public Node {
< prev index next >