Skip to content

[mono][llvm] Support exception filters #54185

Open

Description

@imhameed

Seen in https://github.com/dotnet/runtime/blob/6474c725025a8b29b4265c4d9485018982ee6b16/src/tests/JIT/HardwareIntrinsics/X86/Sse42.X64/Crc32.cs. Makes Mono bail out of translating to LLVM with "LLVM failed for 'Program.Main': non-finally/catch/fault clause."

The resulting test then ends up with weird semi-consistent codegen which causes it to print:

Intrinsic Sse42.X64.Crc32 is called on non-supported hardware.
Sse42.IsSupported False
Environment.Is64BitProcess True
Intrinsic Sse42.X64.Crc32 is called via reflection on non-supported hardware.
Sse42.IsSupported False
Environment.Is64BitProcess True

but still yield 0 (instead of 100) as an exit code.

Random notes:

https://llvm.org/docs/LangRef.html#llvm-localescape-and-llvm-localrecover-intrinsics
https://github.com/dotnet/llvm-project/blob/release/11.x/llvm/test/CodeGen/X86/wineh-coreclr.ll

One difficulty with llvm.localaddress and llvm.localrecover is that they are currently only supported on x86, x86-64, and aarch64. But it doesn't look like it'd be too hard to add support for other platforms. (But I have no idea how involved this would be for WASM)

Also enable JIT/HardwareIntrinsics/X86/Sse42.X64/Crc32_{r,ro} test with the fix

Activity

  1. ghost added
    area-CodeGen-coreclr
    on Jun 14, 2021
  2. ghost added
    untriaged
    on Jun 14, 2021
  3. added
    runtime-mono
    and removed
    area-CodeGen-coreclr
    untriaged
    on Jun 14, 2021
  4. added this to the 6.0.0 milestone on Jun 15, 2021
  5. SamMonoRT commented on Jun 15, 2021

    @SamMonoRT
    Member

    @BrzVlad - any overlap between work done on exception filters from issues in your queue ?

  6. BrzVlad commented on Jun 16, 2021

    @BrzVlad
    Member

    Supporting exception filters with llvm requires some research, unrelated with any other work. We never supported exception filters with llvm. Doesn't seem feasible for .NET 6.0

  7. modified the milestones: 6.0.0, 7.0.0 on Jun 16, 2021
  8. SamMonoRT commented on Jun 16, 2021

    @SamMonoRT
    Member

    Moving this to Future milestone.

  9. modified the milestones: 7.0.0, 8.0.0 on Jul 23, 2022
  10. modified the milestones: 8.0.0, Future on May 19, 2023
  11. kasperk81 commented on Oct 8, 2023

    @kasperk81
    Contributor

    @jandupej #54176 is closed but referenced in

    <ExcludeList Include = "$(XunitTestBinBase)/JIT/HardwareIntrinsics/X86/Sse2.X64/StoreNonTemporal_r/**">
    <Issue>https://github.com/dotnet/runtime/issues/54176</Issue>
    </ExcludeList>
    <ExcludeList Include = "$(XunitTestBinBase)/JIT/HardwareIntrinsics/X86/Sse2.X64/StoreNonTemporal_ro/**">
    <Issue>https://github.com/dotnet/runtime/issues/54176</Issue>
    </ExcludeList>
    and
    [ActiveIssue("https://github.com/dotnet/runtime/issues/54176", TestRuntimes.Mono)]
    will it be fixed somewhat differently? otherwise replace the link with reason strings similar to other unsupported tests: non-temporal store intrinsics are not supported on this platform.

  12. jandupej commented on Oct 9, 2023

    @jandupej
    Contributor

    @kasperk81 The reason for disabling the test you indicate is strange. I created an issue where enabling these tests can be tracked: #93202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-Codegen-LLVM-monoruntime-mono

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions