Skip to content

Mono LLVMAOT fails for Sse2_r and Sse2_ro with Invalid Record #102037

Open

Description

@tannergooding

As per the title the Sse2_r and Sse2_ro hardware intrinsics projects fail compiling with errors similar to the following:

 /__w/1/s/artifacts/bin/mono/linux.x64.Release/opt: mono_aot_dFNFkp/temp.bc: error: Invalid record (Producer: 'LLVM16.0.5' Reader: 'LLVM 16.0.5')
  AOT of image /__w/1/s/artifacts/tests/coreclr/linux.x64.Release/JIT/HardwareIntrinsics/HardwareIntrinsics_X86_r/X86_Sse2_r.dll failed.
  Mono Ahead of Time compiler - compiling assembly /__w/1/s/artifacts/tests/coreclr/linux.x64.Release/JIT/HardwareIntrinsics/HardwareIntrinsics_X86_r/X86_Sse2_r.dll

This was found in #101886 after extending various tests to include new coverage in the form of the following (that is, the same as the existing RuneBasicScenario but using Vector.Create and Vector.ConditionalSelect as part of the scenario to ensure that embedded broadcasts and embedded masking could be validated.

public void RunBroadcastScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunBroadcastScenario));

            var result = {Isa}.{Method}(
                Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr),
                {Op2VectorType}.Create<{Op2BaseType}>(Unsafe.Read<{Op2BaseType}>(_dataTable.inArray2Ptr))
            );

            Unsafe.Write(_dataTable.outArrayPtr, result);
            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr, isBroadcast: true);
        }

        public void RunMaskingValueScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunMaskingValueScenario));

            var op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr);

            var result = {RetVectorType}.ConditionalSelect(
                {RetVectorType}.Equals<{RetBaseType}>(op1.As{RetBaseType}(), {RetVectorType}<{RetBaseType}>.Zero),
                {Isa}.{Method}(
                    op1,
                    Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr)
                ),
                {RetVectorType}.Create<{RetBaseType}>(1)
            );

            Unsafe.Write(_dataTable.outArrayPtr, result);
            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr, mask: 1);
        }

        public void RunMaskingZeroScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunMaskingZeroScenario));

            var op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr);

            var result = {RetVectorType}.ConditionalSelect(
                {RetVectorType}.Equals<{RetBaseType}>(op1.As{RetBaseType}(), {RetVectorType}<{RetBaseType}>.Zero),
                {Isa}.{Method}(
                    op1,
                    Unsafe.Read<{Op2VectorType}<{Op2BaseType}>>(_dataTable.inArray2Ptr)
                ),
                {RetVectorType}<{RetBaseType}>.Zero
            );

            Unsafe.Write(_dataTable.outArrayPtr, result);
            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr, mask: 0);
        }

        public void RunBroadcastAndMaskingScenario()
        {
            TestLibrary.TestFramework.BeginScenario(nameof(RunBroadcastAndMaskingScenario));

            var op1 = Unsafe.Read<{Op1VectorType}<{Op1BaseType}>>(_dataTable.inArray1Ptr);

            var result = {RetVectorType}.ConditionalSelect(
                {RetVectorType}.Equals<{RetBaseType}>(op1.As{RetBaseType}(), {RetVectorType}<{RetBaseType}>.Zero),
                {Isa}.{Method}(
                    op1,
                    {Op2VectorType}.Create<{Op2BaseType}>(Unsafe.Read<{Op2BaseType}>(_dataTable.inArray2Ptr))
                ),
                {RetVectorType}<{RetBaseType}>.Zero
            );

            Unsafe.Write(_dataTable.outArrayPtr, result);
            ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr, isBroadcast: true, mask: 0);
        }

Activity

  1. ghost added
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on May 9, 2024
  2. added and removed
    needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
    on May 9, 2024
  3. dotnet-policy-service commented on May 9, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @lambdageek, @steveisok
    See info in area-owners.md if you want to be subscribed.

  4. steveisok commented on May 9, 2024

    @steveisok
    Member
  5. modified the milestones: 9.0.0, Future on Jun 13, 2024
  6. removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 2, 2024
  7. removed their assignment
    on Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions