Skip to content

[do not merge] inspecting llc's bejaviour with llvm.sext, llvm.zext and llvm.trunc#1981

Draft
luisacicolini wants to merge 4 commits into
mainfrom
luisa/inspect-ext
Draft

[do not merge] inspecting llc's bejaviour with llvm.sext, llvm.zext and llvm.trunc#1981
luisacicolini wants to merge 4 commits into
mainfrom
luisa/inspect-ext

Conversation

@luisacicolini

@luisacicolini luisacicolini commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

This will remain a draft but I want to store somewhere the inspections of llvm.sext, llvm.zext and llvm.trunc's instruction selection patterns.

github-merge-queue Bot pushed a commit to opencompl/veir that referenced this pull request Apr 10, 2026
We add the lowering patterns for `llvm.sext`, `llvm.zext`, `llvm.trunc`
to behave like [`llc`](opencompl/lean-mlir#1981)
AlexanderViand pushed a commit to AlexanderViand/veir that referenced this pull request Jun 29, 2026
We add the remaining correctness proofs for the isel patterns of
sext/zext/trunc types for legal types within RV64
and update the tests accordingly. We also check the condition on the
relation between the width of the input and output types (e.g., for
sext, the return type's width must be greater than the operand's).

Legal extensions are: i16 -> i64, i16 -> i32, i32 -> i64, while
truncation is always legal (as described in the
[legalizer](https://github.com/llvm/llvm-project/blob/16a0a1042f7e4e5a0c667096fcdeb5803e06d120/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp#L171-L179)).

The patterns are based on the inspection of
[llc](opencompl/lean-mlir#1981 behaviour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant