Skip to content

Commit 81d35e4

Browse files
author
Vladimir Kozlov
committed
8264063: Outer Safepoint poll load should not reference the head of inner strip mined loop.
Reviewed-by: roland, vlivanov
1 parent 04fa1ed commit 81d35e4

File tree

7 files changed

+11
-47
lines changed

7 files changed

+11
-47
lines changed

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,20 +1782,6 @@ int MachCallNativeNode::ret_addr_offset() {
17821782
}
17831783
}
17841784

1785-
// Indicate if the safepoint node needs the polling page as an input
1786-
1787-
// the shared code plants the oop data at the start of the generated
1788-
// code for the safepoint node and that needs ot be at the load
1789-
// instruction itself. so we cannot plant a mov of the safepoint poll
1790-
// address followed by a load. setting this to true means the mov is
1791-
// scheduled as a prior instruction. that's better for scheduling
1792-
// anyway.
1793-
1794-
bool SafePointNode::needs_polling_address_input()
1795-
{
1796-
return true;
1797-
}
1798-
17991785
//=============================================================================
18001786

18011787
#ifndef PRODUCT

src/hotspot/cpu/arm/arm.ad

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,6 @@ int MachNode::compute_padding(int current_offset) const {
146146

147147
// REQUIRED FUNCTIONALITY
148148

149-
// Indicate if the safepoint node needs the polling page as an input.
150-
// Since ARM does not have absolute addressing, it does.
151-
bool SafePointNode::needs_polling_address_input() {
152-
return true;
153-
}
154-
155149
// emit an interrupt that is caught by the debugger (for debugging compiler)
156150
void emit_break(CodeBuffer &cbuf) {
157151
C2_MacroAssembler _masm(&cbuf);

src/hotspot/cpu/ppc/ppc.ad

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,14 +1159,6 @@ static int cc_to_biint(int cc, int flags_reg) {
11591159

11601160
//=============================================================================
11611161

1162-
// Indicate if the safepoint node needs the polling page as an input.
1163-
bool SafePointNode::needs_polling_address_input() {
1164-
// The address is loaded from thread by a seperate node.
1165-
return true;
1166-
}
1167-
1168-
//=============================================================================
1169-
11701162
// Emit an interrupt that is caught by the debugger (for debugging compiler).
11711163
void emit_break(CodeBuffer &cbuf) {
11721164
C2_MacroAssembler _masm(&cbuf);

src/hotspot/cpu/s390/s390.ad

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -671,12 +671,6 @@ int CallLeafNoFPDirectNode::compute_padding(int current_offset) const {
671671
return (12 - current_offset) & 2;
672672
}
673673

674-
// Indicate if the safepoint node needs the polling page as an input.
675-
// Since z/Architecture does not have absolute addressing, it does.
676-
bool SafePointNode::needs_polling_address_input() {
677-
return true;
678-
}
679-
680674
void emit_nop(CodeBuffer &cbuf) {
681675
C2_MacroAssembler _masm(&cbuf);
682676
__ z_nop();

src/hotspot/share/opto/callnode.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,6 @@ class SafePointNode : public MultiNode {
484484
virtual const RegMask &out_RegMask() const;
485485
virtual uint match_edge(uint idx) const;
486486

487-
static bool needs_polling_address_input();
488-
489487
#ifndef PRODUCT
490488
virtual void dump_spec(outputStream *st) const;
491489
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;

src/hotspot/share/opto/loopTransform.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3701,16 +3701,6 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st
37013701
for (SimpleDUIterator iter(n); iter.has_next(); iter.next()) {
37023702
Node* use = iter.get();
37033703
if (!lpt->_body.contains(use)) {
3704-
if (n->is_CountedLoop() && n->as_CountedLoop()->is_strip_mined()) {
3705-
// In strip-mined counted loops, the CountedLoopNode may be
3706-
// used by the address polling node of the outer safepoint.
3707-
// Skip this use because it's safe.
3708-
Node* sfpt = n->as_CountedLoop()->outer_safepoint();
3709-
Node* polladr = sfpt->in(TypeFunc::Parms+0);
3710-
if (use == polladr) {
3711-
continue;
3712-
}
3713-
}
37143704
msg = "node is used outside loop";
37153705
msg_node = n;
37163706
break;

src/hotspot/share/opto/loopnode.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1638,6 +1638,16 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*&loop, BasicType iv_
16381638
Node* sfpt = sfpt2->clone();
16391639
sfpt->set_req(0, iffalse);
16401640
outer_le->set_req(0, sfpt);
1641+
1642+
Node* polladdr = sfpt->in(TypeFunc::Parms);
1643+
if (polladdr != nullptr && polladdr->is_Load()) {
1644+
// Polling load should be pinned outside inner loop.
1645+
Node* new_polladdr = polladdr->clone();
1646+
new_polladdr->set_req(0, iffalse);
1647+
_igvn.register_new_node_with_optimizer(new_polladdr, polladdr);
1648+
set_ctrl(new_polladdr, iffalse);
1649+
sfpt->set_req(TypeFunc::Parms, new_polladdr);
1650+
}
16411651
// When this code runs, loop bodies have not yet been populated.
16421652
const bool body_populated = false;
16431653
register_control(sfpt, outer_ilt, iffalse, body_populated);

0 commit comments

Comments
 (0)