20 #include "mlir/Dialect/X86Vector/X86VectorInterfaces.cpp.inc"
22 #include "mlir/Dialect/X86Vector/X86VectorDialect.cpp.inc"
24 void x86vector::X86VectorDialect::initialize() {
27 #include "mlir/Dialect/X86Vector/X86Vector.cpp.inc"
35 return memRefDescriptor.
bufferPtr(rewriter, loc, typeConverter, type);
39 if (getSrc() && getConstantSrc())
40 return emitError(
"cannot use both src and constant_src");
43 return emitError(
"failed to verify that src and dst have same type");
45 if (getConstantSrc() && (getConstantSrc()->
getType() != getDst().
getType()))
47 "failed to verify that constant_src and dst have same type");
56 Adaptor adaptor(operands, *
this);
58 auto opType = adaptor.getA().getType();
60 if (adaptor.getSrc()) {
61 src = adaptor.getSrc();
62 }
else if (adaptor.getConstantSrc()) {
63 src = LLVM::ConstantOp::create(rewriter, loc, opType,
64 adaptor.getConstantSrcAttr());
67 src = LLVM::ConstantOp::create(rewriter, loc, opType, zeroAttr);
80 LLVM::ConstantOp::create(rewriter, getLoc(), rewriter.
getI8Type(), 0xff);
81 intrinsicOperands.push_back(scale);
83 return intrinsicOperands;
90 Adaptor adaptor(operands, *
this);
91 intrinsicOprnds.push_back(adaptor.getW());
93 Value bitcast_a = LLVM::BitcastOp::create(
98 intrinsicOprnds.push_back(bitcast_a);
99 Value bitcast_b = LLVM::BitcastOp::create(
104 intrinsicOprnds.push_back(bitcast_b);
106 return intrinsicOprnds;
112 Adaptor adaptor(operands, *
this);
114 typeConverter, rewriter)};
120 Adaptor adaptor(operands, *
this);
122 typeConverter, rewriter)};
128 Adaptor adaptor(operands, *
this);
130 typeConverter, rewriter)};
133 #define GET_OP_CLASSES
134 #include "mlir/Dialect/X86Vector/X86Vector.cpp.inc"
static ArrayRef< int64_t > getShape(Type type)
Returns the shape of the given type.
static Value getMemrefBuffPtr(Location loc, MemRefType type, Value buffer, const LLVMTypeConverter &typeConverter, RewriterBase &rewriter)
IntegerType getIntegerType(unsigned width)
TypedAttr getZeroAttr(Type type)
Conversion from types to the LLVM IR dialect.
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Helper class to produce LLVM dialect operations extracting or inserting elements of a MemRef descript...
Value bufferPtr(OpBuilder &builder, Location loc, const LLVMTypeConverter &converter, MemRefType type)
Builds IR for getting the start address of the buffer represented by this memref: memref....
This class coordinates the application of a rewrite on a set of IR, providing a way for clients to tr...
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Include the generated interface declarations.
Type getType(OpFoldResult ofr)
Returns the int type of the integer in ofr.
InFlightDiagnostic emitError(Location loc)
Utility method to emit an error message using this location.
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...
LogicalResult verify(Operation *op, bool verifyRecursively=true)
Perform (potentially expensive) checks of invariants, used to detect compiler bugs,...