| 1 | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
| 2 | |* *| |
| 3 | |* Op Declarations *| |
| 4 | |* *| |
| 5 | |* Automatically generated file, do not edit! *| |
| 6 | |* From: AsyncOps.td *| |
| 7 | |* *| |
| 8 | \*===----------------------------------------------------------------------===*/ |
| 9 | |
| 10 | namespace mlir::async { |
| 11 | |
| 12 | /// adds an async token or value to the group |
| 13 | /// The `async.add_to_group` adds an async token or value to the async group. |
| 14 | /// Returns the rank of the added element in the group. This rank is fixed |
| 15 | /// for the group lifetime. |
| 16 | /// |
| 17 | /// Example: |
| 18 | /// |
| 19 | /// ```mlir |
| 20 | /// %0 = async.create_group %size : !async.group |
| 21 | /// %1 = ... : !async.token |
| 22 | /// %2 = async.add_to_group %1, %0 : !async.token |
| 23 | /// ``` |
| 24 | class AddToGroupOp; |
| 25 | |
| 26 | } // namespace mlir::async |
| 27 | namespace mlir::async { |
| 28 | |
| 29 | /// waits for the all async tokens or values in the group to become ready |
| 30 | /// The `async.await_all` operation waits until all the tokens or values in the |
| 31 | /// group become ready. |
| 32 | /// |
| 33 | /// Example: |
| 34 | /// |
| 35 | /// ```mlir |
| 36 | /// %0 = async.create_group %size : !async.group |
| 37 | /// |
| 38 | /// %1 = ... : !async.token |
| 39 | /// %2 = async.add_to_group %1, %0 : !async.token |
| 40 | /// |
| 41 | /// %3 = ... : !async.token |
| 42 | /// %4 = async.add_to_group %2, %0 : !async.token |
| 43 | /// |
| 44 | /// async.await_all %0 |
| 45 | /// ``` |
| 46 | class AwaitAllOp; |
| 47 | |
| 48 | } // namespace mlir::async |
| 49 | namespace mlir::async { |
| 50 | |
| 51 | /// waits for the argument to become ready |
| 52 | /// The `async.await` operation waits until the argument becomes ready, and for |
| 53 | /// the `async.value` arguments it unwraps the underlying value |
| 54 | /// |
| 55 | /// Example: |
| 56 | /// |
| 57 | /// ```mlir |
| 58 | /// %0 = ... : !async.token |
| 59 | /// async.await %0 : !async.token |
| 60 | /// |
| 61 | /// %1 = ... : !async.value<f32> |
| 62 | /// %2 = async.await %1 : !async.value<f32> |
| 63 | /// ``` |
| 64 | class AwaitOp; |
| 65 | |
| 66 | } // namespace mlir::async |
| 67 | namespace mlir::async { |
| 68 | |
| 69 | /// async call operation |
| 70 | /// The `async.call` operation represents a direct call to an async function |
| 71 | /// that is within the same symbol scope as the call. The operands and result |
| 72 | /// types of the call must match the specified async function type. The callee |
| 73 | /// is encoded as a symbol reference attribute named "callee". |
| 74 | /// |
| 75 | /// Example: |
| 76 | /// |
| 77 | /// ```mlir |
| 78 | /// %2 = async.call @my_add(%0, %1) : (f32, f32) -> !async.value<f32> |
| 79 | /// ``` |
| 80 | class CallOp; |
| 81 | |
| 82 | } // namespace mlir::async |
| 83 | namespace mlir::async { |
| 84 | |
| 85 | /// returns a handle to the coroutine |
| 86 | /// The `async.coro.begin` allocates a coroutine frame and returns a handle to |
| 87 | /// the coroutine. |
| 88 | class CoroBeginOp; |
| 89 | |
| 90 | } // namespace mlir::async |
| 91 | namespace mlir::async { |
| 92 | |
| 93 | /// marks the end of the coroutine in the suspend block |
| 94 | /// The `async.coro.end` marks the point where a coroutine needs to return |
| 95 | /// control back to the caller if it is not an initial invocation of the |
| 96 | /// coroutine. In the start part of the coroutine it is no-op. |
| 97 | class CoroEndOp; |
| 98 | |
| 99 | } // namespace mlir::async |
| 100 | namespace mlir::async { |
| 101 | |
| 102 | /// deallocates the coroutine frame |
| 103 | /// The `async.coro.free` deallocates the coroutine frame created by the |
| 104 | /// async.coro.begin operation. |
| 105 | class CoroFreeOp; |
| 106 | |
| 107 | } // namespace mlir::async |
| 108 | namespace mlir::async { |
| 109 | |
| 110 | /// returns a switched-resume coroutine identifier |
| 111 | /// The `async.coro.id` returns a switched-resume coroutine identifier. |
| 112 | class CoroIdOp; |
| 113 | |
| 114 | } // namespace mlir::async |
| 115 | namespace mlir::async { |
| 116 | |
| 117 | /// saves the coroutine state |
| 118 | /// The `async.coro.saves` saves the coroutine state. |
| 119 | class CoroSaveOp; |
| 120 | |
| 121 | } // namespace mlir::async |
| 122 | namespace mlir::async { |
| 123 | |
| 124 | /// suspends the coroutine |
| 125 | /// The `async.coro.suspend` suspends the coroutine and transfers control to the |
| 126 | /// `suspend` successor. If suspended coroutine later resumed it will transfer |
| 127 | /// control to the `resume` successor. If it is destroyed it will transfer |
| 128 | /// control to the the `cleanup` successor. |
| 129 | /// |
| 130 | /// In switched-resume lowering coroutine can be already in resumed state when |
| 131 | /// suspend operation is called, in this case control will be transferred to the |
| 132 | /// `resume` successor skipping the `suspend` successor. |
| 133 | class CoroSuspendOp; |
| 134 | |
| 135 | } // namespace mlir::async |
| 136 | namespace mlir::async { |
| 137 | |
| 138 | /// creates an empty async group |
| 139 | /// The `async.create_group` allocates an empty async group. Async tokens or |
| 140 | /// values can be added to this group later. The size of the group must be |
| 141 | /// specified at construction time, and `await_all` operation will first |
| 142 | /// wait until the number of added tokens or values reaches the group size. |
| 143 | /// |
| 144 | /// Example: |
| 145 | /// |
| 146 | /// ```mlir |
| 147 | /// %size = ... : index |
| 148 | /// %group = async.create_group %size : !async.group |
| 149 | /// ... |
| 150 | /// async.await_all %group |
| 151 | /// ``` |
| 152 | class CreateGroupOp; |
| 153 | |
| 154 | } // namespace mlir::async |
| 155 | namespace mlir::async { |
| 156 | |
| 157 | /// Asynchronous execute operation |
| 158 | /// The `body` region attached to the `async.execute` operation semantically |
| 159 | /// can be executed concurrently with the successor operation. In the followup |
| 160 | /// example "compute0" can be executed concurrently with "compute1". |
| 161 | /// |
| 162 | /// The actual concurrency semantics depends on the dialect lowering to the |
| 163 | /// executable format. Fully sequential execution ("compute0" completes before |
| 164 | /// "compute1" starts) is a completely legal execution. |
| 165 | /// |
| 166 | /// Because concurrent execution is not guaranteed, it is illegal to create an |
| 167 | /// implicit dependency from "compute1" to "compute0" (e.g. via shared global |
| 168 | /// state). All dependencies must be made explicit with async execute arguments |
| 169 | /// (`async.token` or `async.value`). |
| 170 | /// |
| 171 | /// `async.execute` operation takes `async.token` dependencies and `async.value` |
| 172 | /// operands separately, and starts execution of the attached body region only |
| 173 | /// when all tokens and values become ready. |
| 174 | /// |
| 175 | /// Example: |
| 176 | /// |
| 177 | /// ```mlir |
| 178 | /// %dependency = ... : !async.token |
| 179 | /// %value = ... : !async.value<f32> |
| 180 | /// |
| 181 | /// %token, %results = |
| 182 | /// async.execute [%dependency](%value as %unwrapped: !async.value<f32>) |
| 183 | /// -> !async.value<!some.type> |
| 184 | /// { |
| 185 | /// %0 = "compute0"(%unwrapped): (f32) -> !some.type |
| 186 | /// async.yield %0 : !some.type |
| 187 | /// } |
| 188 | /// |
| 189 | /// %1 = "compute1"(...) : !some.type |
| 190 | /// ``` |
| 191 | /// |
| 192 | /// In the example above asynchronous execution starts only after dependency |
| 193 | /// token and value argument become ready. Unwrapped value passed to the |
| 194 | /// attached body region as an %unwrapped value of f32 type. |
| 195 | class ExecuteOp; |
| 196 | |
| 197 | } // namespace mlir::async |
| 198 | namespace mlir::async { |
| 199 | |
| 200 | /// async function operation |
| 201 | /// An async function is like a normal function, but supports non-blocking |
| 202 | /// await. Internally, async function is lowered to the LLVM coroutinue with |
| 203 | /// async runtime intrinsic. It can return an async token and/or async values. |
| 204 | /// The token represents the execution state of async function and can be used |
| 205 | /// when users want to express dependencies on some side effects, e.g., |
| 206 | /// the token becomes available once every thing in the func body is executed. |
| 207 | /// |
| 208 | /// Example: |
| 209 | /// |
| 210 | /// ```mlir |
| 211 | /// // Async function can't return void, it always must be some async thing. |
| 212 | /// async.func @async.0() -> !async.token { |
| 213 | /// return |
| 214 | /// } |
| 215 | /// |
| 216 | /// // Function returns only async value. |
| 217 | /// async.func @async.1() -> !async.value<i32> { |
| 218 | /// %0 = arith.constant 42 : i32 |
| 219 | /// return %0 : i32 |
| 220 | /// } |
| 221 | /// |
| 222 | /// // Implicit token can be added to return types. |
| 223 | /// async.func @async.2() -> !async.token, !async.value<i32> { |
| 224 | /// %0 = arith.constant 42 : i32 |
| 225 | /// return %0 : i32 |
| 226 | /// } |
| 227 | /// ``` |
| 228 | class FuncOp; |
| 229 | |
| 230 | } // namespace mlir::async |
| 231 | namespace mlir::async { |
| 232 | |
| 233 | /// Async function return operation |
| 234 | /// The `async.return` is a special terminator operation for Async function. |
| 235 | /// |
| 236 | /// Example: |
| 237 | /// |
| 238 | /// ```mlir |
| 239 | /// async.func @foo() : !async.token { |
| 240 | /// return |
| 241 | /// } |
| 242 | /// ``` |
| 243 | class ReturnOp; |
| 244 | |
| 245 | } // namespace mlir::async |
| 246 | namespace mlir::async { |
| 247 | |
| 248 | /// adds a reference to async value |
| 249 | /// The `async.runtime.add_ref` operation adds a reference(s) to async value |
| 250 | /// (token, value or group). |
| 251 | class RuntimeAddRefOp; |
| 252 | |
| 253 | } // namespace mlir::async |
| 254 | namespace mlir::async { |
| 255 | |
| 256 | /// adds an async token or value to the group |
| 257 | /// The `async.runtime.add_to_group` adds an async token or value to the async |
| 258 | /// group. Returns the rank of the added element in the group. |
| 259 | class RuntimeAddToGroupOp; |
| 260 | |
| 261 | } // namespace mlir::async |
| 262 | namespace mlir::async { |
| 263 | |
| 264 | /// awaits the async operand and resumes the coroutine |
| 265 | /// The `async.runtime.await_and_resume` operation awaits for the operand to |
| 266 | /// become available or error and resumes the coroutine on a thread managed by |
| 267 | /// the runtime. |
| 268 | class RuntimeAwaitAndResumeOp; |
| 269 | |
| 270 | } // namespace mlir::async |
| 271 | namespace mlir::async { |
| 272 | |
| 273 | /// blocks the caller thread until the operand becomes available |
| 274 | /// The `async.runtime.await` operation blocks the caller thread until the |
| 275 | /// operand becomes available or error. |
| 276 | class RuntimeAwaitOp; |
| 277 | |
| 278 | } // namespace mlir::async |
| 279 | namespace mlir::async { |
| 280 | |
| 281 | /// creates an async runtime group |
| 282 | /// The `async.runtime.create_group` operation creates an async dialect group |
| 283 | /// of the given size. Group created in the empty state. |
| 284 | class RuntimeCreateGroupOp; |
| 285 | |
| 286 | } // namespace mlir::async |
| 287 | namespace mlir::async { |
| 288 | |
| 289 | /// creates an async runtime token or value |
| 290 | /// The `async.runtime.create` operation creates an async dialect token or |
| 291 | /// value. Tokens and values are created in the non-ready state. |
| 292 | class RuntimeCreateOp; |
| 293 | |
| 294 | } // namespace mlir::async |
| 295 | namespace mlir::async { |
| 296 | |
| 297 | /// drops a reference to async value |
| 298 | /// The `async.runtime.drop_ref` operation drops a reference(s) to async value |
| 299 | /// (token, value or group). |
| 300 | class RuntimeDropRefOp; |
| 301 | |
| 302 | } // namespace mlir::async |
| 303 | namespace mlir::async { |
| 304 | |
| 305 | /// returns true if token, value or group is in error state |
| 306 | /// The `async.runtime.is_error` operation returns true if the token, value or |
| 307 | /// group (any of the async runtime values) is in the error state. It is the |
| 308 | /// caller responsibility to check error state after the call to `await` or |
| 309 | /// resuming after `await_and_resume`. |
| 310 | class RuntimeIsErrorOp; |
| 311 | |
| 312 | } // namespace mlir::async |
| 313 | namespace mlir::async { |
| 314 | |
| 315 | /// loads the value from the runtime async.value |
| 316 | /// The `async.runtime.load` operation loads the value from the runtime |
| 317 | /// async.value storage. |
| 318 | class RuntimeLoadOp; |
| 319 | |
| 320 | } // namespace mlir::async |
| 321 | namespace mlir::async { |
| 322 | |
| 323 | /// gets the number of threads in the threadpool from the runtime |
| 324 | /// The `async.runtime.num_worker_threads` operation gets the number of threads |
| 325 | /// in the threadpool from the runtime. |
| 326 | class RuntimeNumWorkerThreadsOp; |
| 327 | |
| 328 | } // namespace mlir::async |
| 329 | namespace mlir::async { |
| 330 | |
| 331 | /// resumes the coroutine on a thread managed by the runtime |
| 332 | /// The `async.runtime.resume` operation resumes the coroutine on a thread |
| 333 | /// managed by the runtime. |
| 334 | class RuntimeResumeOp; |
| 335 | |
| 336 | } // namespace mlir::async |
| 337 | namespace mlir::async { |
| 338 | |
| 339 | /// switches token or value to available state |
| 340 | /// The `async.runtime.set_available` operation switches async token or value |
| 341 | /// state to available. |
| 342 | class RuntimeSetAvailableOp; |
| 343 | |
| 344 | } // namespace mlir::async |
| 345 | namespace mlir::async { |
| 346 | |
| 347 | /// switches token or value to error state |
| 348 | /// The `async.runtime.set_error` operation switches async token or value |
| 349 | /// state to error. |
| 350 | class RuntimeSetErrorOp; |
| 351 | |
| 352 | } // namespace mlir::async |
| 353 | namespace mlir::async { |
| 354 | |
| 355 | /// stores the value into the runtime async.value |
| 356 | /// The `async.runtime.store` operation stores the value into the runtime |
| 357 | /// async.value storage. |
| 358 | class RuntimeStoreOp; |
| 359 | |
| 360 | } // namespace mlir::async |
| 361 | namespace mlir::async { |
| 362 | |
| 363 | /// terminator for Async execute operation |
| 364 | /// The `async.yield` is a special terminator operation for the block inside |
| 365 | /// `async.execute` operation. |
| 366 | class YieldOp; |
| 367 | |
| 368 | } // namespace mlir::async |
| 369 | #ifdef GET_OP_CLASSES |
| 370 | #undef GET_OP_CLASSES |
| 371 | |
| 372 | #include "mlir/Bytecode/BytecodeOpInterface.h" |
| 373 | #include "mlir/Dialect/Async/IR/AsyncTypes.h" |
| 374 | #include "mlir/IR/BuiltinAttributes.h" |
| 375 | #include "mlir/IR/BuiltinTypes.h" |
| 376 | #include "mlir/IR/OpDefinition.h" |
| 377 | #include "mlir/IR/OpImplementation.h" |
| 378 | #include "mlir/IR/SymbolTable.h" |
| 379 | #include "mlir/IR/Types.h" |
| 380 | #include "mlir/Interfaces/CallInterfaces.h" |
| 381 | #include "mlir/Interfaces/ControlFlowInterfaces.h" |
| 382 | #include "mlir/Interfaces/FunctionInterfaces.h" |
| 383 | #include "mlir/Interfaces/InferTypeOpInterface.h" |
| 384 | #include "mlir/Interfaces/SideEffectInterfaces.h" |
| 385 | |
| 386 | namespace mlir::async { |
| 387 | |
| 388 | |
| 389 | //===----------------------------------------------------------------------===// |
| 390 | // ::mlir::async::AddToGroupOp declarations |
| 391 | //===----------------------------------------------------------------------===// |
| 392 | |
| 393 | namespace detail { |
| 394 | |
| 395 | class AddToGroupOpGenericAdaptorBase { |
| 396 | public: |
| 397 | using Properties = ::mlir::EmptyProperties; |
| 398 | protected: |
| 399 | ::mlir::DictionaryAttr odsAttrs; |
| 400 | ::std::optional<::mlir::OperationName> odsOpName; |
| 401 | Properties properties; |
| 402 | ::mlir::RegionRange odsRegions; |
| 403 | public: |
| 404 | AddToGroupOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 405 | odsOpName.emplace(args: "async.add_to_group" , args: odsAttrs.getContext()); |
| 406 | } |
| 407 | |
| 408 | AddToGroupOpGenericAdaptorBase(AddToGroupOp op); |
| 409 | |
| 410 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 411 | return {index, 1}; |
| 412 | } |
| 413 | |
| 414 | const Properties &getProperties() { |
| 415 | return properties; |
| 416 | } |
| 417 | |
| 418 | ::mlir::DictionaryAttr getAttributes() { |
| 419 | return odsAttrs; |
| 420 | } |
| 421 | |
| 422 | }; |
| 423 | |
| 424 | } // namespace detail |
| 425 | template <typename RangeT> |
| 426 | class AddToGroupOpGenericAdaptor : public detail::AddToGroupOpGenericAdaptorBase { |
| 427 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 428 | using Base = detail::AddToGroupOpGenericAdaptorBase; |
| 429 | static constexpr int odsIndex_operand = 0; |
| 430 | static constexpr int odsIndex_group = 1; |
| 431 | public: |
| 432 | AddToGroupOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 433 | |
| 434 | AddToGroupOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : AddToGroupOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 435 | |
| 436 | AddToGroupOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : AddToGroupOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 437 | |
| 438 | AddToGroupOpGenericAdaptor(RangeT values, const AddToGroupOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 439 | |
| 440 | template <typename LateInst = AddToGroupOp, typename = std::enable_if_t<std::is_same_v<LateInst, AddToGroupOp>>> |
| 441 | AddToGroupOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 442 | |
| 443 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 444 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 445 | } |
| 446 | |
| 447 | RangeT getODSOperands(unsigned index) { |
| 448 | auto valueRange = getODSOperandIndexAndLength(index); |
| 449 | return {std::next(odsOperands.begin(), valueRange.first), |
| 450 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 451 | } |
| 452 | |
| 453 | ValueT getOperand() { |
| 454 | return (*getODSOperands(index: 0).begin()); |
| 455 | } |
| 456 | |
| 457 | ValueT getGroup() { |
| 458 | return (*getODSOperands(index: 1).begin()); |
| 459 | } |
| 460 | |
| 461 | RangeT getOperands() { |
| 462 | return odsOperands; |
| 463 | } |
| 464 | |
| 465 | private: |
| 466 | RangeT odsOperands; |
| 467 | }; |
| 468 | class AddToGroupOpAdaptor : public AddToGroupOpGenericAdaptor<::mlir::ValueRange> { |
| 469 | public: |
| 470 | using AddToGroupOpGenericAdaptor::AddToGroupOpGenericAdaptor; |
| 471 | AddToGroupOpAdaptor(AddToGroupOp op); |
| 472 | |
| 473 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 474 | }; |
| 475 | class AddToGroupOp : public ::mlir::Op<AddToGroupOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::IndexType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::InferTypeOpInterface::Trait> { |
| 476 | public: |
| 477 | using Op::Op; |
| 478 | using Op::print; |
| 479 | using Adaptor = AddToGroupOpAdaptor; |
| 480 | template <typename RangeT> |
| 481 | using GenericAdaptor = AddToGroupOpGenericAdaptor<RangeT>; |
| 482 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 483 | static constexpr int odsIndex_operand = 0; |
| 484 | static constexpr int odsIndex_group = 1; |
| 485 | static constexpr int odsIndex_rank = 0; |
| 486 | using Properties = FoldAdaptor::Properties; |
| 487 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 488 | return {}; |
| 489 | } |
| 490 | |
| 491 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 492 | return ::llvm::StringLiteral("async.add_to_group" ); |
| 493 | } |
| 494 | |
| 495 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 496 | return {index, 1}; |
| 497 | } |
| 498 | |
| 499 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 500 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 501 | return getOperation()->getOperands().slice(n: start, m: length); |
| 502 | } |
| 503 | |
| 504 | ::mlir::TypedValue<::mlir::Type> getOperand() { |
| 505 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 506 | } |
| 507 | |
| 508 | ::mlir::TypedValue<::mlir::async::GroupType> getGroup() { |
| 509 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::GroupType>>(Val: *getODSOperands(index: 1).begin()); |
| 510 | } |
| 511 | |
| 512 | ::mlir::OpOperand &getOperandMutable() { |
| 513 | auto range = getODSOperandIndexAndLength(index: 0); |
| 514 | return getOperation()->getOpOperand(idx: range.first); |
| 515 | } |
| 516 | |
| 517 | ::mlir::OpOperand &getGroupMutable() { |
| 518 | auto range = getODSOperandIndexAndLength(index: 1); |
| 519 | return getOperation()->getOpOperand(idx: range.first); |
| 520 | } |
| 521 | |
| 522 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 523 | return {index, 1}; |
| 524 | } |
| 525 | |
| 526 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 527 | auto valueRange = getODSResultIndexAndLength(index); |
| 528 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 529 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 530 | } |
| 531 | |
| 532 | ::mlir::TypedValue<::mlir::IndexType> getRank() { |
| 533 | return ::llvm::cast<::mlir::TypedValue<::mlir::IndexType>>(Val: *getODSResults(index: 0).begin()); |
| 534 | } |
| 535 | |
| 536 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 537 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 538 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 539 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 540 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 541 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 542 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 543 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type rank, ::mlir::Value operand, ::mlir::Value group); |
| 544 | static AddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type rank, ::mlir::Value operand, ::mlir::Value group); |
| 545 | static AddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type rank, ::mlir::Value operand, ::mlir::Value group); |
| 546 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand, ::mlir::Value group); |
| 547 | static AddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand, ::mlir::Value group); |
| 548 | static AddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand, ::mlir::Value group); |
| 549 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value group); |
| 550 | static AddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value group); |
| 551 | static AddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value group); |
| 552 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 553 | static AddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 554 | static AddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 555 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 556 | static AddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 557 | static AddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 558 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 559 | static AddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 560 | static AddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 561 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 562 | static AddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 563 | static AddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 564 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 565 | ::llvm::LogicalResult verifyInvariants(); |
| 566 | static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); |
| 567 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 568 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 569 | public: |
| 570 | }; |
| 571 | |
| 572 | } // namespace mlir::async |
| 573 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::AddToGroupOp) |
| 574 | |
| 575 | namespace mlir::async { |
| 576 | |
| 577 | |
| 578 | //===----------------------------------------------------------------------===// |
| 579 | // ::mlir::async::AwaitAllOp declarations |
| 580 | //===----------------------------------------------------------------------===// |
| 581 | |
| 582 | namespace detail { |
| 583 | |
| 584 | class AwaitAllOpGenericAdaptorBase { |
| 585 | public: |
| 586 | using Properties = ::mlir::EmptyProperties; |
| 587 | protected: |
| 588 | ::mlir::DictionaryAttr odsAttrs; |
| 589 | ::std::optional<::mlir::OperationName> odsOpName; |
| 590 | Properties properties; |
| 591 | ::mlir::RegionRange odsRegions; |
| 592 | public: |
| 593 | AwaitAllOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 594 | odsOpName.emplace(args: "async.await_all" , args: odsAttrs.getContext()); |
| 595 | } |
| 596 | |
| 597 | AwaitAllOpGenericAdaptorBase(AwaitAllOp op); |
| 598 | |
| 599 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 600 | return {index, 1}; |
| 601 | } |
| 602 | |
| 603 | const Properties &getProperties() { |
| 604 | return properties; |
| 605 | } |
| 606 | |
| 607 | ::mlir::DictionaryAttr getAttributes() { |
| 608 | return odsAttrs; |
| 609 | } |
| 610 | |
| 611 | }; |
| 612 | |
| 613 | } // namespace detail |
| 614 | template <typename RangeT> |
| 615 | class AwaitAllOpGenericAdaptor : public detail::AwaitAllOpGenericAdaptorBase { |
| 616 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 617 | using Base = detail::AwaitAllOpGenericAdaptorBase; |
| 618 | static constexpr int odsIndex_operand = 0; |
| 619 | public: |
| 620 | AwaitAllOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 621 | |
| 622 | AwaitAllOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : AwaitAllOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 623 | |
| 624 | AwaitAllOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : AwaitAllOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 625 | |
| 626 | AwaitAllOpGenericAdaptor(RangeT values, const AwaitAllOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 627 | |
| 628 | template <typename LateInst = AwaitAllOp, typename = std::enable_if_t<std::is_same_v<LateInst, AwaitAllOp>>> |
| 629 | AwaitAllOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 630 | |
| 631 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 632 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 633 | } |
| 634 | |
| 635 | RangeT getODSOperands(unsigned index) { |
| 636 | auto valueRange = getODSOperandIndexAndLength(index); |
| 637 | return {std::next(odsOperands.begin(), valueRange.first), |
| 638 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 639 | } |
| 640 | |
| 641 | ValueT getOperand() { |
| 642 | return (*getODSOperands(index: 0).begin()); |
| 643 | } |
| 644 | |
| 645 | RangeT getOperands() { |
| 646 | return odsOperands; |
| 647 | } |
| 648 | |
| 649 | private: |
| 650 | RangeT odsOperands; |
| 651 | }; |
| 652 | class AwaitAllOpAdaptor : public AwaitAllOpGenericAdaptor<::mlir::ValueRange> { |
| 653 | public: |
| 654 | using AwaitAllOpGenericAdaptor::AwaitAllOpGenericAdaptor; |
| 655 | AwaitAllOpAdaptor(AwaitAllOp op); |
| 656 | |
| 657 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 658 | }; |
| 659 | class AwaitAllOp : public ::mlir::Op<AwaitAllOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants> { |
| 660 | public: |
| 661 | using Op::Op; |
| 662 | using Op::print; |
| 663 | using Adaptor = AwaitAllOpAdaptor; |
| 664 | template <typename RangeT> |
| 665 | using GenericAdaptor = AwaitAllOpGenericAdaptor<RangeT>; |
| 666 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 667 | static constexpr int odsIndex_operand = 0; |
| 668 | using Properties = FoldAdaptor::Properties; |
| 669 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 670 | return {}; |
| 671 | } |
| 672 | |
| 673 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 674 | return ::llvm::StringLiteral("async.await_all" ); |
| 675 | } |
| 676 | |
| 677 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 678 | return {index, 1}; |
| 679 | } |
| 680 | |
| 681 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 682 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 683 | return getOperation()->getOperands().slice(n: start, m: length); |
| 684 | } |
| 685 | |
| 686 | ::mlir::TypedValue<::mlir::async::GroupType> getOperand() { |
| 687 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::GroupType>>(Val: *getODSOperands(index: 0).begin()); |
| 688 | } |
| 689 | |
| 690 | ::mlir::OpOperand &getOperandMutable() { |
| 691 | auto range = getODSOperandIndexAndLength(index: 0); |
| 692 | return getOperation()->getOpOperand(idx: range.first); |
| 693 | } |
| 694 | |
| 695 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 696 | return {index, 1}; |
| 697 | } |
| 698 | |
| 699 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 700 | auto valueRange = getODSResultIndexAndLength(index); |
| 701 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 702 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 703 | } |
| 704 | |
| 705 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 706 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 707 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 708 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 709 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 710 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 711 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 712 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand); |
| 713 | static AwaitAllOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand); |
| 714 | static AwaitAllOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand); |
| 715 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 716 | static AwaitAllOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 717 | static AwaitAllOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 718 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 719 | static AwaitAllOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 720 | static AwaitAllOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 721 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 722 | static AwaitAllOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 723 | static AwaitAllOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 724 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 725 | ::llvm::LogicalResult verifyInvariants(); |
| 726 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 727 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 728 | public: |
| 729 | }; |
| 730 | |
| 731 | } // namespace mlir::async |
| 732 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::AwaitAllOp) |
| 733 | |
| 734 | namespace mlir::async { |
| 735 | |
| 736 | |
| 737 | //===----------------------------------------------------------------------===// |
| 738 | // ::mlir::async::AwaitOp declarations |
| 739 | //===----------------------------------------------------------------------===// |
| 740 | |
| 741 | namespace detail { |
| 742 | |
| 743 | class AwaitOpGenericAdaptorBase { |
| 744 | public: |
| 745 | using Properties = ::mlir::EmptyProperties; |
| 746 | protected: |
| 747 | ::mlir::DictionaryAttr odsAttrs; |
| 748 | ::std::optional<::mlir::OperationName> odsOpName; |
| 749 | Properties properties; |
| 750 | ::mlir::RegionRange odsRegions; |
| 751 | public: |
| 752 | AwaitOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 753 | odsOpName.emplace(args: "async.await" , args: odsAttrs.getContext()); |
| 754 | } |
| 755 | |
| 756 | AwaitOpGenericAdaptorBase(AwaitOp op); |
| 757 | |
| 758 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 759 | return {index, 1}; |
| 760 | } |
| 761 | |
| 762 | const Properties &getProperties() { |
| 763 | return properties; |
| 764 | } |
| 765 | |
| 766 | ::mlir::DictionaryAttr getAttributes() { |
| 767 | return odsAttrs; |
| 768 | } |
| 769 | |
| 770 | }; |
| 771 | |
| 772 | } // namespace detail |
| 773 | template <typename RangeT> |
| 774 | class AwaitOpGenericAdaptor : public detail::AwaitOpGenericAdaptorBase { |
| 775 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 776 | using Base = detail::AwaitOpGenericAdaptorBase; |
| 777 | static constexpr int odsIndex_operand = 0; |
| 778 | public: |
| 779 | AwaitOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 780 | |
| 781 | AwaitOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : AwaitOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 782 | |
| 783 | AwaitOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : AwaitOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 784 | |
| 785 | AwaitOpGenericAdaptor(RangeT values, const AwaitOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 786 | |
| 787 | template <typename LateInst = AwaitOp, typename = std::enable_if_t<std::is_same_v<LateInst, AwaitOp>>> |
| 788 | AwaitOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 789 | |
| 790 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 791 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 792 | } |
| 793 | |
| 794 | RangeT getODSOperands(unsigned index) { |
| 795 | auto valueRange = getODSOperandIndexAndLength(index); |
| 796 | return {std::next(odsOperands.begin(), valueRange.first), |
| 797 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 798 | } |
| 799 | |
| 800 | ValueT getOperand() { |
| 801 | return (*getODSOperands(index: 0).begin()); |
| 802 | } |
| 803 | |
| 804 | RangeT getOperands() { |
| 805 | return odsOperands; |
| 806 | } |
| 807 | |
| 808 | private: |
| 809 | RangeT odsOperands; |
| 810 | }; |
| 811 | class AwaitOpAdaptor : public AwaitOpGenericAdaptor<::mlir::ValueRange> { |
| 812 | public: |
| 813 | using AwaitOpGenericAdaptor::AwaitOpGenericAdaptor; |
| 814 | AwaitOpAdaptor(AwaitOp op); |
| 815 | |
| 816 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 817 | }; |
| 818 | class AwaitOp : public ::mlir::Op<AwaitOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants> { |
| 819 | public: |
| 820 | using Op::Op; |
| 821 | using Op::print; |
| 822 | using Adaptor = AwaitOpAdaptor; |
| 823 | template <typename RangeT> |
| 824 | using GenericAdaptor = AwaitOpGenericAdaptor<RangeT>; |
| 825 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 826 | static constexpr int odsIndex_operand = 0; |
| 827 | static constexpr int odsIndex_result = 0; |
| 828 | using Properties = FoldAdaptor::Properties; |
| 829 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 830 | return {}; |
| 831 | } |
| 832 | |
| 833 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 834 | return ::llvm::StringLiteral("async.await" ); |
| 835 | } |
| 836 | |
| 837 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 838 | return {index, 1}; |
| 839 | } |
| 840 | |
| 841 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 842 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 843 | return getOperation()->getOperands().slice(n: start, m: length); |
| 844 | } |
| 845 | |
| 846 | ::mlir::TypedValue<::mlir::Type> getOperand() { |
| 847 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 848 | } |
| 849 | |
| 850 | ::mlir::OpOperand &getOperandMutable() { |
| 851 | auto range = getODSOperandIndexAndLength(index: 0); |
| 852 | return getOperation()->getOpOperand(idx: range.first); |
| 853 | } |
| 854 | |
| 855 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index); |
| 856 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 857 | auto valueRange = getODSResultIndexAndLength(index); |
| 858 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 859 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 860 | } |
| 861 | |
| 862 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 863 | auto results = getODSResults(index: 0); |
| 864 | return results.empty() ? ::mlir::TypedValue<::mlir::Type>() : ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *results.begin()); |
| 865 | } |
| 866 | |
| 867 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 868 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 869 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 870 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 871 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 872 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 873 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 874 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value operand, ArrayRef<NamedAttribute> attrs = {}); |
| 875 | static AwaitOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value operand, ArrayRef<NamedAttribute> attrs = {}); |
| 876 | static AwaitOp create(::mlir::ImplicitLocOpBuilder &builder, Value operand, ArrayRef<NamedAttribute> attrs = {}); |
| 877 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 878 | ::llvm::LogicalResult verifyInvariants(); |
| 879 | ::llvm::LogicalResult verify(); |
| 880 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 881 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 882 | public: |
| 883 | std::optional<Type> getResultType() { |
| 884 | if (getResultTypes().empty()) return std::nullopt; |
| 885 | return getResultTypes()[0]; |
| 886 | } |
| 887 | }; |
| 888 | |
| 889 | } // namespace mlir::async |
| 890 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::AwaitOp) |
| 891 | |
| 892 | namespace mlir::async { |
| 893 | |
| 894 | |
| 895 | //===----------------------------------------------------------------------===// |
| 896 | // ::mlir::async::CallOp declarations |
| 897 | //===----------------------------------------------------------------------===// |
| 898 | |
| 899 | namespace detail { |
| 900 | |
| 901 | class CallOpGenericAdaptorBase { |
| 902 | public: |
| 903 | struct Properties { |
| 904 | using arg_attrsTy = ::mlir::ArrayAttr; |
| 905 | arg_attrsTy arg_attrs; |
| 906 | |
| 907 | auto getArgAttrs() const { |
| 908 | auto &propStorage = this->arg_attrs; |
| 909 | return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(Val: propStorage); |
| 910 | } |
| 911 | void setArgAttrs(const ::mlir::ArrayAttr &propValue) { |
| 912 | this->arg_attrs = propValue; |
| 913 | } |
| 914 | using calleeTy = ::mlir::FlatSymbolRefAttr; |
| 915 | calleeTy callee; |
| 916 | |
| 917 | auto getCallee() const { |
| 918 | auto &propStorage = this->callee; |
| 919 | return ::llvm::cast<::mlir::FlatSymbolRefAttr>(Val: propStorage); |
| 920 | } |
| 921 | void setCallee(const ::mlir::FlatSymbolRefAttr &propValue) { |
| 922 | this->callee = propValue; |
| 923 | } |
| 924 | using res_attrsTy = ::mlir::ArrayAttr; |
| 925 | res_attrsTy res_attrs; |
| 926 | |
| 927 | auto getResAttrs() const { |
| 928 | auto &propStorage = this->res_attrs; |
| 929 | return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(Val: propStorage); |
| 930 | } |
| 931 | void setResAttrs(const ::mlir::ArrayAttr &propValue) { |
| 932 | this->res_attrs = propValue; |
| 933 | } |
| 934 | bool operator==(const Properties &rhs) const { |
| 935 | return |
| 936 | rhs.arg_attrs == this->arg_attrs && |
| 937 | rhs.callee == this->callee && |
| 938 | rhs.res_attrs == this->res_attrs && |
| 939 | true; |
| 940 | } |
| 941 | bool operator!=(const Properties &rhs) const { |
| 942 | return !(*this == rhs); |
| 943 | } |
| 944 | }; |
| 945 | protected: |
| 946 | ::mlir::DictionaryAttr odsAttrs; |
| 947 | ::std::optional<::mlir::OperationName> odsOpName; |
| 948 | Properties properties; |
| 949 | ::mlir::RegionRange odsRegions; |
| 950 | public: |
| 951 | CallOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 952 | odsOpName.emplace(args: "async.call" , args: odsAttrs.getContext()); |
| 953 | } |
| 954 | |
| 955 | CallOpGenericAdaptorBase(CallOp op); |
| 956 | |
| 957 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize); |
| 958 | const Properties &getProperties() { |
| 959 | return properties; |
| 960 | } |
| 961 | |
| 962 | ::mlir::DictionaryAttr getAttributes() { |
| 963 | return odsAttrs; |
| 964 | } |
| 965 | |
| 966 | ::mlir::FlatSymbolRefAttr getCalleeAttr() { |
| 967 | auto attr = ::llvm::cast<::mlir::FlatSymbolRefAttr>(Val: getProperties().callee); |
| 968 | return attr; |
| 969 | } |
| 970 | |
| 971 | ::llvm::StringRef getCallee(); |
| 972 | ::mlir::ArrayAttr getArgAttrsAttr() { |
| 973 | auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(Val: getProperties().arg_attrs); |
| 974 | return attr; |
| 975 | } |
| 976 | |
| 977 | ::std::optional< ::mlir::ArrayAttr > getArgAttrs(); |
| 978 | ::mlir::ArrayAttr getResAttrsAttr() { |
| 979 | auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(Val: getProperties().res_attrs); |
| 980 | return attr; |
| 981 | } |
| 982 | |
| 983 | ::std::optional< ::mlir::ArrayAttr > getResAttrs(); |
| 984 | }; |
| 985 | |
| 986 | } // namespace detail |
| 987 | template <typename RangeT> |
| 988 | class CallOpGenericAdaptor : public detail::CallOpGenericAdaptorBase { |
| 989 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 990 | using Base = detail::CallOpGenericAdaptorBase; |
| 991 | static constexpr int odsIndex_operands = 0; |
| 992 | public: |
| 993 | CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 994 | |
| 995 | CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CallOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 996 | |
| 997 | CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CallOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 998 | |
| 999 | CallOpGenericAdaptor(RangeT values, const CallOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 1000 | |
| 1001 | template <typename LateInst = CallOp, typename = std::enable_if_t<std::is_same_v<LateInst, CallOp>>> |
| 1002 | CallOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 1003 | |
| 1004 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1005 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 1006 | } |
| 1007 | |
| 1008 | RangeT getODSOperands(unsigned index) { |
| 1009 | auto valueRange = getODSOperandIndexAndLength(index); |
| 1010 | return {std::next(odsOperands.begin(), valueRange.first), |
| 1011 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 1012 | } |
| 1013 | |
| 1014 | RangeT getOperands() { |
| 1015 | return getODSOperands(index: 0); |
| 1016 | } |
| 1017 | |
| 1018 | private: |
| 1019 | RangeT odsOperands; |
| 1020 | }; |
| 1021 | class CallOpAdaptor : public CallOpGenericAdaptor<::mlir::ValueRange> { |
| 1022 | public: |
| 1023 | using CallOpGenericAdaptor::CallOpGenericAdaptor; |
| 1024 | CallOpAdaptor(CallOp op); |
| 1025 | |
| 1026 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 1027 | }; |
| 1028 | class CallOp : public ::mlir::Op<CallOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ArgAndResultAttrsOpInterface::Trait, ::mlir::CallOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> { |
| 1029 | public: |
| 1030 | using Op::Op; |
| 1031 | using Op::print; |
| 1032 | using Adaptor = CallOpAdaptor; |
| 1033 | template <typename RangeT> |
| 1034 | using GenericAdaptor = CallOpGenericAdaptor<RangeT>; |
| 1035 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 1036 | static constexpr int odsIndex_operands = 0; |
| 1037 | using Properties = FoldAdaptor::Properties; |
| 1038 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 1039 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("arg_attrs" ), ::llvm::StringRef("callee" ), ::llvm::StringRef("res_attrs" )}; |
| 1040 | return ::llvm::ArrayRef(attrNames); |
| 1041 | } |
| 1042 | |
| 1043 | ::mlir::StringAttr getArgAttrsAttrName() { |
| 1044 | return getAttributeNameForIndex(index: 0); |
| 1045 | } |
| 1046 | |
| 1047 | static ::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name) { |
| 1048 | return getAttributeNameForIndex(name, index: 0); |
| 1049 | } |
| 1050 | |
| 1051 | ::mlir::StringAttr getCalleeAttrName() { |
| 1052 | return getAttributeNameForIndex(index: 1); |
| 1053 | } |
| 1054 | |
| 1055 | static ::mlir::StringAttr getCalleeAttrName(::mlir::OperationName name) { |
| 1056 | return getAttributeNameForIndex(name, index: 1); |
| 1057 | } |
| 1058 | |
| 1059 | ::mlir::StringAttr getResAttrsAttrName() { |
| 1060 | return getAttributeNameForIndex(index: 2); |
| 1061 | } |
| 1062 | |
| 1063 | static ::mlir::StringAttr getResAttrsAttrName(::mlir::OperationName name) { |
| 1064 | return getAttributeNameForIndex(name, index: 2); |
| 1065 | } |
| 1066 | |
| 1067 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 1068 | return ::llvm::StringLiteral("async.call" ); |
| 1069 | } |
| 1070 | |
| 1071 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index); |
| 1072 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 1073 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 1074 | return getOperation()->getOperands().slice(n: start, m: length); |
| 1075 | } |
| 1076 | |
| 1077 | ::mlir::Operation::operand_range getOperands() { |
| 1078 | return getODSOperands(index: 0); |
| 1079 | } |
| 1080 | |
| 1081 | ::mlir::MutableOperandRange getOperandsMutable(); |
| 1082 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index); |
| 1083 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 1084 | auto valueRange = getODSResultIndexAndLength(index); |
| 1085 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 1086 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 1087 | } |
| 1088 | |
| 1089 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1090 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 1091 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 1092 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 1093 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 1094 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 1095 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1096 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 1097 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 1098 | ::mlir::FlatSymbolRefAttr getCalleeAttr() { |
| 1099 | return ::llvm::cast<::mlir::FlatSymbolRefAttr>(Val&: getProperties().callee); |
| 1100 | } |
| 1101 | |
| 1102 | ::llvm::StringRef getCallee(); |
| 1103 | ::mlir::ArrayAttr getArgAttrsAttr() { |
| 1104 | return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(Val&: getProperties().arg_attrs); |
| 1105 | } |
| 1106 | |
| 1107 | ::std::optional< ::mlir::ArrayAttr > getArgAttrs(); |
| 1108 | ::mlir::ArrayAttr getResAttrsAttr() { |
| 1109 | return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(Val&: getProperties().res_attrs); |
| 1110 | } |
| 1111 | |
| 1112 | ::std::optional< ::mlir::ArrayAttr > getResAttrs(); |
| 1113 | void setCalleeAttr(::mlir::FlatSymbolRefAttr attr) { |
| 1114 | getProperties().callee = attr; |
| 1115 | } |
| 1116 | |
| 1117 | void setCallee(::llvm::StringRef attrValue); |
| 1118 | void setArgAttrsAttr(::mlir::ArrayAttr attr) { |
| 1119 | getProperties().arg_attrs = attr; |
| 1120 | } |
| 1121 | |
| 1122 | void setResAttrsAttr(::mlir::ArrayAttr attr) { |
| 1123 | getProperties().res_attrs = attr; |
| 1124 | } |
| 1125 | |
| 1126 | ::mlir::Attribute removeArgAttrsAttr() { |
| 1127 | auto attr = getProperties().arg_attrs; |
| 1128 | getProperties().arg_attrs = {}; |
| 1129 | return attr; |
| 1130 | } |
| 1131 | |
| 1132 | ::mlir::Attribute removeResAttrsAttr() { |
| 1133 | auto attr = getProperties().res_attrs; |
| 1134 | getProperties().res_attrs = {}; |
| 1135 | return attr; |
| 1136 | } |
| 1137 | |
| 1138 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, FuncOp callee, ValueRange operands = {}); |
| 1139 | static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, FuncOp callee, ValueRange operands = {}); |
| 1140 | static CallOp create(::mlir::ImplicitLocOpBuilder &builder, FuncOp callee, ValueRange operands = {}); |
| 1141 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, SymbolRefAttr callee, TypeRange results, ValueRange operands = {}); |
| 1142 | static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, SymbolRefAttr callee, TypeRange results, ValueRange operands = {}); |
| 1143 | static CallOp create(::mlir::ImplicitLocOpBuilder &builder, SymbolRefAttr callee, TypeRange results, ValueRange operands = {}); |
| 1144 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, StringAttr callee, TypeRange results, ValueRange operands = {}); |
| 1145 | static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, StringAttr callee, TypeRange results, ValueRange operands = {}); |
| 1146 | static CallOp create(::mlir::ImplicitLocOpBuilder &builder, StringAttr callee, TypeRange results, ValueRange operands = {}); |
| 1147 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, StringRef callee, TypeRange results, ValueRange operands = {}); |
| 1148 | static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, StringRef callee, TypeRange results, ValueRange operands = {}); |
| 1149 | static CallOp create(::mlir::ImplicitLocOpBuilder &builder, StringRef callee, TypeRange results, ValueRange operands = {}); |
| 1150 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultType0, ::mlir::FlatSymbolRefAttr callee, ::mlir::ValueRange operands, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 1151 | static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultType0, ::mlir::FlatSymbolRefAttr callee, ::mlir::ValueRange operands, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 1152 | static CallOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultType0, ::mlir::FlatSymbolRefAttr callee, ::mlir::ValueRange operands, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 1153 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultType0, ::llvm::StringRef callee, ::mlir::ValueRange operands, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 1154 | static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultType0, ::llvm::StringRef callee, ::mlir::ValueRange operands, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 1155 | static CallOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultType0, ::llvm::StringRef callee, ::mlir::ValueRange operands, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 1156 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1157 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1158 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1159 | static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1160 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1161 | static CallOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1162 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1163 | static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1164 | static CallOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1165 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 1166 | ::llvm::LogicalResult verifyInvariants(); |
| 1167 | ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable); |
| 1168 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 1169 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 1170 | private: |
| 1171 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 1172 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 1173 | } |
| 1174 | |
| 1175 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 1176 | assert(index < 3 && "invalid attribute index" ); |
| 1177 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 1178 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 1179 | "dependent dialect loading?" ); |
| 1180 | return name.getAttributeNames()[index]; |
| 1181 | } |
| 1182 | |
| 1183 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 1184 | public: |
| 1185 | FunctionType getCalleeType(); |
| 1186 | |
| 1187 | /// Get the argument operands to the called function. |
| 1188 | operand_range getArgOperands() { |
| 1189 | return {arg_operand_begin(), arg_operand_end()}; |
| 1190 | } |
| 1191 | |
| 1192 | MutableOperandRange getArgOperandsMutable() { |
| 1193 | return getOperandsMutable(); |
| 1194 | } |
| 1195 | |
| 1196 | operand_iterator arg_operand_begin() { return operand_begin(); } |
| 1197 | operand_iterator arg_operand_end() { return operand_end(); } |
| 1198 | |
| 1199 | /// Return the callee of this operation. |
| 1200 | CallInterfaceCallable getCallableForCallee() { |
| 1201 | return getCalleeAttr(); |
| 1202 | } |
| 1203 | |
| 1204 | /// Set the callee for this operation. |
| 1205 | void setCalleeFromCallable(CallInterfaceCallable callee) { |
| 1206 | setCalleeAttr(cast<FlatSymbolRefAttr>(Val: cast<SymbolRefAttr>(Val&: callee))); |
| 1207 | } |
| 1208 | }; |
| 1209 | |
| 1210 | } // namespace mlir::async |
| 1211 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::CallOp) |
| 1212 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::detail::CallOpGenericAdaptorBase::Properties) |
| 1213 | |
| 1214 | namespace mlir::async { |
| 1215 | |
| 1216 | |
| 1217 | //===----------------------------------------------------------------------===// |
| 1218 | // ::mlir::async::CoroBeginOp declarations |
| 1219 | //===----------------------------------------------------------------------===// |
| 1220 | |
| 1221 | namespace detail { |
| 1222 | |
| 1223 | class CoroBeginOpGenericAdaptorBase { |
| 1224 | public: |
| 1225 | using Properties = ::mlir::EmptyProperties; |
| 1226 | protected: |
| 1227 | ::mlir::DictionaryAttr odsAttrs; |
| 1228 | ::std::optional<::mlir::OperationName> odsOpName; |
| 1229 | Properties properties; |
| 1230 | ::mlir::RegionRange odsRegions; |
| 1231 | public: |
| 1232 | CoroBeginOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 1233 | odsOpName.emplace(args: "async.coro.begin" , args: odsAttrs.getContext()); |
| 1234 | } |
| 1235 | |
| 1236 | CoroBeginOpGenericAdaptorBase(CoroBeginOp op); |
| 1237 | |
| 1238 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 1239 | return {index, 1}; |
| 1240 | } |
| 1241 | |
| 1242 | const Properties &getProperties() { |
| 1243 | return properties; |
| 1244 | } |
| 1245 | |
| 1246 | ::mlir::DictionaryAttr getAttributes() { |
| 1247 | return odsAttrs; |
| 1248 | } |
| 1249 | |
| 1250 | }; |
| 1251 | |
| 1252 | } // namespace detail |
| 1253 | template <typename RangeT> |
| 1254 | class CoroBeginOpGenericAdaptor : public detail::CoroBeginOpGenericAdaptorBase { |
| 1255 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 1256 | using Base = detail::CoroBeginOpGenericAdaptorBase; |
| 1257 | static constexpr int odsIndex_id = 0; |
| 1258 | public: |
| 1259 | CoroBeginOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 1260 | |
| 1261 | CoroBeginOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CoroBeginOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 1262 | |
| 1263 | CoroBeginOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CoroBeginOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 1264 | |
| 1265 | CoroBeginOpGenericAdaptor(RangeT values, const CoroBeginOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 1266 | |
| 1267 | template <typename LateInst = CoroBeginOp, typename = std::enable_if_t<std::is_same_v<LateInst, CoroBeginOp>>> |
| 1268 | CoroBeginOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 1269 | |
| 1270 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1271 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 1272 | } |
| 1273 | |
| 1274 | RangeT getODSOperands(unsigned index) { |
| 1275 | auto valueRange = getODSOperandIndexAndLength(index); |
| 1276 | return {std::next(odsOperands.begin(), valueRange.first), |
| 1277 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 1278 | } |
| 1279 | |
| 1280 | ValueT getId() { |
| 1281 | return (*getODSOperands(index: 0).begin()); |
| 1282 | } |
| 1283 | |
| 1284 | RangeT getOperands() { |
| 1285 | return odsOperands; |
| 1286 | } |
| 1287 | |
| 1288 | private: |
| 1289 | RangeT odsOperands; |
| 1290 | }; |
| 1291 | class CoroBeginOpAdaptor : public CoroBeginOpGenericAdaptor<::mlir::ValueRange> { |
| 1292 | public: |
| 1293 | using CoroBeginOpGenericAdaptor::CoroBeginOpGenericAdaptor; |
| 1294 | CoroBeginOpAdaptor(CoroBeginOp op); |
| 1295 | |
| 1296 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 1297 | }; |
| 1298 | class CoroBeginOp : public ::mlir::Op<CoroBeginOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::async::CoroHandleType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::InferTypeOpInterface::Trait> { |
| 1299 | public: |
| 1300 | using Op::Op; |
| 1301 | using Op::print; |
| 1302 | using Adaptor = CoroBeginOpAdaptor; |
| 1303 | template <typename RangeT> |
| 1304 | using GenericAdaptor = CoroBeginOpGenericAdaptor<RangeT>; |
| 1305 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 1306 | static constexpr int odsIndex_id = 0; |
| 1307 | static constexpr int odsIndex_handle = 0; |
| 1308 | using Properties = FoldAdaptor::Properties; |
| 1309 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 1310 | return {}; |
| 1311 | } |
| 1312 | |
| 1313 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 1314 | return ::llvm::StringLiteral("async.coro.begin" ); |
| 1315 | } |
| 1316 | |
| 1317 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1318 | return {index, 1}; |
| 1319 | } |
| 1320 | |
| 1321 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 1322 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 1323 | return getOperation()->getOperands().slice(n: start, m: length); |
| 1324 | } |
| 1325 | |
| 1326 | ::mlir::TypedValue<::mlir::async::CoroIdType> getId() { |
| 1327 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::CoroIdType>>(Val: *getODSOperands(index: 0).begin()); |
| 1328 | } |
| 1329 | |
| 1330 | ::mlir::OpOperand &getIdMutable() { |
| 1331 | auto range = getODSOperandIndexAndLength(index: 0); |
| 1332 | return getOperation()->getOpOperand(idx: range.first); |
| 1333 | } |
| 1334 | |
| 1335 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 1336 | return {index, 1}; |
| 1337 | } |
| 1338 | |
| 1339 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 1340 | auto valueRange = getODSResultIndexAndLength(index); |
| 1341 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 1342 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 1343 | } |
| 1344 | |
| 1345 | ::mlir::TypedValue<::mlir::async::CoroHandleType> getHandle() { |
| 1346 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::CoroHandleType>>(Val: *getODSResults(index: 0).begin()); |
| 1347 | } |
| 1348 | |
| 1349 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1350 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 1351 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 1352 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 1353 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 1354 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 1355 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1356 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type handle, ::mlir::Value id); |
| 1357 | static CoroBeginOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type handle, ::mlir::Value id); |
| 1358 | static CoroBeginOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type handle, ::mlir::Value id); |
| 1359 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value id); |
| 1360 | static CoroBeginOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value id); |
| 1361 | static CoroBeginOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value id); |
| 1362 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value id); |
| 1363 | static CoroBeginOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value id); |
| 1364 | static CoroBeginOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value id); |
| 1365 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1366 | static CoroBeginOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1367 | static CoroBeginOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1368 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1369 | static CoroBeginOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1370 | static CoroBeginOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1371 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1372 | static CoroBeginOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1373 | static CoroBeginOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1374 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1375 | static CoroBeginOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1376 | static CoroBeginOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1377 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 1378 | ::llvm::LogicalResult verifyInvariants(); |
| 1379 | static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); |
| 1380 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 1381 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 1382 | public: |
| 1383 | }; |
| 1384 | |
| 1385 | } // namespace mlir::async |
| 1386 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::CoroBeginOp) |
| 1387 | |
| 1388 | namespace mlir::async { |
| 1389 | |
| 1390 | |
| 1391 | //===----------------------------------------------------------------------===// |
| 1392 | // ::mlir::async::CoroEndOp declarations |
| 1393 | //===----------------------------------------------------------------------===// |
| 1394 | |
| 1395 | namespace detail { |
| 1396 | |
| 1397 | class CoroEndOpGenericAdaptorBase { |
| 1398 | public: |
| 1399 | using Properties = ::mlir::EmptyProperties; |
| 1400 | protected: |
| 1401 | ::mlir::DictionaryAttr odsAttrs; |
| 1402 | ::std::optional<::mlir::OperationName> odsOpName; |
| 1403 | Properties properties; |
| 1404 | ::mlir::RegionRange odsRegions; |
| 1405 | public: |
| 1406 | CoroEndOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 1407 | odsOpName.emplace(args: "async.coro.end" , args: odsAttrs.getContext()); |
| 1408 | } |
| 1409 | |
| 1410 | CoroEndOpGenericAdaptorBase(CoroEndOp op); |
| 1411 | |
| 1412 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 1413 | return {index, 1}; |
| 1414 | } |
| 1415 | |
| 1416 | const Properties &getProperties() { |
| 1417 | return properties; |
| 1418 | } |
| 1419 | |
| 1420 | ::mlir::DictionaryAttr getAttributes() { |
| 1421 | return odsAttrs; |
| 1422 | } |
| 1423 | |
| 1424 | }; |
| 1425 | |
| 1426 | } // namespace detail |
| 1427 | template <typename RangeT> |
| 1428 | class CoroEndOpGenericAdaptor : public detail::CoroEndOpGenericAdaptorBase { |
| 1429 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 1430 | using Base = detail::CoroEndOpGenericAdaptorBase; |
| 1431 | static constexpr int odsIndex_handle = 0; |
| 1432 | public: |
| 1433 | CoroEndOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 1434 | |
| 1435 | CoroEndOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CoroEndOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 1436 | |
| 1437 | CoroEndOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CoroEndOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 1438 | |
| 1439 | CoroEndOpGenericAdaptor(RangeT values, const CoroEndOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 1440 | |
| 1441 | template <typename LateInst = CoroEndOp, typename = std::enable_if_t<std::is_same_v<LateInst, CoroEndOp>>> |
| 1442 | CoroEndOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 1443 | |
| 1444 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1445 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 1446 | } |
| 1447 | |
| 1448 | RangeT getODSOperands(unsigned index) { |
| 1449 | auto valueRange = getODSOperandIndexAndLength(index); |
| 1450 | return {std::next(odsOperands.begin(), valueRange.first), |
| 1451 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 1452 | } |
| 1453 | |
| 1454 | ValueT getHandle() { |
| 1455 | return (*getODSOperands(index: 0).begin()); |
| 1456 | } |
| 1457 | |
| 1458 | RangeT getOperands() { |
| 1459 | return odsOperands; |
| 1460 | } |
| 1461 | |
| 1462 | private: |
| 1463 | RangeT odsOperands; |
| 1464 | }; |
| 1465 | class CoroEndOpAdaptor : public CoroEndOpGenericAdaptor<::mlir::ValueRange> { |
| 1466 | public: |
| 1467 | using CoroEndOpGenericAdaptor::CoroEndOpGenericAdaptor; |
| 1468 | CoroEndOpAdaptor(CoroEndOp op); |
| 1469 | |
| 1470 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 1471 | }; |
| 1472 | class CoroEndOp : public ::mlir::Op<CoroEndOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants> { |
| 1473 | public: |
| 1474 | using Op::Op; |
| 1475 | using Op::print; |
| 1476 | using Adaptor = CoroEndOpAdaptor; |
| 1477 | template <typename RangeT> |
| 1478 | using GenericAdaptor = CoroEndOpGenericAdaptor<RangeT>; |
| 1479 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 1480 | static constexpr int odsIndex_handle = 0; |
| 1481 | using Properties = FoldAdaptor::Properties; |
| 1482 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 1483 | return {}; |
| 1484 | } |
| 1485 | |
| 1486 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 1487 | return ::llvm::StringLiteral("async.coro.end" ); |
| 1488 | } |
| 1489 | |
| 1490 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1491 | return {index, 1}; |
| 1492 | } |
| 1493 | |
| 1494 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 1495 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 1496 | return getOperation()->getOperands().slice(n: start, m: length); |
| 1497 | } |
| 1498 | |
| 1499 | ::mlir::TypedValue<::mlir::async::CoroHandleType> getHandle() { |
| 1500 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::CoroHandleType>>(Val: *getODSOperands(index: 0).begin()); |
| 1501 | } |
| 1502 | |
| 1503 | ::mlir::OpOperand &getHandleMutable() { |
| 1504 | auto range = getODSOperandIndexAndLength(index: 0); |
| 1505 | return getOperation()->getOpOperand(idx: range.first); |
| 1506 | } |
| 1507 | |
| 1508 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 1509 | return {index, 1}; |
| 1510 | } |
| 1511 | |
| 1512 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 1513 | auto valueRange = getODSResultIndexAndLength(index); |
| 1514 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 1515 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 1516 | } |
| 1517 | |
| 1518 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1519 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 1520 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 1521 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 1522 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 1523 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 1524 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1525 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value handle); |
| 1526 | static CoroEndOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value handle); |
| 1527 | static CoroEndOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value handle); |
| 1528 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle); |
| 1529 | static CoroEndOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value handle); |
| 1530 | static CoroEndOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value handle); |
| 1531 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1532 | static CoroEndOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1533 | static CoroEndOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1534 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1535 | static CoroEndOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1536 | static CoroEndOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1537 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 1538 | ::llvm::LogicalResult verifyInvariants(); |
| 1539 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 1540 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 1541 | public: |
| 1542 | }; |
| 1543 | |
| 1544 | } // namespace mlir::async |
| 1545 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::CoroEndOp) |
| 1546 | |
| 1547 | namespace mlir::async { |
| 1548 | |
| 1549 | |
| 1550 | //===----------------------------------------------------------------------===// |
| 1551 | // ::mlir::async::CoroFreeOp declarations |
| 1552 | //===----------------------------------------------------------------------===// |
| 1553 | |
| 1554 | namespace detail { |
| 1555 | |
| 1556 | class CoroFreeOpGenericAdaptorBase { |
| 1557 | public: |
| 1558 | using Properties = ::mlir::EmptyProperties; |
| 1559 | protected: |
| 1560 | ::mlir::DictionaryAttr odsAttrs; |
| 1561 | ::std::optional<::mlir::OperationName> odsOpName; |
| 1562 | Properties properties; |
| 1563 | ::mlir::RegionRange odsRegions; |
| 1564 | public: |
| 1565 | CoroFreeOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 1566 | odsOpName.emplace(args: "async.coro.free" , args: odsAttrs.getContext()); |
| 1567 | } |
| 1568 | |
| 1569 | CoroFreeOpGenericAdaptorBase(CoroFreeOp op); |
| 1570 | |
| 1571 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 1572 | return {index, 1}; |
| 1573 | } |
| 1574 | |
| 1575 | const Properties &getProperties() { |
| 1576 | return properties; |
| 1577 | } |
| 1578 | |
| 1579 | ::mlir::DictionaryAttr getAttributes() { |
| 1580 | return odsAttrs; |
| 1581 | } |
| 1582 | |
| 1583 | }; |
| 1584 | |
| 1585 | } // namespace detail |
| 1586 | template <typename RangeT> |
| 1587 | class CoroFreeOpGenericAdaptor : public detail::CoroFreeOpGenericAdaptorBase { |
| 1588 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 1589 | using Base = detail::CoroFreeOpGenericAdaptorBase; |
| 1590 | static constexpr int odsIndex_id = 0; |
| 1591 | static constexpr int odsIndex_handle = 1; |
| 1592 | public: |
| 1593 | CoroFreeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 1594 | |
| 1595 | CoroFreeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CoroFreeOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 1596 | |
| 1597 | CoroFreeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CoroFreeOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 1598 | |
| 1599 | CoroFreeOpGenericAdaptor(RangeT values, const CoroFreeOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 1600 | |
| 1601 | template <typename LateInst = CoroFreeOp, typename = std::enable_if_t<std::is_same_v<LateInst, CoroFreeOp>>> |
| 1602 | CoroFreeOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 1603 | |
| 1604 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1605 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 1606 | } |
| 1607 | |
| 1608 | RangeT getODSOperands(unsigned index) { |
| 1609 | auto valueRange = getODSOperandIndexAndLength(index); |
| 1610 | return {std::next(odsOperands.begin(), valueRange.first), |
| 1611 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 1612 | } |
| 1613 | |
| 1614 | ValueT getId() { |
| 1615 | return (*getODSOperands(index: 0).begin()); |
| 1616 | } |
| 1617 | |
| 1618 | ValueT getHandle() { |
| 1619 | return (*getODSOperands(index: 1).begin()); |
| 1620 | } |
| 1621 | |
| 1622 | RangeT getOperands() { |
| 1623 | return odsOperands; |
| 1624 | } |
| 1625 | |
| 1626 | private: |
| 1627 | RangeT odsOperands; |
| 1628 | }; |
| 1629 | class CoroFreeOpAdaptor : public CoroFreeOpGenericAdaptor<::mlir::ValueRange> { |
| 1630 | public: |
| 1631 | using CoroFreeOpGenericAdaptor::CoroFreeOpGenericAdaptor; |
| 1632 | CoroFreeOpAdaptor(CoroFreeOp op); |
| 1633 | |
| 1634 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 1635 | }; |
| 1636 | class CoroFreeOp : public ::mlir::Op<CoroFreeOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants> { |
| 1637 | public: |
| 1638 | using Op::Op; |
| 1639 | using Op::print; |
| 1640 | using Adaptor = CoroFreeOpAdaptor; |
| 1641 | template <typename RangeT> |
| 1642 | using GenericAdaptor = CoroFreeOpGenericAdaptor<RangeT>; |
| 1643 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 1644 | static constexpr int odsIndex_id = 0; |
| 1645 | static constexpr int odsIndex_handle = 1; |
| 1646 | using Properties = FoldAdaptor::Properties; |
| 1647 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 1648 | return {}; |
| 1649 | } |
| 1650 | |
| 1651 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 1652 | return ::llvm::StringLiteral("async.coro.free" ); |
| 1653 | } |
| 1654 | |
| 1655 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1656 | return {index, 1}; |
| 1657 | } |
| 1658 | |
| 1659 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 1660 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 1661 | return getOperation()->getOperands().slice(n: start, m: length); |
| 1662 | } |
| 1663 | |
| 1664 | ::mlir::TypedValue<::mlir::async::CoroIdType> getId() { |
| 1665 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::CoroIdType>>(Val: *getODSOperands(index: 0).begin()); |
| 1666 | } |
| 1667 | |
| 1668 | ::mlir::TypedValue<::mlir::async::CoroHandleType> getHandle() { |
| 1669 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::CoroHandleType>>(Val: *getODSOperands(index: 1).begin()); |
| 1670 | } |
| 1671 | |
| 1672 | ::mlir::OpOperand &getIdMutable() { |
| 1673 | auto range = getODSOperandIndexAndLength(index: 0); |
| 1674 | return getOperation()->getOpOperand(idx: range.first); |
| 1675 | } |
| 1676 | |
| 1677 | ::mlir::OpOperand &getHandleMutable() { |
| 1678 | auto range = getODSOperandIndexAndLength(index: 1); |
| 1679 | return getOperation()->getOpOperand(idx: range.first); |
| 1680 | } |
| 1681 | |
| 1682 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 1683 | return {index, 1}; |
| 1684 | } |
| 1685 | |
| 1686 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 1687 | auto valueRange = getODSResultIndexAndLength(index); |
| 1688 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 1689 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 1690 | } |
| 1691 | |
| 1692 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1693 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 1694 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 1695 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 1696 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 1697 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 1698 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1699 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value id, ::mlir::Value handle); |
| 1700 | static CoroFreeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value id, ::mlir::Value handle); |
| 1701 | static CoroFreeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value id, ::mlir::Value handle); |
| 1702 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value id, ::mlir::Value handle); |
| 1703 | static CoroFreeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value id, ::mlir::Value handle); |
| 1704 | static CoroFreeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value id, ::mlir::Value handle); |
| 1705 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1706 | static CoroFreeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1707 | static CoroFreeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1708 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1709 | static CoroFreeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1710 | static CoroFreeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1711 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 1712 | ::llvm::LogicalResult verifyInvariants(); |
| 1713 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 1714 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 1715 | public: |
| 1716 | }; |
| 1717 | |
| 1718 | } // namespace mlir::async |
| 1719 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::CoroFreeOp) |
| 1720 | |
| 1721 | namespace mlir::async { |
| 1722 | |
| 1723 | |
| 1724 | //===----------------------------------------------------------------------===// |
| 1725 | // ::mlir::async::CoroIdOp declarations |
| 1726 | //===----------------------------------------------------------------------===// |
| 1727 | |
| 1728 | namespace detail { |
| 1729 | |
| 1730 | class CoroIdOpGenericAdaptorBase { |
| 1731 | public: |
| 1732 | using Properties = ::mlir::EmptyProperties; |
| 1733 | protected: |
| 1734 | ::mlir::DictionaryAttr odsAttrs; |
| 1735 | ::std::optional<::mlir::OperationName> odsOpName; |
| 1736 | Properties properties; |
| 1737 | ::mlir::RegionRange odsRegions; |
| 1738 | public: |
| 1739 | CoroIdOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 1740 | odsOpName.emplace(args: "async.coro.id" , args: odsAttrs.getContext()); |
| 1741 | } |
| 1742 | |
| 1743 | CoroIdOpGenericAdaptorBase(CoroIdOp op); |
| 1744 | |
| 1745 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 1746 | return {index, 1}; |
| 1747 | } |
| 1748 | |
| 1749 | const Properties &getProperties() { |
| 1750 | return properties; |
| 1751 | } |
| 1752 | |
| 1753 | ::mlir::DictionaryAttr getAttributes() { |
| 1754 | return odsAttrs; |
| 1755 | } |
| 1756 | |
| 1757 | }; |
| 1758 | |
| 1759 | } // namespace detail |
| 1760 | template <typename RangeT> |
| 1761 | class CoroIdOpGenericAdaptor : public detail::CoroIdOpGenericAdaptorBase { |
| 1762 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 1763 | using Base = detail::CoroIdOpGenericAdaptorBase; |
| 1764 | public: |
| 1765 | CoroIdOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 1766 | |
| 1767 | CoroIdOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CoroIdOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 1768 | |
| 1769 | CoroIdOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CoroIdOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 1770 | |
| 1771 | CoroIdOpGenericAdaptor(RangeT values, const CoroIdOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 1772 | |
| 1773 | template <typename LateInst = CoroIdOp, typename = std::enable_if_t<std::is_same_v<LateInst, CoroIdOp>>> |
| 1774 | CoroIdOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 1775 | |
| 1776 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1777 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 1778 | } |
| 1779 | |
| 1780 | RangeT getODSOperands(unsigned index) { |
| 1781 | auto valueRange = getODSOperandIndexAndLength(index); |
| 1782 | return {std::next(odsOperands.begin(), valueRange.first), |
| 1783 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 1784 | } |
| 1785 | |
| 1786 | RangeT getOperands() { |
| 1787 | return odsOperands; |
| 1788 | } |
| 1789 | |
| 1790 | private: |
| 1791 | RangeT odsOperands; |
| 1792 | }; |
| 1793 | class CoroIdOpAdaptor : public CoroIdOpGenericAdaptor<::mlir::ValueRange> { |
| 1794 | public: |
| 1795 | using CoroIdOpGenericAdaptor::CoroIdOpGenericAdaptor; |
| 1796 | CoroIdOpAdaptor(CoroIdOp op); |
| 1797 | |
| 1798 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 1799 | }; |
| 1800 | class CoroIdOp : public ::mlir::Op<CoroIdOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::async::CoroIdType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::InferTypeOpInterface::Trait> { |
| 1801 | public: |
| 1802 | using Op::Op; |
| 1803 | using Op::print; |
| 1804 | using Adaptor = CoroIdOpAdaptor; |
| 1805 | template <typename RangeT> |
| 1806 | using GenericAdaptor = CoroIdOpGenericAdaptor<RangeT>; |
| 1807 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 1808 | static constexpr int odsIndex_id = 0; |
| 1809 | using Properties = FoldAdaptor::Properties; |
| 1810 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 1811 | return {}; |
| 1812 | } |
| 1813 | |
| 1814 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 1815 | return ::llvm::StringLiteral("async.coro.id" ); |
| 1816 | } |
| 1817 | |
| 1818 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1819 | return {index, 1}; |
| 1820 | } |
| 1821 | |
| 1822 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 1823 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 1824 | return getOperation()->getOperands().slice(n: start, m: length); |
| 1825 | } |
| 1826 | |
| 1827 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 1828 | return {index, 1}; |
| 1829 | } |
| 1830 | |
| 1831 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 1832 | auto valueRange = getODSResultIndexAndLength(index); |
| 1833 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 1834 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 1835 | } |
| 1836 | |
| 1837 | ::mlir::TypedValue<::mlir::async::CoroIdType> getId() { |
| 1838 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::CoroIdType>>(Val: *getODSResults(index: 0).begin()); |
| 1839 | } |
| 1840 | |
| 1841 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1842 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 1843 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 1844 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 1845 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 1846 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 1847 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1848 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type id); |
| 1849 | static CoroIdOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type id); |
| 1850 | static CoroIdOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type id); |
| 1851 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState); |
| 1852 | static CoroIdOp create(::mlir::OpBuilder &builder, ::mlir::Location location); |
| 1853 | static CoroIdOp create(::mlir::ImplicitLocOpBuilder &builder); |
| 1854 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes); |
| 1855 | static CoroIdOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes); |
| 1856 | static CoroIdOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes); |
| 1857 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1858 | static CoroIdOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1859 | static CoroIdOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1860 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1861 | static CoroIdOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1862 | static CoroIdOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1863 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1864 | static CoroIdOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1865 | static CoroIdOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1866 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1867 | static CoroIdOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1868 | static CoroIdOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1869 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 1870 | ::llvm::LogicalResult verifyInvariants(); |
| 1871 | static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); |
| 1872 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 1873 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 1874 | public: |
| 1875 | }; |
| 1876 | |
| 1877 | } // namespace mlir::async |
| 1878 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::CoroIdOp) |
| 1879 | |
| 1880 | namespace mlir::async { |
| 1881 | |
| 1882 | |
| 1883 | //===----------------------------------------------------------------------===// |
| 1884 | // ::mlir::async::CoroSaveOp declarations |
| 1885 | //===----------------------------------------------------------------------===// |
| 1886 | |
| 1887 | namespace detail { |
| 1888 | |
| 1889 | class CoroSaveOpGenericAdaptorBase { |
| 1890 | public: |
| 1891 | using Properties = ::mlir::EmptyProperties; |
| 1892 | protected: |
| 1893 | ::mlir::DictionaryAttr odsAttrs; |
| 1894 | ::std::optional<::mlir::OperationName> odsOpName; |
| 1895 | Properties properties; |
| 1896 | ::mlir::RegionRange odsRegions; |
| 1897 | public: |
| 1898 | CoroSaveOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 1899 | odsOpName.emplace(args: "async.coro.save" , args: odsAttrs.getContext()); |
| 1900 | } |
| 1901 | |
| 1902 | CoroSaveOpGenericAdaptorBase(CoroSaveOp op); |
| 1903 | |
| 1904 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 1905 | return {index, 1}; |
| 1906 | } |
| 1907 | |
| 1908 | const Properties &getProperties() { |
| 1909 | return properties; |
| 1910 | } |
| 1911 | |
| 1912 | ::mlir::DictionaryAttr getAttributes() { |
| 1913 | return odsAttrs; |
| 1914 | } |
| 1915 | |
| 1916 | }; |
| 1917 | |
| 1918 | } // namespace detail |
| 1919 | template <typename RangeT> |
| 1920 | class CoroSaveOpGenericAdaptor : public detail::CoroSaveOpGenericAdaptorBase { |
| 1921 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 1922 | using Base = detail::CoroSaveOpGenericAdaptorBase; |
| 1923 | static constexpr int odsIndex_handle = 0; |
| 1924 | public: |
| 1925 | CoroSaveOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 1926 | |
| 1927 | CoroSaveOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CoroSaveOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 1928 | |
| 1929 | CoroSaveOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CoroSaveOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 1930 | |
| 1931 | CoroSaveOpGenericAdaptor(RangeT values, const CoroSaveOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 1932 | |
| 1933 | template <typename LateInst = CoroSaveOp, typename = std::enable_if_t<std::is_same_v<LateInst, CoroSaveOp>>> |
| 1934 | CoroSaveOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 1935 | |
| 1936 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1937 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 1938 | } |
| 1939 | |
| 1940 | RangeT getODSOperands(unsigned index) { |
| 1941 | auto valueRange = getODSOperandIndexAndLength(index); |
| 1942 | return {std::next(odsOperands.begin(), valueRange.first), |
| 1943 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 1944 | } |
| 1945 | |
| 1946 | ValueT getHandle() { |
| 1947 | return (*getODSOperands(index: 0).begin()); |
| 1948 | } |
| 1949 | |
| 1950 | RangeT getOperands() { |
| 1951 | return odsOperands; |
| 1952 | } |
| 1953 | |
| 1954 | private: |
| 1955 | RangeT odsOperands; |
| 1956 | }; |
| 1957 | class CoroSaveOpAdaptor : public CoroSaveOpGenericAdaptor<::mlir::ValueRange> { |
| 1958 | public: |
| 1959 | using CoroSaveOpGenericAdaptor::CoroSaveOpGenericAdaptor; |
| 1960 | CoroSaveOpAdaptor(CoroSaveOp op); |
| 1961 | |
| 1962 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 1963 | }; |
| 1964 | class CoroSaveOp : public ::mlir::Op<CoroSaveOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::async::CoroStateType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::InferTypeOpInterface::Trait> { |
| 1965 | public: |
| 1966 | using Op::Op; |
| 1967 | using Op::print; |
| 1968 | using Adaptor = CoroSaveOpAdaptor; |
| 1969 | template <typename RangeT> |
| 1970 | using GenericAdaptor = CoroSaveOpGenericAdaptor<RangeT>; |
| 1971 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 1972 | static constexpr int odsIndex_handle = 0; |
| 1973 | static constexpr int odsIndex_state = 0; |
| 1974 | using Properties = FoldAdaptor::Properties; |
| 1975 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 1976 | return {}; |
| 1977 | } |
| 1978 | |
| 1979 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 1980 | return ::llvm::StringLiteral("async.coro.save" ); |
| 1981 | } |
| 1982 | |
| 1983 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1984 | return {index, 1}; |
| 1985 | } |
| 1986 | |
| 1987 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 1988 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 1989 | return getOperation()->getOperands().slice(n: start, m: length); |
| 1990 | } |
| 1991 | |
| 1992 | ::mlir::TypedValue<::mlir::async::CoroHandleType> getHandle() { |
| 1993 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::CoroHandleType>>(Val: *getODSOperands(index: 0).begin()); |
| 1994 | } |
| 1995 | |
| 1996 | ::mlir::OpOperand &getHandleMutable() { |
| 1997 | auto range = getODSOperandIndexAndLength(index: 0); |
| 1998 | return getOperation()->getOpOperand(idx: range.first); |
| 1999 | } |
| 2000 | |
| 2001 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 2002 | return {index, 1}; |
| 2003 | } |
| 2004 | |
| 2005 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 2006 | auto valueRange = getODSResultIndexAndLength(index); |
| 2007 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 2008 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 2009 | } |
| 2010 | |
| 2011 | ::mlir::TypedValue<::mlir::async::CoroStateType> getState() { |
| 2012 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::CoroStateType>>(Val: *getODSResults(index: 0).begin()); |
| 2013 | } |
| 2014 | |
| 2015 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2016 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 2017 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 2018 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 2019 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 2020 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 2021 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2022 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type state, ::mlir::Value handle); |
| 2023 | static CoroSaveOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type state, ::mlir::Value handle); |
| 2024 | static CoroSaveOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type state, ::mlir::Value handle); |
| 2025 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value handle); |
| 2026 | static CoroSaveOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value handle); |
| 2027 | static CoroSaveOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value handle); |
| 2028 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle); |
| 2029 | static CoroSaveOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value handle); |
| 2030 | static CoroSaveOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value handle); |
| 2031 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2032 | static CoroSaveOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2033 | static CoroSaveOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2034 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2035 | static CoroSaveOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2036 | static CoroSaveOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2037 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2038 | static CoroSaveOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2039 | static CoroSaveOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2040 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2041 | static CoroSaveOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2042 | static CoroSaveOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2043 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 2044 | ::llvm::LogicalResult verifyInvariants(); |
| 2045 | static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); |
| 2046 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 2047 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 2048 | public: |
| 2049 | }; |
| 2050 | |
| 2051 | } // namespace mlir::async |
| 2052 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::CoroSaveOp) |
| 2053 | |
| 2054 | namespace mlir::async { |
| 2055 | |
| 2056 | |
| 2057 | //===----------------------------------------------------------------------===// |
| 2058 | // ::mlir::async::CoroSuspendOp declarations |
| 2059 | //===----------------------------------------------------------------------===// |
| 2060 | |
| 2061 | namespace detail { |
| 2062 | |
| 2063 | class CoroSuspendOpGenericAdaptorBase { |
| 2064 | public: |
| 2065 | using Properties = ::mlir::EmptyProperties; |
| 2066 | protected: |
| 2067 | ::mlir::DictionaryAttr odsAttrs; |
| 2068 | ::std::optional<::mlir::OperationName> odsOpName; |
| 2069 | Properties properties; |
| 2070 | ::mlir::RegionRange odsRegions; |
| 2071 | public: |
| 2072 | CoroSuspendOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 2073 | odsOpName.emplace(args: "async.coro.suspend" , args: odsAttrs.getContext()); |
| 2074 | } |
| 2075 | |
| 2076 | CoroSuspendOpGenericAdaptorBase(CoroSuspendOp op); |
| 2077 | |
| 2078 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 2079 | return {index, 1}; |
| 2080 | } |
| 2081 | |
| 2082 | const Properties &getProperties() { |
| 2083 | return properties; |
| 2084 | } |
| 2085 | |
| 2086 | ::mlir::DictionaryAttr getAttributes() { |
| 2087 | return odsAttrs; |
| 2088 | } |
| 2089 | |
| 2090 | }; |
| 2091 | |
| 2092 | } // namespace detail |
| 2093 | template <typename RangeT> |
| 2094 | class CoroSuspendOpGenericAdaptor : public detail::CoroSuspendOpGenericAdaptorBase { |
| 2095 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 2096 | using Base = detail::CoroSuspendOpGenericAdaptorBase; |
| 2097 | static constexpr int odsIndex_state = 0; |
| 2098 | public: |
| 2099 | CoroSuspendOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 2100 | |
| 2101 | CoroSuspendOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CoroSuspendOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 2102 | |
| 2103 | CoroSuspendOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CoroSuspendOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 2104 | |
| 2105 | CoroSuspendOpGenericAdaptor(RangeT values, const CoroSuspendOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 2106 | |
| 2107 | template <typename LateInst = CoroSuspendOp, typename = std::enable_if_t<std::is_same_v<LateInst, CoroSuspendOp>>> |
| 2108 | CoroSuspendOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 2109 | |
| 2110 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2111 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 2112 | } |
| 2113 | |
| 2114 | RangeT getODSOperands(unsigned index) { |
| 2115 | auto valueRange = getODSOperandIndexAndLength(index); |
| 2116 | return {std::next(odsOperands.begin(), valueRange.first), |
| 2117 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 2118 | } |
| 2119 | |
| 2120 | ValueT getState() { |
| 2121 | return (*getODSOperands(index: 0).begin()); |
| 2122 | } |
| 2123 | |
| 2124 | RangeT getOperands() { |
| 2125 | return odsOperands; |
| 2126 | } |
| 2127 | |
| 2128 | private: |
| 2129 | RangeT odsOperands; |
| 2130 | }; |
| 2131 | class CoroSuspendOpAdaptor : public CoroSuspendOpGenericAdaptor<::mlir::ValueRange> { |
| 2132 | public: |
| 2133 | using CoroSuspendOpGenericAdaptor::CoroSuspendOpGenericAdaptor; |
| 2134 | CoroSuspendOpAdaptor(CoroSuspendOp op); |
| 2135 | |
| 2136 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 2137 | }; |
| 2138 | class CoroSuspendOp : public ::mlir::Op<CoroSuspendOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::NSuccessors<3>::Impl, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::IsTerminator> { |
| 2139 | public: |
| 2140 | using Op::Op; |
| 2141 | using Op::print; |
| 2142 | using Adaptor = CoroSuspendOpAdaptor; |
| 2143 | template <typename RangeT> |
| 2144 | using GenericAdaptor = CoroSuspendOpGenericAdaptor<RangeT>; |
| 2145 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 2146 | static constexpr int odsIndex_state = 0; |
| 2147 | using Properties = FoldAdaptor::Properties; |
| 2148 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 2149 | return {}; |
| 2150 | } |
| 2151 | |
| 2152 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 2153 | return ::llvm::StringLiteral("async.coro.suspend" ); |
| 2154 | } |
| 2155 | |
| 2156 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2157 | return {index, 1}; |
| 2158 | } |
| 2159 | |
| 2160 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 2161 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 2162 | return getOperation()->getOperands().slice(n: start, m: length); |
| 2163 | } |
| 2164 | |
| 2165 | ::mlir::TypedValue<::mlir::async::CoroStateType> getState() { |
| 2166 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::CoroStateType>>(Val: *getODSOperands(index: 0).begin()); |
| 2167 | } |
| 2168 | |
| 2169 | ::mlir::OpOperand &getStateMutable() { |
| 2170 | auto range = getODSOperandIndexAndLength(index: 0); |
| 2171 | return getOperation()->getOpOperand(idx: range.first); |
| 2172 | } |
| 2173 | |
| 2174 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 2175 | return {index, 1}; |
| 2176 | } |
| 2177 | |
| 2178 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 2179 | auto valueRange = getODSResultIndexAndLength(index); |
| 2180 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 2181 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 2182 | } |
| 2183 | |
| 2184 | ::mlir::Block *getSuspendDest() { |
| 2185 | return (*this)->getSuccessor(index: 0); |
| 2186 | } |
| 2187 | |
| 2188 | ::mlir::Block *getResumeDest() { |
| 2189 | return (*this)->getSuccessor(index: 1); |
| 2190 | } |
| 2191 | |
| 2192 | ::mlir::Block *getCleanupDest() { |
| 2193 | return (*this)->getSuccessor(index: 2); |
| 2194 | } |
| 2195 | |
| 2196 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2197 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 2198 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 2199 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 2200 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 2201 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 2202 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2203 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value state, ::mlir::Block *suspendDest, ::mlir::Block *resumeDest, ::mlir::Block *cleanupDest); |
| 2204 | static CoroSuspendOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value state, ::mlir::Block *suspendDest, ::mlir::Block *resumeDest, ::mlir::Block *cleanupDest); |
| 2205 | static CoroSuspendOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value state, ::mlir::Block *suspendDest, ::mlir::Block *resumeDest, ::mlir::Block *cleanupDest); |
| 2206 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value state, ::mlir::Block *suspendDest, ::mlir::Block *resumeDest, ::mlir::Block *cleanupDest); |
| 2207 | static CoroSuspendOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value state, ::mlir::Block *suspendDest, ::mlir::Block *resumeDest, ::mlir::Block *cleanupDest); |
| 2208 | static CoroSuspendOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value state, ::mlir::Block *suspendDest, ::mlir::Block *resumeDest, ::mlir::Block *cleanupDest); |
| 2209 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2210 | static CoroSuspendOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2211 | static CoroSuspendOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2212 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2213 | static CoroSuspendOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2214 | static CoroSuspendOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2215 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 2216 | ::llvm::LogicalResult verifyInvariants(); |
| 2217 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 2218 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 2219 | public: |
| 2220 | }; |
| 2221 | |
| 2222 | } // namespace mlir::async |
| 2223 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::CoroSuspendOp) |
| 2224 | |
| 2225 | namespace mlir::async { |
| 2226 | |
| 2227 | |
| 2228 | //===----------------------------------------------------------------------===// |
| 2229 | // ::mlir::async::CreateGroupOp declarations |
| 2230 | //===----------------------------------------------------------------------===// |
| 2231 | |
| 2232 | namespace detail { |
| 2233 | |
| 2234 | class CreateGroupOpGenericAdaptorBase { |
| 2235 | public: |
| 2236 | using Properties = ::mlir::EmptyProperties; |
| 2237 | protected: |
| 2238 | ::mlir::DictionaryAttr odsAttrs; |
| 2239 | ::std::optional<::mlir::OperationName> odsOpName; |
| 2240 | Properties properties; |
| 2241 | ::mlir::RegionRange odsRegions; |
| 2242 | public: |
| 2243 | CreateGroupOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 2244 | odsOpName.emplace(args: "async.create_group" , args: odsAttrs.getContext()); |
| 2245 | } |
| 2246 | |
| 2247 | CreateGroupOpGenericAdaptorBase(CreateGroupOp op); |
| 2248 | |
| 2249 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 2250 | return {index, 1}; |
| 2251 | } |
| 2252 | |
| 2253 | const Properties &getProperties() { |
| 2254 | return properties; |
| 2255 | } |
| 2256 | |
| 2257 | ::mlir::DictionaryAttr getAttributes() { |
| 2258 | return odsAttrs; |
| 2259 | } |
| 2260 | |
| 2261 | }; |
| 2262 | |
| 2263 | } // namespace detail |
| 2264 | template <typename RangeT> |
| 2265 | class CreateGroupOpGenericAdaptor : public detail::CreateGroupOpGenericAdaptorBase { |
| 2266 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 2267 | using Base = detail::CreateGroupOpGenericAdaptorBase; |
| 2268 | static constexpr int odsIndex_size = 0; |
| 2269 | public: |
| 2270 | CreateGroupOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 2271 | |
| 2272 | CreateGroupOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CreateGroupOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 2273 | |
| 2274 | CreateGroupOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CreateGroupOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 2275 | |
| 2276 | CreateGroupOpGenericAdaptor(RangeT values, const CreateGroupOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 2277 | |
| 2278 | template <typename LateInst = CreateGroupOp, typename = std::enable_if_t<std::is_same_v<LateInst, CreateGroupOp>>> |
| 2279 | CreateGroupOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 2280 | |
| 2281 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2282 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 2283 | } |
| 2284 | |
| 2285 | RangeT getODSOperands(unsigned index) { |
| 2286 | auto valueRange = getODSOperandIndexAndLength(index); |
| 2287 | return {std::next(odsOperands.begin(), valueRange.first), |
| 2288 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 2289 | } |
| 2290 | |
| 2291 | ValueT getSize() { |
| 2292 | return (*getODSOperands(index: 0).begin()); |
| 2293 | } |
| 2294 | |
| 2295 | RangeT getOperands() { |
| 2296 | return odsOperands; |
| 2297 | } |
| 2298 | |
| 2299 | private: |
| 2300 | RangeT odsOperands; |
| 2301 | }; |
| 2302 | class CreateGroupOpAdaptor : public CreateGroupOpGenericAdaptor<::mlir::ValueRange> { |
| 2303 | public: |
| 2304 | using CreateGroupOpGenericAdaptor::CreateGroupOpGenericAdaptor; |
| 2305 | CreateGroupOpAdaptor(CreateGroupOp op); |
| 2306 | |
| 2307 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 2308 | }; |
| 2309 | class CreateGroupOp : public ::mlir::Op<CreateGroupOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::async::GroupType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { |
| 2310 | public: |
| 2311 | using Op::Op; |
| 2312 | using Op::print; |
| 2313 | using Adaptor = CreateGroupOpAdaptor; |
| 2314 | template <typename RangeT> |
| 2315 | using GenericAdaptor = CreateGroupOpGenericAdaptor<RangeT>; |
| 2316 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 2317 | static constexpr int odsIndex_size = 0; |
| 2318 | static constexpr int odsIndex_result = 0; |
| 2319 | using Properties = FoldAdaptor::Properties; |
| 2320 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 2321 | return {}; |
| 2322 | } |
| 2323 | |
| 2324 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 2325 | return ::llvm::StringLiteral("async.create_group" ); |
| 2326 | } |
| 2327 | |
| 2328 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2329 | return {index, 1}; |
| 2330 | } |
| 2331 | |
| 2332 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 2333 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 2334 | return getOperation()->getOperands().slice(n: start, m: length); |
| 2335 | } |
| 2336 | |
| 2337 | ::mlir::TypedValue<::mlir::IndexType> getSize() { |
| 2338 | return ::llvm::cast<::mlir::TypedValue<::mlir::IndexType>>(Val: *getODSOperands(index: 0).begin()); |
| 2339 | } |
| 2340 | |
| 2341 | ::mlir::OpOperand &getSizeMutable() { |
| 2342 | auto range = getODSOperandIndexAndLength(index: 0); |
| 2343 | return getOperation()->getOpOperand(idx: range.first); |
| 2344 | } |
| 2345 | |
| 2346 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 2347 | return {index, 1}; |
| 2348 | } |
| 2349 | |
| 2350 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 2351 | auto valueRange = getODSResultIndexAndLength(index); |
| 2352 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 2353 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 2354 | } |
| 2355 | |
| 2356 | ::mlir::TypedValue<::mlir::async::GroupType> getResult() { |
| 2357 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::GroupType>>(Val: *getODSResults(index: 0).begin()); |
| 2358 | } |
| 2359 | |
| 2360 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2361 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 2362 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 2363 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 2364 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 2365 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 2366 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2367 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value size); |
| 2368 | static CreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value size); |
| 2369 | static CreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value size); |
| 2370 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value size); |
| 2371 | static CreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value size); |
| 2372 | static CreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value size); |
| 2373 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value size); |
| 2374 | static CreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value size); |
| 2375 | static CreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value size); |
| 2376 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2377 | static CreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2378 | static CreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2379 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2380 | static CreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2381 | static CreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2382 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2383 | static CreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2384 | static CreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2385 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2386 | static CreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2387 | static CreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2388 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 2389 | ::llvm::LogicalResult verifyInvariants(); |
| 2390 | static ::llvm::LogicalResult canonicalize(CreateGroupOp op, ::mlir::PatternRewriter &rewriter); |
| 2391 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 2392 | static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); |
| 2393 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 2394 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 2395 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 2396 | public: |
| 2397 | }; |
| 2398 | |
| 2399 | } // namespace mlir::async |
| 2400 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::CreateGroupOp) |
| 2401 | |
| 2402 | namespace mlir::async { |
| 2403 | |
| 2404 | |
| 2405 | //===----------------------------------------------------------------------===// |
| 2406 | // ::mlir::async::ExecuteOp declarations |
| 2407 | //===----------------------------------------------------------------------===// |
| 2408 | |
| 2409 | namespace detail { |
| 2410 | |
| 2411 | class ExecuteOpGenericAdaptorBase { |
| 2412 | public: |
| 2413 | struct Properties { |
| 2414 | using operandSegmentSizesTy = std::array<int32_t, 2>; |
| 2415 | operandSegmentSizesTy operandSegmentSizes; |
| 2416 | ::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const { |
| 2417 | auto &propStorage = this->operandSegmentSizes; |
| 2418 | return propStorage; |
| 2419 | } |
| 2420 | void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) { |
| 2421 | auto &propStorage = this->operandSegmentSizes; |
| 2422 | ::llvm::copy(Range&: propValue, Out: propStorage.begin()); |
| 2423 | } |
| 2424 | bool operator==(const Properties &rhs) const { |
| 2425 | return |
| 2426 | rhs.operandSegmentSizes == this->operandSegmentSizes && |
| 2427 | true; |
| 2428 | } |
| 2429 | bool operator!=(const Properties &rhs) const { |
| 2430 | return !(*this == rhs); |
| 2431 | } |
| 2432 | }; |
| 2433 | protected: |
| 2434 | ::mlir::DictionaryAttr odsAttrs; |
| 2435 | ::std::optional<::mlir::OperationName> odsOpName; |
| 2436 | Properties properties; |
| 2437 | ::mlir::RegionRange odsRegions; |
| 2438 | public: |
| 2439 | ExecuteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 2440 | odsOpName.emplace(args: "async.execute" , args: odsAttrs.getContext()); |
| 2441 | } |
| 2442 | |
| 2443 | ExecuteOpGenericAdaptorBase(ExecuteOp op); |
| 2444 | |
| 2445 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize); |
| 2446 | const Properties &getProperties() { |
| 2447 | return properties; |
| 2448 | } |
| 2449 | |
| 2450 | ::mlir::DictionaryAttr getAttributes() { |
| 2451 | return odsAttrs; |
| 2452 | } |
| 2453 | |
| 2454 | ::mlir::Region &getBodyRegion() { |
| 2455 | return *odsRegions[0]; |
| 2456 | } |
| 2457 | |
| 2458 | ::mlir::RegionRange getRegions() { |
| 2459 | return odsRegions; |
| 2460 | } |
| 2461 | |
| 2462 | }; |
| 2463 | |
| 2464 | } // namespace detail |
| 2465 | template <typename RangeT> |
| 2466 | class ExecuteOpGenericAdaptor : public detail::ExecuteOpGenericAdaptorBase { |
| 2467 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 2468 | using Base = detail::ExecuteOpGenericAdaptorBase; |
| 2469 | static constexpr int odsIndex_dependencies = 0; |
| 2470 | static constexpr int odsIndex_bodyOperands = 1; |
| 2471 | public: |
| 2472 | ExecuteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 2473 | |
| 2474 | ExecuteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ExecuteOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 2475 | |
| 2476 | ExecuteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : ExecuteOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 2477 | |
| 2478 | ExecuteOpGenericAdaptor(RangeT values, const ExecuteOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 2479 | |
| 2480 | template <typename LateInst = ExecuteOp, typename = std::enable_if_t<std::is_same_v<LateInst, ExecuteOp>>> |
| 2481 | ExecuteOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 2482 | |
| 2483 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2484 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 2485 | } |
| 2486 | |
| 2487 | RangeT getODSOperands(unsigned index) { |
| 2488 | auto valueRange = getODSOperandIndexAndLength(index); |
| 2489 | return {std::next(odsOperands.begin(), valueRange.first), |
| 2490 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 2491 | } |
| 2492 | |
| 2493 | RangeT getDependencies() { |
| 2494 | return getODSOperands(index: 0); |
| 2495 | } |
| 2496 | |
| 2497 | RangeT getBodyOperands() { |
| 2498 | return getODSOperands(index: 1); |
| 2499 | } |
| 2500 | |
| 2501 | RangeT getOperands() { |
| 2502 | return odsOperands; |
| 2503 | } |
| 2504 | |
| 2505 | private: |
| 2506 | RangeT odsOperands; |
| 2507 | }; |
| 2508 | class ExecuteOpAdaptor : public ExecuteOpGenericAdaptor<::mlir::ValueRange> { |
| 2509 | public: |
| 2510 | using ExecuteOpGenericAdaptor::ExecuteOpGenericAdaptor; |
| 2511 | ExecuteOpAdaptor(ExecuteOp op); |
| 2512 | |
| 2513 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 2514 | }; |
| 2515 | class ExecuteOp : public ::mlir::Op<ExecuteOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::AtLeastNResults<1>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::SingleBlockImplicitTerminator<YieldOp>::Impl, ::mlir::OpTrait::AttrSizedOperandSegments, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::RegionBranchOpInterface::Trait, ::mlir::OpTrait::AutomaticAllocationScope, ::mlir::OpTrait::HasRecursiveMemoryEffects, ::mlir::OpAsmOpInterface::Trait> { |
| 2516 | public: |
| 2517 | using Op::Op; |
| 2518 | using Op::print; |
| 2519 | using Adaptor = ExecuteOpAdaptor; |
| 2520 | template <typename RangeT> |
| 2521 | using GenericAdaptor = ExecuteOpGenericAdaptor<RangeT>; |
| 2522 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 2523 | static constexpr int odsIndex_dependencies = 0; |
| 2524 | static constexpr int odsIndex_bodyOperands = 1; |
| 2525 | static constexpr int odsIndex_token = 0; |
| 2526 | static constexpr int odsIndex_bodyResults = 1; |
| 2527 | using Properties = FoldAdaptor::Properties; |
| 2528 | using ::mlir::RegionBranchOpInterface::Trait<ExecuteOp>::getEntrySuccessorRegions; |
| 2529 | using ::mlir::RegionBranchOpInterface::Trait<ExecuteOp>::getSuccessorRegions; |
| 2530 | using ::mlir::RegionBranchOpInterface::Trait<ExecuteOp>::getPredecessors; |
| 2531 | using ::mlir::RegionBranchOpInterface::Trait<ExecuteOp>::getPredecessorValues; |
| 2532 | using ::mlir::RegionBranchOpInterface::Trait<ExecuteOp>::getRegionInvocationBounds; |
| 2533 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 2534 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("operandSegmentSizes" )}; |
| 2535 | return ::llvm::ArrayRef(attrNames); |
| 2536 | } |
| 2537 | |
| 2538 | ::mlir::StringAttr getOperandSegmentSizesAttrName() { |
| 2539 | return (*this)->getName().getAttributeNames().back(); |
| 2540 | } |
| 2541 | |
| 2542 | static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) { |
| 2543 | return name.getAttributeNames().back(); |
| 2544 | } |
| 2545 | |
| 2546 | void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn); |
| 2547 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 2548 | return ::llvm::StringLiteral("async.execute" ); |
| 2549 | } |
| 2550 | |
| 2551 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index); |
| 2552 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 2553 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 2554 | return getOperation()->getOperands().slice(n: start, m: length); |
| 2555 | } |
| 2556 | |
| 2557 | ::mlir::Operation::operand_range getDependencies() { |
| 2558 | return getODSOperands(index: 0); |
| 2559 | } |
| 2560 | |
| 2561 | ::mlir::Operation::operand_range getBodyOperands() { |
| 2562 | return getODSOperands(index: 1); |
| 2563 | } |
| 2564 | |
| 2565 | ::mlir::MutableOperandRange getDependenciesMutable(); |
| 2566 | ::mlir::MutableOperandRange getBodyOperandsMutable(); |
| 2567 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index); |
| 2568 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 2569 | auto valueRange = getODSResultIndexAndLength(index); |
| 2570 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 2571 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 2572 | } |
| 2573 | |
| 2574 | ::mlir::TypedValue<::mlir::async::TokenType> getToken() { |
| 2575 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::TokenType>>(Val: *getODSResults(index: 0).begin()); |
| 2576 | } |
| 2577 | |
| 2578 | ::mlir::Operation::result_range getBodyResults() { |
| 2579 | return getODSResults(index: 1); |
| 2580 | } |
| 2581 | |
| 2582 | ::mlir::Region &getBodyRegion() { |
| 2583 | return (*this)->getRegion(index: 0); |
| 2584 | } |
| 2585 | |
| 2586 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2587 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 2588 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 2589 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 2590 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 2591 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 2592 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2593 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 2594 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 2595 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, TypeRange resultTypes, ValueRange dependencies, ValueRange operands, function_ref<void(OpBuilder &, Location, ValueRange)> bodyBuilder = nullptr); |
| 2596 | static ExecuteOp create(::mlir::OpBuilder &builder, ::mlir::Location location, TypeRange resultTypes, ValueRange dependencies, ValueRange operands, function_ref<void(OpBuilder &, Location, ValueRange)> bodyBuilder = nullptr); |
| 2597 | static ExecuteOp create(::mlir::ImplicitLocOpBuilder &builder, TypeRange resultTypes, ValueRange dependencies, ValueRange operands, function_ref<void(OpBuilder &, Location, ValueRange)> bodyBuilder = nullptr); |
| 2598 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 2599 | void print(::mlir::OpAsmPrinter &p); |
| 2600 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 2601 | ::llvm::LogicalResult verifyInvariants(); |
| 2602 | ::llvm::LogicalResult verifyRegions(); |
| 2603 | ::mlir::OperandRange getEntrySuccessorOperands(::mlir::RegionSuccessor successor); |
| 2604 | void getSuccessorRegions(::mlir::RegionBranchPoint point, ::llvm::SmallVectorImpl<::mlir::RegionSuccessor> ®ions); |
| 2605 | ::mlir::ValueRange getSuccessorInputs(::mlir::RegionSuccessor successor); |
| 2606 | bool areTypesCompatible(::mlir::Type lhs, ::mlir::Type rhs); |
| 2607 | static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2608 | private: |
| 2609 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 2610 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 2611 | } |
| 2612 | |
| 2613 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 2614 | return {}; |
| 2615 | } |
| 2616 | |
| 2617 | public: |
| 2618 | using BodyBuilderFn = |
| 2619 | function_ref<void(OpBuilder &, Location, ValueRange)>; |
| 2620 | |
| 2621 | }; |
| 2622 | |
| 2623 | } // namespace mlir::async |
| 2624 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::ExecuteOp) |
| 2625 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::detail::ExecuteOpGenericAdaptorBase::Properties) |
| 2626 | |
| 2627 | namespace mlir::async { |
| 2628 | |
| 2629 | |
| 2630 | //===----------------------------------------------------------------------===// |
| 2631 | // ::mlir::async::FuncOp declarations |
| 2632 | //===----------------------------------------------------------------------===// |
| 2633 | |
| 2634 | namespace detail { |
| 2635 | |
| 2636 | class FuncOpGenericAdaptorBase { |
| 2637 | public: |
| 2638 | struct Properties { |
| 2639 | using arg_attrsTy = ::mlir::ArrayAttr; |
| 2640 | arg_attrsTy arg_attrs; |
| 2641 | |
| 2642 | auto getArgAttrs() const { |
| 2643 | auto &propStorage = this->arg_attrs; |
| 2644 | return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(Val: propStorage); |
| 2645 | } |
| 2646 | void setArgAttrs(const ::mlir::ArrayAttr &propValue) { |
| 2647 | this->arg_attrs = propValue; |
| 2648 | } |
| 2649 | using function_typeTy = ::mlir::TypeAttr; |
| 2650 | function_typeTy function_type; |
| 2651 | |
| 2652 | auto getFunctionType() const { |
| 2653 | auto &propStorage = this->function_type; |
| 2654 | return ::llvm::cast<::mlir::TypeAttr>(Val: propStorage); |
| 2655 | } |
| 2656 | void setFunctionType(const ::mlir::TypeAttr &propValue) { |
| 2657 | this->function_type = propValue; |
| 2658 | } |
| 2659 | using res_attrsTy = ::mlir::ArrayAttr; |
| 2660 | res_attrsTy res_attrs; |
| 2661 | |
| 2662 | auto getResAttrs() const { |
| 2663 | auto &propStorage = this->res_attrs; |
| 2664 | return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(Val: propStorage); |
| 2665 | } |
| 2666 | void setResAttrs(const ::mlir::ArrayAttr &propValue) { |
| 2667 | this->res_attrs = propValue; |
| 2668 | } |
| 2669 | using sym_nameTy = ::mlir::StringAttr; |
| 2670 | sym_nameTy sym_name; |
| 2671 | |
| 2672 | auto getSymName() const { |
| 2673 | auto &propStorage = this->sym_name; |
| 2674 | return ::llvm::cast<::mlir::StringAttr>(Val: propStorage); |
| 2675 | } |
| 2676 | void setSymName(const ::mlir::StringAttr &propValue) { |
| 2677 | this->sym_name = propValue; |
| 2678 | } |
| 2679 | using sym_visibilityTy = ::mlir::StringAttr; |
| 2680 | sym_visibilityTy sym_visibility; |
| 2681 | |
| 2682 | auto getSymVisibility() const { |
| 2683 | auto &propStorage = this->sym_visibility; |
| 2684 | return ::llvm::dyn_cast_or_null<::mlir::StringAttr>(Val: propStorage); |
| 2685 | } |
| 2686 | void setSymVisibility(const ::mlir::StringAttr &propValue) { |
| 2687 | this->sym_visibility = propValue; |
| 2688 | } |
| 2689 | bool operator==(const Properties &rhs) const { |
| 2690 | return |
| 2691 | rhs.arg_attrs == this->arg_attrs && |
| 2692 | rhs.function_type == this->function_type && |
| 2693 | rhs.res_attrs == this->res_attrs && |
| 2694 | rhs.sym_name == this->sym_name && |
| 2695 | rhs.sym_visibility == this->sym_visibility && |
| 2696 | true; |
| 2697 | } |
| 2698 | bool operator!=(const Properties &rhs) const { |
| 2699 | return !(*this == rhs); |
| 2700 | } |
| 2701 | }; |
| 2702 | protected: |
| 2703 | ::mlir::DictionaryAttr odsAttrs; |
| 2704 | ::std::optional<::mlir::OperationName> odsOpName; |
| 2705 | Properties properties; |
| 2706 | ::mlir::RegionRange odsRegions; |
| 2707 | public: |
| 2708 | FuncOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 2709 | odsOpName.emplace(args: "async.func" , args: odsAttrs.getContext()); |
| 2710 | } |
| 2711 | |
| 2712 | FuncOpGenericAdaptorBase(FuncOp op); |
| 2713 | |
| 2714 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 2715 | return {index, 1}; |
| 2716 | } |
| 2717 | |
| 2718 | const Properties &getProperties() { |
| 2719 | return properties; |
| 2720 | } |
| 2721 | |
| 2722 | ::mlir::DictionaryAttr getAttributes() { |
| 2723 | return odsAttrs; |
| 2724 | } |
| 2725 | |
| 2726 | ::mlir::StringAttr getSymNameAttr() { |
| 2727 | auto attr = ::llvm::cast<::mlir::StringAttr>(Val: getProperties().sym_name); |
| 2728 | return attr; |
| 2729 | } |
| 2730 | |
| 2731 | ::llvm::StringRef getSymName(); |
| 2732 | ::mlir::TypeAttr getFunctionTypeAttr() { |
| 2733 | auto attr = ::llvm::cast<::mlir::TypeAttr>(Val: getProperties().function_type); |
| 2734 | return attr; |
| 2735 | } |
| 2736 | |
| 2737 | ::mlir::FunctionType getFunctionType(); |
| 2738 | ::mlir::StringAttr getSymVisibilityAttr() { |
| 2739 | auto attr = ::llvm::dyn_cast_or_null<::mlir::StringAttr>(Val: getProperties().sym_visibility); |
| 2740 | return attr; |
| 2741 | } |
| 2742 | |
| 2743 | ::std::optional< ::llvm::StringRef > getSymVisibility(); |
| 2744 | ::mlir::ArrayAttr getArgAttrsAttr() { |
| 2745 | auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(Val: getProperties().arg_attrs); |
| 2746 | return attr; |
| 2747 | } |
| 2748 | |
| 2749 | ::std::optional< ::mlir::ArrayAttr > getArgAttrs(); |
| 2750 | ::mlir::ArrayAttr getResAttrsAttr() { |
| 2751 | auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(Val: getProperties().res_attrs); |
| 2752 | return attr; |
| 2753 | } |
| 2754 | |
| 2755 | ::std::optional< ::mlir::ArrayAttr > getResAttrs(); |
| 2756 | ::mlir::Region &getBody() { |
| 2757 | return *odsRegions[0]; |
| 2758 | } |
| 2759 | |
| 2760 | ::mlir::RegionRange getRegions() { |
| 2761 | return odsRegions; |
| 2762 | } |
| 2763 | |
| 2764 | }; |
| 2765 | |
| 2766 | } // namespace detail |
| 2767 | template <typename RangeT> |
| 2768 | class FuncOpGenericAdaptor : public detail::FuncOpGenericAdaptorBase { |
| 2769 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 2770 | using Base = detail::FuncOpGenericAdaptorBase; |
| 2771 | public: |
| 2772 | FuncOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 2773 | |
| 2774 | FuncOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : FuncOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 2775 | |
| 2776 | FuncOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : FuncOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 2777 | |
| 2778 | FuncOpGenericAdaptor(RangeT values, const FuncOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 2779 | |
| 2780 | template <typename LateInst = FuncOp, typename = std::enable_if_t<std::is_same_v<LateInst, FuncOp>>> |
| 2781 | FuncOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 2782 | |
| 2783 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2784 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 2785 | } |
| 2786 | |
| 2787 | RangeT getODSOperands(unsigned index) { |
| 2788 | auto valueRange = getODSOperandIndexAndLength(index); |
| 2789 | return {std::next(odsOperands.begin(), valueRange.first), |
| 2790 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 2791 | } |
| 2792 | |
| 2793 | RangeT getOperands() { |
| 2794 | return odsOperands; |
| 2795 | } |
| 2796 | |
| 2797 | private: |
| 2798 | RangeT odsOperands; |
| 2799 | }; |
| 2800 | class FuncOpAdaptor : public FuncOpGenericAdaptor<::mlir::ValueRange> { |
| 2801 | public: |
| 2802 | using FuncOpGenericAdaptor::FuncOpGenericAdaptor; |
| 2803 | FuncOpAdaptor(FuncOp op); |
| 2804 | |
| 2805 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 2806 | }; |
| 2807 | class FuncOp : public ::mlir::Op<FuncOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SymbolName, ::mlir::OpTrait::SymbolVisibility, ::mlir::SymbolOpInterface::Trait, ::mlir::ArgAndResultAttrsOpInterface::Trait, ::mlir::CallableOpInterface::Trait, ::mlir::FunctionOpInterface::Trait, ::mlir::OpTrait::IsIsolatedFromAbove, ::mlir::OpAsmOpInterface::Trait> { |
| 2808 | public: |
| 2809 | using Op::Op; |
| 2810 | using Op::print; |
| 2811 | using Adaptor = FuncOpAdaptor; |
| 2812 | template <typename RangeT> |
| 2813 | using GenericAdaptor = FuncOpGenericAdaptor<RangeT>; |
| 2814 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 2815 | using Properties = FoldAdaptor::Properties; |
| 2816 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 2817 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("arg_attrs" ), ::llvm::StringRef("function_type" ), ::llvm::StringRef("res_attrs" ), ::llvm::StringRef("sym_name" ), ::llvm::StringRef("sym_visibility" )}; |
| 2818 | return ::llvm::ArrayRef(attrNames); |
| 2819 | } |
| 2820 | |
| 2821 | ::mlir::StringAttr getArgAttrsAttrName() { |
| 2822 | return getAttributeNameForIndex(index: 0); |
| 2823 | } |
| 2824 | |
| 2825 | static ::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name) { |
| 2826 | return getAttributeNameForIndex(name, index: 0); |
| 2827 | } |
| 2828 | |
| 2829 | ::mlir::StringAttr getFunctionTypeAttrName() { |
| 2830 | return getAttributeNameForIndex(index: 1); |
| 2831 | } |
| 2832 | |
| 2833 | static ::mlir::StringAttr getFunctionTypeAttrName(::mlir::OperationName name) { |
| 2834 | return getAttributeNameForIndex(name, index: 1); |
| 2835 | } |
| 2836 | |
| 2837 | ::mlir::StringAttr getResAttrsAttrName() { |
| 2838 | return getAttributeNameForIndex(index: 2); |
| 2839 | } |
| 2840 | |
| 2841 | static ::mlir::StringAttr getResAttrsAttrName(::mlir::OperationName name) { |
| 2842 | return getAttributeNameForIndex(name, index: 2); |
| 2843 | } |
| 2844 | |
| 2845 | ::mlir::StringAttr getSymNameAttrName() { |
| 2846 | return getAttributeNameForIndex(index: 3); |
| 2847 | } |
| 2848 | |
| 2849 | static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) { |
| 2850 | return getAttributeNameForIndex(name, index: 3); |
| 2851 | } |
| 2852 | |
| 2853 | ::mlir::StringAttr getSymVisibilityAttrName() { |
| 2854 | return getAttributeNameForIndex(index: 4); |
| 2855 | } |
| 2856 | |
| 2857 | static ::mlir::StringAttr getSymVisibilityAttrName(::mlir::OperationName name) { |
| 2858 | return getAttributeNameForIndex(name, index: 4); |
| 2859 | } |
| 2860 | |
| 2861 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 2862 | return ::llvm::StringLiteral("async.func" ); |
| 2863 | } |
| 2864 | |
| 2865 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2866 | return {index, 1}; |
| 2867 | } |
| 2868 | |
| 2869 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 2870 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 2871 | return getOperation()->getOperands().slice(n: start, m: length); |
| 2872 | } |
| 2873 | |
| 2874 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 2875 | return {index, 1}; |
| 2876 | } |
| 2877 | |
| 2878 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 2879 | auto valueRange = getODSResultIndexAndLength(index); |
| 2880 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 2881 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 2882 | } |
| 2883 | |
| 2884 | ::mlir::Region &getBody() { |
| 2885 | return (*this)->getRegion(index: 0); |
| 2886 | } |
| 2887 | |
| 2888 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2889 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 2890 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 2891 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 2892 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 2893 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 2894 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2895 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 2896 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 2897 | ::mlir::StringAttr getSymNameAttr() { |
| 2898 | return ::llvm::cast<::mlir::StringAttr>(Val&: getProperties().sym_name); |
| 2899 | } |
| 2900 | |
| 2901 | ::llvm::StringRef getSymName(); |
| 2902 | ::mlir::TypeAttr getFunctionTypeAttr() { |
| 2903 | return ::llvm::cast<::mlir::TypeAttr>(Val&: getProperties().function_type); |
| 2904 | } |
| 2905 | |
| 2906 | ::mlir::FunctionType getFunctionType(); |
| 2907 | ::mlir::StringAttr getSymVisibilityAttr() { |
| 2908 | return ::llvm::dyn_cast_or_null<::mlir::StringAttr>(Val&: getProperties().sym_visibility); |
| 2909 | } |
| 2910 | |
| 2911 | ::std::optional< ::llvm::StringRef > getSymVisibility(); |
| 2912 | ::mlir::ArrayAttr getArgAttrsAttr() { |
| 2913 | return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(Val&: getProperties().arg_attrs); |
| 2914 | } |
| 2915 | |
| 2916 | ::std::optional< ::mlir::ArrayAttr > getArgAttrs(); |
| 2917 | ::mlir::ArrayAttr getResAttrsAttr() { |
| 2918 | return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(Val&: getProperties().res_attrs); |
| 2919 | } |
| 2920 | |
| 2921 | ::std::optional< ::mlir::ArrayAttr > getResAttrs(); |
| 2922 | void setSymNameAttr(::mlir::StringAttr attr) { |
| 2923 | getProperties().sym_name = attr; |
| 2924 | } |
| 2925 | |
| 2926 | void setSymName(::llvm::StringRef attrValue); |
| 2927 | void setFunctionTypeAttr(::mlir::TypeAttr attr) { |
| 2928 | getProperties().function_type = attr; |
| 2929 | } |
| 2930 | |
| 2931 | void setFunctionType(::mlir::FunctionType attrValue); |
| 2932 | void setSymVisibilityAttr(::mlir::StringAttr attr) { |
| 2933 | getProperties().sym_visibility = attr; |
| 2934 | } |
| 2935 | |
| 2936 | void setSymVisibility(::std::optional<::llvm::StringRef> attrValue); |
| 2937 | void setArgAttrsAttr(::mlir::ArrayAttr attr) { |
| 2938 | getProperties().arg_attrs = attr; |
| 2939 | } |
| 2940 | |
| 2941 | void setResAttrsAttr(::mlir::ArrayAttr attr) { |
| 2942 | getProperties().res_attrs = attr; |
| 2943 | } |
| 2944 | |
| 2945 | ::mlir::Attribute removeSymVisibilityAttr() { |
| 2946 | auto attr = getProperties().sym_visibility; |
| 2947 | getProperties().sym_visibility = {}; |
| 2948 | return attr; |
| 2949 | } |
| 2950 | |
| 2951 | ::mlir::Attribute removeArgAttrsAttr() { |
| 2952 | auto attr = getProperties().arg_attrs; |
| 2953 | getProperties().arg_attrs = {}; |
| 2954 | return attr; |
| 2955 | } |
| 2956 | |
| 2957 | ::mlir::Attribute removeResAttrsAttr() { |
| 2958 | auto attr = getProperties().res_attrs; |
| 2959 | getProperties().res_attrs = {}; |
| 2960 | return attr; |
| 2961 | } |
| 2962 | |
| 2963 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, StringRef name, FunctionType type, ArrayRef<NamedAttribute> attrs = {}, ArrayRef<DictionaryAttr> argAttrs = {}); |
| 2964 | static FuncOp create(::mlir::OpBuilder &builder, ::mlir::Location location, StringRef name, FunctionType type, ArrayRef<NamedAttribute> attrs = {}, ArrayRef<DictionaryAttr> argAttrs = {}); |
| 2965 | static FuncOp create(::mlir::ImplicitLocOpBuilder &builder, StringRef name, FunctionType type, ArrayRef<NamedAttribute> attrs = {}, ArrayRef<DictionaryAttr> argAttrs = {}); |
| 2966 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::StringAttr sym_visibility, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 2967 | static FuncOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::StringAttr sym_visibility, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 2968 | static FuncOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::StringAttr sym_visibility, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 2969 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::StringAttr sym_visibility, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 2970 | static FuncOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::StringAttr sym_visibility, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 2971 | static FuncOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::StringAttr sym_visibility, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 2972 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::StringAttr sym_visibility, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 2973 | static FuncOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::StringAttr sym_visibility, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 2974 | static FuncOp create(::mlir::ImplicitLocOpBuilder &builder, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::StringAttr sym_visibility, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 2975 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::StringAttr sym_visibility, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 2976 | static FuncOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::StringAttr sym_visibility, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 2977 | static FuncOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::StringAttr sym_visibility, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs); |
| 2978 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 2979 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2980 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 2981 | static FuncOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2982 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 2983 | static FuncOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2984 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2985 | static FuncOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2986 | static FuncOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2987 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 2988 | void print(::mlir::OpAsmPrinter &p); |
| 2989 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 2990 | ::llvm::LogicalResult verifyInvariants(); |
| 2991 | ::llvm::LogicalResult verify(); |
| 2992 | static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2993 | private: |
| 2994 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 2995 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 2996 | } |
| 2997 | |
| 2998 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 2999 | assert(index < 5 && "invalid attribute index" ); |
| 3000 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 3001 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 3002 | "dependent dialect loading?" ); |
| 3003 | return name.getAttributeNames()[index]; |
| 3004 | } |
| 3005 | |
| 3006 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 3007 | public: |
| 3008 | //===------------------------------------------------------------------===// |
| 3009 | // FunctionOpInterface Methods |
| 3010 | //===------------------------------------------------------------------===// |
| 3011 | |
| 3012 | /// Returns the region on the current operation that is callable. This may |
| 3013 | /// return null in the case of an external callable object, e.g. an external |
| 3014 | /// function. |
| 3015 | ::mlir::Region *getCallableRegion() { return isExternal() ? nullptr |
| 3016 | : &getBody(); } |
| 3017 | |
| 3018 | /// Returns the argument types of this async function. |
| 3019 | ArrayRef<Type> getArgumentTypes() { return getFunctionType().getInputs(); } |
| 3020 | |
| 3021 | /// Returns the result types of this async function. |
| 3022 | ArrayRef<Type> getResultTypes() { return getFunctionType().getResults(); } |
| 3023 | |
| 3024 | /// Returns the number of results of this async function |
| 3025 | unsigned getNumResults() {return getResultTypes().size();} |
| 3026 | |
| 3027 | /// Is the async func stateful |
| 3028 | bool isStateful() { |
| 3029 | return isa<async::TokenType>(Val: getFunctionType().getResult(i: 0)); |
| 3030 | } |
| 3031 | |
| 3032 | //===------------------------------------------------------------------===// |
| 3033 | // OpAsmOpInterface Methods |
| 3034 | //===------------------------------------------------------------------===// |
| 3035 | |
| 3036 | /// Allow the dialect prefix to be omitted. |
| 3037 | static StringRef getDefaultDialect() { return "async" ; } |
| 3038 | |
| 3039 | //===------------------------------------------------------------------===// |
| 3040 | // SymbolOpInterface Methods |
| 3041 | //===------------------------------------------------------------------===// |
| 3042 | |
| 3043 | bool isDeclaration() { return isExternal(); } |
| 3044 | }; |
| 3045 | |
| 3046 | } // namespace mlir::async |
| 3047 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::FuncOp) |
| 3048 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::detail::FuncOpGenericAdaptorBase::Properties) |
| 3049 | |
| 3050 | namespace mlir::async { |
| 3051 | |
| 3052 | |
| 3053 | //===----------------------------------------------------------------------===// |
| 3054 | // ::mlir::async::ReturnOp declarations |
| 3055 | //===----------------------------------------------------------------------===// |
| 3056 | |
| 3057 | namespace detail { |
| 3058 | |
| 3059 | class ReturnOpGenericAdaptorBase { |
| 3060 | public: |
| 3061 | using Properties = ::mlir::EmptyProperties; |
| 3062 | protected: |
| 3063 | ::mlir::DictionaryAttr odsAttrs; |
| 3064 | ::std::optional<::mlir::OperationName> odsOpName; |
| 3065 | Properties properties; |
| 3066 | ::mlir::RegionRange odsRegions; |
| 3067 | public: |
| 3068 | ReturnOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 3069 | odsOpName.emplace(args: "async.return" , args: odsAttrs.getContext()); |
| 3070 | } |
| 3071 | |
| 3072 | ReturnOpGenericAdaptorBase(ReturnOp op); |
| 3073 | |
| 3074 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize); |
| 3075 | const Properties &getProperties() { |
| 3076 | return properties; |
| 3077 | } |
| 3078 | |
| 3079 | ::mlir::DictionaryAttr getAttributes() { |
| 3080 | return odsAttrs; |
| 3081 | } |
| 3082 | |
| 3083 | }; |
| 3084 | |
| 3085 | } // namespace detail |
| 3086 | template <typename RangeT> |
| 3087 | class ReturnOpGenericAdaptor : public detail::ReturnOpGenericAdaptorBase { |
| 3088 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 3089 | using Base = detail::ReturnOpGenericAdaptorBase; |
| 3090 | static constexpr int odsIndex_operands = 0; |
| 3091 | public: |
| 3092 | ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 3093 | |
| 3094 | ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ReturnOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 3095 | |
| 3096 | ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ReturnOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 3097 | |
| 3098 | ReturnOpGenericAdaptor(RangeT values, const ReturnOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 3099 | |
| 3100 | template <typename LateInst = ReturnOp, typename = std::enable_if_t<std::is_same_v<LateInst, ReturnOp>>> |
| 3101 | ReturnOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 3102 | |
| 3103 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3104 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 3105 | } |
| 3106 | |
| 3107 | RangeT getODSOperands(unsigned index) { |
| 3108 | auto valueRange = getODSOperandIndexAndLength(index); |
| 3109 | return {std::next(odsOperands.begin(), valueRange.first), |
| 3110 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 3111 | } |
| 3112 | |
| 3113 | RangeT getOperands() { |
| 3114 | return getODSOperands(index: 0); |
| 3115 | } |
| 3116 | |
| 3117 | private: |
| 3118 | RangeT odsOperands; |
| 3119 | }; |
| 3120 | class ReturnOpAdaptor : public ReturnOpGenericAdaptor<::mlir::ValueRange> { |
| 3121 | public: |
| 3122 | using ReturnOpGenericAdaptor::ReturnOpGenericAdaptor; |
| 3123 | ReturnOpAdaptor(ReturnOp op); |
| 3124 | |
| 3125 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 3126 | }; |
| 3127 | class ReturnOp : public ::mlir::Op<ReturnOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::HasParent<FuncOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::RegionBranchTerminatorOpInterface::Trait, ::mlir::OpTrait::ReturnLike, ::mlir::OpTrait::IsTerminator> { |
| 3128 | public: |
| 3129 | using Op::Op; |
| 3130 | using Op::print; |
| 3131 | using Adaptor = ReturnOpAdaptor; |
| 3132 | template <typename RangeT> |
| 3133 | using GenericAdaptor = ReturnOpGenericAdaptor<RangeT>; |
| 3134 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 3135 | static constexpr int odsIndex_operands = 0; |
| 3136 | using Properties = FoldAdaptor::Properties; |
| 3137 | using ::mlir::RegionBranchTerminatorOpInterface::Trait<ReturnOp>::getMutableSuccessorOperands; |
| 3138 | using ::mlir::RegionBranchTerminatorOpInterface::Trait<ReturnOp>::getSuccessorRegions; |
| 3139 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 3140 | return {}; |
| 3141 | } |
| 3142 | |
| 3143 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 3144 | return ::llvm::StringLiteral("async.return" ); |
| 3145 | } |
| 3146 | |
| 3147 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index); |
| 3148 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 3149 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 3150 | return getOperation()->getOperands().slice(n: start, m: length); |
| 3151 | } |
| 3152 | |
| 3153 | ::mlir::Operation::operand_range getOperands() { |
| 3154 | return getODSOperands(index: 0); |
| 3155 | } |
| 3156 | |
| 3157 | ::mlir::MutableOperandRange getOperandsMutable(); |
| 3158 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 3159 | return {index, 1}; |
| 3160 | } |
| 3161 | |
| 3162 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 3163 | auto valueRange = getODSResultIndexAndLength(index); |
| 3164 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 3165 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 3166 | } |
| 3167 | |
| 3168 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3169 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 3170 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 3171 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 3172 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 3173 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 3174 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3175 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState); |
| 3176 | static ReturnOp create(::mlir::OpBuilder &builder, ::mlir::Location location); |
| 3177 | static ReturnOp create(::mlir::ImplicitLocOpBuilder &builder); |
| 3178 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands); |
| 3179 | static ReturnOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands); |
| 3180 | static ReturnOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands); |
| 3181 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3182 | static ReturnOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3183 | static ReturnOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3184 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3185 | static ReturnOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3186 | static ReturnOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3187 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 3188 | ::llvm::LogicalResult verifyInvariants(); |
| 3189 | ::llvm::LogicalResult verify(); |
| 3190 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 3191 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 3192 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 3193 | public: |
| 3194 | }; |
| 3195 | |
| 3196 | } // namespace mlir::async |
| 3197 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::ReturnOp) |
| 3198 | |
| 3199 | namespace mlir::async { |
| 3200 | |
| 3201 | |
| 3202 | //===----------------------------------------------------------------------===// |
| 3203 | // ::mlir::async::RuntimeAddRefOp declarations |
| 3204 | //===----------------------------------------------------------------------===// |
| 3205 | |
| 3206 | namespace detail { |
| 3207 | |
| 3208 | class RuntimeAddRefOpGenericAdaptorBase { |
| 3209 | public: |
| 3210 | struct Properties { |
| 3211 | using countTy = ::mlir::IntegerAttr; |
| 3212 | countTy count; |
| 3213 | |
| 3214 | auto getCount() const { |
| 3215 | auto &propStorage = this->count; |
| 3216 | return ::llvm::cast<::mlir::IntegerAttr>(Val: propStorage); |
| 3217 | } |
| 3218 | void setCount(const ::mlir::IntegerAttr &propValue) { |
| 3219 | this->count = propValue; |
| 3220 | } |
| 3221 | bool operator==(const Properties &rhs) const { |
| 3222 | return |
| 3223 | rhs.count == this->count && |
| 3224 | true; |
| 3225 | } |
| 3226 | bool operator!=(const Properties &rhs) const { |
| 3227 | return !(*this == rhs); |
| 3228 | } |
| 3229 | }; |
| 3230 | protected: |
| 3231 | ::mlir::DictionaryAttr odsAttrs; |
| 3232 | ::std::optional<::mlir::OperationName> odsOpName; |
| 3233 | Properties properties; |
| 3234 | ::mlir::RegionRange odsRegions; |
| 3235 | public: |
| 3236 | RuntimeAddRefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 3237 | odsOpName.emplace(args: "async.runtime.add_ref" , args: odsAttrs.getContext()); |
| 3238 | } |
| 3239 | |
| 3240 | RuntimeAddRefOpGenericAdaptorBase(RuntimeAddRefOp op); |
| 3241 | |
| 3242 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 3243 | return {index, 1}; |
| 3244 | } |
| 3245 | |
| 3246 | const Properties &getProperties() { |
| 3247 | return properties; |
| 3248 | } |
| 3249 | |
| 3250 | ::mlir::DictionaryAttr getAttributes() { |
| 3251 | return odsAttrs; |
| 3252 | } |
| 3253 | |
| 3254 | ::mlir::IntegerAttr getCountAttr() { |
| 3255 | auto attr = ::llvm::cast<::mlir::IntegerAttr>(Val: getProperties().count); |
| 3256 | return attr; |
| 3257 | } |
| 3258 | |
| 3259 | uint64_t getCount(); |
| 3260 | }; |
| 3261 | |
| 3262 | } // namespace detail |
| 3263 | template <typename RangeT> |
| 3264 | class RuntimeAddRefOpGenericAdaptor : public detail::RuntimeAddRefOpGenericAdaptorBase { |
| 3265 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 3266 | using Base = detail::RuntimeAddRefOpGenericAdaptorBase; |
| 3267 | static constexpr int odsIndex_operand = 0; |
| 3268 | public: |
| 3269 | RuntimeAddRefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 3270 | |
| 3271 | RuntimeAddRefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeAddRefOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 3272 | |
| 3273 | RuntimeAddRefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeAddRefOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 3274 | |
| 3275 | RuntimeAddRefOpGenericAdaptor(RangeT values, const RuntimeAddRefOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 3276 | |
| 3277 | template <typename LateInst = RuntimeAddRefOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeAddRefOp>>> |
| 3278 | RuntimeAddRefOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 3279 | |
| 3280 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3281 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 3282 | } |
| 3283 | |
| 3284 | RangeT getODSOperands(unsigned index) { |
| 3285 | auto valueRange = getODSOperandIndexAndLength(index); |
| 3286 | return {std::next(odsOperands.begin(), valueRange.first), |
| 3287 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 3288 | } |
| 3289 | |
| 3290 | ValueT getOperand() { |
| 3291 | return (*getODSOperands(index: 0).begin()); |
| 3292 | } |
| 3293 | |
| 3294 | RangeT getOperands() { |
| 3295 | return odsOperands; |
| 3296 | } |
| 3297 | |
| 3298 | private: |
| 3299 | RangeT odsOperands; |
| 3300 | }; |
| 3301 | class RuntimeAddRefOpAdaptor : public RuntimeAddRefOpGenericAdaptor<::mlir::ValueRange> { |
| 3302 | public: |
| 3303 | using RuntimeAddRefOpGenericAdaptor::RuntimeAddRefOpGenericAdaptor; |
| 3304 | RuntimeAddRefOpAdaptor(RuntimeAddRefOp op); |
| 3305 | |
| 3306 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 3307 | }; |
| 3308 | class RuntimeAddRefOp : public ::mlir::Op<RuntimeAddRefOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait> { |
| 3309 | public: |
| 3310 | using Op::Op; |
| 3311 | using Op::print; |
| 3312 | using Adaptor = RuntimeAddRefOpAdaptor; |
| 3313 | template <typename RangeT> |
| 3314 | using GenericAdaptor = RuntimeAddRefOpGenericAdaptor<RangeT>; |
| 3315 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 3316 | static constexpr int odsIndex_operand = 0; |
| 3317 | using Properties = FoldAdaptor::Properties; |
| 3318 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 3319 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("count" )}; |
| 3320 | return ::llvm::ArrayRef(attrNames); |
| 3321 | } |
| 3322 | |
| 3323 | ::mlir::StringAttr getCountAttrName() { |
| 3324 | return getAttributeNameForIndex(index: 0); |
| 3325 | } |
| 3326 | |
| 3327 | static ::mlir::StringAttr getCountAttrName(::mlir::OperationName name) { |
| 3328 | return getAttributeNameForIndex(name, index: 0); |
| 3329 | } |
| 3330 | |
| 3331 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 3332 | return ::llvm::StringLiteral("async.runtime.add_ref" ); |
| 3333 | } |
| 3334 | |
| 3335 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3336 | return {index, 1}; |
| 3337 | } |
| 3338 | |
| 3339 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 3340 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 3341 | return getOperation()->getOperands().slice(n: start, m: length); |
| 3342 | } |
| 3343 | |
| 3344 | ::mlir::TypedValue<::mlir::Type> getOperand() { |
| 3345 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 3346 | } |
| 3347 | |
| 3348 | ::mlir::OpOperand &getOperandMutable() { |
| 3349 | auto range = getODSOperandIndexAndLength(index: 0); |
| 3350 | return getOperation()->getOpOperand(idx: range.first); |
| 3351 | } |
| 3352 | |
| 3353 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 3354 | return {index, 1}; |
| 3355 | } |
| 3356 | |
| 3357 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 3358 | auto valueRange = getODSResultIndexAndLength(index); |
| 3359 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 3360 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 3361 | } |
| 3362 | |
| 3363 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3364 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 3365 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 3366 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 3367 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 3368 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 3369 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3370 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 3371 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 3372 | ::mlir::IntegerAttr getCountAttr() { |
| 3373 | return ::llvm::cast<::mlir::IntegerAttr>(Val&: getProperties().count); |
| 3374 | } |
| 3375 | |
| 3376 | uint64_t getCount(); |
| 3377 | void setCountAttr(::mlir::IntegerAttr attr) { |
| 3378 | getProperties().count = attr; |
| 3379 | } |
| 3380 | |
| 3381 | void setCount(uint64_t attrValue); |
| 3382 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand, ::mlir::IntegerAttr count); |
| 3383 | static RuntimeAddRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand, ::mlir::IntegerAttr count); |
| 3384 | static RuntimeAddRefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand, ::mlir::IntegerAttr count); |
| 3385 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::IntegerAttr count); |
| 3386 | static RuntimeAddRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::IntegerAttr count); |
| 3387 | static RuntimeAddRefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::IntegerAttr count); |
| 3388 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand, uint64_t count); |
| 3389 | static RuntimeAddRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand, uint64_t count); |
| 3390 | static RuntimeAddRefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand, uint64_t count); |
| 3391 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, uint64_t count); |
| 3392 | static RuntimeAddRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand, uint64_t count); |
| 3393 | static RuntimeAddRefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand, uint64_t count); |
| 3394 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3395 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3396 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3397 | static RuntimeAddRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3398 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3399 | static RuntimeAddRefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3400 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3401 | static RuntimeAddRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3402 | static RuntimeAddRefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3403 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 3404 | ::llvm::LogicalResult verifyInvariants(); |
| 3405 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 3406 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 3407 | private: |
| 3408 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 3409 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 3410 | } |
| 3411 | |
| 3412 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 3413 | assert(index < 1 && "invalid attribute index" ); |
| 3414 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 3415 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 3416 | "dependent dialect loading?" ); |
| 3417 | return name.getAttributeNames()[index]; |
| 3418 | } |
| 3419 | |
| 3420 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 3421 | public: |
| 3422 | }; |
| 3423 | |
| 3424 | } // namespace mlir::async |
| 3425 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeAddRefOp) |
| 3426 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::detail::RuntimeAddRefOpGenericAdaptorBase::Properties) |
| 3427 | |
| 3428 | namespace mlir::async { |
| 3429 | |
| 3430 | |
| 3431 | //===----------------------------------------------------------------------===// |
| 3432 | // ::mlir::async::RuntimeAddToGroupOp declarations |
| 3433 | //===----------------------------------------------------------------------===// |
| 3434 | |
| 3435 | namespace detail { |
| 3436 | |
| 3437 | class RuntimeAddToGroupOpGenericAdaptorBase { |
| 3438 | public: |
| 3439 | using Properties = ::mlir::EmptyProperties; |
| 3440 | protected: |
| 3441 | ::mlir::DictionaryAttr odsAttrs; |
| 3442 | ::std::optional<::mlir::OperationName> odsOpName; |
| 3443 | Properties properties; |
| 3444 | ::mlir::RegionRange odsRegions; |
| 3445 | public: |
| 3446 | RuntimeAddToGroupOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 3447 | odsOpName.emplace(args: "async.runtime.add_to_group" , args: odsAttrs.getContext()); |
| 3448 | } |
| 3449 | |
| 3450 | RuntimeAddToGroupOpGenericAdaptorBase(RuntimeAddToGroupOp op); |
| 3451 | |
| 3452 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 3453 | return {index, 1}; |
| 3454 | } |
| 3455 | |
| 3456 | const Properties &getProperties() { |
| 3457 | return properties; |
| 3458 | } |
| 3459 | |
| 3460 | ::mlir::DictionaryAttr getAttributes() { |
| 3461 | return odsAttrs; |
| 3462 | } |
| 3463 | |
| 3464 | }; |
| 3465 | |
| 3466 | } // namespace detail |
| 3467 | template <typename RangeT> |
| 3468 | class RuntimeAddToGroupOpGenericAdaptor : public detail::RuntimeAddToGroupOpGenericAdaptorBase { |
| 3469 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 3470 | using Base = detail::RuntimeAddToGroupOpGenericAdaptorBase; |
| 3471 | static constexpr int odsIndex_operand = 0; |
| 3472 | static constexpr int odsIndex_group = 1; |
| 3473 | public: |
| 3474 | RuntimeAddToGroupOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 3475 | |
| 3476 | RuntimeAddToGroupOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeAddToGroupOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 3477 | |
| 3478 | RuntimeAddToGroupOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeAddToGroupOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 3479 | |
| 3480 | RuntimeAddToGroupOpGenericAdaptor(RangeT values, const RuntimeAddToGroupOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 3481 | |
| 3482 | template <typename LateInst = RuntimeAddToGroupOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeAddToGroupOp>>> |
| 3483 | RuntimeAddToGroupOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 3484 | |
| 3485 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3486 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 3487 | } |
| 3488 | |
| 3489 | RangeT getODSOperands(unsigned index) { |
| 3490 | auto valueRange = getODSOperandIndexAndLength(index); |
| 3491 | return {std::next(odsOperands.begin(), valueRange.first), |
| 3492 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 3493 | } |
| 3494 | |
| 3495 | ValueT getOperand() { |
| 3496 | return (*getODSOperands(index: 0).begin()); |
| 3497 | } |
| 3498 | |
| 3499 | ValueT getGroup() { |
| 3500 | return (*getODSOperands(index: 1).begin()); |
| 3501 | } |
| 3502 | |
| 3503 | RangeT getOperands() { |
| 3504 | return odsOperands; |
| 3505 | } |
| 3506 | |
| 3507 | private: |
| 3508 | RangeT odsOperands; |
| 3509 | }; |
| 3510 | class RuntimeAddToGroupOpAdaptor : public RuntimeAddToGroupOpGenericAdaptor<::mlir::ValueRange> { |
| 3511 | public: |
| 3512 | using RuntimeAddToGroupOpGenericAdaptor::RuntimeAddToGroupOpGenericAdaptor; |
| 3513 | RuntimeAddToGroupOpAdaptor(RuntimeAddToGroupOp op); |
| 3514 | |
| 3515 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 3516 | }; |
| 3517 | class RuntimeAddToGroupOp : public ::mlir::Op<RuntimeAddToGroupOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::IndexType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::InferTypeOpInterface::Trait> { |
| 3518 | public: |
| 3519 | using Op::Op; |
| 3520 | using Op::print; |
| 3521 | using Adaptor = RuntimeAddToGroupOpAdaptor; |
| 3522 | template <typename RangeT> |
| 3523 | using GenericAdaptor = RuntimeAddToGroupOpGenericAdaptor<RangeT>; |
| 3524 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 3525 | static constexpr int odsIndex_operand = 0; |
| 3526 | static constexpr int odsIndex_group = 1; |
| 3527 | static constexpr int odsIndex_rank = 0; |
| 3528 | using Properties = FoldAdaptor::Properties; |
| 3529 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 3530 | return {}; |
| 3531 | } |
| 3532 | |
| 3533 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 3534 | return ::llvm::StringLiteral("async.runtime.add_to_group" ); |
| 3535 | } |
| 3536 | |
| 3537 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3538 | return {index, 1}; |
| 3539 | } |
| 3540 | |
| 3541 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 3542 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 3543 | return getOperation()->getOperands().slice(n: start, m: length); |
| 3544 | } |
| 3545 | |
| 3546 | ::mlir::TypedValue<::mlir::Type> getOperand() { |
| 3547 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 3548 | } |
| 3549 | |
| 3550 | ::mlir::TypedValue<::mlir::async::GroupType> getGroup() { |
| 3551 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::GroupType>>(Val: *getODSOperands(index: 1).begin()); |
| 3552 | } |
| 3553 | |
| 3554 | ::mlir::OpOperand &getOperandMutable() { |
| 3555 | auto range = getODSOperandIndexAndLength(index: 0); |
| 3556 | return getOperation()->getOpOperand(idx: range.first); |
| 3557 | } |
| 3558 | |
| 3559 | ::mlir::OpOperand &getGroupMutable() { |
| 3560 | auto range = getODSOperandIndexAndLength(index: 1); |
| 3561 | return getOperation()->getOpOperand(idx: range.first); |
| 3562 | } |
| 3563 | |
| 3564 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 3565 | return {index, 1}; |
| 3566 | } |
| 3567 | |
| 3568 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 3569 | auto valueRange = getODSResultIndexAndLength(index); |
| 3570 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 3571 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 3572 | } |
| 3573 | |
| 3574 | ::mlir::TypedValue<::mlir::IndexType> getRank() { |
| 3575 | return ::llvm::cast<::mlir::TypedValue<::mlir::IndexType>>(Val: *getODSResults(index: 0).begin()); |
| 3576 | } |
| 3577 | |
| 3578 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3579 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 3580 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 3581 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 3582 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 3583 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 3584 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3585 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type rank, ::mlir::Value operand, ::mlir::Value group); |
| 3586 | static RuntimeAddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type rank, ::mlir::Value operand, ::mlir::Value group); |
| 3587 | static RuntimeAddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type rank, ::mlir::Value operand, ::mlir::Value group); |
| 3588 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand, ::mlir::Value group); |
| 3589 | static RuntimeAddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand, ::mlir::Value group); |
| 3590 | static RuntimeAddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand, ::mlir::Value group); |
| 3591 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value group); |
| 3592 | static RuntimeAddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value group); |
| 3593 | static RuntimeAddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value group); |
| 3594 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3595 | static RuntimeAddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3596 | static RuntimeAddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3597 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3598 | static RuntimeAddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3599 | static RuntimeAddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3600 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3601 | static RuntimeAddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3602 | static RuntimeAddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3603 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3604 | static RuntimeAddToGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3605 | static RuntimeAddToGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3606 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 3607 | ::llvm::LogicalResult verifyInvariants(); |
| 3608 | static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); |
| 3609 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 3610 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 3611 | public: |
| 3612 | }; |
| 3613 | |
| 3614 | } // namespace mlir::async |
| 3615 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeAddToGroupOp) |
| 3616 | |
| 3617 | namespace mlir::async { |
| 3618 | |
| 3619 | |
| 3620 | //===----------------------------------------------------------------------===// |
| 3621 | // ::mlir::async::RuntimeAwaitAndResumeOp declarations |
| 3622 | //===----------------------------------------------------------------------===// |
| 3623 | |
| 3624 | namespace detail { |
| 3625 | |
| 3626 | class RuntimeAwaitAndResumeOpGenericAdaptorBase { |
| 3627 | public: |
| 3628 | using Properties = ::mlir::EmptyProperties; |
| 3629 | protected: |
| 3630 | ::mlir::DictionaryAttr odsAttrs; |
| 3631 | ::std::optional<::mlir::OperationName> odsOpName; |
| 3632 | Properties properties; |
| 3633 | ::mlir::RegionRange odsRegions; |
| 3634 | public: |
| 3635 | RuntimeAwaitAndResumeOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 3636 | odsOpName.emplace(args: "async.runtime.await_and_resume" , args: odsAttrs.getContext()); |
| 3637 | } |
| 3638 | |
| 3639 | RuntimeAwaitAndResumeOpGenericAdaptorBase(RuntimeAwaitAndResumeOp op); |
| 3640 | |
| 3641 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 3642 | return {index, 1}; |
| 3643 | } |
| 3644 | |
| 3645 | const Properties &getProperties() { |
| 3646 | return properties; |
| 3647 | } |
| 3648 | |
| 3649 | ::mlir::DictionaryAttr getAttributes() { |
| 3650 | return odsAttrs; |
| 3651 | } |
| 3652 | |
| 3653 | }; |
| 3654 | |
| 3655 | } // namespace detail |
| 3656 | template <typename RangeT> |
| 3657 | class RuntimeAwaitAndResumeOpGenericAdaptor : public detail::RuntimeAwaitAndResumeOpGenericAdaptorBase { |
| 3658 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 3659 | using Base = detail::RuntimeAwaitAndResumeOpGenericAdaptorBase; |
| 3660 | static constexpr int odsIndex_operand = 0; |
| 3661 | static constexpr int odsIndex_handle = 1; |
| 3662 | public: |
| 3663 | RuntimeAwaitAndResumeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 3664 | |
| 3665 | RuntimeAwaitAndResumeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeAwaitAndResumeOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 3666 | |
| 3667 | RuntimeAwaitAndResumeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeAwaitAndResumeOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 3668 | |
| 3669 | RuntimeAwaitAndResumeOpGenericAdaptor(RangeT values, const RuntimeAwaitAndResumeOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 3670 | |
| 3671 | template <typename LateInst = RuntimeAwaitAndResumeOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeAwaitAndResumeOp>>> |
| 3672 | RuntimeAwaitAndResumeOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 3673 | |
| 3674 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3675 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 3676 | } |
| 3677 | |
| 3678 | RangeT getODSOperands(unsigned index) { |
| 3679 | auto valueRange = getODSOperandIndexAndLength(index); |
| 3680 | return {std::next(odsOperands.begin(), valueRange.first), |
| 3681 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 3682 | } |
| 3683 | |
| 3684 | ValueT getOperand() { |
| 3685 | return (*getODSOperands(index: 0).begin()); |
| 3686 | } |
| 3687 | |
| 3688 | ValueT getHandle() { |
| 3689 | return (*getODSOperands(index: 1).begin()); |
| 3690 | } |
| 3691 | |
| 3692 | RangeT getOperands() { |
| 3693 | return odsOperands; |
| 3694 | } |
| 3695 | |
| 3696 | private: |
| 3697 | RangeT odsOperands; |
| 3698 | }; |
| 3699 | class RuntimeAwaitAndResumeOpAdaptor : public RuntimeAwaitAndResumeOpGenericAdaptor<::mlir::ValueRange> { |
| 3700 | public: |
| 3701 | using RuntimeAwaitAndResumeOpGenericAdaptor::RuntimeAwaitAndResumeOpGenericAdaptor; |
| 3702 | RuntimeAwaitAndResumeOpAdaptor(RuntimeAwaitAndResumeOp op); |
| 3703 | |
| 3704 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 3705 | }; |
| 3706 | class RuntimeAwaitAndResumeOp : public ::mlir::Op<RuntimeAwaitAndResumeOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants> { |
| 3707 | public: |
| 3708 | using Op::Op; |
| 3709 | using Op::print; |
| 3710 | using Adaptor = RuntimeAwaitAndResumeOpAdaptor; |
| 3711 | template <typename RangeT> |
| 3712 | using GenericAdaptor = RuntimeAwaitAndResumeOpGenericAdaptor<RangeT>; |
| 3713 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 3714 | static constexpr int odsIndex_operand = 0; |
| 3715 | static constexpr int odsIndex_handle = 1; |
| 3716 | using Properties = FoldAdaptor::Properties; |
| 3717 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 3718 | return {}; |
| 3719 | } |
| 3720 | |
| 3721 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 3722 | return ::llvm::StringLiteral("async.runtime.await_and_resume" ); |
| 3723 | } |
| 3724 | |
| 3725 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3726 | return {index, 1}; |
| 3727 | } |
| 3728 | |
| 3729 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 3730 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 3731 | return getOperation()->getOperands().slice(n: start, m: length); |
| 3732 | } |
| 3733 | |
| 3734 | ::mlir::TypedValue<::mlir::Type> getOperand() { |
| 3735 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 3736 | } |
| 3737 | |
| 3738 | ::mlir::TypedValue<::mlir::async::CoroHandleType> getHandle() { |
| 3739 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::CoroHandleType>>(Val: *getODSOperands(index: 1).begin()); |
| 3740 | } |
| 3741 | |
| 3742 | ::mlir::OpOperand &getOperandMutable() { |
| 3743 | auto range = getODSOperandIndexAndLength(index: 0); |
| 3744 | return getOperation()->getOpOperand(idx: range.first); |
| 3745 | } |
| 3746 | |
| 3747 | ::mlir::OpOperand &getHandleMutable() { |
| 3748 | auto range = getODSOperandIndexAndLength(index: 1); |
| 3749 | return getOperation()->getOpOperand(idx: range.first); |
| 3750 | } |
| 3751 | |
| 3752 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 3753 | return {index, 1}; |
| 3754 | } |
| 3755 | |
| 3756 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 3757 | auto valueRange = getODSResultIndexAndLength(index); |
| 3758 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 3759 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 3760 | } |
| 3761 | |
| 3762 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3763 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 3764 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 3765 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 3766 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 3767 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 3768 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3769 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand, ::mlir::Value handle); |
| 3770 | static RuntimeAwaitAndResumeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand, ::mlir::Value handle); |
| 3771 | static RuntimeAwaitAndResumeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand, ::mlir::Value handle); |
| 3772 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value handle); |
| 3773 | static RuntimeAwaitAndResumeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value handle); |
| 3774 | static RuntimeAwaitAndResumeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::Value handle); |
| 3775 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3776 | static RuntimeAwaitAndResumeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3777 | static RuntimeAwaitAndResumeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3778 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3779 | static RuntimeAwaitAndResumeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3780 | static RuntimeAwaitAndResumeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3781 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 3782 | ::llvm::LogicalResult verifyInvariants(); |
| 3783 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 3784 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 3785 | public: |
| 3786 | }; |
| 3787 | |
| 3788 | } // namespace mlir::async |
| 3789 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeAwaitAndResumeOp) |
| 3790 | |
| 3791 | namespace mlir::async { |
| 3792 | |
| 3793 | |
| 3794 | //===----------------------------------------------------------------------===// |
| 3795 | // ::mlir::async::RuntimeAwaitOp declarations |
| 3796 | //===----------------------------------------------------------------------===// |
| 3797 | |
| 3798 | namespace detail { |
| 3799 | |
| 3800 | class RuntimeAwaitOpGenericAdaptorBase { |
| 3801 | public: |
| 3802 | using Properties = ::mlir::EmptyProperties; |
| 3803 | protected: |
| 3804 | ::mlir::DictionaryAttr odsAttrs; |
| 3805 | ::std::optional<::mlir::OperationName> odsOpName; |
| 3806 | Properties properties; |
| 3807 | ::mlir::RegionRange odsRegions; |
| 3808 | public: |
| 3809 | RuntimeAwaitOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 3810 | odsOpName.emplace(args: "async.runtime.await" , args: odsAttrs.getContext()); |
| 3811 | } |
| 3812 | |
| 3813 | RuntimeAwaitOpGenericAdaptorBase(RuntimeAwaitOp op); |
| 3814 | |
| 3815 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 3816 | return {index, 1}; |
| 3817 | } |
| 3818 | |
| 3819 | const Properties &getProperties() { |
| 3820 | return properties; |
| 3821 | } |
| 3822 | |
| 3823 | ::mlir::DictionaryAttr getAttributes() { |
| 3824 | return odsAttrs; |
| 3825 | } |
| 3826 | |
| 3827 | }; |
| 3828 | |
| 3829 | } // namespace detail |
| 3830 | template <typename RangeT> |
| 3831 | class RuntimeAwaitOpGenericAdaptor : public detail::RuntimeAwaitOpGenericAdaptorBase { |
| 3832 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 3833 | using Base = detail::RuntimeAwaitOpGenericAdaptorBase; |
| 3834 | static constexpr int odsIndex_operand = 0; |
| 3835 | public: |
| 3836 | RuntimeAwaitOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 3837 | |
| 3838 | RuntimeAwaitOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeAwaitOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 3839 | |
| 3840 | RuntimeAwaitOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeAwaitOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 3841 | |
| 3842 | RuntimeAwaitOpGenericAdaptor(RangeT values, const RuntimeAwaitOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 3843 | |
| 3844 | template <typename LateInst = RuntimeAwaitOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeAwaitOp>>> |
| 3845 | RuntimeAwaitOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 3846 | |
| 3847 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3848 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 3849 | } |
| 3850 | |
| 3851 | RangeT getODSOperands(unsigned index) { |
| 3852 | auto valueRange = getODSOperandIndexAndLength(index); |
| 3853 | return {std::next(odsOperands.begin(), valueRange.first), |
| 3854 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 3855 | } |
| 3856 | |
| 3857 | ValueT getOperand() { |
| 3858 | return (*getODSOperands(index: 0).begin()); |
| 3859 | } |
| 3860 | |
| 3861 | RangeT getOperands() { |
| 3862 | return odsOperands; |
| 3863 | } |
| 3864 | |
| 3865 | private: |
| 3866 | RangeT odsOperands; |
| 3867 | }; |
| 3868 | class RuntimeAwaitOpAdaptor : public RuntimeAwaitOpGenericAdaptor<::mlir::ValueRange> { |
| 3869 | public: |
| 3870 | using RuntimeAwaitOpGenericAdaptor::RuntimeAwaitOpGenericAdaptor; |
| 3871 | RuntimeAwaitOpAdaptor(RuntimeAwaitOp op); |
| 3872 | |
| 3873 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 3874 | }; |
| 3875 | class RuntimeAwaitOp : public ::mlir::Op<RuntimeAwaitOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants> { |
| 3876 | public: |
| 3877 | using Op::Op; |
| 3878 | using Op::print; |
| 3879 | using Adaptor = RuntimeAwaitOpAdaptor; |
| 3880 | template <typename RangeT> |
| 3881 | using GenericAdaptor = RuntimeAwaitOpGenericAdaptor<RangeT>; |
| 3882 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 3883 | static constexpr int odsIndex_operand = 0; |
| 3884 | using Properties = FoldAdaptor::Properties; |
| 3885 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 3886 | return {}; |
| 3887 | } |
| 3888 | |
| 3889 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 3890 | return ::llvm::StringLiteral("async.runtime.await" ); |
| 3891 | } |
| 3892 | |
| 3893 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3894 | return {index, 1}; |
| 3895 | } |
| 3896 | |
| 3897 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 3898 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 3899 | return getOperation()->getOperands().slice(n: start, m: length); |
| 3900 | } |
| 3901 | |
| 3902 | ::mlir::TypedValue<::mlir::Type> getOperand() { |
| 3903 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 3904 | } |
| 3905 | |
| 3906 | ::mlir::OpOperand &getOperandMutable() { |
| 3907 | auto range = getODSOperandIndexAndLength(index: 0); |
| 3908 | return getOperation()->getOpOperand(idx: range.first); |
| 3909 | } |
| 3910 | |
| 3911 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 3912 | return {index, 1}; |
| 3913 | } |
| 3914 | |
| 3915 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 3916 | auto valueRange = getODSResultIndexAndLength(index); |
| 3917 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 3918 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 3919 | } |
| 3920 | |
| 3921 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3922 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 3923 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 3924 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 3925 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 3926 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 3927 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3928 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand); |
| 3929 | static RuntimeAwaitOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand); |
| 3930 | static RuntimeAwaitOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand); |
| 3931 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 3932 | static RuntimeAwaitOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 3933 | static RuntimeAwaitOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 3934 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3935 | static RuntimeAwaitOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3936 | static RuntimeAwaitOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3937 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3938 | static RuntimeAwaitOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3939 | static RuntimeAwaitOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3940 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 3941 | ::llvm::LogicalResult verifyInvariants(); |
| 3942 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 3943 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 3944 | public: |
| 3945 | }; |
| 3946 | |
| 3947 | } // namespace mlir::async |
| 3948 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeAwaitOp) |
| 3949 | |
| 3950 | namespace mlir::async { |
| 3951 | |
| 3952 | |
| 3953 | //===----------------------------------------------------------------------===// |
| 3954 | // ::mlir::async::RuntimeCreateGroupOp declarations |
| 3955 | //===----------------------------------------------------------------------===// |
| 3956 | |
| 3957 | namespace detail { |
| 3958 | |
| 3959 | class RuntimeCreateGroupOpGenericAdaptorBase { |
| 3960 | public: |
| 3961 | using Properties = ::mlir::EmptyProperties; |
| 3962 | protected: |
| 3963 | ::mlir::DictionaryAttr odsAttrs; |
| 3964 | ::std::optional<::mlir::OperationName> odsOpName; |
| 3965 | Properties properties; |
| 3966 | ::mlir::RegionRange odsRegions; |
| 3967 | public: |
| 3968 | RuntimeCreateGroupOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 3969 | odsOpName.emplace(args: "async.runtime.create_group" , args: odsAttrs.getContext()); |
| 3970 | } |
| 3971 | |
| 3972 | RuntimeCreateGroupOpGenericAdaptorBase(RuntimeCreateGroupOp op); |
| 3973 | |
| 3974 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 3975 | return {index, 1}; |
| 3976 | } |
| 3977 | |
| 3978 | const Properties &getProperties() { |
| 3979 | return properties; |
| 3980 | } |
| 3981 | |
| 3982 | ::mlir::DictionaryAttr getAttributes() { |
| 3983 | return odsAttrs; |
| 3984 | } |
| 3985 | |
| 3986 | }; |
| 3987 | |
| 3988 | } // namespace detail |
| 3989 | template <typename RangeT> |
| 3990 | class RuntimeCreateGroupOpGenericAdaptor : public detail::RuntimeCreateGroupOpGenericAdaptorBase { |
| 3991 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 3992 | using Base = detail::RuntimeCreateGroupOpGenericAdaptorBase; |
| 3993 | static constexpr int odsIndex_size = 0; |
| 3994 | public: |
| 3995 | RuntimeCreateGroupOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 3996 | |
| 3997 | RuntimeCreateGroupOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeCreateGroupOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 3998 | |
| 3999 | RuntimeCreateGroupOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeCreateGroupOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 4000 | |
| 4001 | RuntimeCreateGroupOpGenericAdaptor(RangeT values, const RuntimeCreateGroupOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 4002 | |
| 4003 | template <typename LateInst = RuntimeCreateGroupOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeCreateGroupOp>>> |
| 4004 | RuntimeCreateGroupOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 4005 | |
| 4006 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4007 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 4008 | } |
| 4009 | |
| 4010 | RangeT getODSOperands(unsigned index) { |
| 4011 | auto valueRange = getODSOperandIndexAndLength(index); |
| 4012 | return {std::next(odsOperands.begin(), valueRange.first), |
| 4013 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 4014 | } |
| 4015 | |
| 4016 | ValueT getSize() { |
| 4017 | return (*getODSOperands(index: 0).begin()); |
| 4018 | } |
| 4019 | |
| 4020 | RangeT getOperands() { |
| 4021 | return odsOperands; |
| 4022 | } |
| 4023 | |
| 4024 | private: |
| 4025 | RangeT odsOperands; |
| 4026 | }; |
| 4027 | class RuntimeCreateGroupOpAdaptor : public RuntimeCreateGroupOpGenericAdaptor<::mlir::ValueRange> { |
| 4028 | public: |
| 4029 | using RuntimeCreateGroupOpGenericAdaptor::RuntimeCreateGroupOpGenericAdaptor; |
| 4030 | RuntimeCreateGroupOpAdaptor(RuntimeCreateGroupOp op); |
| 4031 | |
| 4032 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 4033 | }; |
| 4034 | class RuntimeCreateGroupOp : public ::mlir::Op<RuntimeCreateGroupOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::async::GroupType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::InferTypeOpInterface::Trait> { |
| 4035 | public: |
| 4036 | using Op::Op; |
| 4037 | using Op::print; |
| 4038 | using Adaptor = RuntimeCreateGroupOpAdaptor; |
| 4039 | template <typename RangeT> |
| 4040 | using GenericAdaptor = RuntimeCreateGroupOpGenericAdaptor<RangeT>; |
| 4041 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 4042 | static constexpr int odsIndex_size = 0; |
| 4043 | static constexpr int odsIndex_result = 0; |
| 4044 | using Properties = FoldAdaptor::Properties; |
| 4045 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 4046 | return {}; |
| 4047 | } |
| 4048 | |
| 4049 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 4050 | return ::llvm::StringLiteral("async.runtime.create_group" ); |
| 4051 | } |
| 4052 | |
| 4053 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4054 | return {index, 1}; |
| 4055 | } |
| 4056 | |
| 4057 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 4058 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 4059 | return getOperation()->getOperands().slice(n: start, m: length); |
| 4060 | } |
| 4061 | |
| 4062 | ::mlir::TypedValue<::mlir::IndexType> getSize() { |
| 4063 | return ::llvm::cast<::mlir::TypedValue<::mlir::IndexType>>(Val: *getODSOperands(index: 0).begin()); |
| 4064 | } |
| 4065 | |
| 4066 | ::mlir::OpOperand &getSizeMutable() { |
| 4067 | auto range = getODSOperandIndexAndLength(index: 0); |
| 4068 | return getOperation()->getOpOperand(idx: range.first); |
| 4069 | } |
| 4070 | |
| 4071 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 4072 | return {index, 1}; |
| 4073 | } |
| 4074 | |
| 4075 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 4076 | auto valueRange = getODSResultIndexAndLength(index); |
| 4077 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 4078 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 4079 | } |
| 4080 | |
| 4081 | ::mlir::TypedValue<::mlir::async::GroupType> getResult() { |
| 4082 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::GroupType>>(Val: *getODSResults(index: 0).begin()); |
| 4083 | } |
| 4084 | |
| 4085 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4086 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 4087 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 4088 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 4089 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 4090 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 4091 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4092 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value size); |
| 4093 | static RuntimeCreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value size); |
| 4094 | static RuntimeCreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value size); |
| 4095 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value size); |
| 4096 | static RuntimeCreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value size); |
| 4097 | static RuntimeCreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value size); |
| 4098 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value size); |
| 4099 | static RuntimeCreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value size); |
| 4100 | static RuntimeCreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value size); |
| 4101 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4102 | static RuntimeCreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4103 | static RuntimeCreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4104 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4105 | static RuntimeCreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4106 | static RuntimeCreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4107 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4108 | static RuntimeCreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4109 | static RuntimeCreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4110 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4111 | static RuntimeCreateGroupOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4112 | static RuntimeCreateGroupOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4113 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 4114 | ::llvm::LogicalResult verifyInvariants(); |
| 4115 | static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); |
| 4116 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 4117 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 4118 | public: |
| 4119 | }; |
| 4120 | |
| 4121 | } // namespace mlir::async |
| 4122 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeCreateGroupOp) |
| 4123 | |
| 4124 | namespace mlir::async { |
| 4125 | |
| 4126 | |
| 4127 | //===----------------------------------------------------------------------===// |
| 4128 | // ::mlir::async::RuntimeCreateOp declarations |
| 4129 | //===----------------------------------------------------------------------===// |
| 4130 | |
| 4131 | namespace detail { |
| 4132 | |
| 4133 | class RuntimeCreateOpGenericAdaptorBase { |
| 4134 | public: |
| 4135 | using Properties = ::mlir::EmptyProperties; |
| 4136 | protected: |
| 4137 | ::mlir::DictionaryAttr odsAttrs; |
| 4138 | ::std::optional<::mlir::OperationName> odsOpName; |
| 4139 | Properties properties; |
| 4140 | ::mlir::RegionRange odsRegions; |
| 4141 | public: |
| 4142 | RuntimeCreateOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 4143 | odsOpName.emplace(args: "async.runtime.create" , args: odsAttrs.getContext()); |
| 4144 | } |
| 4145 | |
| 4146 | RuntimeCreateOpGenericAdaptorBase(RuntimeCreateOp op); |
| 4147 | |
| 4148 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 4149 | return {index, 1}; |
| 4150 | } |
| 4151 | |
| 4152 | const Properties &getProperties() { |
| 4153 | return properties; |
| 4154 | } |
| 4155 | |
| 4156 | ::mlir::DictionaryAttr getAttributes() { |
| 4157 | return odsAttrs; |
| 4158 | } |
| 4159 | |
| 4160 | }; |
| 4161 | |
| 4162 | } // namespace detail |
| 4163 | template <typename RangeT> |
| 4164 | class RuntimeCreateOpGenericAdaptor : public detail::RuntimeCreateOpGenericAdaptorBase { |
| 4165 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 4166 | using Base = detail::RuntimeCreateOpGenericAdaptorBase; |
| 4167 | public: |
| 4168 | RuntimeCreateOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 4169 | |
| 4170 | RuntimeCreateOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeCreateOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 4171 | |
| 4172 | RuntimeCreateOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeCreateOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 4173 | |
| 4174 | RuntimeCreateOpGenericAdaptor(RangeT values, const RuntimeCreateOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 4175 | |
| 4176 | template <typename LateInst = RuntimeCreateOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeCreateOp>>> |
| 4177 | RuntimeCreateOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 4178 | |
| 4179 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4180 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 4181 | } |
| 4182 | |
| 4183 | RangeT getODSOperands(unsigned index) { |
| 4184 | auto valueRange = getODSOperandIndexAndLength(index); |
| 4185 | return {std::next(odsOperands.begin(), valueRange.first), |
| 4186 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 4187 | } |
| 4188 | |
| 4189 | RangeT getOperands() { |
| 4190 | return odsOperands; |
| 4191 | } |
| 4192 | |
| 4193 | private: |
| 4194 | RangeT odsOperands; |
| 4195 | }; |
| 4196 | class RuntimeCreateOpAdaptor : public RuntimeCreateOpGenericAdaptor<::mlir::ValueRange> { |
| 4197 | public: |
| 4198 | using RuntimeCreateOpGenericAdaptor::RuntimeCreateOpGenericAdaptor; |
| 4199 | RuntimeCreateOpAdaptor(RuntimeCreateOp op); |
| 4200 | |
| 4201 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 4202 | }; |
| 4203 | class RuntimeCreateOp : public ::mlir::Op<RuntimeCreateOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants> { |
| 4204 | public: |
| 4205 | using Op::Op; |
| 4206 | using Op::print; |
| 4207 | using Adaptor = RuntimeCreateOpAdaptor; |
| 4208 | template <typename RangeT> |
| 4209 | using GenericAdaptor = RuntimeCreateOpGenericAdaptor<RangeT>; |
| 4210 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 4211 | static constexpr int odsIndex_result = 0; |
| 4212 | using Properties = FoldAdaptor::Properties; |
| 4213 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 4214 | return {}; |
| 4215 | } |
| 4216 | |
| 4217 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 4218 | return ::llvm::StringLiteral("async.runtime.create" ); |
| 4219 | } |
| 4220 | |
| 4221 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4222 | return {index, 1}; |
| 4223 | } |
| 4224 | |
| 4225 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 4226 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 4227 | return getOperation()->getOperands().slice(n: start, m: length); |
| 4228 | } |
| 4229 | |
| 4230 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 4231 | return {index, 1}; |
| 4232 | } |
| 4233 | |
| 4234 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 4235 | auto valueRange = getODSResultIndexAndLength(index); |
| 4236 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 4237 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 4238 | } |
| 4239 | |
| 4240 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 4241 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 4242 | } |
| 4243 | |
| 4244 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4245 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 4246 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 4247 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 4248 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 4249 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 4250 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4251 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result); |
| 4252 | static RuntimeCreateOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result); |
| 4253 | static RuntimeCreateOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result); |
| 4254 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes); |
| 4255 | static RuntimeCreateOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes); |
| 4256 | static RuntimeCreateOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes); |
| 4257 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4258 | static RuntimeCreateOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4259 | static RuntimeCreateOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4260 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4261 | static RuntimeCreateOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4262 | static RuntimeCreateOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4263 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 4264 | ::llvm::LogicalResult verifyInvariants(); |
| 4265 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 4266 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 4267 | public: |
| 4268 | }; |
| 4269 | |
| 4270 | } // namespace mlir::async |
| 4271 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeCreateOp) |
| 4272 | |
| 4273 | namespace mlir::async { |
| 4274 | |
| 4275 | |
| 4276 | //===----------------------------------------------------------------------===// |
| 4277 | // ::mlir::async::RuntimeDropRefOp declarations |
| 4278 | //===----------------------------------------------------------------------===// |
| 4279 | |
| 4280 | namespace detail { |
| 4281 | |
| 4282 | class RuntimeDropRefOpGenericAdaptorBase { |
| 4283 | public: |
| 4284 | struct Properties { |
| 4285 | using countTy = ::mlir::IntegerAttr; |
| 4286 | countTy count; |
| 4287 | |
| 4288 | auto getCount() const { |
| 4289 | auto &propStorage = this->count; |
| 4290 | return ::llvm::cast<::mlir::IntegerAttr>(Val: propStorage); |
| 4291 | } |
| 4292 | void setCount(const ::mlir::IntegerAttr &propValue) { |
| 4293 | this->count = propValue; |
| 4294 | } |
| 4295 | bool operator==(const Properties &rhs) const { |
| 4296 | return |
| 4297 | rhs.count == this->count && |
| 4298 | true; |
| 4299 | } |
| 4300 | bool operator!=(const Properties &rhs) const { |
| 4301 | return !(*this == rhs); |
| 4302 | } |
| 4303 | }; |
| 4304 | protected: |
| 4305 | ::mlir::DictionaryAttr odsAttrs; |
| 4306 | ::std::optional<::mlir::OperationName> odsOpName; |
| 4307 | Properties properties; |
| 4308 | ::mlir::RegionRange odsRegions; |
| 4309 | public: |
| 4310 | RuntimeDropRefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 4311 | odsOpName.emplace(args: "async.runtime.drop_ref" , args: odsAttrs.getContext()); |
| 4312 | } |
| 4313 | |
| 4314 | RuntimeDropRefOpGenericAdaptorBase(RuntimeDropRefOp op); |
| 4315 | |
| 4316 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 4317 | return {index, 1}; |
| 4318 | } |
| 4319 | |
| 4320 | const Properties &getProperties() { |
| 4321 | return properties; |
| 4322 | } |
| 4323 | |
| 4324 | ::mlir::DictionaryAttr getAttributes() { |
| 4325 | return odsAttrs; |
| 4326 | } |
| 4327 | |
| 4328 | ::mlir::IntegerAttr getCountAttr() { |
| 4329 | auto attr = ::llvm::cast<::mlir::IntegerAttr>(Val: getProperties().count); |
| 4330 | return attr; |
| 4331 | } |
| 4332 | |
| 4333 | uint64_t getCount(); |
| 4334 | }; |
| 4335 | |
| 4336 | } // namespace detail |
| 4337 | template <typename RangeT> |
| 4338 | class RuntimeDropRefOpGenericAdaptor : public detail::RuntimeDropRefOpGenericAdaptorBase { |
| 4339 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 4340 | using Base = detail::RuntimeDropRefOpGenericAdaptorBase; |
| 4341 | static constexpr int odsIndex_operand = 0; |
| 4342 | public: |
| 4343 | RuntimeDropRefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 4344 | |
| 4345 | RuntimeDropRefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeDropRefOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 4346 | |
| 4347 | RuntimeDropRefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeDropRefOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 4348 | |
| 4349 | RuntimeDropRefOpGenericAdaptor(RangeT values, const RuntimeDropRefOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 4350 | |
| 4351 | template <typename LateInst = RuntimeDropRefOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeDropRefOp>>> |
| 4352 | RuntimeDropRefOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 4353 | |
| 4354 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4355 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 4356 | } |
| 4357 | |
| 4358 | RangeT getODSOperands(unsigned index) { |
| 4359 | auto valueRange = getODSOperandIndexAndLength(index); |
| 4360 | return {std::next(odsOperands.begin(), valueRange.first), |
| 4361 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 4362 | } |
| 4363 | |
| 4364 | ValueT getOperand() { |
| 4365 | return (*getODSOperands(index: 0).begin()); |
| 4366 | } |
| 4367 | |
| 4368 | RangeT getOperands() { |
| 4369 | return odsOperands; |
| 4370 | } |
| 4371 | |
| 4372 | private: |
| 4373 | RangeT odsOperands; |
| 4374 | }; |
| 4375 | class RuntimeDropRefOpAdaptor : public RuntimeDropRefOpGenericAdaptor<::mlir::ValueRange> { |
| 4376 | public: |
| 4377 | using RuntimeDropRefOpGenericAdaptor::RuntimeDropRefOpGenericAdaptor; |
| 4378 | RuntimeDropRefOpAdaptor(RuntimeDropRefOp op); |
| 4379 | |
| 4380 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 4381 | }; |
| 4382 | class RuntimeDropRefOp : public ::mlir::Op<RuntimeDropRefOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait> { |
| 4383 | public: |
| 4384 | using Op::Op; |
| 4385 | using Op::print; |
| 4386 | using Adaptor = RuntimeDropRefOpAdaptor; |
| 4387 | template <typename RangeT> |
| 4388 | using GenericAdaptor = RuntimeDropRefOpGenericAdaptor<RangeT>; |
| 4389 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 4390 | static constexpr int odsIndex_operand = 0; |
| 4391 | using Properties = FoldAdaptor::Properties; |
| 4392 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 4393 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("count" )}; |
| 4394 | return ::llvm::ArrayRef(attrNames); |
| 4395 | } |
| 4396 | |
| 4397 | ::mlir::StringAttr getCountAttrName() { |
| 4398 | return getAttributeNameForIndex(index: 0); |
| 4399 | } |
| 4400 | |
| 4401 | static ::mlir::StringAttr getCountAttrName(::mlir::OperationName name) { |
| 4402 | return getAttributeNameForIndex(name, index: 0); |
| 4403 | } |
| 4404 | |
| 4405 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 4406 | return ::llvm::StringLiteral("async.runtime.drop_ref" ); |
| 4407 | } |
| 4408 | |
| 4409 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4410 | return {index, 1}; |
| 4411 | } |
| 4412 | |
| 4413 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 4414 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 4415 | return getOperation()->getOperands().slice(n: start, m: length); |
| 4416 | } |
| 4417 | |
| 4418 | ::mlir::TypedValue<::mlir::Type> getOperand() { |
| 4419 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 4420 | } |
| 4421 | |
| 4422 | ::mlir::OpOperand &getOperandMutable() { |
| 4423 | auto range = getODSOperandIndexAndLength(index: 0); |
| 4424 | return getOperation()->getOpOperand(idx: range.first); |
| 4425 | } |
| 4426 | |
| 4427 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 4428 | return {index, 1}; |
| 4429 | } |
| 4430 | |
| 4431 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 4432 | auto valueRange = getODSResultIndexAndLength(index); |
| 4433 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 4434 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 4435 | } |
| 4436 | |
| 4437 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4438 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 4439 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 4440 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 4441 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 4442 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 4443 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4444 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 4445 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 4446 | ::mlir::IntegerAttr getCountAttr() { |
| 4447 | return ::llvm::cast<::mlir::IntegerAttr>(Val&: getProperties().count); |
| 4448 | } |
| 4449 | |
| 4450 | uint64_t getCount(); |
| 4451 | void setCountAttr(::mlir::IntegerAttr attr) { |
| 4452 | getProperties().count = attr; |
| 4453 | } |
| 4454 | |
| 4455 | void setCount(uint64_t attrValue); |
| 4456 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand, ::mlir::IntegerAttr count); |
| 4457 | static RuntimeDropRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand, ::mlir::IntegerAttr count); |
| 4458 | static RuntimeDropRefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand, ::mlir::IntegerAttr count); |
| 4459 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::IntegerAttr count); |
| 4460 | static RuntimeDropRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::IntegerAttr count); |
| 4461 | static RuntimeDropRefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::IntegerAttr count); |
| 4462 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand, uint64_t count); |
| 4463 | static RuntimeDropRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand, uint64_t count); |
| 4464 | static RuntimeDropRefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand, uint64_t count); |
| 4465 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, uint64_t count); |
| 4466 | static RuntimeDropRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand, uint64_t count); |
| 4467 | static RuntimeDropRefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand, uint64_t count); |
| 4468 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4469 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4470 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4471 | static RuntimeDropRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4472 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4473 | static RuntimeDropRefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4474 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4475 | static RuntimeDropRefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4476 | static RuntimeDropRefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4477 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 4478 | ::llvm::LogicalResult verifyInvariants(); |
| 4479 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 4480 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 4481 | private: |
| 4482 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 4483 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 4484 | } |
| 4485 | |
| 4486 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 4487 | assert(index < 1 && "invalid attribute index" ); |
| 4488 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 4489 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 4490 | "dependent dialect loading?" ); |
| 4491 | return name.getAttributeNames()[index]; |
| 4492 | } |
| 4493 | |
| 4494 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 4495 | public: |
| 4496 | }; |
| 4497 | |
| 4498 | } // namespace mlir::async |
| 4499 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeDropRefOp) |
| 4500 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::detail::RuntimeDropRefOpGenericAdaptorBase::Properties) |
| 4501 | |
| 4502 | namespace mlir::async { |
| 4503 | |
| 4504 | |
| 4505 | //===----------------------------------------------------------------------===// |
| 4506 | // ::mlir::async::RuntimeIsErrorOp declarations |
| 4507 | //===----------------------------------------------------------------------===// |
| 4508 | |
| 4509 | namespace detail { |
| 4510 | |
| 4511 | class RuntimeIsErrorOpGenericAdaptorBase { |
| 4512 | public: |
| 4513 | using Properties = ::mlir::EmptyProperties; |
| 4514 | protected: |
| 4515 | ::mlir::DictionaryAttr odsAttrs; |
| 4516 | ::std::optional<::mlir::OperationName> odsOpName; |
| 4517 | Properties properties; |
| 4518 | ::mlir::RegionRange odsRegions; |
| 4519 | public: |
| 4520 | RuntimeIsErrorOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 4521 | odsOpName.emplace(args: "async.runtime.is_error" , args: odsAttrs.getContext()); |
| 4522 | } |
| 4523 | |
| 4524 | RuntimeIsErrorOpGenericAdaptorBase(RuntimeIsErrorOp op); |
| 4525 | |
| 4526 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 4527 | return {index, 1}; |
| 4528 | } |
| 4529 | |
| 4530 | const Properties &getProperties() { |
| 4531 | return properties; |
| 4532 | } |
| 4533 | |
| 4534 | ::mlir::DictionaryAttr getAttributes() { |
| 4535 | return odsAttrs; |
| 4536 | } |
| 4537 | |
| 4538 | }; |
| 4539 | |
| 4540 | } // namespace detail |
| 4541 | template <typename RangeT> |
| 4542 | class RuntimeIsErrorOpGenericAdaptor : public detail::RuntimeIsErrorOpGenericAdaptorBase { |
| 4543 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 4544 | using Base = detail::RuntimeIsErrorOpGenericAdaptorBase; |
| 4545 | static constexpr int odsIndex_operand = 0; |
| 4546 | public: |
| 4547 | RuntimeIsErrorOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 4548 | |
| 4549 | RuntimeIsErrorOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeIsErrorOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 4550 | |
| 4551 | RuntimeIsErrorOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeIsErrorOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 4552 | |
| 4553 | RuntimeIsErrorOpGenericAdaptor(RangeT values, const RuntimeIsErrorOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 4554 | |
| 4555 | template <typename LateInst = RuntimeIsErrorOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeIsErrorOp>>> |
| 4556 | RuntimeIsErrorOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 4557 | |
| 4558 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4559 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 4560 | } |
| 4561 | |
| 4562 | RangeT getODSOperands(unsigned index) { |
| 4563 | auto valueRange = getODSOperandIndexAndLength(index); |
| 4564 | return {std::next(odsOperands.begin(), valueRange.first), |
| 4565 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 4566 | } |
| 4567 | |
| 4568 | ValueT getOperand() { |
| 4569 | return (*getODSOperands(index: 0).begin()); |
| 4570 | } |
| 4571 | |
| 4572 | RangeT getOperands() { |
| 4573 | return odsOperands; |
| 4574 | } |
| 4575 | |
| 4576 | private: |
| 4577 | RangeT odsOperands; |
| 4578 | }; |
| 4579 | class RuntimeIsErrorOpAdaptor : public RuntimeIsErrorOpGenericAdaptor<::mlir::ValueRange> { |
| 4580 | public: |
| 4581 | using RuntimeIsErrorOpGenericAdaptor::RuntimeIsErrorOpGenericAdaptor; |
| 4582 | RuntimeIsErrorOpAdaptor(RuntimeIsErrorOp op); |
| 4583 | |
| 4584 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 4585 | }; |
| 4586 | class RuntimeIsErrorOp : public ::mlir::Op<RuntimeIsErrorOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::IntegerType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::InferTypeOpInterface::Trait> { |
| 4587 | public: |
| 4588 | using Op::Op; |
| 4589 | using Op::print; |
| 4590 | using Adaptor = RuntimeIsErrorOpAdaptor; |
| 4591 | template <typename RangeT> |
| 4592 | using GenericAdaptor = RuntimeIsErrorOpGenericAdaptor<RangeT>; |
| 4593 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 4594 | static constexpr int odsIndex_operand = 0; |
| 4595 | static constexpr int odsIndex_is_error = 0; |
| 4596 | using Properties = FoldAdaptor::Properties; |
| 4597 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 4598 | return {}; |
| 4599 | } |
| 4600 | |
| 4601 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 4602 | return ::llvm::StringLiteral("async.runtime.is_error" ); |
| 4603 | } |
| 4604 | |
| 4605 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4606 | return {index, 1}; |
| 4607 | } |
| 4608 | |
| 4609 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 4610 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 4611 | return getOperation()->getOperands().slice(n: start, m: length); |
| 4612 | } |
| 4613 | |
| 4614 | ::mlir::TypedValue<::mlir::Type> getOperand() { |
| 4615 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 4616 | } |
| 4617 | |
| 4618 | ::mlir::OpOperand &getOperandMutable() { |
| 4619 | auto range = getODSOperandIndexAndLength(index: 0); |
| 4620 | return getOperation()->getOpOperand(idx: range.first); |
| 4621 | } |
| 4622 | |
| 4623 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 4624 | return {index, 1}; |
| 4625 | } |
| 4626 | |
| 4627 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 4628 | auto valueRange = getODSResultIndexAndLength(index); |
| 4629 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 4630 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 4631 | } |
| 4632 | |
| 4633 | ::mlir::TypedValue<::mlir::IntegerType> getIsError() { |
| 4634 | return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(Val: *getODSResults(index: 0).begin()); |
| 4635 | } |
| 4636 | |
| 4637 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4638 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 4639 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 4640 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 4641 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 4642 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 4643 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4644 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type is_error, ::mlir::Value operand); |
| 4645 | static RuntimeIsErrorOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type is_error, ::mlir::Value operand); |
| 4646 | static RuntimeIsErrorOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type is_error, ::mlir::Value operand); |
| 4647 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand); |
| 4648 | static RuntimeIsErrorOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand); |
| 4649 | static RuntimeIsErrorOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand); |
| 4650 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 4651 | static RuntimeIsErrorOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 4652 | static RuntimeIsErrorOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 4653 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4654 | static RuntimeIsErrorOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4655 | static RuntimeIsErrorOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4656 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4657 | static RuntimeIsErrorOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4658 | static RuntimeIsErrorOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4659 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4660 | static RuntimeIsErrorOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4661 | static RuntimeIsErrorOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4662 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4663 | static RuntimeIsErrorOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4664 | static RuntimeIsErrorOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4665 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 4666 | ::llvm::LogicalResult verifyInvariants(); |
| 4667 | static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); |
| 4668 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 4669 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 4670 | public: |
| 4671 | }; |
| 4672 | |
| 4673 | } // namespace mlir::async |
| 4674 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeIsErrorOp) |
| 4675 | |
| 4676 | namespace mlir::async { |
| 4677 | |
| 4678 | |
| 4679 | //===----------------------------------------------------------------------===// |
| 4680 | // ::mlir::async::RuntimeLoadOp declarations |
| 4681 | //===----------------------------------------------------------------------===// |
| 4682 | |
| 4683 | namespace detail { |
| 4684 | |
| 4685 | class RuntimeLoadOpGenericAdaptorBase { |
| 4686 | public: |
| 4687 | using Properties = ::mlir::EmptyProperties; |
| 4688 | protected: |
| 4689 | ::mlir::DictionaryAttr odsAttrs; |
| 4690 | ::std::optional<::mlir::OperationName> odsOpName; |
| 4691 | Properties properties; |
| 4692 | ::mlir::RegionRange odsRegions; |
| 4693 | public: |
| 4694 | RuntimeLoadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 4695 | odsOpName.emplace(args: "async.runtime.load" , args: odsAttrs.getContext()); |
| 4696 | } |
| 4697 | |
| 4698 | RuntimeLoadOpGenericAdaptorBase(RuntimeLoadOp op); |
| 4699 | |
| 4700 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 4701 | return {index, 1}; |
| 4702 | } |
| 4703 | |
| 4704 | const Properties &getProperties() { |
| 4705 | return properties; |
| 4706 | } |
| 4707 | |
| 4708 | ::mlir::DictionaryAttr getAttributes() { |
| 4709 | return odsAttrs; |
| 4710 | } |
| 4711 | |
| 4712 | }; |
| 4713 | |
| 4714 | } // namespace detail |
| 4715 | template <typename RangeT> |
| 4716 | class RuntimeLoadOpGenericAdaptor : public detail::RuntimeLoadOpGenericAdaptorBase { |
| 4717 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 4718 | using Base = detail::RuntimeLoadOpGenericAdaptorBase; |
| 4719 | static constexpr int odsIndex_storage = 0; |
| 4720 | public: |
| 4721 | RuntimeLoadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 4722 | |
| 4723 | RuntimeLoadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeLoadOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 4724 | |
| 4725 | RuntimeLoadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeLoadOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 4726 | |
| 4727 | RuntimeLoadOpGenericAdaptor(RangeT values, const RuntimeLoadOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 4728 | |
| 4729 | template <typename LateInst = RuntimeLoadOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeLoadOp>>> |
| 4730 | RuntimeLoadOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 4731 | |
| 4732 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4733 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 4734 | } |
| 4735 | |
| 4736 | RangeT getODSOperands(unsigned index) { |
| 4737 | auto valueRange = getODSOperandIndexAndLength(index); |
| 4738 | return {std::next(odsOperands.begin(), valueRange.first), |
| 4739 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 4740 | } |
| 4741 | |
| 4742 | ValueT getStorage() { |
| 4743 | return (*getODSOperands(index: 0).begin()); |
| 4744 | } |
| 4745 | |
| 4746 | RangeT getOperands() { |
| 4747 | return odsOperands; |
| 4748 | } |
| 4749 | |
| 4750 | private: |
| 4751 | RangeT odsOperands; |
| 4752 | }; |
| 4753 | class RuntimeLoadOpAdaptor : public RuntimeLoadOpGenericAdaptor<::mlir::ValueRange> { |
| 4754 | public: |
| 4755 | using RuntimeLoadOpGenericAdaptor::RuntimeLoadOpGenericAdaptor; |
| 4756 | RuntimeLoadOpAdaptor(RuntimeLoadOp op); |
| 4757 | |
| 4758 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 4759 | }; |
| 4760 | class RuntimeLoadOp : public ::mlir::Op<RuntimeLoadOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::InferTypeOpInterface::Trait> { |
| 4761 | public: |
| 4762 | using Op::Op; |
| 4763 | using Op::print; |
| 4764 | using Adaptor = RuntimeLoadOpAdaptor; |
| 4765 | template <typename RangeT> |
| 4766 | using GenericAdaptor = RuntimeLoadOpGenericAdaptor<RangeT>; |
| 4767 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 4768 | static constexpr int odsIndex_storage = 0; |
| 4769 | static constexpr int odsIndex_result = 0; |
| 4770 | using Properties = FoldAdaptor::Properties; |
| 4771 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 4772 | return {}; |
| 4773 | } |
| 4774 | |
| 4775 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 4776 | return ::llvm::StringLiteral("async.runtime.load" ); |
| 4777 | } |
| 4778 | |
| 4779 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4780 | return {index, 1}; |
| 4781 | } |
| 4782 | |
| 4783 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 4784 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 4785 | return getOperation()->getOperands().slice(n: start, m: length); |
| 4786 | } |
| 4787 | |
| 4788 | ::mlir::TypedValue<::mlir::async::ValueType> getStorage() { |
| 4789 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::ValueType>>(Val: *getODSOperands(index: 0).begin()); |
| 4790 | } |
| 4791 | |
| 4792 | ::mlir::OpOperand &getStorageMutable() { |
| 4793 | auto range = getODSOperandIndexAndLength(index: 0); |
| 4794 | return getOperation()->getOpOperand(idx: range.first); |
| 4795 | } |
| 4796 | |
| 4797 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 4798 | return {index, 1}; |
| 4799 | } |
| 4800 | |
| 4801 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 4802 | auto valueRange = getODSResultIndexAndLength(index); |
| 4803 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 4804 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 4805 | } |
| 4806 | |
| 4807 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 4808 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 4809 | } |
| 4810 | |
| 4811 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4812 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 4813 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 4814 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 4815 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 4816 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 4817 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4818 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value storage); |
| 4819 | static RuntimeLoadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value storage); |
| 4820 | static RuntimeLoadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value storage); |
| 4821 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value storage); |
| 4822 | static RuntimeLoadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value storage); |
| 4823 | static RuntimeLoadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value storage); |
| 4824 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value storage); |
| 4825 | static RuntimeLoadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value storage); |
| 4826 | static RuntimeLoadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value storage); |
| 4827 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4828 | static RuntimeLoadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4829 | static RuntimeLoadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4830 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4831 | static RuntimeLoadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4832 | static RuntimeLoadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4833 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4834 | static RuntimeLoadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4835 | static RuntimeLoadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4836 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4837 | static RuntimeLoadOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4838 | static RuntimeLoadOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4839 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 4840 | ::llvm::LogicalResult verifyInvariants(); |
| 4841 | static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); |
| 4842 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 4843 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 4844 | public: |
| 4845 | }; |
| 4846 | |
| 4847 | } // namespace mlir::async |
| 4848 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeLoadOp) |
| 4849 | |
| 4850 | namespace mlir::async { |
| 4851 | |
| 4852 | |
| 4853 | //===----------------------------------------------------------------------===// |
| 4854 | // ::mlir::async::RuntimeNumWorkerThreadsOp declarations |
| 4855 | //===----------------------------------------------------------------------===// |
| 4856 | |
| 4857 | namespace detail { |
| 4858 | |
| 4859 | class { |
| 4860 | public: |
| 4861 | using = ::mlir::EmptyProperties; |
| 4862 | protected: |
| 4863 | ::mlir::DictionaryAttr ; |
| 4864 | ::std::optional<::mlir::OperationName> ; |
| 4865 | Properties ; |
| 4866 | ::mlir::RegionRange ; |
| 4867 | public: |
| 4868 | (::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 4869 | odsOpName.emplace(args: "async.runtime.num_worker_threads" , args: odsAttrs.getContext()); |
| 4870 | } |
| 4871 | |
| 4872 | (RuntimeNumWorkerThreadsOp op); |
| 4873 | |
| 4874 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 4875 | return {index, 1}; |
| 4876 | } |
| 4877 | |
| 4878 | const Properties &() { |
| 4879 | return properties; |
| 4880 | } |
| 4881 | |
| 4882 | ::mlir::DictionaryAttr () { |
| 4883 | return odsAttrs; |
| 4884 | } |
| 4885 | |
| 4886 | }; |
| 4887 | |
| 4888 | } // namespace detail |
| 4889 | template <typename RangeT> |
| 4890 | class : public detail::RuntimeNumWorkerThreadsOpGenericAdaptorBase { |
| 4891 | using = ::llvm::detail::ValueOfRange<RangeT>; |
| 4892 | using = detail::RuntimeNumWorkerThreadsOpGenericAdaptorBase; |
| 4893 | public: |
| 4894 | (RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 4895 | |
| 4896 | (RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeNumWorkerThreadsOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 4897 | |
| 4898 | (RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeNumWorkerThreadsOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 4899 | |
| 4900 | (RangeT values, const RuntimeNumWorkerThreadsOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 4901 | |
| 4902 | template <typename LateInst = RuntimeNumWorkerThreadsOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeNumWorkerThreadsOp>>> |
| 4903 | (RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 4904 | |
| 4905 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4906 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 4907 | } |
| 4908 | |
| 4909 | RangeT getODSOperands(unsigned index) { |
| 4910 | auto valueRange = getODSOperandIndexAndLength(index); |
| 4911 | return {std::next(odsOperands.begin(), valueRange.first), |
| 4912 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 4913 | } |
| 4914 | |
| 4915 | RangeT getOperands() { |
| 4916 | return odsOperands; |
| 4917 | } |
| 4918 | |
| 4919 | private: |
| 4920 | RangeT odsOperands; |
| 4921 | }; |
| 4922 | class : public RuntimeNumWorkerThreadsOpGenericAdaptor<::mlir::ValueRange> { |
| 4923 | public: |
| 4924 | using RuntimeNumWorkerThreadsOpGenericAdaptor::RuntimeNumWorkerThreadsOpGenericAdaptor; |
| 4925 | (RuntimeNumWorkerThreadsOp op); |
| 4926 | |
| 4927 | ::llvm::LogicalResult (::mlir::Location loc); |
| 4928 | }; |
| 4929 | class : public ::mlir::Op<RuntimeNumWorkerThreadsOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::IndexType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::InferTypeOpInterface::Trait> { |
| 4930 | public: |
| 4931 | using Op::Op; |
| 4932 | using Op::print; |
| 4933 | using = RuntimeNumWorkerThreadsOpAdaptor; |
| 4934 | template <typename RangeT> |
| 4935 | using = RuntimeNumWorkerThreadsOpGenericAdaptor<RangeT>; |
| 4936 | using = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 4937 | static constexpr int = 0; |
| 4938 | using = FoldAdaptor::Properties; |
| 4939 | using ::mlir::InferTypeOpInterface::Trait<RuntimeNumWorkerThreadsOp>::refineReturnTypes; |
| 4940 | static ::llvm::ArrayRef<::llvm::StringRef> () { |
| 4941 | return {}; |
| 4942 | } |
| 4943 | |
| 4944 | static constexpr ::llvm::StringLiteral () { |
| 4945 | return ::llvm::StringLiteral("async.runtime.num_worker_threads" ); |
| 4946 | } |
| 4947 | |
| 4948 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4949 | return {index, 1}; |
| 4950 | } |
| 4951 | |
| 4952 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 4953 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 4954 | return getOperation()->getOperands().slice(n: start, m: length); |
| 4955 | } |
| 4956 | |
| 4957 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 4958 | return {index, 1}; |
| 4959 | } |
| 4960 | |
| 4961 | ::mlir::Operation::result_range (unsigned index) { |
| 4962 | auto valueRange = getODSResultIndexAndLength(index); |
| 4963 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 4964 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 4965 | } |
| 4966 | |
| 4967 | ::mlir::TypedValue<::mlir::IndexType> () { |
| 4968 | return ::llvm::cast<::mlir::TypedValue<::mlir::IndexType>>(Val: *getODSResults(index: 0).begin()); |
| 4969 | } |
| 4970 | |
| 4971 | static ::llvm::LogicalResult (Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4972 | static ::mlir::Attribute (::mlir::MLIRContext *ctx, const Properties &prop); |
| 4973 | static llvm::hash_code (const Properties &prop); |
| 4974 | static std::optional<mlir::Attribute> (::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 4975 | static void (Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 4976 | static void (::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 4977 | static ::llvm::LogicalResult (::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4978 | static void (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result); |
| 4979 | static RuntimeNumWorkerThreadsOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result); |
| 4980 | static RuntimeNumWorkerThreadsOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result); |
| 4981 | static void (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState); |
| 4982 | static RuntimeNumWorkerThreadsOp (::mlir::OpBuilder &builder, ::mlir::Location location); |
| 4983 | static RuntimeNumWorkerThreadsOp (::mlir::ImplicitLocOpBuilder &builder); |
| 4984 | static void (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes); |
| 4985 | static RuntimeNumWorkerThreadsOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes); |
| 4986 | static RuntimeNumWorkerThreadsOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes); |
| 4987 | static void (::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4988 | static RuntimeNumWorkerThreadsOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4989 | static RuntimeNumWorkerThreadsOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4990 | static void (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4991 | static RuntimeNumWorkerThreadsOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4992 | static RuntimeNumWorkerThreadsOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4993 | static void (::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4994 | static RuntimeNumWorkerThreadsOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4995 | static RuntimeNumWorkerThreadsOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4996 | static void (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4997 | static RuntimeNumWorkerThreadsOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4998 | static RuntimeNumWorkerThreadsOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4999 | ::llvm::LogicalResult (); |
| 5000 | ::llvm::LogicalResult (); |
| 5001 | static ::llvm::LogicalResult (::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); |
| 5002 | static ::mlir::ParseResult (::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 5003 | LLVM_ATTRIBUTE_MINSIZE void (::mlir::OpAsmPrinter &_odsPrinter); |
| 5004 | public: |
| 5005 | }; |
| 5006 | |
| 5007 | } // namespace mlir::async |
| 5008 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeNumWorkerThreadsOp) |
| 5009 | |
| 5010 | namespace mlir::async { |
| 5011 | |
| 5012 | |
| 5013 | //===----------------------------------------------------------------------===// |
| 5014 | // ::mlir::async::RuntimeResumeOp declarations |
| 5015 | //===----------------------------------------------------------------------===// |
| 5016 | |
| 5017 | namespace detail { |
| 5018 | |
| 5019 | class RuntimeResumeOpGenericAdaptorBase { |
| 5020 | public: |
| 5021 | using Properties = ::mlir::EmptyProperties; |
| 5022 | protected: |
| 5023 | ::mlir::DictionaryAttr odsAttrs; |
| 5024 | ::std::optional<::mlir::OperationName> odsOpName; |
| 5025 | Properties properties; |
| 5026 | ::mlir::RegionRange odsRegions; |
| 5027 | public: |
| 5028 | RuntimeResumeOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 5029 | odsOpName.emplace(args: "async.runtime.resume" , args: odsAttrs.getContext()); |
| 5030 | } |
| 5031 | |
| 5032 | RuntimeResumeOpGenericAdaptorBase(RuntimeResumeOp op); |
| 5033 | |
| 5034 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 5035 | return {index, 1}; |
| 5036 | } |
| 5037 | |
| 5038 | const Properties &getProperties() { |
| 5039 | return properties; |
| 5040 | } |
| 5041 | |
| 5042 | ::mlir::DictionaryAttr getAttributes() { |
| 5043 | return odsAttrs; |
| 5044 | } |
| 5045 | |
| 5046 | }; |
| 5047 | |
| 5048 | } // namespace detail |
| 5049 | template <typename RangeT> |
| 5050 | class RuntimeResumeOpGenericAdaptor : public detail::RuntimeResumeOpGenericAdaptorBase { |
| 5051 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 5052 | using Base = detail::RuntimeResumeOpGenericAdaptorBase; |
| 5053 | static constexpr int odsIndex_handle = 0; |
| 5054 | public: |
| 5055 | RuntimeResumeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 5056 | |
| 5057 | RuntimeResumeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeResumeOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 5058 | |
| 5059 | RuntimeResumeOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeResumeOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 5060 | |
| 5061 | RuntimeResumeOpGenericAdaptor(RangeT values, const RuntimeResumeOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 5062 | |
| 5063 | template <typename LateInst = RuntimeResumeOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeResumeOp>>> |
| 5064 | RuntimeResumeOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 5065 | |
| 5066 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5067 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 5068 | } |
| 5069 | |
| 5070 | RangeT getODSOperands(unsigned index) { |
| 5071 | auto valueRange = getODSOperandIndexAndLength(index); |
| 5072 | return {std::next(odsOperands.begin(), valueRange.first), |
| 5073 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 5074 | } |
| 5075 | |
| 5076 | ValueT getHandle() { |
| 5077 | return (*getODSOperands(index: 0).begin()); |
| 5078 | } |
| 5079 | |
| 5080 | RangeT getOperands() { |
| 5081 | return odsOperands; |
| 5082 | } |
| 5083 | |
| 5084 | private: |
| 5085 | RangeT odsOperands; |
| 5086 | }; |
| 5087 | class RuntimeResumeOpAdaptor : public RuntimeResumeOpGenericAdaptor<::mlir::ValueRange> { |
| 5088 | public: |
| 5089 | using RuntimeResumeOpGenericAdaptor::RuntimeResumeOpGenericAdaptor; |
| 5090 | RuntimeResumeOpAdaptor(RuntimeResumeOp op); |
| 5091 | |
| 5092 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 5093 | }; |
| 5094 | class RuntimeResumeOp : public ::mlir::Op<RuntimeResumeOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants> { |
| 5095 | public: |
| 5096 | using Op::Op; |
| 5097 | using Op::print; |
| 5098 | using Adaptor = RuntimeResumeOpAdaptor; |
| 5099 | template <typename RangeT> |
| 5100 | using GenericAdaptor = RuntimeResumeOpGenericAdaptor<RangeT>; |
| 5101 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 5102 | static constexpr int odsIndex_handle = 0; |
| 5103 | using Properties = FoldAdaptor::Properties; |
| 5104 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 5105 | return {}; |
| 5106 | } |
| 5107 | |
| 5108 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 5109 | return ::llvm::StringLiteral("async.runtime.resume" ); |
| 5110 | } |
| 5111 | |
| 5112 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5113 | return {index, 1}; |
| 5114 | } |
| 5115 | |
| 5116 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 5117 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 5118 | return getOperation()->getOperands().slice(n: start, m: length); |
| 5119 | } |
| 5120 | |
| 5121 | ::mlir::TypedValue<::mlir::async::CoroHandleType> getHandle() { |
| 5122 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::CoroHandleType>>(Val: *getODSOperands(index: 0).begin()); |
| 5123 | } |
| 5124 | |
| 5125 | ::mlir::OpOperand &getHandleMutable() { |
| 5126 | auto range = getODSOperandIndexAndLength(index: 0); |
| 5127 | return getOperation()->getOpOperand(idx: range.first); |
| 5128 | } |
| 5129 | |
| 5130 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 5131 | return {index, 1}; |
| 5132 | } |
| 5133 | |
| 5134 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 5135 | auto valueRange = getODSResultIndexAndLength(index); |
| 5136 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 5137 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 5138 | } |
| 5139 | |
| 5140 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5141 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 5142 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 5143 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 5144 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 5145 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 5146 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5147 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value handle); |
| 5148 | static RuntimeResumeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value handle); |
| 5149 | static RuntimeResumeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value handle); |
| 5150 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle); |
| 5151 | static RuntimeResumeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value handle); |
| 5152 | static RuntimeResumeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value handle); |
| 5153 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5154 | static RuntimeResumeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5155 | static RuntimeResumeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5156 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5157 | static RuntimeResumeOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5158 | static RuntimeResumeOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5159 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 5160 | ::llvm::LogicalResult verifyInvariants(); |
| 5161 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 5162 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 5163 | public: |
| 5164 | }; |
| 5165 | |
| 5166 | } // namespace mlir::async |
| 5167 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeResumeOp) |
| 5168 | |
| 5169 | namespace mlir::async { |
| 5170 | |
| 5171 | |
| 5172 | //===----------------------------------------------------------------------===// |
| 5173 | // ::mlir::async::RuntimeSetAvailableOp declarations |
| 5174 | //===----------------------------------------------------------------------===// |
| 5175 | |
| 5176 | namespace detail { |
| 5177 | |
| 5178 | class RuntimeSetAvailableOpGenericAdaptorBase { |
| 5179 | public: |
| 5180 | using Properties = ::mlir::EmptyProperties; |
| 5181 | protected: |
| 5182 | ::mlir::DictionaryAttr odsAttrs; |
| 5183 | ::std::optional<::mlir::OperationName> odsOpName; |
| 5184 | Properties properties; |
| 5185 | ::mlir::RegionRange odsRegions; |
| 5186 | public: |
| 5187 | RuntimeSetAvailableOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 5188 | odsOpName.emplace(args: "async.runtime.set_available" , args: odsAttrs.getContext()); |
| 5189 | } |
| 5190 | |
| 5191 | RuntimeSetAvailableOpGenericAdaptorBase(RuntimeSetAvailableOp op); |
| 5192 | |
| 5193 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 5194 | return {index, 1}; |
| 5195 | } |
| 5196 | |
| 5197 | const Properties &getProperties() { |
| 5198 | return properties; |
| 5199 | } |
| 5200 | |
| 5201 | ::mlir::DictionaryAttr getAttributes() { |
| 5202 | return odsAttrs; |
| 5203 | } |
| 5204 | |
| 5205 | }; |
| 5206 | |
| 5207 | } // namespace detail |
| 5208 | template <typename RangeT> |
| 5209 | class RuntimeSetAvailableOpGenericAdaptor : public detail::RuntimeSetAvailableOpGenericAdaptorBase { |
| 5210 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 5211 | using Base = detail::RuntimeSetAvailableOpGenericAdaptorBase; |
| 5212 | static constexpr int odsIndex_operand = 0; |
| 5213 | public: |
| 5214 | RuntimeSetAvailableOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 5215 | |
| 5216 | RuntimeSetAvailableOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeSetAvailableOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 5217 | |
| 5218 | RuntimeSetAvailableOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeSetAvailableOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 5219 | |
| 5220 | RuntimeSetAvailableOpGenericAdaptor(RangeT values, const RuntimeSetAvailableOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 5221 | |
| 5222 | template <typename LateInst = RuntimeSetAvailableOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeSetAvailableOp>>> |
| 5223 | RuntimeSetAvailableOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 5224 | |
| 5225 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5226 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 5227 | } |
| 5228 | |
| 5229 | RangeT getODSOperands(unsigned index) { |
| 5230 | auto valueRange = getODSOperandIndexAndLength(index); |
| 5231 | return {std::next(odsOperands.begin(), valueRange.first), |
| 5232 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 5233 | } |
| 5234 | |
| 5235 | ValueT getOperand() { |
| 5236 | return (*getODSOperands(index: 0).begin()); |
| 5237 | } |
| 5238 | |
| 5239 | RangeT getOperands() { |
| 5240 | return odsOperands; |
| 5241 | } |
| 5242 | |
| 5243 | private: |
| 5244 | RangeT odsOperands; |
| 5245 | }; |
| 5246 | class RuntimeSetAvailableOpAdaptor : public RuntimeSetAvailableOpGenericAdaptor<::mlir::ValueRange> { |
| 5247 | public: |
| 5248 | using RuntimeSetAvailableOpGenericAdaptor::RuntimeSetAvailableOpGenericAdaptor; |
| 5249 | RuntimeSetAvailableOpAdaptor(RuntimeSetAvailableOp op); |
| 5250 | |
| 5251 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 5252 | }; |
| 5253 | class RuntimeSetAvailableOp : public ::mlir::Op<RuntimeSetAvailableOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants> { |
| 5254 | public: |
| 5255 | using Op::Op; |
| 5256 | using Op::print; |
| 5257 | using Adaptor = RuntimeSetAvailableOpAdaptor; |
| 5258 | template <typename RangeT> |
| 5259 | using GenericAdaptor = RuntimeSetAvailableOpGenericAdaptor<RangeT>; |
| 5260 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 5261 | static constexpr int odsIndex_operand = 0; |
| 5262 | using Properties = FoldAdaptor::Properties; |
| 5263 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 5264 | return {}; |
| 5265 | } |
| 5266 | |
| 5267 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 5268 | return ::llvm::StringLiteral("async.runtime.set_available" ); |
| 5269 | } |
| 5270 | |
| 5271 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5272 | return {index, 1}; |
| 5273 | } |
| 5274 | |
| 5275 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 5276 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 5277 | return getOperation()->getOperands().slice(n: start, m: length); |
| 5278 | } |
| 5279 | |
| 5280 | ::mlir::TypedValue<::mlir::Type> getOperand() { |
| 5281 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 5282 | } |
| 5283 | |
| 5284 | ::mlir::OpOperand &getOperandMutable() { |
| 5285 | auto range = getODSOperandIndexAndLength(index: 0); |
| 5286 | return getOperation()->getOpOperand(idx: range.first); |
| 5287 | } |
| 5288 | |
| 5289 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 5290 | return {index, 1}; |
| 5291 | } |
| 5292 | |
| 5293 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 5294 | auto valueRange = getODSResultIndexAndLength(index); |
| 5295 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 5296 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 5297 | } |
| 5298 | |
| 5299 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5300 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 5301 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 5302 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 5303 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 5304 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 5305 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5306 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand); |
| 5307 | static RuntimeSetAvailableOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand); |
| 5308 | static RuntimeSetAvailableOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand); |
| 5309 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 5310 | static RuntimeSetAvailableOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 5311 | static RuntimeSetAvailableOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 5312 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5313 | static RuntimeSetAvailableOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5314 | static RuntimeSetAvailableOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5315 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5316 | static RuntimeSetAvailableOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5317 | static RuntimeSetAvailableOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5318 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 5319 | ::llvm::LogicalResult verifyInvariants(); |
| 5320 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 5321 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 5322 | public: |
| 5323 | }; |
| 5324 | |
| 5325 | } // namespace mlir::async |
| 5326 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeSetAvailableOp) |
| 5327 | |
| 5328 | namespace mlir::async { |
| 5329 | |
| 5330 | |
| 5331 | //===----------------------------------------------------------------------===// |
| 5332 | // ::mlir::async::RuntimeSetErrorOp declarations |
| 5333 | //===----------------------------------------------------------------------===// |
| 5334 | |
| 5335 | namespace detail { |
| 5336 | |
| 5337 | class RuntimeSetErrorOpGenericAdaptorBase { |
| 5338 | public: |
| 5339 | using Properties = ::mlir::EmptyProperties; |
| 5340 | protected: |
| 5341 | ::mlir::DictionaryAttr odsAttrs; |
| 5342 | ::std::optional<::mlir::OperationName> odsOpName; |
| 5343 | Properties properties; |
| 5344 | ::mlir::RegionRange odsRegions; |
| 5345 | public: |
| 5346 | RuntimeSetErrorOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 5347 | odsOpName.emplace(args: "async.runtime.set_error" , args: odsAttrs.getContext()); |
| 5348 | } |
| 5349 | |
| 5350 | RuntimeSetErrorOpGenericAdaptorBase(RuntimeSetErrorOp op); |
| 5351 | |
| 5352 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 5353 | return {index, 1}; |
| 5354 | } |
| 5355 | |
| 5356 | const Properties &getProperties() { |
| 5357 | return properties; |
| 5358 | } |
| 5359 | |
| 5360 | ::mlir::DictionaryAttr getAttributes() { |
| 5361 | return odsAttrs; |
| 5362 | } |
| 5363 | |
| 5364 | }; |
| 5365 | |
| 5366 | } // namespace detail |
| 5367 | template <typename RangeT> |
| 5368 | class RuntimeSetErrorOpGenericAdaptor : public detail::RuntimeSetErrorOpGenericAdaptorBase { |
| 5369 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 5370 | using Base = detail::RuntimeSetErrorOpGenericAdaptorBase; |
| 5371 | static constexpr int odsIndex_operand = 0; |
| 5372 | public: |
| 5373 | RuntimeSetErrorOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 5374 | |
| 5375 | RuntimeSetErrorOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeSetErrorOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 5376 | |
| 5377 | RuntimeSetErrorOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeSetErrorOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 5378 | |
| 5379 | RuntimeSetErrorOpGenericAdaptor(RangeT values, const RuntimeSetErrorOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 5380 | |
| 5381 | template <typename LateInst = RuntimeSetErrorOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeSetErrorOp>>> |
| 5382 | RuntimeSetErrorOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 5383 | |
| 5384 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5385 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 5386 | } |
| 5387 | |
| 5388 | RangeT getODSOperands(unsigned index) { |
| 5389 | auto valueRange = getODSOperandIndexAndLength(index); |
| 5390 | return {std::next(odsOperands.begin(), valueRange.first), |
| 5391 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 5392 | } |
| 5393 | |
| 5394 | ValueT getOperand() { |
| 5395 | return (*getODSOperands(index: 0).begin()); |
| 5396 | } |
| 5397 | |
| 5398 | RangeT getOperands() { |
| 5399 | return odsOperands; |
| 5400 | } |
| 5401 | |
| 5402 | private: |
| 5403 | RangeT odsOperands; |
| 5404 | }; |
| 5405 | class RuntimeSetErrorOpAdaptor : public RuntimeSetErrorOpGenericAdaptor<::mlir::ValueRange> { |
| 5406 | public: |
| 5407 | using RuntimeSetErrorOpGenericAdaptor::RuntimeSetErrorOpGenericAdaptor; |
| 5408 | RuntimeSetErrorOpAdaptor(RuntimeSetErrorOp op); |
| 5409 | |
| 5410 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 5411 | }; |
| 5412 | class RuntimeSetErrorOp : public ::mlir::Op<RuntimeSetErrorOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants> { |
| 5413 | public: |
| 5414 | using Op::Op; |
| 5415 | using Op::print; |
| 5416 | using Adaptor = RuntimeSetErrorOpAdaptor; |
| 5417 | template <typename RangeT> |
| 5418 | using GenericAdaptor = RuntimeSetErrorOpGenericAdaptor<RangeT>; |
| 5419 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 5420 | static constexpr int odsIndex_operand = 0; |
| 5421 | using Properties = FoldAdaptor::Properties; |
| 5422 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 5423 | return {}; |
| 5424 | } |
| 5425 | |
| 5426 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 5427 | return ::llvm::StringLiteral("async.runtime.set_error" ); |
| 5428 | } |
| 5429 | |
| 5430 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5431 | return {index, 1}; |
| 5432 | } |
| 5433 | |
| 5434 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 5435 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 5436 | return getOperation()->getOperands().slice(n: start, m: length); |
| 5437 | } |
| 5438 | |
| 5439 | ::mlir::TypedValue<::mlir::Type> getOperand() { |
| 5440 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 5441 | } |
| 5442 | |
| 5443 | ::mlir::OpOperand &getOperandMutable() { |
| 5444 | auto range = getODSOperandIndexAndLength(index: 0); |
| 5445 | return getOperation()->getOpOperand(idx: range.first); |
| 5446 | } |
| 5447 | |
| 5448 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 5449 | return {index, 1}; |
| 5450 | } |
| 5451 | |
| 5452 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 5453 | auto valueRange = getODSResultIndexAndLength(index); |
| 5454 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 5455 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 5456 | } |
| 5457 | |
| 5458 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5459 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 5460 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 5461 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 5462 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 5463 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 5464 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5465 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand); |
| 5466 | static RuntimeSetErrorOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand); |
| 5467 | static RuntimeSetErrorOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand); |
| 5468 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 5469 | static RuntimeSetErrorOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 5470 | static RuntimeSetErrorOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand); |
| 5471 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5472 | static RuntimeSetErrorOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5473 | static RuntimeSetErrorOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5474 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5475 | static RuntimeSetErrorOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5476 | static RuntimeSetErrorOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5477 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 5478 | ::llvm::LogicalResult verifyInvariants(); |
| 5479 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 5480 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 5481 | public: |
| 5482 | }; |
| 5483 | |
| 5484 | } // namespace mlir::async |
| 5485 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeSetErrorOp) |
| 5486 | |
| 5487 | namespace mlir::async { |
| 5488 | |
| 5489 | |
| 5490 | //===----------------------------------------------------------------------===// |
| 5491 | // ::mlir::async::RuntimeStoreOp declarations |
| 5492 | //===----------------------------------------------------------------------===// |
| 5493 | |
| 5494 | namespace detail { |
| 5495 | |
| 5496 | class RuntimeStoreOpGenericAdaptorBase { |
| 5497 | public: |
| 5498 | using Properties = ::mlir::EmptyProperties; |
| 5499 | protected: |
| 5500 | ::mlir::DictionaryAttr odsAttrs; |
| 5501 | ::std::optional<::mlir::OperationName> odsOpName; |
| 5502 | Properties properties; |
| 5503 | ::mlir::RegionRange odsRegions; |
| 5504 | public: |
| 5505 | RuntimeStoreOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 5506 | odsOpName.emplace(args: "async.runtime.store" , args: odsAttrs.getContext()); |
| 5507 | } |
| 5508 | |
| 5509 | RuntimeStoreOpGenericAdaptorBase(RuntimeStoreOp op); |
| 5510 | |
| 5511 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 5512 | return {index, 1}; |
| 5513 | } |
| 5514 | |
| 5515 | const Properties &getProperties() { |
| 5516 | return properties; |
| 5517 | } |
| 5518 | |
| 5519 | ::mlir::DictionaryAttr getAttributes() { |
| 5520 | return odsAttrs; |
| 5521 | } |
| 5522 | |
| 5523 | }; |
| 5524 | |
| 5525 | } // namespace detail |
| 5526 | template <typename RangeT> |
| 5527 | class RuntimeStoreOpGenericAdaptor : public detail::RuntimeStoreOpGenericAdaptorBase { |
| 5528 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 5529 | using Base = detail::RuntimeStoreOpGenericAdaptorBase; |
| 5530 | static constexpr int odsIndex_value = 0; |
| 5531 | static constexpr int odsIndex_storage = 1; |
| 5532 | public: |
| 5533 | RuntimeStoreOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 5534 | |
| 5535 | RuntimeStoreOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RuntimeStoreOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 5536 | |
| 5537 | RuntimeStoreOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RuntimeStoreOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 5538 | |
| 5539 | RuntimeStoreOpGenericAdaptor(RangeT values, const RuntimeStoreOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 5540 | |
| 5541 | template <typename LateInst = RuntimeStoreOp, typename = std::enable_if_t<std::is_same_v<LateInst, RuntimeStoreOp>>> |
| 5542 | RuntimeStoreOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 5543 | |
| 5544 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5545 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 5546 | } |
| 5547 | |
| 5548 | RangeT getODSOperands(unsigned index) { |
| 5549 | auto valueRange = getODSOperandIndexAndLength(index); |
| 5550 | return {std::next(odsOperands.begin(), valueRange.first), |
| 5551 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 5552 | } |
| 5553 | |
| 5554 | ValueT getValue() { |
| 5555 | return (*getODSOperands(index: 0).begin()); |
| 5556 | } |
| 5557 | |
| 5558 | ValueT getStorage() { |
| 5559 | return (*getODSOperands(index: 1).begin()); |
| 5560 | } |
| 5561 | |
| 5562 | RangeT getOperands() { |
| 5563 | return odsOperands; |
| 5564 | } |
| 5565 | |
| 5566 | private: |
| 5567 | RangeT odsOperands; |
| 5568 | }; |
| 5569 | class RuntimeStoreOpAdaptor : public RuntimeStoreOpGenericAdaptor<::mlir::ValueRange> { |
| 5570 | public: |
| 5571 | using RuntimeStoreOpGenericAdaptor::RuntimeStoreOpGenericAdaptor; |
| 5572 | RuntimeStoreOpAdaptor(RuntimeStoreOp op); |
| 5573 | |
| 5574 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 5575 | }; |
| 5576 | class RuntimeStoreOp : public ::mlir::Op<RuntimeStoreOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants> { |
| 5577 | public: |
| 5578 | using Op::Op; |
| 5579 | using Op::print; |
| 5580 | using Adaptor = RuntimeStoreOpAdaptor; |
| 5581 | template <typename RangeT> |
| 5582 | using GenericAdaptor = RuntimeStoreOpGenericAdaptor<RangeT>; |
| 5583 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 5584 | static constexpr int odsIndex_value = 0; |
| 5585 | static constexpr int odsIndex_storage = 1; |
| 5586 | using Properties = FoldAdaptor::Properties; |
| 5587 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 5588 | return {}; |
| 5589 | } |
| 5590 | |
| 5591 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 5592 | return ::llvm::StringLiteral("async.runtime.store" ); |
| 5593 | } |
| 5594 | |
| 5595 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5596 | return {index, 1}; |
| 5597 | } |
| 5598 | |
| 5599 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 5600 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 5601 | return getOperation()->getOperands().slice(n: start, m: length); |
| 5602 | } |
| 5603 | |
| 5604 | ::mlir::TypedValue<::mlir::Type> getValue() { |
| 5605 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 5606 | } |
| 5607 | |
| 5608 | ::mlir::TypedValue<::mlir::async::ValueType> getStorage() { |
| 5609 | return ::llvm::cast<::mlir::TypedValue<::mlir::async::ValueType>>(Val: *getODSOperands(index: 1).begin()); |
| 5610 | } |
| 5611 | |
| 5612 | ::mlir::OpOperand &getValueMutable() { |
| 5613 | auto range = getODSOperandIndexAndLength(index: 0); |
| 5614 | return getOperation()->getOpOperand(idx: range.first); |
| 5615 | } |
| 5616 | |
| 5617 | ::mlir::OpOperand &getStorageMutable() { |
| 5618 | auto range = getODSOperandIndexAndLength(index: 1); |
| 5619 | return getOperation()->getOpOperand(idx: range.first); |
| 5620 | } |
| 5621 | |
| 5622 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 5623 | return {index, 1}; |
| 5624 | } |
| 5625 | |
| 5626 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 5627 | auto valueRange = getODSResultIndexAndLength(index); |
| 5628 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 5629 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 5630 | } |
| 5631 | |
| 5632 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5633 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 5634 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 5635 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 5636 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 5637 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 5638 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5639 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value, ::mlir::Value storage); |
| 5640 | static RuntimeStoreOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value value, ::mlir::Value storage); |
| 5641 | static RuntimeStoreOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value value, ::mlir::Value storage); |
| 5642 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value storage); |
| 5643 | static RuntimeStoreOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value storage); |
| 5644 | static RuntimeStoreOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value storage); |
| 5645 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5646 | static RuntimeStoreOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5647 | static RuntimeStoreOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5648 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5649 | static RuntimeStoreOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5650 | static RuntimeStoreOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5651 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 5652 | ::llvm::LogicalResult verifyInvariants(); |
| 5653 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 5654 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 5655 | public: |
| 5656 | }; |
| 5657 | |
| 5658 | } // namespace mlir::async |
| 5659 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::RuntimeStoreOp) |
| 5660 | |
| 5661 | namespace mlir::async { |
| 5662 | |
| 5663 | |
| 5664 | //===----------------------------------------------------------------------===// |
| 5665 | // ::mlir::async::YieldOp declarations |
| 5666 | //===----------------------------------------------------------------------===// |
| 5667 | |
| 5668 | namespace detail { |
| 5669 | |
| 5670 | class YieldOpGenericAdaptorBase { |
| 5671 | public: |
| 5672 | using Properties = ::mlir::EmptyProperties; |
| 5673 | protected: |
| 5674 | ::mlir::DictionaryAttr odsAttrs; |
| 5675 | ::std::optional<::mlir::OperationName> odsOpName; |
| 5676 | Properties properties; |
| 5677 | ::mlir::RegionRange odsRegions; |
| 5678 | public: |
| 5679 | YieldOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 5680 | odsOpName.emplace(args: "async.yield" , args: odsAttrs.getContext()); |
| 5681 | } |
| 5682 | |
| 5683 | YieldOpGenericAdaptorBase(YieldOp op); |
| 5684 | |
| 5685 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize); |
| 5686 | const Properties &getProperties() { |
| 5687 | return properties; |
| 5688 | } |
| 5689 | |
| 5690 | ::mlir::DictionaryAttr getAttributes() { |
| 5691 | return odsAttrs; |
| 5692 | } |
| 5693 | |
| 5694 | }; |
| 5695 | |
| 5696 | } // namespace detail |
| 5697 | template <typename RangeT> |
| 5698 | class YieldOpGenericAdaptor : public detail::YieldOpGenericAdaptorBase { |
| 5699 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 5700 | using Base = detail::YieldOpGenericAdaptorBase; |
| 5701 | static constexpr int odsIndex_operands = 0; |
| 5702 | public: |
| 5703 | YieldOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 5704 | |
| 5705 | YieldOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : YieldOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 5706 | |
| 5707 | YieldOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : YieldOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 5708 | |
| 5709 | YieldOpGenericAdaptor(RangeT values, const YieldOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 5710 | |
| 5711 | template <typename LateInst = YieldOp, typename = std::enable_if_t<std::is_same_v<LateInst, YieldOp>>> |
| 5712 | YieldOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 5713 | |
| 5714 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5715 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 5716 | } |
| 5717 | |
| 5718 | RangeT getODSOperands(unsigned index) { |
| 5719 | auto valueRange = getODSOperandIndexAndLength(index); |
| 5720 | return {std::next(odsOperands.begin(), valueRange.first), |
| 5721 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 5722 | } |
| 5723 | |
| 5724 | RangeT getOperands() { |
| 5725 | return getODSOperands(index: 0); |
| 5726 | } |
| 5727 | |
| 5728 | private: |
| 5729 | RangeT odsOperands; |
| 5730 | }; |
| 5731 | class YieldOpAdaptor : public YieldOpGenericAdaptor<::mlir::ValueRange> { |
| 5732 | public: |
| 5733 | using YieldOpGenericAdaptor::YieldOpGenericAdaptor; |
| 5734 | YieldOpAdaptor(YieldOp op); |
| 5735 | |
| 5736 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 5737 | }; |
| 5738 | class YieldOp : public ::mlir::Op<YieldOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::HasParent<ExecuteOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::IsTerminator, ::mlir::RegionBranchTerminatorOpInterface::Trait, ::mlir::OpTrait::ReturnLike> { |
| 5739 | public: |
| 5740 | using Op::Op; |
| 5741 | using Op::print; |
| 5742 | using Adaptor = YieldOpAdaptor; |
| 5743 | template <typename RangeT> |
| 5744 | using GenericAdaptor = YieldOpGenericAdaptor<RangeT>; |
| 5745 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 5746 | static constexpr int odsIndex_operands = 0; |
| 5747 | using Properties = FoldAdaptor::Properties; |
| 5748 | using ::mlir::RegionBranchTerminatorOpInterface::Trait<YieldOp>::getMutableSuccessorOperands; |
| 5749 | using ::mlir::RegionBranchTerminatorOpInterface::Trait<YieldOp>::getSuccessorRegions; |
| 5750 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 5751 | return {}; |
| 5752 | } |
| 5753 | |
| 5754 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 5755 | return ::llvm::StringLiteral("async.yield" ); |
| 5756 | } |
| 5757 | |
| 5758 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index); |
| 5759 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 5760 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 5761 | return getOperation()->getOperands().slice(n: start, m: length); |
| 5762 | } |
| 5763 | |
| 5764 | ::mlir::Operation::operand_range getOperands() { |
| 5765 | return getODSOperands(index: 0); |
| 5766 | } |
| 5767 | |
| 5768 | ::mlir::MutableOperandRange getOperandsMutable(); |
| 5769 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 5770 | return {index, 1}; |
| 5771 | } |
| 5772 | |
| 5773 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 5774 | auto valueRange = getODSResultIndexAndLength(index); |
| 5775 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 5776 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 5777 | } |
| 5778 | |
| 5779 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5780 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 5781 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 5782 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 5783 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 5784 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 5785 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5786 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands); |
| 5787 | static YieldOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands); |
| 5788 | static YieldOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands); |
| 5789 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5790 | static YieldOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5791 | static YieldOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5792 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5793 | static YieldOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5794 | static YieldOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5795 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 5796 | ::llvm::LogicalResult verifyInvariants(); |
| 5797 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 5798 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 5799 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 5800 | public: |
| 5801 | }; |
| 5802 | |
| 5803 | } // namespace mlir::async |
| 5804 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::async::YieldOp) |
| 5805 | |
| 5806 | |
| 5807 | #endif // GET_OP_CLASSES |
| 5808 | |
| 5809 | |