Skip to content

Commit 9d305b9

Browse files
committed
8252372: Check if cloning is required to move loads out of loops in PhaseIdealLoop::split_if_with_blocks_post()
Reviewed-by: thartmann, kvn
1 parent 0394416 commit 9d305b9

File tree

14 files changed

+537
-211
lines changed

14 files changed

+537
-211
lines changed

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8735,6 +8735,61 @@ instruct castLL(iRegL dst)
87358735
ins_pipe(pipe_class_empty);
87368736
%}
87378737

8738+
instruct castFF(vRegF dst)
8739+
%{
8740+
match(Set dst (CastFF dst));
8741+
8742+
size(0);
8743+
format %{ "# castFF of $dst" %}
8744+
ins_encode(/* empty encoding */);
8745+
ins_cost(0);
8746+
ins_pipe(pipe_class_empty);
8747+
%}
8748+
8749+
instruct castDD(vRegD dst)
8750+
%{
8751+
match(Set dst (CastDD dst));
8752+
8753+
size(0);
8754+
format %{ "# castDD of $dst" %}
8755+
ins_encode(/* empty encoding */);
8756+
ins_cost(0);
8757+
ins_pipe(pipe_class_empty);
8758+
%}
8759+
8760+
instruct castVVD(vecD dst)
8761+
%{
8762+
match(Set dst (CastVV dst));
8763+
8764+
size(0);
8765+
format %{ "# castVV of $dst" %}
8766+
ins_encode(/* empty encoding */);
8767+
ins_cost(0);
8768+
ins_pipe(pipe_class_empty);
8769+
%}
8770+
8771+
instruct castVVX(vecX dst)
8772+
%{
8773+
match(Set dst (CastVV dst));
8774+
8775+
size(0);
8776+
format %{ "# castVV of $dst" %}
8777+
ins_encode(/* empty encoding */);
8778+
ins_cost(0);
8779+
ins_pipe(pipe_class_empty);
8780+
%}
8781+
8782+
instruct castVV(vReg dst)
8783+
%{
8784+
match(Set dst (CastVV dst));
8785+
8786+
size(0);
8787+
format %{ "# castVV of $dst" %}
8788+
ins_encode(/* empty encoding */);
8789+
ins_cost(0);
8790+
ins_pipe(pipe_class_empty);
8791+
%}
8792+
87388793
// ============================================================================
87398794
// Atomic operation instructions
87408795
//

src/hotspot/cpu/arm/arm.ad

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5182,6 +5182,39 @@ instruct castLL( iRegL dst ) %{
51825182
ins_pipe(empty);
51835183
%}
51845184

5185+
instruct castFF( regF dst ) %{
5186+
match(Set dst (CastFF dst));
5187+
format %{ "! castFF of $dst" %}
5188+
ins_encode( /*empty encoding*/ );
5189+
ins_cost(0);
5190+
ins_pipe(empty);
5191+
%}
5192+
5193+
instruct castDD( regD dst ) %{
5194+
match(Set dst (CastDD dst));
5195+
format %{ "! castDD of $dst" %}
5196+
ins_encode( /*empty encoding*/ );
5197+
ins_cost(0);
5198+
ins_pipe(empty);
5199+
%}
5200+
5201+
instruct castVVD( vecD dst ) %{
5202+
match(Set dst (CastVV dst));
5203+
format %{ "! castVV of $dst" %}
5204+
ins_encode( /*empty encoding*/ );
5205+
ins_cost(0);
5206+
ins_pipe(empty);
5207+
%}
5208+
5209+
instruct castVVX( vecX dst ) %{
5210+
match(Set dst (CastVV dst));
5211+
format %{ "! castVV of $dst" %}
5212+
ins_encode( /*empty encoding*/ );
5213+
ins_cost(0);
5214+
ins_pipe(empty);
5215+
%}
5216+
5217+
51855218
//----------Arithmetic Instructions--------------------------------------------
51865219
// Addition Instructions
51875220
// Register Addition

src/hotspot/cpu/ppc/ppc.ad

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10335,6 +10335,38 @@ instruct castLL(iRegLdst dst) %{
1033510335
ins_pipe(pipe_class_default);
1033610336
%}
1033710337

