MLIR  20.0.0git
X86VectorDialect.cpp
Go to the documentation of this file.
1 //===- X86VectorDialect.cpp - MLIR X86Vector ops implementation -----------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the X86Vector dialect and its operations.
10 //
11 //===----------------------------------------------------------------------===//
12 
15 #include "mlir/IR/Builders.h"
17 #include "mlir/IR/TypeUtilities.h"
19 
20 using namespace mlir;
21 
22 #include "mlir/Dialect/X86Vector/X86VectorDialect.cpp.inc"
23 
24 void x86vector::X86VectorDialect::initialize() {
25  addOperations<
26 #define GET_OP_LIST
27 #include "mlir/Dialect/X86Vector/X86Vector.cpp.inc"
28  >();
29 }
30 
31 LogicalResult x86vector::MaskCompressOp::verify() {
32  if (getSrc() && getConstantSrc())
33  return emitError("cannot use both src and constant_src");
34 
35  if (getSrc() && (getSrc().getType() != getDst().getType()))
36  return emitError("failed to verify that src and dst have same type");
37 
38  if (getConstantSrc() && (getConstantSrc()->getType() != getDst().getType()))
39  return emitError(
40  "failed to verify that constant_src and dst have same type");
41 
42  return success();
43 }
44 
45 #define GET_OP_CLASSES
46 #include "mlir/Dialect/X86Vector/X86Vector.cpp.inc"
Include the generated interface declarations.
Type getType(OpFoldResult ofr)
Returns the int type of the integer in ofr.
Definition: Utils.cpp:305
InFlightDiagnostic emitError(Location loc)
Utility method to emit an error message using this location.
LogicalResult verify(Operation *op, bool verifyRecursively=true)
Perform (potentially expensive) checks of invariants, used to detect compiler bugs,...
Definition: Verifier.cpp:426