Roadmap / LLVM IR constructs

The intrinsic family Intrinsic.extract

Area
LLVM IR constructs
Kind
construct
Level
L1 (modelled in Lean). Next: L2 needs a recorded GPU run (a conformance test, not a proof).
Evidence present above the level
None above the level.
Reference
LLVM LangRef 24.0.0git #llvm-vector-extract-intrinsic
Quote
The ‘llvm.vector.extract.*’ intrinsics extract a vector from within another vector starting from a given index.
Lean declarations
  • MojoProof.LLVM.Intrinsic.ofDecl
  • MojoProof.LLVM.Intrinsic
  • MojoProof.Sem.intrinsic
Corpus files

5 kernel files (.ll) in the corpus.

Tests
  • MojoProofTest.Rule
  • MojoProofTest.Corpus
  • MojoProofTest.Modelled
Upstream issue
None filed.
Depends on
No other card.

Rule

LangRef's section on the intrinsic (the quote is the section's first sentence). The importer accepts a declaration of this family only if Intrinsic.ofDecl recognizes its name and signature (Intrinsic.name, Intrinsic.sig). The semantics gives a call its meaning in MojoProof.Sem.intrinsic. MojoProofTest/Modelled.lean runs a kernel of a call (its row Intrinsic.extract), and the run returns. The block checker (MojoProof/Sym/Rules.lean): refused: SState.stmt takes calls of special registers and of minmax only.

Corpus

30 of the 116 corpus files use it (4868 uses); corpus lists the first 5 in path order. The members called: llvm.vector.extract.v2bf16.v4bf16, llvm.vector.extract.v2f16.v4f16, llvm.vector.extract.v2f32.v2f32, llvm.vector.extract.v2i32.v4i32, llvm.vector.extract.v4bf16.v8bf16, llvm.vector.extract.v4f32.v4f32, llvm.vector.extract.v4i32.v8i32.

Out of scope

Members of the family the corpus does not call. That the semantics gives the family the meaning LLVM gives it rests on reading LangRef (docs/TRUST.md T7).

Open

L2 needs a recorded GPU run of a test of the construct; there is none.