Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RISCV] Add an implementation of findRepresentativeClass to assign i32 to GPRRegClass for RV64. #116165

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Nov 14, 2024

  1. [RISCV] Add an implementation of findRepresentativeClass to assign i3…

    …2 to GPRRegClass for RV64.
    
    This is an alternative fix for llvm#81192. This allows the SelectionDAG
    scheduler to be able to find a register class for i32 on RV64. The
    default implementation of findRepresentativeClass only works for
    legal types which i32 is not for RV64.
    
    I wanted to remove i32 from the GPR register class to fix the issue,
    but we need to be able to write some i32 patterns for GISel. And now
    it looks like I need to add i16 to GPR. I had tried to use manual
    instruction selection for some cases in GISel in llvm#116111, but I got
    some feedback recommending the use of patterns.
    
    I did some investigation of why tablegen uses i32 in output patterns
    on RV64. It appears it comes down to ForceArbitraryInstResultType
    that just picks a type for the output pattern when the isel pattern
    isn't specific enough. I believe it picks the smallest type(lowested
    numbered) to resolve the conflict.
    topperc committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    4928eff View commit details
    Browse the repository at this point in the history
  2. fixup! clang-format

    topperc committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    10b08c4 View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2024

  1. fixup! Add f16/bf16 by calling base class with f32. Handle int by cal…

    …ling base class with XLenVT.
    topperc committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    7fe0a33 View commit details
    Browse the repository at this point in the history
  2. fixup! fix -Wswitch warning

    topperc committed Nov 16, 2024
    Configuration menu
    Copy the full SHA
    076504d View commit details
    Browse the repository at this point in the history