Skip to content

Commit 8287491

Browse files
authored
Merge 13acc8f into 9b98cc0
2 parents 9b98cc0 + 13acc8f commit 8287491

File tree

14 files changed

+312
-3
lines changed

14 files changed

+312
-3
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
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+
*
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
21+
* questions.
22+
*
23+
*/
24+
25+
#include "precompiled.hpp"
26+
#ifdef COMPILER2
27+
#include "opto/node.hpp"
28+
#include "opto/phaseX.hpp"
29+
30+
Node* PhaseLowering::lower_node_platform(Node* n) {
31+
return nullptr;
32+
}
33+
34+
bool PhaseLowering::should_lower() {
35+
return false;
36+
}
37+
#endif // COMPILER2
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
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+
*
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
21+
* questions.
22+
*
23+
*/
24+
25+
#include "precompiled.hpp"
26+
#ifdef COMPILER2
27+
#include "opto/node.hpp"
28+
#include "opto/phaseX.hpp"
29+
30+
Node* PhaseLowering::lower_node_platform(Node* n) {
31+
return nullptr;
32+
}
33+
34+
bool PhaseLowering::should_lower() {
35+
return false;
36+
}
37+
#endif // COMPILER2
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
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+
*
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
21+
* questions.
22+
*
23+
*/
24+
25+
#include "precompiled.hpp"
26+
#ifdef COMPILER2
27+
#include "opto/node.hpp"
28+
#include "opto/phaseX.hpp"
29+
30+
Node* PhaseLowering::lower_node_platform(Node* n) {
31+
return nullptr;
32+
}
33+
34+
bool PhaseLowering::should_lower() {
35+
return false;
36+
}
37+
#endif // COMPILER2
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
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+
*
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
21+
* questions.
22+
*
23+
*/
24+
25+
#include "precompiled.hpp"
26+
#ifdef COMPILER2
27+
#include "opto/node.hpp"
28+
#include "opto/phaseX.hpp"
29+
30+
Node* PhaseLowering::lower_node_platform(Node* n) {
31+
return nullptr;
32+
}
33+
34+
bool PhaseLowering::should_lower() {
35+
return false;
36+
}
37+
#endif // COMPILER2
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
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+
*
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
21+
* questions.
22+
*
23+
*/
24+
25+
#include "precompiled.hpp"
26+
#ifdef COMPILER2
27+
#include "opto/node.hpp"
28+
#include "opto/phaseX.hpp"
29+
30+
Node* PhaseLowering::lower_node_platform(Node* n) {
31+
return nullptr;
32+
}
33+
34+
bool PhaseLowering::should_lower() {
35+
return false;
36+
}
37+
#endif // COMPILER2
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
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+
*
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
21+
* questions.
22+
*
23+
*/
24+
25+
#include "precompiled.hpp"
26+
#ifdef COMPILER2
27+
#include "opto/node.hpp"
28+
#include "opto/phaseX.hpp"
29+
30+
Node* PhaseLowering::lower_node_platform(Node* n) {
31+
return nullptr;
32+
}
33+
34+
bool PhaseLowering::should_lower() {
35+
return false;
36+
}
37+
#endif // COMPILER2

src/hotspot/share/opto/compile.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,6 +2480,16 @@ void Compile::Optimize() {
24802480
process_late_inline_calls_no_inline(igvn);
24812481
if (failing()) return;
24822482
}
2483+
2484+
// Lower nodes and match backend-specific patterns with Ideal nodes.
2485+
{
2486+
TracePhase tp(_t_lower);
2487+
2488+
PhaseLowering lower(&igvn);
2489+
lower.lower();
2490+
2491+
print_method(PHASE_AFTER_LOWERING, 2);
2492+
}
24832493
} // (End scope of igvn; run destructor if necessary for asserts.)
24842494

24852495
check_no_dead_use();

src/hotspot/share/opto/node.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ class PCTableNode;
154154
class PhaseCCP;
155155
class PhaseGVN;
156156
class PhaseIterGVN;
157+
class PhaseLowering;
157158
class PhaseRegAlloc;
158159
class PhaseTransform;
159160
class PhaseValues;
@@ -1108,6 +1109,11 @@ class Node {
11081109
// -XX:VerifyIterativeGVN=1
11091110
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
11101111

1112+
// Return an Idealized node only during PhaseLowering.
1113+
virtual Node* LoweredIdeal(PhaseLowering* phase) {
1114+
return nullptr;
1115+
}
1116+
11111117
// Some nodes have specific Ideal subgraph transformations only if they are
11121118
// unique users of specific nodes. Such nodes should be put on IGVN worklist
11131119
// for the transformations to happen.

src/hotspot/share/opto/phase.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ void Phase::print_timers() {
9696
tty->print_cr (" GVN 2: %7.3f s", timers[_t_iterGVN2].seconds());
9797
tty->print_cr (" Macro Expand: %7.3f s", timers[_t_macroExpand].seconds());
9898
tty->print_cr (" Barrier Expand: %7.3f s", timers[_t_barrierExpand].seconds());
99+
tty->print_cr (" Lowering: %7.3f s", timers[_t_lower].seconds());
99100
tty->print_cr (" Graph Reshape: %7.3f s", timers[_t_graphReshaping].seconds());
100101

101102
double other = timers[_t_optimizer].seconds() -

src/hotspot/share/opto/phase.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class Phase : public StackObj {
5858
Coalesce, // Coalescing copies
5959
Ideal_Loop, // Find idealized trip-counted loops
6060
Macro_Expand, // Expand macro nodes
61+
Lower, // Backend-dependent Ideal node lowering
6162
Peephole, // Apply peephole optimizations
6263
Vector,
6364
Output,
@@ -88,6 +89,7 @@ class Phase : public StackObj {
8889
f( _t_iterGVN2, "iterGVN2") \
8990
f( _t_macroExpand, "macroExpand") \
9091
f( _t_barrierExpand, "barrierExpand") \
92+
f( _t_lower, "lower") \
9193
f( _t_graphReshaping, "graphReshape") \
9294
f( _t_matcher, "matcher") \
9395
f( _t_postselect_cleanup, "postselect_cleanup") \

0 commit comments

Comments
 (0)