Skip to content

fix li isel pattern#357

Merged
luisacicolini merged 5 commits intomainfrom
luisa/fix-li-isel
Apr 2, 2026
Merged

fix li isel pattern#357
luisacicolini merged 5 commits intomainfrom
luisa/fix-li-isel

Conversation

@luisacicolini
Copy link
Copy Markdown
Contributor

@luisacicolini luisacicolini commented Apr 1, 2026

We fix the instruction selection lowering pattern for the li instruction using the new reg type and the unrealized conversion cast. We lower an llvm.constant operation to a riscv.li operation with the same property (i.e., the value of the constant), followed by an unrealized conversion cast. This ensures type consistency in a progressive lowering.

At the moment, we only support i64 types. We will expand this in a future PR, after inspecting LLVM's behaviour closely.

Copy link
Copy Markdown
Collaborator

@tobiasgrosser tobiasgrosser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Instead of referring to lean-mlir's behavior, can you describe what changes in your PR message?

@tobiasgrosser tobiasgrosser added the RISCV The RISCV Dialect label Apr 2, 2026
@luisacicolini luisacicolini added this pull request to the merge queue Apr 2, 2026
Merged via the queue into main with commit edb18de Apr 2, 2026
2 checks passed
@luisacicolini luisacicolini deleted the luisa/fix-li-isel branch April 2, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RISCV The RISCV Dialect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants