[Mlir-commits] [llvm] [mlir] [MLIR][NVVM] Add NVVMRequiresSM op trait (PR #126886)
Mehdi Amini
llvmlistbot at llvm.org
Fri Mar 14 06:45:16 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();
+
----------------
joker-eph wrote:
We can't: the IR verifier is absolute, there is no "conditional validity".
That's what made me a bit hesitant about this feature implemented in the verifier, an alternative would be to have a different pass doing this kind of check and run it before translation to LLVM.
https://github.com/llvm/llvm-project/pull/126886
More information about the Mlir-commits
mailing list