JDK-8293543 : [lworld] Redundant allocations should be removed even when loop opts are not triggered
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2022-09-08
  • Updated: 2024-07-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
repo-valhallaUnresolved
Related Reports
Relates :  
Description
    static primitive class MyPrimitive41_2 {
        int x;

        @ForceInline
        public MyPrimitive41_2() {
            this.x = 42;
        }
    }

    static primitive class MyPrimitive41_1 {
        MyPrimitive41_2.ref val;

        @ForceInline
        public MyPrimitive41_1() {
            this.val = new MyPrimitive41_2();
        }
    }

    static MyPrimitive41_1 f1;
    static MyPrimitive41_1 f2;

    // Verify that redundant allocations are removed even when loop opts are not triggered
    @Test
    @IR(counts = {ALLOC_G, "= 2"})
    public void test41() {
        f1 = new MyPrimitive41_1();
        f2 = new MyPrimitive41_1();
    }

    @Run(test = "test41")
    public void test41_verifier() {
        test41();
        Asserts.assertEQ(f1, new MyPrimitive41_1());
        Asserts.assertEQ(f1, f2);
    }