10338+
instruct castFF(regF dst) %{
10339+
match(Set dst (CastFF dst));
10340+
format %{ " -- \t// castFF of $dst" %}
10341+
size(0);
10342+
ins_encode( /*empty*/ );
10343+
ins_pipe(pipe_class_default);
10344+
%}
10345+
10346+
instruct castDD(regD dst) %{
10347+
match(Set dst (CastDD dst));
10348+
format %{ " -- \t// castDD of $dst" %}
10349+
size(0);
10350+
ins_encode( /*empty*/ );
10351+
ins_pipe(pipe_class_default);
10352+
%}
10353+
10354+
instruct castVV8(iRegLdst dst) %{
10355+
match(Set dst (CastVV dst));
10356+
format %{ " -- \t// castVV of $dst" %}
10357+
size(0);
10358+
ins_encode( /*empty*/ );
10359+
ins_pipe(pipe_class_default);
10360+
%}
10361+
10362+
instruct castVV16(vecX dst) %{
10363+
match(Set dst (CastVV dst));
10364+
format %{ " -- \t// castVV of $dst" %}
10365+
size(0);
10366+
ins_encode( /*empty*/ );
10367+
ins_pipe(pipe_class_default);
10368+
%}
10369+
1033810370
instruct checkCastPP(iRegPdst dst) %{
1033910371
match(Set dst (CheckCastPP dst));
1034010372
format %{ " -- \t// checkcastPP of $dst" %}

src/hotspot/cpu/s390/s390.ad

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5260,6 +5260,30 @@ instruct castLL(iRegL dst) %{
52605260
ins_pipe(pipe_class_dummy);
52615261
%}
52625262

5263+
instruct castFF(regF dst) %{
5264+
match(Set dst (CastFF dst));
5265+
size(0);
5266+
format %{ "# castFF of $dst" %}
5267+
ins_encode(/*empty*/);
5268+
ins_pipe(pipe_class_dummy);
5269+
%}
5270+
5271+
instruct castDD(regD dst) %{
5272+
match(Set dst (CastDD dst));
5273+
size(0);
5274+
format %{ "# castDD of $dst" %}
5275+
ins_encode(/*empty*/);
5276+
ins_pipe(pipe_class_dummy);
5277+
%}
5278+
5279+
instruct castVV(iRegL dst) %{
5280+
match(Set dst (CastVV dst));
5281+
size(0);
5282+
format %{ "# castVV of $dst" %}
5283+
ins_encode(/*empty*/);
5284+
ins_pipe(pipe_class_dummy);
5285+
%}
5286+
52635287
//----------Conditional_store--------------------------------------------------
52645288
// Conditional-store of the updated heap-top.
52655289
// Used during allocation of the shared heap.

src/hotspot/cpu/x86/x86.ad

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8127,3 +8127,25 @@ instruct vmask_first_or_last_true_avx(rRegI dst, vec mask, rRegL tmp, vec xtmp,
81278127
ins_pipe( pipe_slow );
81288128
%}
81298129
#endif // _LP64
8130+
8131+
instruct castVV(vec dst)
8132+
%{
8133+
match(Set dst (CastVV dst));
8134+
8135+
size(0);
8136+
format %{ "# castVV of $dst" %}
8137+
ins_encode(/* empty encoding */);
8138+
ins_cost(0);
8139+
ins_pipe(empty);
8140+
%}
8141+
8142+
instruct castVVLeg(legVec dst)
8143+
%{
8144+
match(Set dst (CastVV dst));
8145+
8146+
size(0);
8147+
format %{ "# castVV of $dst" %}
8148+
ins_encode(/* empty encoding */);
8149+
ins_cost(0);
8150+
ins_pipe(empty);
8151+
%}

src/hotspot/cpu/x86/x86_32.ad

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7178,6 +7178,22 @@ instruct castLL( eRegL dst ) %{
71787178
ins_pipe( empty );
71797179
%}
71807180

7181+
instruct castFF( regF dst ) %{
7182+
match(Set dst (CastFF dst));
7183+
format %{ "#castFF of $dst" %}
7184+
ins_encode( /*empty encoding*/ );
7185+
ins_cost(0);
7186+
ins_pipe( empty );
7187+
%}
7188+
7189+
instruct castDD( regD dst ) %{
7190+
match(Set dst (CastDD dst));
7191+
format %{ "#castDD of $dst" %}
7192+
ins_encode( /*empty encoding*/ );
7193+
ins_cost(0);
7194+
ins_pipe( empty );
7195+
%}
7196+
71817197
// Load-locked - same as a regular pointer load when used with compare-swap
71827198
instruct loadPLocked(eRegP dst, memory mem) %{
71837199
match(Set dst (LoadPLocked mem));

src/hotspot/cpu/x86/x86_64.ad

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7624,6 +7624,28 @@ instruct castLL(rRegL dst)
76247624
ins_pipe(empty);
76257625
%}
76267626

7627+
instruct castFF(regF dst)
7628+
%{
7629+
match(Set dst (CastFF dst));
7630+
7631+
size(0);
7632+
format %{ "# castFF of $dst" %}
7633+
ins_encode(/* empty encoding */);
7634+
ins_cost(0);
7635+
ins_pipe(empty);
7636+
%}
7637+
7638+
instruct castDD(regD dst)
7639+
%{
7640+
match(Set dst (CastDD dst));
7641+
7642+
size(0);
7643+
format %{ "# castDD of $dst" %}
7644+
ins_encode(/* empty encoding */);
7645+
ins_cost(0);
7646+
ins_pipe(empty);
7647+
%}
7648+
76277649
// LoadP-locked same as a regular LoadP when used with compare-swap
76287650
instruct loadPLocked(rRegP dst, memory mem)
76297651
%{

src/hotspot/share/adlc/formssel.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,11 @@ int InstructForm::memory_operand(FormDict &globals) const {
764764
bool InstructForm::captures_bottom_type(FormDict &globals) const {
765765
if (_matrule && _matrule->_rChild &&
766766
(!strcmp(_matrule->_rChild->_opType,"CastPP") || // new result type
767+
!strcmp(_matrule->_rChild->_opType,"CastDD") ||
768+
!strcmp(_matrule->_rChild->_opType,"CastFF") ||
769+
!strcmp(_matrule->_rChild->_opType,"CastII") ||
770+
!strcmp(_matrule->_rChild->_opType,"CastLL") ||
771+
!strcmp(_matrule->_rChild->_opType,"CastVV") ||
767772
!strcmp(_matrule->_rChild->_opType,"CastX2P") || // new result type
768773
!strcmp(_matrule->_rChild->_opType,"DecodeN") ||
769774
!strcmp(_matrule->_rChild->_opType,"EncodeP") ||

src/hotspot/share/opto/castnode.hpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,37 @@ class CastLLNode: public ConstraintCastNode {
115115
virtual uint ideal_reg() const { return Op_RegL; }
116116
};
117117

118+
class CastFFNode: public ConstraintCastNode {
119+
public:
120+
CastFFNode(Node* n, const Type* t, bool carry_dependency = false)
121+
: ConstraintCastNode(n, t, carry_dependency){
122+
init_class_id(Class_CastFF);
123+
}
124+
virtual int Opcode() const;
125+
virtual uint ideal_reg() const { return Op_RegF; }
126+
};
127+
128+
class CastDDNode: public ConstraintCastNode {
129+
public:
130+
CastDDNode(Node* n, const Type* t, bool carry_dependency = false)
131+
: ConstraintCastNode(n, t, carry_dependency){
132+
init_class_id(Class_CastDD);
133+
}
134+
virtual int Opcode() const;
135+
virtual uint ideal_reg() const { return Op_RegD; }
136+
};
137+
138+
class CastVVNode: public ConstraintCastNode {
139+
public:
140+
CastVVNode(Node* n, const Type* t, bool carry_dependency = false)
141+
: ConstraintCastNode(n, t, carry_dependency){
142+
init_class_id(Class_CastVV);
143+
}
144+
virtual int Opcode() const;
145+
virtual uint ideal_reg() const { return in(1)->ideal_reg(); }
146+
};
147+
148+
118149
//------------------------------CastPPNode-------------------------------------
119150
// cast pointer to pointer (different type)
120151
class CastPPNode: public ConstraintCastNode {

src/hotspot/share/opto/classes.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,11 @@ macro(CallLeafNoFP)
6262
macro(CallRuntime)
6363
macro(CallNative)
6464
macro(CallStaticJava)
65+
macro(CastDD)
66+
macro(CastFF)
6567
macro(CastII)
6668
macro(CastLL)
69+
macro(CastVV)
6770
macro(CastX2P)
6871
macro(CastP2X)
6972
macro(CastPP)

0 commit comments

Comments
 (0)