[Mlir-commits] [mlir] [MLIR][GEN] Add GEN dialect (PR #88734)
Victor Perez
llvmlistbot at llvm.org
Tue Apr 16 03:02:18 PDT 2024
================
@@ -0,0 +1,24 @@
+//===- GENTraits.cpp - GEN dialect traits ---------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/GEN/IR/GENTraits.h"
+
+#include "mlir/IR/Matchers.h"
+
+using namespace mlir;
+
+LogicalResult mlir::OpTrait::GEN::detail::verifyGEN3DNDRange(Operation *op) {
+ llvm::APInt value;
+ if (matchPattern(op->getOperand(0), m_ConstantInt(&value)) &&
+ !(/*value in [0, 3)*/ value.sge(0) && value.slt(3))) {
+ return op->emitOpError()
+ << "input dimension must be in the range [0, 3). Got "
+ << value.getSExtValue();
----------------
victor-eds wrote:
Perfect. Thanks! I removed the check itself.
https://github.com/llvm/llvm-project/pull/88734
More information about the Mlir-commits
mailing list