[all-commits] [llvm/llvm-project] b63787: [MLIR][AMDGPU] Add permlane16.var and permlanex16....

stefankoncarevic via All-commits all-commits at lists.llvm.org
Wed May 27 02:58:08 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b63787a1c5d74b437e5cbc6dfc75d6b0cd9998cc
      https://github.com/llvm/llvm-project/commit/b63787a1c5d74b437e5cbc6dfc75d6b0cd9998cc
  Author: stefankoncarevic <skoncare at amd.com>
  Date:   2026-05-27 (Wed, 27 May 2026)

  Changed paths:
    M mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUOps.td
    M mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
    M mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
    A mlir/test/Conversion/AMDGPUToROCDL/permlane-var.mlir
    M mlir/test/Dialect/LLVMIR/rocdl.mlir
    M mlir/test/Target/LLVMIR/rocdl.mlir

  Log Message:
  -----------
  [MLIR][AMDGPU] Add permlane16.var and permlanex16.var intrinsic ops (#199501)

## Summary

Add ROCDL and AMDGPU dialect support for the GFX12+ variable-selector
permlane intrinsics (`v_permlane16_var_b32` / `v_permlanex16_var_b32`).

Unlike the existing fixed-selector `permlane16`/`permlanex16` ops where
source-lane indices come from SGPR immediates, the "var" variants take
per-lane source-lane indices from a VGPR, enabling arbitrary per-lane
intra-row and cross-row permutations within a wave32 subgroup.

### ROCDL dialect
- `ROCDL_Permlane16VarOp` → `llvm.amdgcn.permlane16.var`
- `ROCDL_PermlaneX16VarOp` → `llvm.amdgcn.permlanex16.var`
- Both take `(old, src0, src1, fi, boundControl)` with `fi` and
`boundControl` as immediate i1 attrs

### AMDGPU dialect
- `AMDGPU_PermlaneVarOp` — high-level wrapper supporting arbitrary
int/float/vector types
- `cross` attribute selects between intra-row (`permlane16.var`) and
cross-row (`permlanex16.var`)
- Lowering uses `LLVM::decomposeValue`/`composeValue` to automatically
repack types (f16, i8, vectors, etc.) into i32 register slots

### Tests
- ROCDL roundtrip (parser/printer) tests
- ROCDL → LLVM IR translation tests
- AMDGPU → ROCDL lowering tests covering i32, f32, f16, vector<4xf16>,
cross variants, and fi/bound_ctrl attributes



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list