MLIR 24.0.0git
LLVMGeneralIntrinsicOps.cpp
Go to the documentation of this file.
1//===- LLVMGeneralIntrinsicOps.cpp - LLVM general intrinsics --------------===//
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 defines the ops of op partition `GeneralIntrinsic` of the LLVM
10// dialect.
11//
12//===----------------------------------------------------------------------===//
13
15
16#include "IR/LLVMOps.h"
17#include "mlir/IR/Builders.h"
19
20using namespace mlir;
21using namespace mlir::LLVM;
22
23//===----------------------------------------------------------------------===//
24// AssumeOp (intrinsic)
25//===----------------------------------------------------------------------===//
26
27void LLVM::AssumeOp::build(OpBuilder &builder, OperationState &state,
28 mlir::Value cond) {
29 return build(builder, state, cond, /*op_bundle_operands=*/{},
30 /*op_bundle_tags=*/ArrayAttr{});
31}
32
33void LLVM::AssumeOp::build(OpBuilder &builder, OperationState &state,
34 Value cond, llvm::StringRef tag, ValueRange args) {
35 return build(builder, state, cond, ArrayRef<ValueRange>(args),
36 builder.getStrArrayAttr(tag));
37}
38
39void LLVM::AssumeOp::build(OpBuilder &builder, OperationState &state,
40 Value cond, AssumeAlignTag, Value ptr, Value align) {
41 return build(builder, state, cond, "align", ValueRange{ptr, align});
42}
43
44void LLVM::AssumeOp::build(OpBuilder &builder, OperationState &state,
46 Value ptr2) {
47 return build(builder, state, cond, "separate_storage",
48 ValueRange{ptr1, ptr2});
49}
50
51LogicalResult LLVM::AssumeOp::verify() { return verifyOperandBundles(*this); }
52
53#define GET_OP_CLASSES
54#include "mlir/Dialect/LLVMIR/LLVMGeneralIntrinsicOps.cpp.inc"
ArrayAttr()
ArrayAttr getStrArrayAttr(ArrayRef< StringRef > values)
Definition Builders.cpp:315
This class helps build Operations.
Definition Builders.h:210
This class provides an abstraction over the different types of ranges over Values.
Definition ValueRange.h:392
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
LogicalResult verifyOperandBundles(OpType &op)
Verifies the operand bundles of op.
Definition LLVMOps.h:170
Include the generated interface declarations.
This represents an operation in an abstracted form, suitable for use with the builder APIs.