-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[mlir][gpu][target] Use promises to verify TargetAttrs IR correctness. #65787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This patch employs the updated promise mechanism to enforce Target Attribute IR constraints. Due to this patch, TargetAttributes implementations no longer have to be registered before executing translation to LLVM IR in cases where they are not needed, like when translating `gpu.binary` operations.
@llvm/pr-subscribers-mlir Changesdiff --git a/mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td b/mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td index f30f9d172b08ba9..5255286619e3bf2 100644 --- a/mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td +++ b/mlir/include/mlir/Dialect/GPU/IR/CompilationAttrInterfaces.td @@ -42,7 +42,15 @@ def GPUTargetAttrInterface : AttrInterface<"TargetAttrInterface"> { ]; }
+def GPUTargetArrayAttr : TypedArrayAttrBase<GPUTargetAttr, def GPUNonEmptyTargetArrayAttr :
}];
def GPUObjectArrayAttr : -#include "mlir/Target/LLVM/NVVM/Target.h" // Extension required for translating GPU offloading Ops.
|
This patch employs the updated promise mechanism to enforce Target Attribute IR constraints. Due to this patch, TargetAttributes implementations no longer have to be registered before executing translation to LLVM IR in cases where they are not needed, like when translating
gpu.binary
operations.