Skip to content

Commit 0b467e9

Browse files
robcaslozfisk641billKim Barrettoffamitkumar
committed
8334060: Implementation of Late Barrier Expansion for G1
Co-authored-by: Roberto Castañeda Lozano <[email protected]> Co-authored-by: Erik Österlund <[email protected]> Co-authored-by: Siyao Liu <[email protected]> Co-authored-by: Kim Barrett <[email protected]> Co-authored-by: Amit Kumar <[email protected]> Co-authored-by: Martin Doerr <[email protected]> Co-authored-by: Feilong Jiang <[email protected]> Co-authored-by: Sergey Nazarkin <[email protected]> Reviewed-by: kvn, tschatzl, fyang, ayang, kbarrett
1 parent c6e7e55 commit 0b467e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+6387
-1448
lines changed

make/hotspot/gensrc/GensrcAdlc.gmk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,13 @@ ifeq ($(call check-jvm-feature, compiler2), true)
200200
)))
201201
endif
202202

203+
ifeq ($(call check-jvm-feature, g1gc), true)
204+
AD_SRC_FILES += $(call uniq, $(wildcard $(foreach d, $(AD_SRC_ROOTS), \
205+
$d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/gc/g1/g1_$(HOTSPOT_TARGET_CPU).ad \
206+
$d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/gc/g1/g1_$(HOTSPOT_TARGET_CPU_ARCH).ad \
207+
)))
208+
endif
209+
203210
SINGLE_AD_SRCFILE := $(ADLC_SUPPORT_DIR)/all-ad-src.ad
204211

