aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/StackMaps.cpp
diff options
context:
space:
mode:
authorSrinivasa Ravi <srinivasar@nvidia.com>2025-05-21 08:53:00 +0530
committerGitHub <noreply@github.com>2025-05-21 08:53:00 +0530
commit9a553d3766aacb69e884823da92dedff264e3f0f (patch)
tree5e9906073168ea7bc5daff3efa863af60c7f235e /llvm/lib/CodeGen/StackMaps.cpp
parent0f2a46995164c99064264d60d7a2dc0c9c5a716e (diff)
downloadllvm-9a553d3766aacb69e884823da92dedff264e3f0f.zip
llvm-9a553d3766aacb69e884823da92dedff264e3f0f.tar.gz
llvm-9a553d3766aacb69e884823da92dedff264e3f0f.tar.bz2
[MLIR][NVVM] Add NVVMRequiresSM op traits (#126886)
Motivation: Currently, the NVVMOps are not verified against the supported SM architectures. This can manifest as an ISel failure in the NVPTX LLVM backend during CodeGen to PTX ISA. This PR addresses this issue by adding verifier checks for Target-SM architectures in the NVVM Dialect itself, thereby catching the errors early on. Summary: * Parametric traits named `NVVMRequiresSM` and `NVVMRequiresSMa` are added to facilitate the version checks for typical and arch-accelerated versions respectively. * These traits can be attached to any NVVM Op to enable the checks for the particular Op. (example shown below) * An attribute interface called named `TargetAttrVerifyInterface` is added to the GPU dialect which any target attribute seeking to perform target-verification on the module can implement. * The checks are performed by the `NVVMTargetAttr` (implementing the `TargetAttrVerifyInterface` interface) when called from the GPU module verifier where it walks through the module and performs the checks for Ops with the `NVVMRequiresSM` traits. * A few Ops in `NVVMOps.td` have been updated to serve as examples. Example Usage: ``` def NVVM_ReduxOp : NVVM_Op<"redux.sync"> {...} ----> def NVVM_ReduxOp : NVVM_Op<"redux.sync", [NVVMRequiresSM<80>]> {...} def NVVM_WgmmaFenceAlignedOp : NVVM_Op<"wgmma.fence.aligned"> {...} ----> def NVVM_WgmmaFenceAlignedOp : NVVM_Op<"wgmma.fence.aligned", [NVVMRequiresSMa<[90]>]> {...} ``` --------- Co-authored-by: Guray Ozen <guray.ozen@gmail.com>
Diffstat (limited to 'llvm/lib/CodeGen/StackMaps.cpp')
0 files changed, 0 insertions, 0 deletions