2
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
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).
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.
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
25
#include "precompiled.hpp"
26
#include "opto/loopnode.hpp"
27
#include "opto/opaquenode.hpp"
28
#include "opto/phaseX.hpp"
30
//=============================================================================
31
// Do not allow value-numbering
32
uint Opaque1Node::hash() const { return NO_HASH; }
33
bool Opaque1Node::cmp( const Node &n ) const {
34
return (&n == this); // Always fail except on self
37
//------------------------------Identity---------------------------------------
38
// Do NOT remove the opaque node until no more loop opts can happen.
39
Node* Opaque1Node::Identity(PhaseGVN* phase) {
40
if (phase->C->post_loop_opts_phase()) {
43
phase->C->record_for_post_loop_opts_igvn(this);
49
CountedLoopNode* OpaqueZeroTripGuardNode::guarded_loop() const {
50
Node* iff = if_node();
54
for (uint i = 0; i < wq.size(); ++i) {
56
for (DUIterator_Fast imax, i = nn->fast_outs(imax); i < imax; i++) {
57
Node* u = nn->fast_out(i);
58
if (u->is_OuterStripMinedLoop()) {
61
if (u->is_CountedLoop() && u->as_CountedLoop()->is_canonical_loop_entry() == this) {
62
return u->as_CountedLoop();
76
IfNode* OpaqueZeroTripGuardNode::if_node() const {
77
Node* cmp = unique_out();
78
assert(cmp->Opcode() == Op_CmpI, "");
79
Node* bol = cmp->unique_out();
80
assert(bol->Opcode() == Op_Bool, "");
81
Node* iff = bol->unique_out();
85
const Type* Opaque4Node::Value(PhaseGVN* phase) const {
86
return phase->type(in(1));
89
const Type* OpaqueInitializedAssertionPredicateNode::Value(PhaseGVN* phase) const {
90
return phase->type(in(1));
93
//=============================================================================
95
uint ProfileBooleanNode::hash() const { return NO_HASH; }
96
bool ProfileBooleanNode::cmp( const Node &n ) const {
100
Node *ProfileBooleanNode::Ideal(PhaseGVN *phase, bool can_reshape) {
101
if (can_reshape && _delay_removal) {
102
_delay_removal = false;
109
Node* ProfileBooleanNode::Identity(PhaseGVN* phase) {
110
if (_delay_removal) {
113
assert(_consumed, "profile should be consumed before elimination");