From f48c006c3d05d26a545bc3ce9a6bf6186cd1c13b Mon Sep 17 00:00:00 2001 From: Quan Anh Mai Date: Sun, 25 Jan 2026 02:21:58 +0700 Subject: [PATCH] Add test store the loaded vector --- .../vectorapi/TestVectorLoadStoreOptimization.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/hotspot/jtreg/compiler/vectorapi/TestVectorLoadStoreOptimization.java b/test/hotspot/jtreg/compiler/vectorapi/TestVectorLoadStoreOptimization.java index c603f450d0c..fb5fd4b0ce3 100644 --- a/test/hotspot/jtreg/compiler/vectorapi/TestVectorLoadStoreOptimization.java +++ b/test/hotspot/jtreg/compiler/vectorapi/TestVectorLoadStoreOptimization.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * Copyright (c) 2025, 2026, 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 + * @test 8371603 8376220 * @key randomness * @library /test/lib / * @summary Test the missing optimization issues for vector load/store caused by JDK-8286941 @@ -96,6 +96,14 @@ 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)