[Mlir-commits] [mlir] [mlir][llvm] Use zeroinitializer for TargetExtType (PR #66510)

Lukas Sommer llvmlistbot at llvm.org
Mon Sep 18 04:23:02 PDT 2023


================
@@ -2510,6 +2505,21 @@ Region *LLVMFuncOp::getCallableRegion() {
   return &getBody();
 }
 
+//===----------------------------------------------------------------------===//
+// ZeroOp.
+//===----------------------------------------------------------------------===//
+
+LogicalResult LLVM::ZeroOp::verify() {
+  if (auto targetExtType = dyn_cast<LLVMTargetExtType>(getType())) {
+    if (!targetExtType.hasProperty(LLVM::LLVMTargetExtType::HasZeroInit))
+      return emitOpError()
+             << "target extension type does not support zero-initializer";
+
+    return success();
+  }
----------------
sommerlukas wrote:

Done.

https://github.com/llvm/llvm-project/pull/66510


More information about the Mlir-commits mailing list