205212
INSERT_FILENAME_AWK_SCRIPT := \

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2620,7 +2620,8 @@ static bool is_vector_bitwise_not_pattern(Node* n, Node* m) {
26202620
bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) {
26212621
if (is_vshift_con_pattern(n, m) ||
26222622
is_vector_bitwise_not_pattern(n, m) ||
2623-
is_valid_sve_arith_imm_pattern(n, m)) {
2623+
is_valid_sve_arith_imm_pattern(n, m) ||
2624+
is_encode_and_store_pattern(n, m)) {
26242625
mstack.push(m, Visit);
26252626
return true;
26262627
}
@@ -6410,7 +6411,7 @@ instruct loadP(iRegPNoSp dst, memory mem)
64106411
instruct loadN(iRegNNoSp dst, memory mem)
64116412
%{
64126413
match(Set dst (LoadN mem));
6413-
predicate(!needs_acquiring_load(n));
6414+
predicate(!needs_acquiring_load(n) && n->as_Load()->barrier_data() == 0);
64146415

64156416
ins_cost(4 * INSN_COST);
64166417
format %{ "ldrw $dst, $mem\t# compressed ptr" %}
@@ -6839,7 +6840,7 @@ instruct storeimmP0(immP0 zero, memory mem)
68396840
instruct storeN(iRegN src, memory mem)
68406841
%{
68416842
match(Set mem (StoreN mem src));
6842-
predicate(!needs_releasing_store(n));
6843+
predicate(!needs_releasing_store(n) && n->as_Store()->barrier_data() == 0);
68436844

68446845
ins_cost(INSN_COST);
68456846
format %{ "strw $src, $mem\t# compressed ptr" %}
@@ -6852,7 +6853,7 @@ instruct storeN(iRegN src, memory mem)
68526853
instruct storeImmN0(immN0 zero, memory mem)
68536854
%{
68546855
match(Set mem (StoreN mem zero));
6855-
predicate(!needs_releasing_store(n));
6856+
predicate(!needs_releasing_store(n) && n->as_Store()->barrier_data() == 0);
68566857

68576858
ins_cost(INSN_COST);
68586859
format %{ "strw zr, $mem\t# compressed ptr" %}
@@ -7086,6 +7087,7 @@ instruct loadP_volatile(iRegPNoSp dst, /* sync_memory*/indirect mem)
70867087
instruct loadN_volatile(iRegNNoSp dst, /* sync_memory*/indirect mem)
70877088
%{
70887089
match(Set dst (LoadN mem));
7090+
predicate(n->as_Load()->barrier_data() == 0);
70897091

70907092
ins_cost(VOLATILE_REF_COST);
70917093
format %{ "ldarw $dst, $mem\t# compressed ptr" %}
@@ -7253,6 +7255,7 @@ instruct storeimmP0_volatile(immP0 zero, /* sync_memory*/indirect mem)
72537255
instruct storeN_volatile(iRegN src, /* sync_memory*/indirect mem)
72547256
%{
72557257
match(Set mem (StoreN mem src));
7258+
predicate(n->as_Store()->barrier_data() == 0);
72567259

72577260
ins_cost(VOLATILE_REF_COST);
72587261
format %{ "stlrw $src, $mem\t# compressed ptr" %}
@@ -7265,6 +7268,7 @@ instruct storeN_volatile(iRegN src, /* sync_memory*/indirect mem)
72657268
instruct storeimmN0_volatile(immN0 zero, /* sync_memory*/indirect mem)
72667269
%{
72677270
match(Set mem (StoreN mem zero));
7271+
predicate(n->as_Store()->barrier_data() == 0);
72687272

72697273
ins_cost(VOLATILE_REF_COST);
72707274
format %{ "stlrw zr, $mem\t# compressed ptr" %}
@@ -8061,6 +8065,7 @@ instruct compareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval
80618065
instruct compareAndSwapN(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegNNoSp newval, rFlagsReg cr) %{
80628066

80638067
match(Set res (CompareAndSwapN mem (Binary oldval newval)));
8068+
predicate(n->as_LoadStore()->barrier_data() == 0);
80648069
ins_cost(2 * VOLATILE_REF_COST);
80658070

80668071
effect(KILL cr);
@@ -8175,7 +8180,7 @@ instruct compareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP new
81758180

81768181
instruct compareAndSwapNAcq(iRegINoSp res, indirect mem, iRegNNoSp oldval, iRegNNoSp newval, rFlagsReg cr) %{
81778182

8178-
predicate(needs_acquiring_load_exclusive(n));
8183+
predicate(needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == 0);
81798184
match(Set res (CompareAndSwapN mem (Binary oldval newval)));
81808185
ins_cost(VOLATILE_REF_COST);
81818186

@@ -8280,6 +8285,7 @@ instruct compareAndExchangeL(iRegLNoSp res, indirect mem, iRegL oldval, iRegL ne
82808285
// This pattern is generated automatically from cas.m4.
82818286
// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE
82828287
instruct compareAndExchangeN(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{
8288+
predicate(n->as_LoadStore()->barrier_data() == 0);
82838289
match(Set res (CompareAndExchangeN mem (Binary oldval newval)));
82848290
ins_cost(2 * VOLATILE_REF_COST);
82858291
effect(TEMP_DEF res, KILL cr);
@@ -8389,7 +8395,7 @@ instruct compareAndExchangeLAcq(iRegLNoSp res, indirect mem, iRegL oldval, iRegL
83898395
// This pattern is generated automatically from cas.m4.
83908396
// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE
83918397
instruct compareAndExchangeNAcq(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{
8392-
predicate(needs_acquiring_load_exclusive(n));
8398+
predicate(needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == 0);
83938399
match(Set res (CompareAndExchangeN mem (Binary oldval newval)));
83948400
ins_cost(VOLATILE_REF_COST);
83958401
effect(TEMP_DEF res, KILL cr);
@@ -8501,6 +8507,7 @@ instruct weakCompareAndSwapL(iRegINoSp res, indirect mem, iRegL oldval, iRegL ne
85018507
// This pattern is generated automatically from cas.m4.
85028508
// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE
85038509
instruct weakCompareAndSwapN(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{
8510+
predicate(n->as_LoadStore()->barrier_data() == 0);
85048511
match(Set res (WeakCompareAndSwapN mem (Binary oldval newval)));
85058512
ins_cost(2 * VOLATILE_REF_COST);
85068513
effect(KILL cr);
@@ -8620,7 +8627,7 @@ instruct weakCompareAndSwapLAcq(iRegINoSp res, indirect mem, iRegL oldval, iRegL
86208627
// This pattern is generated automatically from cas.m4.
86218628
// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE
86228629
instruct weakCompareAndSwapNAcq(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, rFlagsReg cr) %{
8623-
predicate(needs_acquiring_load_exclusive(n));
8630+
predicate(needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == 0);
86248631
match(Set res (WeakCompareAndSwapN mem (Binary oldval newval)));
86258632
ins_cost(VOLATILE_REF_COST);
86268633
effect(KILL cr);
@@ -8681,6 +8688,7 @@ instruct get_and_setL(indirect mem, iRegL newv, iRegLNoSp prev) %{
86818688
%}
86828689

86838690
instruct get_and_setN(indirect mem, iRegN newv, iRegINoSp prev) %{
8691+
predicate(n->as_LoadStore()->barrier_data() == 0);
86848692
match(Set prev (GetAndSetN mem newv));
86858693
ins_cost(2 * VOLATILE_REF_COST);
86868694
format %{ "atomic_xchgw $prev, $newv, [$mem]" %}
@@ -8724,7 +8732,7 @@ instruct get_and_setLAcq(indirect mem, iRegL newv, iRegLNoSp prev) %{
87248732
%}
87258733

87268734
instruct get_and_setNAcq(indirect mem, iRegN newv, iRegINoSp prev) %{
8727-
predicate(needs_acquiring_load_exclusive(n));
8735+
predicate(needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == 0);
87288736
match(Set prev (GetAndSetN mem newv));
87298737
ins_cost(VOLATILE_REF_COST);
87308738
format %{ "atomic_xchgw_acq $prev, $newv, [$mem]" %}

src/hotspot/cpu/aarch64/cas.m4

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ define(`CAS_INSN',
4545
// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE
4646
instruct compareAndExchange$1$6(iReg$2NoSp res, indirect mem, iReg$2 oldval, iReg$2 newval, rFlagsReg cr) %{
4747
ifelse($1$6,PAcq,INDENT(predicate(needs_acquiring_load_exclusive(n) && (n->as_LoadStore()->barrier_data() == 0));),
48+
$1$6,NAcq,INDENT(predicate(needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == 0);),
4849
$1,P,INDENT(predicate(n->as_LoadStore()->barrier_data() == 0);),
50+
$1,N,INDENT(predicate(n->as_LoadStore()->barrier_data() == 0);),
4951
$6,Acq,INDENT(predicate(needs_acquiring_load_exclusive(n));),
5052
`dnl')
5153
match(Set res (CompareAndExchange$1 mem (Binary oldval newval)));
@@ -122,7 +124,9 @@ define(`CAS_INSN3',
122124
// DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE
123125
instruct weakCompareAndSwap$1$6(iRegINoSp res, indirect mem, iReg$2 oldval, iReg$2 newval, rFlagsReg cr) %{
124126
ifelse($1$6,PAcq,INDENT(predicate(needs_acquiring_load_exclusive(n) && (n->as_LoadStore()->barrier_data() == 0));),
127+
$1$6,NAcq,INDENT(predicate(needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == 0);),
125128
$1,P,INDENT(predicate(n->as_LoadStore()->barrier_data() == 0);),
129+
$1,N,INDENT(predicate(n->as_LoadStore()->barrier_data() == 0);),
126130
$6,Acq,INDENT(predicate(needs_acquiring_load_exclusive(n));),
127131
`dnl')
128132
match(Set res (WeakCompareAndSwap$1 mem (Binary oldval newval)));

0 commit comments

Comments
 (0)