Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/hotspot/share/opto/vectornode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*/

#include "memory/allocation.inline.hpp"
#include "opto/c2_globals.hpp"
#include "opto/compile.hpp"
#include "opto/connode.hpp"
#include "opto/convertnode.hpp"
#include "opto/mulnode.hpp"
Expand Down Expand Up @@ -1145,7 +1147,14 @@ Node* LoadVectorMaskedNode::Ideal(PhaseGVN* phase, bool can_reshape) {
if (ty && ty->is_con()) {
BasicType mask_bt = Matcher::vector_element_basic_type(in(3));
int load_sz = type2aelembytes(mask_bt) * ty->get_con();
assert(load_sz <= MaxVectorSize, "Unexpected load size");
if (load_sz > MaxVectorSize) {
// After loop opts, cast nodes are aggressively removed, if the input is then transformed
// into a constant that is outside the range of the removed cast, we may encounter it here.
// This should be a dead node then.
assert(Compile::current()->post_loop_opts_phase(), "Unexpected load size");
return phase->C->top();
}

if (load_sz == MaxVectorSize) {
Node* ctr = in(MemNode::Control);
Node* mem = in(MemNode::Memory);
Expand All @@ -1164,7 +1173,14 @@ Node* StoreVectorMaskedNode::Ideal(PhaseGVN* phase, bool can_reshape) {
if (ty && ty->is_con()) {
BasicType mask_bt = Matcher::vector_element_basic_type(in(4));
int load_sz = type2aelembytes(mask_bt) * ty->get_con();
assert(load_sz <= MaxVectorSize, "Unexpected store size");
if (load_sz > MaxVectorSize) {
// After loop opts, cast nodes are aggressively removed, if the input is then transformed
// into a constant that is outside the range of the removed cast, we may encounter it here.
// This should be a dead node then.
assert(Compile::current()->post_loop_opts_phase(), "Unexpected store size");
return phase->C->top();
}

if (load_sz == MaxVectorSize) {
Node* ctr = in(MemNode::Control);
Node* mem = in(MemNode::Memory);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2025, Oracle and/or its affiliates. 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
Expand All @@ -26,7 +26,7 @@

/**
* @test
* @bug 8251871 8285301
* @bug 8251871 8285301 8371964
* @summary Optimize arrayCopy using AVX-512 masked instructions.
*
* @run main/othervm/timeout=600 -XX:-TieredCompilation -Xbatch -XX:+IgnoreUnrecognizedVMOptions
Expand All @@ -52,6 +52,9 @@
* compiler.arraycopy.TestArrayCopyDisjoint
* @run main/othervm/timeout=600 -XX:-TieredCompilation -Xbatch -XX:+UnlockExperimentalVMOptions -XX:+AlwaysAtomicAccesses
* compiler.arraycopy.TestArrayCopyDisjoint
* @run main/othervm/timeout=600 -XX:-TieredCompilation -Xbatch -XX:+IgnoreUnrecognizedVMOptions
* -XX:+UnlockDiagnosticVMOptions -XX:UseAVX=3 -XX:MaxVectorSize=32 -XX:ArrayOperationPartialInlineSize=32 -XX:+StressIGVN
* compiler.arraycopy.TestArrayCopyDisjoint
*
*/

Expand Down