[Mlir-commits] [llvm] [mlir] [MLIR][NVVM] Add NVVMRequiresSM op trait (PR #126886)
Srinivasa Ravi
llvmlistbot at llvm.org
Fri Mar 14 08:31:56 PDT 2025
================
@@ -1793,6 +1793,22 @@ void GPUModuleOp::setTargets(ArrayRef<TargetAttrInterface> targets) {
targetsAttr = ArrayAttr::get(getContext(), targetsVector);
}
+LogicalResult GPUModuleOp::verify() {
+ auto targets = getOperation()->getAttrOfType<ArrayAttr>("targets");
+
+ if (!targets)
+ return success();
+
----------------
Wolfram70 wrote:
> What makes this invariant different from all the other invariants implemented in the verifier?
>From what I understand, this is an invariant since if the usage violates it, we will definitely run into errors further down the line during CodeGen. We could have an option to disable it during development to save some compile-time. Perhaps it could be renamed to something more appropriate to indicate that it should be used cautiously? Please let me know if I have misunderstood something or if my reasoning is incorrect.
https://github.com/llvm/llvm-project/pull/126886
More information about the Mlir-commits
mailing list