author | bobv |
Tue, 29 Aug 2017 15:53:04 -0400 | |
changeset 47100 | 17953cf82d51 |
parent 35551 | 36ef3841fb34 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
32084
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
2 |
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
26 |
#include "memory/allocation.inline.hpp" |
|
27 |
#include "opto/callnode.hpp" |
|
28 |
#include "opto/cfgnode.hpp" |
|
29 |
#include "opto/phaseX.hpp" |
|
30 |
#include "opto/regmask.hpp" |
|
31 |
#include "opto/rootnode.hpp" |
|
32 |
#include "opto/subnode.hpp" |
|
33 |
#include "opto/type.hpp" |
|
1 | 34 |
|
35 |
//------------------------------Ideal------------------------------------------ |
|
36 |
// Remove dead inputs |
|
37 |
Node *RootNode::Ideal(PhaseGVN *phase, bool can_reshape) { |
|
25913
81dbc151e91c
8040213: C2 does not put all modified nodes on IGVN worklist
thartmann
parents:
7397
diff
changeset
|
38 |
bool modified = false; |
1 | 39 |
for( uint i = 1; i < req(); i++ ) { // For all inputs |
40 |
// Check for and remove dead inputs |
|
41 |
if( phase->type(in(i)) == Type::TOP ) { |
|
42 |
del_req(i--); // Delete TOP inputs |
|
25913
81dbc151e91c
8040213: C2 does not put all modified nodes on IGVN worklist
thartmann
parents:
7397
diff
changeset
|
43 |
modified = true; |
1 | 44 |
} |
45 |
} |
|
46 |
||
47 |
// I used to do tail-splitting in the Ideal graph here, but it does not |
|
48 |
// work. The tail-splitting forces values live into the Return to be |
|
49 |
// ready at a point which dominates the split returns. This forces Stores |
|
50 |
// to be hoisted high. The "proper" fix would be to split Stores down |
|
51 |
// each path, but this makes the split unprofitable. If we want to do this |
|
52 |
// optimization, it needs to be done after allocation so we can count all |
|
53 |
// the instructions needing to be cloned in the cost metric. |
|
54 |
||
55 |
// There used to be a spoof here for caffeine marks which completely |
|
56 |
// eliminated very simple self-recursion recursions, but it's not worth it. |
|
57 |
// Deep inlining of self-calls gets nearly all of the same benefits. |
|
58 |
// If we want to get the rest of the win later, we should pattern match |
|
59 |
// simple recursive call trees to closed-form solutions. |
|
60 |
||
25913
81dbc151e91c
8040213: C2 does not put all modified nodes on IGVN worklist
thartmann
parents:
7397
diff
changeset
|
61 |
return modified ? this : NULL; |
1 | 62 |
} |
63 |
||
64 |
//============================================================================= |
|
65 |
HaltNode::HaltNode( Node *ctrl, Node *frameptr ) : Node(TypeFunc::Parms) { |
|
66 |
Node* top = Compile::current()->top(); |
|
67 |
init_req(TypeFunc::Control, ctrl ); |
|
68 |
init_req(TypeFunc::I_O, top); |
|
69 |
init_req(TypeFunc::Memory, top); |
|
70 |
init_req(TypeFunc::FramePtr, frameptr ); |
|
71 |
init_req(TypeFunc::ReturnAdr,top); |
|
72 |
} |
|
73 |
||
74 |
const Type *HaltNode::bottom_type() const { return Type::BOTTOM; } |
|
75 |
||
76 |
//------------------------------Ideal------------------------------------------ |
|
77 |
Node *HaltNode::Ideal(PhaseGVN *phase, bool can_reshape) { |
|
78 |
return remove_dead_region(phase, can_reshape) ? this : NULL; |
|
79 |
} |
|
80 |
||
81 |
//------------------------------Value------------------------------------------ |
|
35551
36ef3841fb34
8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value
thartmann
parents:
32084
diff
changeset
|
82 |
const Type* HaltNode::Value(PhaseGVN* phase) const { |
1 | 83 |
return ( phase->type(in(TypeFunc::Control)) == Type::TOP) |
84 |
? Type::TOP |
|
85 |
: Type::BOTTOM; |
|
86 |
} |
|
87 |
||
88 |
const RegMask &HaltNode::out_RegMask() const { |
|
89 |
return RegMask::Empty; |
|
90 |
} |
|
32084
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
91 |
|
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
92 |
#ifndef PRODUCT |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
93 |
//-----------------------------related----------------------------------------- |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
94 |
// Include all control inputs in the related set, and also the input data |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
95 |
// boundary. In compact mode, include all inputs till level 2. Also include |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
96 |
// all outputs at level 1. |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
97 |
void HaltNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const { |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
98 |
if (compact) { |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
99 |
this->collect_nodes(in_rel, 2, false, false); |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
100 |
} else { |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
101 |
this->collect_nodes_in_all_ctrl(in_rel, true); |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
102 |
} |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
103 |
this->collect_nodes(out_rel, -1, false, false); |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
104 |
} |
7743e6943cdf
8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents:
25913
diff
changeset
|
105 |
#endif |