[llvm] [NVVM][NVPTX] Support spcompress and spdecompress intrinsics (PR #221751)
Alex MacLean via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 7 09:59:02 PDT 2026
================
@@ -996,6 +996,114 @@ If the given pointer in the generic address space refers to memory which falls
within the state space of the intrinsic (and therefore could be safely address
space casted to this space), 1 is returned, otherwise 0 is returned.
+### Structured Sparsity Intrinsics
+
+The `llvm.nvvm.spcompress.*` and `llvm.nvvm.spdecompress.*` intrinsics model
+the PTX `spcompress` and `spdecompress` instructions. They require PTX ISA 9.4
+and `sm_107a`.
+
+The intrinsic types representing `mdata`, `cdata`, and `data` are overloaded.
+A bundle of one 32-bit register is represented by `i32`, and a bundle of `N`
+registers is represented by `<N x i32>`. The actual intrinsic names include
+the corresponding LLVM overload suffixes.
+
+The three trailing arguments are immediate qualifiers with the following
+encodings:
+
+| Argument | Values | PTX qualifiers |
+| ----------------------- | ------------------------- | -------------------------------------- |
+| `%elem_size` | `8`, `16` | `.b8`, `.b16` |
+| `%idx_size` | `2`, `4` | `.b2`, `.b4` |
----------------
AlexMaclean wrote:
It seems like we're encoding type information in immediate arguments here, can we instead use native llvm types for the corresponding operands?
https://github.com/llvm/llvm-project/pull/221751
More information about the llvm-commits
mailing list