From 2cdfe8d24498cc7d9b794b77eef3c8b9642f75d9 Mon Sep 17 00:00:00 2001 From: Quan Anh Mai Date: Thu, 19 Feb 2026 18:47:28 +0700 Subject: [PATCH] revert the change in StoreNode::Identity --- src/hotspot/share/opto/memnode.cpp | 9 ++------- .../vectorapi/TestVectorLoadStoreOptimization.java | 12 ++---------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp index b9c9b89793f..856adce79bb 100644 --- a/src/hotspot/share/opto/memnode.cpp +++ b/src/hotspot/share/opto/memnode.cpp @@ -3560,13 +3560,8 @@ Node* StoreNode::Identity(PhaseGVN* phase) { val->in(MemNode::Address)->eqv_uncast(adr) && val->in(MemNode::Memory )->eqv_uncast(mem) && val->as_Load()->store_Opcode() == Opcode()) { - if (!is_StoreVector()) { - result = mem; - } else if (Opcode() == Op_StoreVector && val->Opcode() == Op_LoadVector && - as_StoreVector()->vect_type() == val->as_LoadVector()->vect_type()) { - // Ensure vector type is the same. For a masked access or a gather/scatter, we need to check - // for the equivalence of the mask or the indices vector, respectively. We give up on those - // cases for now. + // Ensure vector type is the same + if (!is_StoreVector() || (mem->is_LoadVector() && as_StoreVector()->vect_type() == mem->as_LoadVector()->vect_type())) { result = mem; } } diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestVectorLoadStoreOptimization.java b/test/hotspot/jtreg/compiler/vectorapi/TestVectorLoadStoreOptimization.java index fb5fd4b0ce3..c603f450d0c 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestVectorLoadStoreOptimization.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestVectorLoadStoreOptimization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * Copyright (c) 2025, NVIDIA CORPORATION & 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 @@ -29,7 +29,7 @@ import jdk.incubator.vector.*; import jdk.test.lib.Asserts; /** - * @test 8371603 8376220 + * @test 8371603 * @key randomness * @library /test/lib / * @summary Test the missing optimization issues for vector load/store caused by JDK-8286941 @@ -96,14 +96,6 @@ public class TestVectorLoadStoreOptimization { } } - // Test that store a value that is just loaded from the same memory location is elided - @Test - @IR(failOn = IRNode.STORE_VECTOR, - applyIfCPUFeatureOr = {"asimd", "true", "avx", "true", "rvv", "true"}) - public static void testStoreVector2() { - IntVector.fromArray(SPECIES, a, 0).intoArray(a, 0); - } - public static void main(String[] args) { TestFramework testFramework = new TestFramework(); testFramework.setDefaultWarmup(10000)