mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8289127: Apache Lucene triggers: DEBUG MESSAGE: duplicated predicate failed which is impossible
Reviewed-by: kvn, dlong
This commit is contained in:
parent
15d3329edd
commit
4f3f74c141
@ -1390,6 +1390,7 @@ static bool skeleton_follow_inputs(Node* n, int op) {
|
||||
op == Op_OrL ||
|
||||
op == Op_RShiftL ||
|
||||
op == Op_LShiftL ||
|
||||
op == Op_LShiftI ||
|
||||
op == Op_AddL ||
|
||||
op == Op_AddI ||
|
||||
op == Op_MulL ||
|
||||
@ -1404,6 +1405,8 @@ bool PhaseIdealLoop::skeleton_predicate_has_opaque(IfNode* iff) {
|
||||
ResourceMark rm;
|
||||
Unique_Node_List wq;
|
||||
wq.push(iff->in(1)->in(1));
|
||||
uint init = 0;
|
||||
uint stride = 0;
|
||||
for (uint i = 0; i < wq.size(); i++) {
|
||||
Node* n = wq.at(i);
|
||||
int op = n->Opcode();
|
||||
@ -1416,11 +1419,39 @@ bool PhaseIdealLoop::skeleton_predicate_has_opaque(IfNode* iff) {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (n->is_Opaque1()) {
|
||||
return true;
|
||||
if (n->Opcode() == Op_OpaqueLoopInit) {
|
||||
init++;
|
||||
} else if (n->Opcode() == Op_OpaqueLoopStride) {
|
||||
stride++;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
#ifdef ASSERT
|
||||
wq.clear();
|
||||
wq.push(iff->in(1)->in(1));
|
||||
uint verif_init = 0;
|
||||
uint verif_stride = 0;
|
||||
for (uint i = 0; i < wq.size(); i++) {
|
||||
Node* n = wq.at(i);
|
||||
int op = n->Opcode();
|
||||
if (!n->is_CFG()) {
|
||||
if (n->Opcode() == Op_OpaqueLoopInit) {
|
||||
verif_init++;
|
||||
} else if (n->Opcode() == Op_OpaqueLoopStride) {
|
||||
verif_stride++;
|
||||
} else {
|
||||
for (uint j = 1; j < n->req(); j++) {
|
||||
Node* m = n->in(j);
|
||||
if (m != NULL) {
|
||||
wq.push(m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
assert(init == verif_init && stride == verif_stride, "missed opaque node");
|
||||
#endif
|
||||
assert(stride == 0 || init != 0, "init should be there every time stride is");
|
||||
return init != 0;
|
||||
}
|
||||
|
||||
// Clone the skeleton predicate bool for a main or unswitched loop:
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Red Hat, Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8289127
|
||||
* @summary Apache Lucene triggers: DEBUG MESSAGE: duplicated predicate failed which is impossible
|
||||
* @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-TieredCompilation TestMissedOpaqueInPredicate
|
||||
*/
|
||||
|
||||
public class TestMissedOpaqueInPredicate {
|
||||
public static void main(String[] args) {
|
||||
long[] tmp = new long[28];
|
||||
long[] longs = new long[32];
|
||||
for (int i = 0; i < 20_000; i++) {
|
||||
test(tmp, longs);
|
||||
}
|
||||
}
|
||||
|
||||
private static void test(long[] tmp, long[] longs) {
|
||||
for (int iter = 0, tmpIdx = 0, longsIdx = 28; iter < 4; ++iter, tmpIdx += 7, longsIdx += 1) {
|
||||
long l0 = tmp[tmpIdx + 0] << 12;
|
||||
l0 |= tmp[tmpIdx + 1] << 10;
|
||||
l0 |= tmp[tmpIdx + 2] << 8;
|
||||
l0 |= tmp[tmpIdx + 3] << 6;
|
||||
l0 |= tmp[tmpIdx + 4] << 4;
|
||||
l0 |= tmp[tmpIdx + 5] << 2;
|
||||
l0 |= tmp[tmpIdx + 6] << 0;
|
||||
longs[longsIdx + 0] = l0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user