Roadmap / LLVM IR constructs

The intrinsic family Intrinsic.laneid

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
PTX ISA 9.5 #special-registers-laneid
Quote
Lane Identifier.
Lean declarations
  • MojoProof.LLVM.Intrinsic.ofDecl
  • MojoProof.LLVM.Intrinsic
  • MojoProof.Sem.intrinsic
  • MojoProof.Sym.exec_laneid
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

PTX ISA's section on the instruction NVPTX lowers it to (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.laneid), and the run returns. The block checker (MojoProof/Sym/Rules.lean): Sym.exec_laneid (the lane number: no arguments, no fast-math flags).

Corpus

69 of the 116 corpus files use it (69 uses); corpus lists the first 5 in path order. The members called: llvm.nvvm.read.ptx.sreg.laneid.

Out of scope

Members of the family the corpus does not call. The NVPTX backend's documentation of the NVVM intrinsics is not quoted (no local copy); that the intrinsic is the PTX instruction cited rests on reading the PTX ISA (docs/TRUST.md T7).

Open

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