| 1 | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
| 2 | |* *| |
| 3 | |* Op Declarations *| |
| 4 | |* *| |
| 5 | |* Automatically generated file, do not edit! *| |
| 6 | |* From: ArithOps.td *| |
| 7 | |* *| |
| 8 | \*===----------------------------------------------------------------------===*/ |
| 9 | |
| 10 | namespace mlir::arith { |
| 11 | |
| 12 | /// floating point addition operation |
| 13 | /// The `addf` operation takes two operands and returns one result, each of |
| 14 | /// these is required to be the same type. This type may be a floating point |
| 15 | /// scalar type, a vector whose element type is a floating point type, or a |
| 16 | /// floating point tensor. |
| 17 | /// |
| 18 | /// Example: |
| 19 | /// |
| 20 | /// ```mlir |
| 21 | /// // Scalar addition. |
| 22 | /// %a = arith.addf %b, %c : f64 |
| 23 | /// |
| 24 | /// // SIMD vector addition, e.g. for Intel SSE. |
| 25 | /// %f = arith.addf %g, %h : vector<4xf32> |
| 26 | /// |
| 27 | /// // Tensor addition. |
| 28 | /// %x = arith.addf %y, %z : tensor<4x?xbf16> |
| 29 | /// |
| 30 | /// // Scalar addition with rounding mode. |
| 31 | /// %a = arith.addf %b, %c to_nearest_even : f64 |
| 32 | /// ``` |
| 33 | class AddFOp; |
| 34 | |
| 35 | } // namespace mlir::arith |
| 36 | namespace mlir::arith { |
| 37 | |
| 38 | /// integer addition operation |
| 39 | /// Performs N-bit addition on the operands. The operands are interpreted as |
| 40 | /// unsigned bitvectors. The result is represented by a bitvector containing the |
| 41 | /// mathematical value of the addition modulo 2^n, where `n` is the bitwidth. |
| 42 | /// Because `arith` integers use a two's complement representation, this operation |
| 43 | /// is applicable on both signed and unsigned integer operands. |
| 44 | /// |
| 45 | /// The `addi` operation takes two operands and returns one result, each of |
| 46 | /// these is required to be the same type. This type may be an integer scalar type, |
| 47 | /// a vector whose element type is integer, or a tensor of integers. |
| 48 | /// |
| 49 | /// This op supports `nuw`/`nsw` overflow flags which stands for |
| 50 | /// "No Unsigned Wrap" and "No Signed Wrap", respectively. If the `nuw` and/or |
| 51 | /// `nsw` flags are present, and an unsigned/signed overflow occurs |
| 52 | /// (respectively), the result is poison. |
| 53 | /// |
| 54 | /// Example: |
| 55 | /// |
| 56 | /// ```mlir |
| 57 | /// // Scalar addition. |
| 58 | /// %a = arith.addi %b, %c : i64 |
| 59 | /// |
| 60 | /// // Scalar addition with overflow flags. |
| 61 | /// %a = arith.addi %b, %c overflow<nsw, nuw> : i64 |
| 62 | /// |
| 63 | /// // SIMD vector element-wise addition. |
| 64 | /// %f = arith.addi %g, %h : vector<4xi32> |
| 65 | /// |
| 66 | /// // Tensor element-wise addition. |
| 67 | /// %x = arith.addi %y, %z : tensor<4x?xi8> |
| 68 | /// ``` |
| 69 | class AddIOp; |
| 70 | |
| 71 | } // namespace mlir::arith |
| 72 | namespace mlir::arith { |
| 73 | |
| 74 | /// extended unsigned integer addition operation returning sum and overflow bit |
| 75 | /// Performs (N+1)-bit addition on zero-extended operands. Returns two results: |
| 76 | /// the N-bit sum (same type as both operands), and the overflow bit |
| 77 | /// (boolean-like), where `1` indicates unsigned addition overflow, while `0` |
| 78 | /// indicates no overflow. |
| 79 | /// |
| 80 | /// Example: |
| 81 | /// |
| 82 | /// ```mlir |
| 83 | /// // Scalar addition. |
| 84 | /// %sum, %overflow = arith.addui_extended %b, %c : i64, i1 |
| 85 | /// |
| 86 | /// // Vector element-wise addition. |
| 87 | /// %d:2 = arith.addui_extended %e, %f : vector<4xi32>, vector<4xi1> |
| 88 | /// |
| 89 | /// // Tensor element-wise addition. |
| 90 | /// %x:2 = arith.addui_extended %y, %z : tensor<4x?xi8>, tensor<4x?xi1> |
| 91 | /// ``` |
| 92 | class AddUIExtendedOp; |
| 93 | |
| 94 | } // namespace mlir::arith |
| 95 | namespace mlir::arith { |
| 96 | |
| 97 | /// integer binary and |
| 98 | /// The `andi` operation takes two operands and returns one result, each of |
| 99 | /// these is required to be the same type. This type may be an integer scalar |
| 100 | /// type, a vector whose element type is integer, or a tensor of integers. It |
| 101 | /// has no standard attributes. |
| 102 | /// |
| 103 | /// Example: |
| 104 | /// |
| 105 | /// ```mlir |
| 106 | /// // Scalar integer bitwise and. |
| 107 | /// %a = arith.andi %b, %c : i64 |
| 108 | /// |
| 109 | /// // SIMD vector element-wise bitwise integer and. |
| 110 | /// %f = arith.andi %g, %h : vector<4xi32> |
| 111 | /// |
| 112 | /// // Tensor element-wise bitwise integer and. |
| 113 | /// %x = arith.andi %y, %z : tensor<4x?xi8> |
| 114 | /// ``` |
| 115 | class AndIOp; |
| 116 | |
| 117 | } // namespace mlir::arith |
| 118 | namespace mlir::arith { |
| 119 | |
| 120 | /// bitcast between values of equal bit width |
| 121 | /// Bitcast an integer or floating point value to an integer or floating point |
| 122 | /// value of equal bit width. When operating on vectors, casts elementwise. |
| 123 | /// |
| 124 | /// Note that this implements a logical bitcast independent of target |
| 125 | /// endianness. This allows constant folding without target information and is |
| 126 | /// consitent with the bitcast constant folders in LLVM (see |
| 127 | /// https://github.com/llvm/llvm-project/blob/18c19414eb/llvm/lib/IR/ConstantFold.cpp#L168) |
| 128 | /// For targets where the source and target type have the same endianness (which |
| 129 | /// is the standard), this cast will also change no bits at runtime, but it may |
| 130 | /// still require an operation, for example if the machine has different |
| 131 | /// floating point and integer register files. For targets that have a different |
| 132 | /// endianness for the source and target types (e.g. float is big-endian and |
| 133 | /// integer is little-endian) a proper lowering would add operations to swap the |
| 134 | /// order of words in addition to the bitcast. |
| 135 | class BitcastOp; |
| 136 | |
| 137 | } // namespace mlir::arith |
| 138 | namespace mlir::arith { |
| 139 | |
| 140 | /// signed ceil integer division operation |
| 141 | /// Signed integer division. Rounds towards positive infinity, i.e. `7 / -2 = -3`. |
| 142 | /// |
| 143 | /// Divison by zero, or signed division overflow (minimum value divided by -1) |
| 144 | /// is undefined behavior. When applied to `vector` and `tensor` values, the |
| 145 | /// behavior is undefined if _any_ of its elements are divided by zero or has a |
| 146 | /// signed division overflow. |
| 147 | /// |
| 148 | /// Example: |
| 149 | /// |
| 150 | /// ```mlir |
| 151 | /// // Scalar signed integer division. |
| 152 | /// %a = arith.ceildivsi %b, %c : i64 |
| 153 | /// ``` |
| 154 | class CeilDivSIOp; |
| 155 | |
| 156 | } // namespace mlir::arith |
| 157 | namespace mlir::arith { |
| 158 | |
| 159 | /// unsigned ceil integer division operation |
| 160 | /// Unsigned integer division. Rounds towards positive infinity. Treats the |
| 161 | /// leading bit as the most significant, i.e. for `i16` given two's complement |
| 162 | /// representation, `6 / -2 = 6 / (2^16 - 2) = 1`. |
| 163 | /// |
| 164 | /// Division by zero is undefined behavior. When applied to `vector` and |
| 165 | /// `tensor` values, the behavior is undefined if _any_ elements are divided by |
| 166 | /// zero. |
| 167 | /// |
| 168 | /// Example: |
| 169 | /// |
| 170 | /// ```mlir |
| 171 | /// // Scalar unsigned integer division. |
| 172 | /// %a = arith.ceildivui %b, %c : i64 |
| 173 | /// ``` |
| 174 | class CeilDivUIOp; |
| 175 | |
| 176 | } // namespace mlir::arith |
| 177 | namespace mlir::arith { |
| 178 | |
| 179 | /// floating-point comparison operation |
| 180 | /// The `cmpf` operation compares its two operands according to the float |
| 181 | /// comparison rules and the predicate specified by the respective attribute. |
| 182 | /// The predicate defines the type of comparison: (un)orderedness, (in)equality |
| 183 | /// and signed less/greater than (or equal to) as well as predicates that are |
| 184 | /// always true or false. The operands must have the same type, and this type |
| 185 | /// must be a float type, or a vector or tensor thereof. The result is an i1, |
| 186 | /// or a vector/tensor thereof having the same shape as the inputs. Unlike cmpi, |
| 187 | /// the operands are always treated as signed. The u prefix indicates |
| 188 | /// *unordered* comparison, not unsigned comparison, so "une" means unordered or |
| 189 | /// not equal. For the sake of readability by humans, custom assembly form for |
| 190 | /// the operation uses a string-typed attribute for the predicate. The value of |
| 191 | /// this attribute corresponds to lower-cased name of the predicate constant, |
| 192 | /// e.g., "one" means "ordered not equal". The string representation of the |
| 193 | /// attribute is merely a syntactic sugar and is converted to an integer |
| 194 | /// attribute by the parser. |
| 195 | /// |
| 196 | /// Example: |
| 197 | /// |
| 198 | /// ```mlir |
| 199 | /// %r1 = arith.cmpf oeq, %0, %1 : f32 |
| 200 | /// %r2 = arith.cmpf ult, %0, %1 : tensor<42x42xf64> |
| 201 | /// %r3 = "arith.cmpf"(%0, %1) {predicate: 0} : (f8, f8) -> i1 |
| 202 | /// ``` |
| 203 | class CmpFOp; |
| 204 | |
| 205 | } // namespace mlir::arith |
| 206 | namespace mlir::arith { |
| 207 | |
| 208 | /// integer comparison operation |
| 209 | /// The `cmpi` operation is a generic comparison for integer-like types. Its two |
| 210 | /// arguments can be integers, vectors or tensors thereof as long as their types |
| 211 | /// match. The operation produces an i1 for the former case, a vector or a |
| 212 | /// tensor of i1 with the same shape as inputs in the other cases. |
| 213 | /// |
| 214 | /// Its first argument is an attribute that defines which type of comparison is |
| 215 | /// performed. The following comparisons are supported: |
| 216 | /// |
| 217 | /// - equal (mnemonic: `"eq"`; integer value: `0`) |
| 218 | /// - not equal (mnemonic: `"ne"`; integer value: `1`) |
| 219 | /// - signed less than (mnemonic: `"slt"`; integer value: `2`) |
| 220 | /// - signed less than or equal (mnemonic: `"sle"`; integer value: `3`) |
| 221 | /// - signed greater than (mnemonic: `"sgt"`; integer value: `4`) |
| 222 | /// - signed greater than or equal (mnemonic: `"sge"`; integer value: `5`) |
| 223 | /// - unsigned less than (mnemonic: `"ult"`; integer value: `6`) |
| 224 | /// - unsigned less than or equal (mnemonic: `"ule"`; integer value: `7`) |
| 225 | /// - unsigned greater than (mnemonic: `"ugt"`; integer value: `8`) |
| 226 | /// - unsigned greater than or equal (mnemonic: `"uge"`; integer value: `9`) |
| 227 | /// |
| 228 | /// The result is `1` if the comparison is true and `0` otherwise. For vector or |
| 229 | /// tensor operands, the comparison is performed elementwise and the element of |
| 230 | /// the result indicates whether the comparison is true for the operand elements |
| 231 | /// with the same indices as those of the result. |
| 232 | /// |
| 233 | /// Note: while the custom assembly form uses strings, the actual underlying |
| 234 | /// attribute has integer type (or rather enum class in C++ code) as seen from |
| 235 | /// the generic assembly form. String literals are used to improve readability |
| 236 | /// of the IR by humans. |
| 237 | /// |
| 238 | /// This operation only applies to integer-like operands, but not floats. The |
| 239 | /// main reason being that comparison operations have diverging sets of |
| 240 | /// attributes: integers require sign specification while floats require various |
| 241 | /// floating point-related particularities, e.g., `-ffast-math` behavior, |
| 242 | /// IEEE754 compliance, etc |
| 243 | /// ([rationale](../Rationale/Rationale.md#splitting-floating-point-vs-integer-operations)). |
| 244 | /// The type of comparison is specified as attribute to avoid introducing ten |
| 245 | /// similar operations, taking into account that they are often implemented |
| 246 | /// using the same operation downstream |
| 247 | /// ([rationale](../Rationale/Rationale.md#specifying-comparison-kind-as-attribute)). The |
| 248 | /// separation between signed and unsigned order comparisons is necessary |
| 249 | /// because of integers being signless. The comparison operation must know how |
| 250 | /// to interpret values with the foremost bit being set: negatives in two's |
| 251 | /// complement or large positives |
| 252 | /// ([rationale](../Rationale/Rationale.md#specifying-sign-in-integer-comparison-operations)). |
| 253 | /// |
| 254 | /// Example: |
| 255 | /// |
| 256 | /// ```mlir |
| 257 | /// // Custom form of scalar "signed less than" comparison. |
| 258 | /// %x = arith.cmpi slt, %lhs, %rhs : i32 |
| 259 | /// |
| 260 | /// // Generic form of the same operation. |
| 261 | /// %x = "arith.cmpi"(%lhs, %rhs) {predicate = 2 : i64} : (i32, i32) -> i1 |
| 262 | /// |
| 263 | /// // Custom form of vector equality comparison. |
| 264 | /// %x = arith.cmpi eq, %lhs, %rhs : vector<4xi64> |
| 265 | /// |
| 266 | /// // Generic form of the same operation. |
| 267 | /// %x = "arith.cmpi"(%lhs, %rhs) {predicate = 0 : i64} |
| 268 | /// : (vector<4xi64>, vector<4xi64>) -> vector<4xi1> |
| 269 | /// ``` |
| 270 | class CmpIOp; |
| 271 | |
| 272 | } // namespace mlir::arith |
| 273 | namespace mlir::arith { |
| 274 | |
| 275 | /// integer or floating point constant |
| 276 | /// The `constant` operation produces an SSA value equal to some integer or |
| 277 | /// floating-point constant specified by an attribute. This is the way MLIR |
| 278 | /// forms simple integer and floating point constants. |
| 279 | /// |
| 280 | /// Example: |
| 281 | /// |
| 282 | /// ``` |
| 283 | /// // Integer constant |
| 284 | /// %1 = arith.constant 42 : i32 |
| 285 | /// |
| 286 | /// // Equivalent generic form |
| 287 | /// %1 = "arith.constant"() {value = 42 : i32} : () -> i32 |
| 288 | /// ``` |
| 289 | class ConstantOp; |
| 290 | |
| 291 | } // namespace mlir::arith |
| 292 | namespace mlir::arith { |
| 293 | |
| 294 | /// cast between floating-point types of the same bitwidth |
| 295 | /// Cast a floating-point value to a different floating-point type of the same |
| 296 | /// bitwidth. This operation handles conversions between types that have the |
| 297 | /// same bitwidth but different semantics (e.g., f16 to bf16), which cannot |
| 298 | /// be represented by `arith.extf` or `arith.truncf`. |
| 299 | /// |
| 300 | /// The source and destination element types must be different and must have |
| 301 | /// the same bitwidth. When operating on vectors, casts elementwise. |
| 302 | class ConvertFOp; |
| 303 | |
| 304 | } // namespace mlir::arith |
| 305 | namespace mlir::arith { |
| 306 | |
| 307 | /// floating point division operation |
| 308 | /// The `divf` operation takes two operands and returns one result, each of |
| 309 | /// these is required to be the same type. This type may be a floating point |
| 310 | /// scalar type, a vector whose element type is a floating point type, or a |
| 311 | /// floating point tensor. |
| 312 | /// |
| 313 | /// Example: |
| 314 | /// |
| 315 | /// ```mlir |
| 316 | /// // Scalar division. |
| 317 | /// %a = arith.divf %b, %c : f64 |
| 318 | /// |
| 319 | /// // Scalar division with rounding mode. |
| 320 | /// %a = arith.divf %b, %c toward_zero : f64 |
| 321 | /// ``` |
| 322 | class DivFOp; |
| 323 | |
| 324 | } // namespace mlir::arith |
| 325 | namespace mlir::arith { |
| 326 | |
| 327 | /// signed integer division operation |
| 328 | /// Signed integer division. Rounds towards zero. Treats the leading bit as |
| 329 | /// sign, i.e. `6 / -2 = -3`. |
| 330 | /// |
| 331 | /// Divison by zero, or signed division overflow (minimum value divided by -1) |
| 332 | /// is undefined behavior. When applied to `vector` and `tensor` values, the |
| 333 | /// behavior is undefined if _any_ of its elements are divided by zero or has a |
| 334 | /// signed division overflow. |
| 335 | /// |
| 336 | /// If the `exact` attribute is present, the result value is poison if `lhs` is |
| 337 | /// not a multiple of `rhs`. |
| 338 | /// |
| 339 | /// Example: |
| 340 | /// |
| 341 | /// ```mlir |
| 342 | /// // Scalar signed integer division. |
| 343 | /// %a = arith.divsi %b, %c : i64 |
| 344 | /// |
| 345 | /// // Scalar signed integer division where %b is known to be a multiple of %c. |
| 346 | /// %a = arith.divsi %b, %c exact : i64 |
| 347 | /// |
| 348 | /// // SIMD vector element-wise division. |
| 349 | /// %f = arith.divsi %g, %h : vector<4xi32> |
| 350 | /// |
| 351 | /// // Tensor element-wise integer division. |
| 352 | /// %x = arith.divsi %y, %z : tensor<4x?xi8> |
| 353 | /// ``` |
| 354 | class DivSIOp; |
| 355 | |
| 356 | } // namespace mlir::arith |
| 357 | namespace mlir::arith { |
| 358 | |
| 359 | /// unsigned integer division operation |
| 360 | /// Unsigned integer division. Rounds towards zero. Treats the leading bit as |
| 361 | /// the most significant, i.e. for `i16` given two's complement representation, |
| 362 | /// `6 / -2 = 6 / (2^16 - 2) = 0`. |
| 363 | /// |
| 364 | /// Division by zero is undefined behavior. When applied to `vector` and |
| 365 | /// `tensor` values, the behavior is undefined if _any_ elements are divided by |
| 366 | /// zero. |
| 367 | /// |
| 368 | /// If the `exact` attribute is present, the result value is poison if `lhs` is |
| 369 | /// not a multiple of `rhs`. |
| 370 | /// |
| 371 | /// Example: |
| 372 | /// |
| 373 | /// ```mlir |
| 374 | /// // Scalar unsigned integer division. |
| 375 | /// %a = arith.divui %b, %c : i64 |
| 376 | /// |
| 377 | /// // Scalar unsigned integer division where %b is known to be a multiple of %c. |
| 378 | /// %a = arith.divui %b, %c exact : i64 |
| 379 | /// |
| 380 | /// // SIMD vector element-wise division. |
| 381 | /// %f = arith.divui %g, %h : vector<4xi32> |
| 382 | /// |
| 383 | /// // Tensor element-wise integer division. |
| 384 | /// %x = arith.divui %y, %z : tensor<4x?xi8> |
| 385 | /// ``` |
| 386 | class DivUIOp; |
| 387 | |
| 388 | } // namespace mlir::arith |
| 389 | namespace mlir::arith { |
| 390 | |
| 391 | /// cast from floating-point to wider floating-point |
| 392 | /// Cast a floating-point value to a larger floating-point-typed value. |
| 393 | /// The destination type must to be strictly wider than the source type. |
| 394 | /// When operating on vectors, casts elementwise. |
| 395 | class ExtFOp; |
| 396 | |
| 397 | } // namespace mlir::arith |
| 398 | namespace mlir::arith { |
| 399 | |
| 400 | /// integer sign extension operation |
| 401 | /// The integer sign extension operation takes an integer input of |
| 402 | /// width M and an integer destination type of width N. The destination |
| 403 | /// bit-width must be larger than the input bit-width (N > M). |
| 404 | /// The top-most (N - M) bits of the output are filled with copies |
| 405 | /// of the most-significant bit of the input. |
| 406 | /// |
| 407 | /// Example: |
| 408 | /// |
| 409 | /// ```mlir |
| 410 | /// %1 = arith.constant 5 : i3 // %1 is 0b101 |
| 411 | /// %2 = arith.extsi %1 : i3 to i6 // %2 is 0b111101 |
| 412 | /// %3 = arith.constant 2 : i3 // %3 is 0b010 |
| 413 | /// %4 = arith.extsi %3 : i3 to i6 // %4 is 0b000010 |
| 414 | /// |
| 415 | /// %5 = arith.extsi %0 : vector<2 x i32> to vector<2 x i64> |
| 416 | /// ``` |
| 417 | class ExtSIOp; |
| 418 | |
| 419 | } // namespace mlir::arith |
| 420 | namespace mlir::arith { |
| 421 | |
| 422 | /// integer zero extension operation |
| 423 | /// The integer zero extension operation takes an integer input of |
| 424 | /// width M and an integer destination type of width N. The destination |
| 425 | /// bit-width must be larger than the input bit-width (N > M). |
| 426 | /// The top-most (N - M) bits of the output are filled with zeros. |
| 427 | /// |
| 428 | /// When the `nneg` flag is present, the operand is assumed to have |
| 429 | /// the most significant bit set to 0. In this case, zero extension is |
| 430 | /// equivalent to sign extension. When this assumption is violated, the |
| 431 | /// result is poison. |
| 432 | /// |
| 433 | /// Example: |
| 434 | /// |
| 435 | /// ```mlir |
| 436 | /// %1 = arith.constant 5 : i3 // %1 is 0b101 |
| 437 | /// %2 = arith.extui %1 : i3 to i6 // %2 is 0b000101 |
| 438 | /// %3 = arith.constant 2 : i3 // %3 is 0b010 |
| 439 | /// %4 = arith.extui %3 : i3 to i6 // %4 is 0b000010 |
| 440 | /// |
| 441 | /// %5 = arith.extui %0 : vector<2 x i32> to vector<2 x i64> |
| 442 | /// |
| 443 | /// // Zero extension with nneg flag. |
| 444 | /// %6 = arith.extui %3 nneg : i3 to i6 |
| 445 | /// ``` |
| 446 | class ExtUIOp; |
| 447 | |
| 448 | } // namespace mlir::arith |
| 449 | namespace mlir::arith { |
| 450 | |
| 451 | /// cast from floating-point type to integer type |
| 452 | /// Cast from a value interpreted as floating-point to the nearest (rounding |
| 453 | /// towards zero) signed integer value. When operating on vectors, casts |
| 454 | /// elementwise. |
| 455 | class FPToSIOp; |
| 456 | |
| 457 | } // namespace mlir::arith |
| 458 | namespace mlir::arith { |
| 459 | |
| 460 | /// cast from floating-point type to integer type |
| 461 | /// Cast from a value interpreted as floating-point to the nearest (rounding |
| 462 | /// towards zero) unsigned integer value. When operating on vectors, casts |
| 463 | /// elementwise. |
| 464 | class FPToUIOp; |
| 465 | |
| 466 | } // namespace mlir::arith |
| 467 | namespace mlir::arith { |
| 468 | |
| 469 | /// signed floor integer division operation |
| 470 | /// Signed integer division. Rounds towards negative infinity, i.e. `5 / -2 = -3`. |
| 471 | /// |
| 472 | /// Divison by zero, or signed division overflow (minimum value divided by -1) |
| 473 | /// is undefined behavior. When applied to `vector` and `tensor` values, the |
| 474 | /// behavior is undefined if _any_ of its elements are divided by zero or has a |
| 475 | /// signed division overflow. |
| 476 | /// |
| 477 | /// Example: |
| 478 | /// |
| 479 | /// ```mlir |
| 480 | /// // Scalar signed integer division. |
| 481 | /// %a = arith.floordivsi %b, %c : i64 |
| 482 | /// |
| 483 | /// ``` |
| 484 | class FloorDivSIOp; |
| 485 | |
| 486 | } // namespace mlir::arith |
| 487 | namespace mlir::arith { |
| 488 | |
| 489 | /// flush denormal floating-point values to zero |
| 490 | /// The `flush_denormals` operation takes a floating-point value and returns |
| 491 | /// the input value if it is a normal (or zero, infinity, or NaN) value, or |
| 492 | /// a zero of the same type if the input is a denormal (subnormal) value. |
| 493 | /// The sign of zero is preserved when flushing a denormal: negative |
| 494 | /// denormals flush to `-0.0`, positive denormals flush to `+0.0`. |
| 495 | /// |
| 496 | /// A denormal number ("subnormal number" in IEEE-754) is a non-zero floating |
| 497 | /// point number that is smaller (closer to zero) than the smallest normal |
| 498 | /// number. Denormals fill the underflow gap around zero in floating-point |
| 499 | /// arithmetics, but may come at a runtime cost on some architectures. |
| 500 | /// |
| 501 | /// The input and result are required to be the same type. This type may be |
| 502 | /// a floating-point scalar type, a vector whose element type is a |
| 503 | /// floating-point type, or a tensor of floats. When operating on vectors |
| 504 | /// or tensors, the operation is applied elementwise. |
| 505 | /// |
| 506 | /// Example: |
| 507 | /// |
| 508 | /// ```mlir |
| 509 | /// // Scalar denormal flushing. |
| 510 | /// %a = arith.flush_denormals %b : f32 |
| 511 | /// |
| 512 | /// // SIMD vector element-wise denormal flushing. |
| 513 | /// %f = arith.flush_denormals %g : vector<4xf32> |
| 514 | /// |
| 515 | /// // Tensor element-wise denormal flushing. |
| 516 | /// %x = arith.flush_denormals %y : tensor<4x?xbf16> |
| 517 | /// ``` |
| 518 | class FlushDenormalsOp; |
| 519 | |
| 520 | } // namespace mlir::arith |
| 521 | namespace mlir::arith { |
| 522 | |
| 523 | /// cast between index and integer types |
| 524 | /// Casts between scalar or vector integers and corresponding 'index' scalar or |
| 525 | /// vectors. Index is an integer of platform-specific bit width. If casting to |
| 526 | /// a wider integer, the value is sign-extended. If casting to a narrower |
| 527 | /// integer, the value is truncated. |
| 528 | class IndexCastOp; |
| 529 | |
| 530 | } // namespace mlir::arith |
| 531 | namespace mlir::arith { |
| 532 | |
| 533 | /// unsigned cast between index and integer types |
| 534 | /// Casts between scalar or vector integers and corresponding 'index' scalar or |
| 535 | /// vectors. Index is an integer of platform-specific bit width. If casting to |
| 536 | /// a wider integer, the value is zero-extended. If casting to a narrower |
| 537 | /// integer, the value is truncated. |
| 538 | /// |
| 539 | /// When the `nneg` flag is present, the operand is assumed to have |
| 540 | /// the most significant bit set to 0. In this case, zero extension |
| 541 | /// is equivalent to sign extension. When this assumption is violated, |
| 542 | /// the result is poison. |
| 543 | /// |
| 544 | /// Example: |
| 545 | /// |
| 546 | /// ```mlir |
| 547 | /// %0 = arith.index_castui %a : i32 to index |
| 548 | /// %1 = arith.index_castui %a nneg : i32 to index |
| 549 | /// %2 = arith.index_castui %b nneg : index to i64 |
| 550 | /// ``` |
| 551 | class IndexCastUIOp; |
| 552 | |
| 553 | } // namespace mlir::arith |
| 554 | namespace mlir::arith { |
| 555 | |
| 556 | /// floating-point maximum operation |
| 557 | /// Returns the maximum of the two arguments. |
| 558 | /// If the arguments are -0.0 and +0.0, then the result is either of them. |
| 559 | /// If one of the arguments is NaN, then the result is the other argument. |
| 560 | /// |
| 561 | /// Example: |
| 562 | /// |
| 563 | /// ```mlir |
| 564 | /// // Scalar floating-point maximum. |
| 565 | /// %a = arith.maxnumf %b, %c : f64 |
| 566 | /// ``` |
| 567 | class MaxNumFOp; |
| 568 | |
| 569 | } // namespace mlir::arith |
| 570 | namespace mlir::arith { |
| 571 | |
| 572 | /// signed integer maximum operation |
| 573 | class MaxSIOp; |
| 574 | |
| 575 | } // namespace mlir::arith |
| 576 | namespace mlir::arith { |
| 577 | |
| 578 | /// unsigned integer maximum operation |
| 579 | class MaxUIOp; |
| 580 | |
| 581 | } // namespace mlir::arith |
| 582 | namespace mlir::arith { |
| 583 | |
| 584 | /// floating-point maximum operation |
| 585 | /// Returns the maximum of the two arguments, treating -0.0 as less than +0.0. |
| 586 | /// If one of the arguments is NaN, then the result is also NaN. |
| 587 | /// |
| 588 | /// Example: |
| 589 | /// |
| 590 | /// ```mlir |
| 591 | /// // Scalar floating-point maximum. |
| 592 | /// %a = arith.maximumf %b, %c : f64 |
| 593 | /// ``` |
| 594 | class MaximumFOp; |
| 595 | |
| 596 | } // namespace mlir::arith |
| 597 | namespace mlir::arith { |
| 598 | |
| 599 | /// floating-point maximumNumber operation |
| 600 | /// Returns the maximum of the two arguments, not propagating NaNs and treating |
| 601 | /// -0.0 as less than +0.0. |
| 602 | /// |
| 603 | /// If both operands are NaNs, returns a NaN. If one operand is NaN and the |
| 604 | /// other operand is a number, returns the number. Otherwise, returns the |
| 605 | /// greater of the two arguments. -0.0 is considered to be less than +0.0 for |
| 606 | /// this operation. |
| 607 | /// |
| 608 | /// If the `nsz` flag is specified, `arith.maximumnumf` with one +0.0 and one |
| 609 | /// -0.0 operand may non-deterministically return either operand. Unlike the |
| 610 | /// usual `nsz` semantics, if both zero operands have the same sign, the result |
| 611 | /// must retain that sign. For example, `maximumnumf(+0.0, +0.0)` with `nsz` |
| 612 | /// must return +0.0, while `maximumnumf(-0.0, +0.0)` may return either zero. |
| 613 | /// |
| 614 | /// This operation follows the semantics of `maximumNumber` in IEEE 754-2019. |
| 615 | class MaximumNumFOp; |
| 616 | |
| 617 | } // namespace mlir::arith |
| 618 | namespace mlir::arith { |
| 619 | |
| 620 | /// floating-point minimum operation |
| 621 | /// Returns the minimum of the two arguments. |
| 622 | /// If the arguments are -0.0 and +0.0, then the result is either of them. |
| 623 | /// If one of the arguments is NaN, then the result is the other argument. |
| 624 | /// |
| 625 | /// Example: |
| 626 | /// |
| 627 | /// ```mlir |
| 628 | /// // Scalar floating-point minimum. |
| 629 | /// %a = arith.minnumf %b, %c : f64 |
| 630 | /// ``` |
| 631 | class MinNumFOp; |
| 632 | |
| 633 | } // namespace mlir::arith |
| 634 | namespace mlir::arith { |
| 635 | |
| 636 | /// signed integer minimum operation |
| 637 | class MinSIOp; |
| 638 | |
| 639 | } // namespace mlir::arith |
| 640 | namespace mlir::arith { |
| 641 | |
| 642 | /// unsigned integer minimum operation |
| 643 | class MinUIOp; |
| 644 | |
| 645 | } // namespace mlir::arith |
| 646 | namespace mlir::arith { |
| 647 | |
| 648 | /// floating-point minimum operation |
| 649 | /// Returns the minimum of the two arguments, treating -0.0 as less than +0.0. |
| 650 | /// If one of the arguments is NaN, then the result is also NaN. |
| 651 | /// |
| 652 | /// Example: |
| 653 | /// |
| 654 | /// ```mlir |
| 655 | /// // Scalar floating-point minimum. |
| 656 | /// %a = arith.minimumf %b, %c : f64 |
| 657 | /// ``` |
| 658 | class MinimumFOp; |
| 659 | |
| 660 | } // namespace mlir::arith |
| 661 | namespace mlir::arith { |
| 662 | |
| 663 | /// floating-point minimumNumber operation |
| 664 | /// Returns the minimum of the two arguments, not propagating NaNs and treating |
| 665 | /// -0.0 as less than +0.0. |
| 666 | /// |
| 667 | /// If both operands are NaNs, returns a NaN. If one operand is NaN and the |
| 668 | /// other operand is a number, returns the number. Otherwise, returns the |
| 669 | /// lesser of the two arguments. -0.0 is considered to be less than +0.0 for |
| 670 | /// this operation. |
| 671 | /// |
| 672 | /// If the `nsz` flag is specified, `arith.minimumnumf` with one +0.0 and one |
| 673 | /// -0.0 operand may non-deterministically return either operand. Unlike the |
| 674 | /// usual `nsz` semantics, if both zero operands have the same sign, the result |
| 675 | /// must retain that sign. For example, `minimumnumf(-0.0, -0.0)` with `nsz` |
| 676 | /// must return -0.0, while `minimumnumf(-0.0, +0.0)` may return either zero. |
| 677 | /// |
| 678 | /// This operation follows the semantics of `minimumNumber` in IEEE 754-2019. |
| 679 | class MinimumNumFOp; |
| 680 | |
| 681 | } // namespace mlir::arith |
| 682 | namespace mlir::arith { |
| 683 | |
| 684 | /// floating point multiplication operation |
| 685 | /// The `mulf` operation takes two operands and returns one result, each of |
| 686 | /// these is required to be the same type. This type may be a floating point |
| 687 | /// scalar type, a vector whose element type is a floating point type, or a |
| 688 | /// floating point tensor. |
| 689 | /// |
| 690 | /// Example: |
| 691 | /// |
| 692 | /// ```mlir |
| 693 | /// // Scalar multiplication. |
| 694 | /// %a = arith.mulf %b, %c : f64 |
| 695 | /// |
| 696 | /// // SIMD pointwise vector multiplication, e.g. for Intel SSE. |
| 697 | /// %f = arith.mulf %g, %h : vector<4xf32> |
| 698 | /// |
| 699 | /// // Tensor pointwise multiplication. |
| 700 | /// %x = arith.mulf %y, %z : tensor<4x?xbf16> |
| 701 | /// |
| 702 | /// // Scalar multiplication with rounding mode. |
| 703 | /// %a = arith.mulf %b, %c upward : f64 |
| 704 | /// ``` |
| 705 | class MulFOp; |
| 706 | |
| 707 | } // namespace mlir::arith |
| 708 | namespace mlir::arith { |
| 709 | |
| 710 | /// Integer multiplication operation. |
| 711 | /// Performs N-bit multiplication on the operands. The operands are interpreted as |
| 712 | /// unsigned bitvectors. The result is represented by a bitvector containing the |
| 713 | /// mathematical value of the multiplication modulo 2^n, where `n` is the bitwidth. |
| 714 | /// Because `arith` integers use a two's complement representation, this operation is |
| 715 | /// applicable on both signed and unsigned integer operands. |
| 716 | /// |
| 717 | /// The `muli` operation takes two operands and returns one result, each of |
| 718 | /// these is required to be the same type. This type may be an integer scalar type, |
| 719 | /// a vector whose element type is integer, or a tensor of integers. |
| 720 | /// |
| 721 | /// This op supports `nuw`/`nsw` overflow flags which stands for |
| 722 | /// "No Unsigned Wrap" and "No Signed Wrap", respectively. If the `nuw` and/or |
| 723 | /// `nsw` flags are present, and an unsigned/signed overflow occurs |
| 724 | /// (respectively), the result is poison. |
| 725 | /// |
| 726 | /// Example: |
| 727 | /// |
| 728 | /// ```mlir |
| 729 | /// // Scalar multiplication. |
| 730 | /// %a = arith.muli %b, %c : i64 |
| 731 | /// |
| 732 | /// // Scalar multiplication with overflow flags. |
| 733 | /// %a = arith.muli %b, %c overflow<nsw, nuw> : i64 |
| 734 | /// |
| 735 | /// // SIMD vector element-wise multiplication. |
| 736 | /// %f = arith.muli %g, %h : vector<4xi32> |
| 737 | /// |
| 738 | /// // Tensor element-wise multiplication. |
| 739 | /// %x = arith.muli %y, %z : tensor<4x?xi8> |
| 740 | /// ``` |
| 741 | class MulIOp; |
| 742 | |
| 743 | } // namespace mlir::arith |
| 744 | namespace mlir::arith { |
| 745 | |
| 746 | /// extended signed integer multiplication operation |
| 747 | /// Performs (2*N)-bit multiplication on sign-extended operands. Returns two |
| 748 | /// N-bit results: the low and the high halves of the product. The low half has |
| 749 | /// the same value as the result of regular multiplication `arith.muli` with |
| 750 | /// the same operands. |
| 751 | /// |
| 752 | /// Example: |
| 753 | /// |
| 754 | /// ```mlir |
| 755 | /// // Scalar multiplication. |
| 756 | /// %low, %high = arith.mulsi_extended %a, %b : i32 |
| 757 | /// |
| 758 | /// // Vector element-wise multiplication. |
| 759 | /// %c:2 = arith.mulsi_extended %d, %e : vector<4xi32> |
| 760 | /// |
| 761 | /// // Tensor element-wise multiplication. |
| 762 | /// %x:2 = arith.mulsi_extended %y, %z : tensor<4x?xi8> |
| 763 | /// ``` |
| 764 | class MulSIExtendedOp; |
| 765 | |
| 766 | } // namespace mlir::arith |
| 767 | namespace mlir::arith { |
| 768 | |
| 769 | /// extended unsigned integer multiplication operation |
| 770 | /// Performs (2*N)-bit multiplication on zero-extended operands. Returns two |
| 771 | /// N-bit results: the low and the high halves of the product. The low half has |
| 772 | /// the same value as the result of regular multiplication `arith.muli` with |
| 773 | /// the same operands. |
| 774 | /// |
| 775 | /// Example: |
| 776 | /// |
| 777 | /// ```mlir |
| 778 | /// // Scalar multiplication. |
| 779 | /// %low, %high = arith.mului_extended %a, %b : i32 |
| 780 | /// |
| 781 | /// // Vector element-wise multiplication. |
| 782 | /// %c:2 = arith.mului_extended %d, %e : vector<4xi32> |
| 783 | /// |
| 784 | /// // Tensor element-wise multiplication. |
| 785 | /// %x:2 = arith.mului_extended %y, %z : tensor<4x?xi8> |
| 786 | /// ``` |
| 787 | class MulUIExtendedOp; |
| 788 | |
| 789 | } // namespace mlir::arith |
| 790 | namespace mlir::arith { |
| 791 | |
| 792 | /// floating point negation |
| 793 | /// The `negf` operation computes the negation of a given value. It takes one |
| 794 | /// operand and returns one result of the same type. This type may be a float |
| 795 | /// scalar type, a vector whose element type is float, or a tensor of floats. |
| 796 | /// It has no standard attributes. |
| 797 | /// |
| 798 | /// Example: |
| 799 | /// |
| 800 | /// ```mlir |
| 801 | /// // Scalar negation value. |
| 802 | /// %a = arith.negf %b : f64 |
| 803 | /// |
| 804 | /// // SIMD vector element-wise negation value. |
| 805 | /// %f = arith.negf %g : vector<4xf32> |
| 806 | /// |
| 807 | /// // Tensor element-wise negation value. |
| 808 | /// %x = arith.negf %y : tensor<4x?xf8> |
| 809 | /// ``` |
| 810 | class NegFOp; |
| 811 | |
| 812 | } // namespace mlir::arith |
| 813 | namespace mlir::arith { |
| 814 | |
| 815 | /// integer binary or |
| 816 | /// The `ori` operation takes two operands and returns one result, each of these |
| 817 | /// is required to be the same type. This type may be an integer scalar type, a |
| 818 | /// vector whose element type is integer, or a tensor of integers. It has no |
| 819 | /// standard attributes. |
| 820 | /// |
| 821 | /// Example: |
| 822 | /// |
| 823 | /// ```mlir |
| 824 | /// // Scalar integer bitwise or. |
| 825 | /// %a = arith.ori %b, %c : i64 |
| 826 | /// |
| 827 | /// // SIMD vector element-wise bitwise integer or. |
| 828 | /// %f = arith.ori %g, %h : vector<4xi32> |
| 829 | /// |
| 830 | /// // Tensor element-wise bitwise integer or. |
| 831 | /// %x = arith.ori %y, %z : tensor<4x?xi8> |
| 832 | /// ``` |
| 833 | class OrIOp; |
| 834 | |
| 835 | } // namespace mlir::arith |
| 836 | namespace mlir::arith { |
| 837 | |
| 838 | /// floating point division remainder operation |
| 839 | /// Returns the floating point division remainder. |
| 840 | /// The remainder has the same sign as the dividend (lhs operand). |
| 841 | /// |
| 842 | /// TODO: Add support for rounding modes. |
| 843 | class RemFOp; |
| 844 | |
| 845 | } // namespace mlir::arith |
| 846 | namespace mlir::arith { |
| 847 | |
| 848 | /// signed integer division remainder operation |
| 849 | /// Signed integer division remainder. Treats the leading bit as sign, i.e. `6 % |
| 850 | /// -2 = 0`. |
| 851 | /// |
| 852 | /// Division by zero is undefined behavior. When applied to `vector` and |
| 853 | /// `tensor` values, the behavior is undefined if _any_ elements are divided by |
| 854 | /// zero. |
| 855 | /// |
| 856 | /// Example: |
| 857 | /// |
| 858 | /// ```mlir |
| 859 | /// // Scalar signed integer division remainder. |
| 860 | /// %a = arith.remsi %b, %c : i64 |
| 861 | /// |
| 862 | /// // SIMD vector element-wise division remainder. |
| 863 | /// %f = arith.remsi %g, %h : vector<4xi32> |
| 864 | /// |
| 865 | /// // Tensor element-wise integer division remainder. |
| 866 | /// %x = arith.remsi %y, %z : tensor<4x?xi8> |
| 867 | /// ``` |
| 868 | class RemSIOp; |
| 869 | |
| 870 | } // namespace mlir::arith |
| 871 | namespace mlir::arith { |
| 872 | |
| 873 | /// unsigned integer division remainder operation |
| 874 | /// Unsigned integer division remainder. Treats the leading bit as the most |
| 875 | /// significant, i.e. for `i16`, `6 % -2 = 6 % (2^16 - 2) = 6`. |
| 876 | /// |
| 877 | /// Division by zero is undefined behavior. When applied to `vector` and |
| 878 | /// `tensor` values, the behavior is undefined if _any_ elements are divided by |
| 879 | /// zero. |
| 880 | /// |
| 881 | /// Example: |
| 882 | /// |
| 883 | /// ```mlir |
| 884 | /// // Scalar unsigned integer division remainder. |
| 885 | /// %a = arith.remui %b, %c : i64 |
| 886 | /// |
| 887 | /// // SIMD vector element-wise division remainder. |
| 888 | /// %f = arith.remui %g, %h : vector<4xi32> |
| 889 | /// |
| 890 | /// // Tensor element-wise integer division remainder. |
| 891 | /// %x = arith.remui %y, %z : tensor<4x?xi8> |
| 892 | /// ``` |
| 893 | class RemUIOp; |
| 894 | |
| 895 | } // namespace mlir::arith |
| 896 | namespace mlir::arith { |
| 897 | |
| 898 | /// cast from integer type to floating-point |
| 899 | /// Cast from a value interpreted as a signed integer to the corresponding |
| 900 | /// floating-point value. When operating on vectors, casts elementwise. |
| 901 | class SIToFPOp; |
| 902 | |
| 903 | } // namespace mlir::arith |
| 904 | namespace mlir::arith { |
| 905 | |
| 906 | /// Upcasts input floats using provided scales values following OCP MXFP Spec |
| 907 | /// This operation upcasts input floating-point values using provided scale |
| 908 | /// values. It expects both scales and the input operand to be of the same shape, |
| 909 | /// making the operation elementwise. Scales are usually calculated per block |
| 910 | /// following the OCP MXFP spec as described in https://arxiv.org/abs/2310.10537. |
| 911 | /// |
| 912 | /// If scales are calculated per block where blockSize != 1, then scales may |
| 913 | /// require broadcasting to make this operation elementwise. For example, let's |
| 914 | /// say the input is of shape `<dim1 x dim2 x ... dimN>`. Given blockSize != 1 and |
| 915 | /// assuming quantization happens on the last axis, the input can be reshaped to |
| 916 | /// `<dim1 x dim2 x ... (dimN/blockSize) x blockSize>`. Scales will be calculated |
| 917 | /// per block on the last axis. Therefore, scales will be of shape |
| 918 | /// `<dim1 x dim2 x ... (dimN/blockSize) x 1>`. Scales could also be of some other |
| 919 | /// shape as long as it is broadcast compatible with the input, e.g., |
| 920 | /// `<1 x 1 x ... (dimN/blockSize) x 1>`. |
| 921 | /// |
| 922 | /// In this example, before calling into `arith.scaling_extf`, scales must be |
| 923 | /// broadcasted to `<dim1 x dim2 x dim3 ... (dimN/blockSize) x blockSize>`. Note |
| 924 | /// that there could be multiple quantization axes. Internally, |
| 925 | /// `arith.scaling_extf` would perform the following: |
| 926 | /// |
| 927 | /// ```mlir |
| 928 | /// // Cast scale to result type. |
| 929 | /// %0 = arith.truncf %1 : f32 to f8E8M0FNU |
| 930 | /// %1 = arith.extf %0 : f8E8M0FNU to f16 |
| 931 | /// |
| 932 | /// // Cast input to result type. |
| 933 | /// %2 = arith.extf %3 : f4E2M1FN to f16 |
| 934 | /// |
| 935 | /// // Perform scaling |
| 936 | /// %3 = arith.mulf %2, %1 : f16 |
| 937 | /// ``` |
| 938 | /// It propagates NaN values. Therefore, if either scale or the input element |
| 939 | /// contains NaN, then the output element value will also be a NaN. |
| 940 | /// |
| 941 | /// Example: |
| 942 | /// |
| 943 | /// ```mlir |
| 944 | /// // Upcast from f4E2M1FN to f32. |
| 945 | /// %a = arith.scaling_extf %b, %c : f4E2M1FN, f8E8M0FNU to f32 |
| 946 | /// |
| 947 | /// // Element-wise upcast with broadcast (blockSize = 32). |
| 948 | /// %f = vector.broadcast %g : vector<1xf8E8M0FNU> to vector<32xf8E8M0FNU> |
| 949 | /// %h = arith.scaling_extf %i, %f : vector<32xf4E2M1FN>, vector<32xf8E8M0FNU> to vector<32xbf16> |
| 950 | /// ``` |
| 951 | class ScalingExtFOp; |
| 952 | |
| 953 | } // namespace mlir::arith |
| 954 | namespace mlir::arith { |
| 955 | |
| 956 | /// Downcasts input floating point values using provided scales values following OCP MXFP Spec |
| 957 | /// This operation downcasts input using the provided scale values. It expects |
| 958 | /// both scales and the input operand to be of the same shape and, therefore, |
| 959 | /// makes the operation elementwise. Scales are usually calculated per block |
| 960 | /// following the OCP MXFP spec as described in https://arxiv.org/abs/2310.10537. |
| 961 | /// Users are required to normalize and clamp the scales as necessary before calling |
| 962 | /// passing them to this operation. OCP MXFP spec also does the flushing of denorms |
| 963 | /// on the input operand, which should be handled during lowering by passing appropriate |
| 964 | /// fastMath flag to this operation. |
| 965 | /// |
| 966 | /// If scales are calculated per block where blockSize != 1, scales may require |
| 967 | /// broadcasting to make this operation elementwise. For example, let's say the |
| 968 | /// input is of shape `<dim1 x dim2 x ... dimN>`. Given blockSize != 1 and |
| 969 | /// assuming quantization happens on the last axis, the input can be reshaped to |
| 970 | /// `<dim1 x dim2 x ... (dimN/blockSize) x blockSize>`. Scales will be calculated |
| 971 | /// per block on the last axis. Therefore, scales will be of shape |
| 972 | /// `<dim1 x dim2 x ... (dimN/blockSize) x 1>`. Scales could also be of some other |
| 973 | /// shape as long as it is broadcast compatible with the input, e.g., |
| 974 | /// `<1 x 1 x ... (dimN/blockSize) x 1>`. |
| 975 | /// |
| 976 | /// In this example, before calling into `arith.scaling_truncf`, scales must be |
| 977 | /// broadcasted to `<dim1 x dim2 x dim3 ... (dimN/blockSize) x blockSize>`. Note |
| 978 | /// that there could be multiple quantization axes. Internally, |
| 979 | /// `arith.scaling_truncf` would perform the following: |
| 980 | /// |
| 981 | /// ```mlir |
| 982 | /// // Cast scale to input type. |
| 983 | /// %0 = arith.truncf %1 : f32 to f8E8M0FNU |
| 984 | /// %1 = arith.extf %0 : f8E8M0FNU to f16 |
| 985 | /// |
| 986 | /// // Perform scaling. |
| 987 | /// %3 = arith.divf %2, %1 : f16 |
| 988 | /// |
| 989 | /// // Cast to result type. |
| 990 | /// %4 = arith.truncf %3 : f16 to f4E2M1FN |
| 991 | /// ``` |
| 992 | /// |
| 993 | /// Example: |
| 994 | /// |
| 995 | /// ```mlir |
| 996 | /// // Downcast from f32 to f4E2M1FN. |
| 997 | /// %a = arith.scaling_truncf %b, %c : f32, f8E8M0FNU to f4E2M1FN |
| 998 | /// |
| 999 | /// // Element-wise downcast with broadcast (blockSize = 32). |
| 1000 | /// %f = vector.broadcast %g : vector<1xf8E8M0FNU> to vector<32xf8E8M0FNU> |
| 1001 | /// %h = arith.scaling_truncf %i, %f : vector<32xbf16>, vector<32xf8E8M0FNU> to vector<32xf4E2M1FN> |
| 1002 | /// ``` |
| 1003 | class ScalingTruncFOp; |
| 1004 | |
| 1005 | } // namespace mlir::arith |
| 1006 | namespace mlir::arith { |
| 1007 | |
| 1008 | /// integer left-shift |
| 1009 | /// The `shli` operation shifts the integer value of the first operand to the left |
| 1010 | /// by the integer value of the second operand. The second operand is interpreted as |
| 1011 | /// unsigned. The low order bits are filled with zeros. If the value of the second |
| 1012 | /// operand is greater or equal than the bitwidth of the first operand, then the |
| 1013 | /// operation returns poison. |
| 1014 | /// |
| 1015 | /// This op supports `nuw`/`nsw` overflow flags which stands for |
| 1016 | /// "No Unsigned Wrap" and "No Signed Wrap", respectively. If the `nuw` and/or |
| 1017 | /// `nsw` flags are present, and an unsigned/signed overflow occurs |
| 1018 | /// (respectively), the result is poison. |
| 1019 | /// |
| 1020 | /// Example: |
| 1021 | /// |
| 1022 | /// ```mlir |
| 1023 | /// %1 = arith.constant 5 : i8 // %1 is 0b00000101 |
| 1024 | /// %2 = arith.constant 3 : i8 |
| 1025 | /// %3 = arith.shli %1, %2 : i8 // %3 is 0b00101000 |
| 1026 | /// %4 = arith.shli %1, %2 overflow<nsw, nuw> : i8 |
| 1027 | /// ``` |
| 1028 | class ShLIOp; |
| 1029 | |
| 1030 | } // namespace mlir::arith |
| 1031 | namespace mlir::arith { |
| 1032 | |
| 1033 | /// signed integer right-shift |
| 1034 | /// The `shrsi` operation shifts an integer value of the first operand to the right |
| 1035 | /// by the value of the second operand. The first operand is interpreted as signed, |
| 1036 | /// and the second operand is interpreter as unsigned. The high order bits in the |
| 1037 | /// output are filled with copies of the most-significant bit of the shifted value |
| 1038 | /// (which means that the sign of the value is preserved). If the value of the second |
| 1039 | /// operand is greater or equal than bitwidth of the first operand, then the operation |
| 1040 | /// returns poison. |
| 1041 | /// |
| 1042 | /// If the `exact` attribute is present, the result value of shrsi is a poison |
| 1043 | /// value if any of the bits shifted out are non-zero. |
| 1044 | /// |
| 1045 | /// Example: |
| 1046 | /// |
| 1047 | /// ```mlir |
| 1048 | /// %1 = arith.constant 160 : i8 // %1 is 0b10100000 |
| 1049 | /// %2 = arith.constant 3 : i8 |
| 1050 | /// %3 = arith.shrsi %1, %2 exact : i8 // %3 is 0b11110100 |
| 1051 | /// %4 = arith.constant 98 : i8 // %4 is 0b01100010 |
| 1052 | /// %5 = arith.shrsi %4, %2 : i8 // %5 is 0b00001100 |
| 1053 | /// ``` |
| 1054 | class ShRSIOp; |
| 1055 | |
| 1056 | } // namespace mlir::arith |
| 1057 | namespace mlir::arith { |
| 1058 | |
| 1059 | /// unsigned integer right-shift |
| 1060 | /// The `shrui` operation shifts an integer value of the first operand to the right |
| 1061 | /// by the value of the second operand. The first operand is interpreted as unsigned, |
| 1062 | /// and the second operand is interpreted as unsigned. The high order bits are always |
| 1063 | /// filled with zeros. If the value of the second operand is greater or equal than the |
| 1064 | /// bitwidth of the first operand, then the operation returns poison. |
| 1065 | /// |
| 1066 | /// If the `exact` attribute is present, the result value of shrui is a poison |
| 1067 | /// value if any of the bits shifted out are non-zero. |
| 1068 | /// |
| 1069 | /// Example: |
| 1070 | /// |
| 1071 | /// ```mlir |
| 1072 | /// %1 = arith.constant 160 : i8 // %1 is 0b10100000 |
| 1073 | /// %2 = arith.constant 3 : i8 |
| 1074 | /// %3 = arith.constant 6 : i8 |
| 1075 | /// %4 = arith.shrui %1, %2 exact : i8 // %4 is 0b00010100 |
| 1076 | /// %5 = arith.shrui %1, %3 : i8 // %3 is 0b00000010 |
| 1077 | /// ``` |
| 1078 | class ShRUIOp; |
| 1079 | |
| 1080 | } // namespace mlir::arith |
| 1081 | namespace mlir::arith { |
| 1082 | |
| 1083 | /// floating point subtraction operation |
| 1084 | /// The `subf` operation takes two operands and returns one result, each of |
| 1085 | /// these is required to be the same type. This type may be a floating point |
| 1086 | /// scalar type, a vector whose element type is a floating point type, or a |
| 1087 | /// floating point tensor. |
| 1088 | /// |
| 1089 | /// Example: |
| 1090 | /// |
| 1091 | /// ```mlir |
| 1092 | /// // Scalar subtraction. |
| 1093 | /// %a = arith.subf %b, %c : f64 |
| 1094 | /// |
| 1095 | /// // SIMD vector subtraction, e.g. for Intel SSE. |
| 1096 | /// %f = arith.subf %g, %h : vector<4xf32> |
| 1097 | /// |
| 1098 | /// // Tensor subtraction. |
| 1099 | /// %x = arith.subf %y, %z : tensor<4x?xbf16> |
| 1100 | /// |
| 1101 | /// // Scalar subtraction with rounding mode. |
| 1102 | /// %a = arith.subf %b, %c downward : f64 |
| 1103 | /// ``` |
| 1104 | class SubFOp; |
| 1105 | |
| 1106 | } // namespace mlir::arith |
| 1107 | namespace mlir::arith { |
| 1108 | |
| 1109 | /// Integer subtraction operation. |
| 1110 | /// Performs N-bit subtraction on the operands. The operands are interpreted as unsigned |
| 1111 | /// bitvectors. The result is represented by a bitvector containing the mathematical |
| 1112 | /// value of the subtraction modulo 2^n, where `n` is the bitwidth. Because `arith` |
| 1113 | /// integers use a two's complement representation, this operation is applicable on |
| 1114 | /// both signed and unsigned integer operands. |
| 1115 | /// |
| 1116 | /// The `subi` operation takes two operands and returns one result, each of |
| 1117 | /// these is required to be the same type. This type may be an integer scalar type, |
| 1118 | /// a vector whose element type is integer, or a tensor of integers. |
| 1119 | /// |
| 1120 | /// This op supports `nuw`/`nsw` overflow flags which stands for |
| 1121 | /// "No Unsigned Wrap" and "No Signed Wrap", respectively. If the `nuw` and/or |
| 1122 | /// `nsw` flags are present, and an unsigned/signed overflow occurs |
| 1123 | /// (respectively), the result is poison. |
| 1124 | /// |
| 1125 | /// Example: |
| 1126 | /// |
| 1127 | /// ```mlir |
| 1128 | /// // Scalar subtraction. |
| 1129 | /// %a = arith.subi %b, %c : i64 |
| 1130 | /// |
| 1131 | /// // Scalar subtraction with overflow flags. |
| 1132 | /// %a = arith.subi %b, %c overflow<nsw, nuw> : i64 |
| 1133 | /// |
| 1134 | /// // SIMD vector element-wise subtraction. |
| 1135 | /// %f = arith.subi %g, %h : vector<4xi32> |
| 1136 | /// |
| 1137 | /// // Tensor element-wise subtraction. |
| 1138 | /// %x = arith.subi %y, %z : tensor<4x?xi8> |
| 1139 | /// ``` |
| 1140 | class SubIOp; |
| 1141 | |
| 1142 | } // namespace mlir::arith |
| 1143 | namespace mlir::arith { |
| 1144 | |
| 1145 | /// extended unsigned integer subtraction operation returning difference and |
| 1146 | /// borrow bit |
| 1147 | /// Performs (N+1)-bit subtraction on zero-extended operands. Returns two |
| 1148 | /// results: the N-bit difference (same type as both operands), and the borrow |
| 1149 | /// bit (boolean-like), where `1` indicates unsigned subtraction underflow |
| 1150 | /// (i.e. `lhs < rhs` when interpreted as unsigned), while `0` indicates no |
| 1151 | /// underflow. |
| 1152 | /// |
| 1153 | /// Example: |
| 1154 | /// |
| 1155 | /// ```mlir |
| 1156 | /// // Scalar subtraction. |
| 1157 | /// %diff, %borrow = arith.subui_extended %b, %c : i64, i1 |
| 1158 | /// |
| 1159 | /// // Vector element-wise subtraction. |
| 1160 | /// %d:2 = arith.subui_extended %e, %f : vector<4xi32>, vector<4xi1> |
| 1161 | /// |
| 1162 | /// // Tensor element-wise subtraction. |
| 1163 | /// %x:2 = arith.subui_extended %y, %z : tensor<4x?xi8>, tensor<4x?xi1> |
| 1164 | /// ``` |
| 1165 | class SubUIExtendedOp; |
| 1166 | |
| 1167 | } // namespace mlir::arith |
| 1168 | namespace mlir::arith { |
| 1169 | |
| 1170 | /// cast from floating-point to narrower floating-point |
| 1171 | /// Truncate a floating-point value to a smaller floating-point-typed value. |
| 1172 | /// The destination type must be strictly narrower than the source type. |
| 1173 | /// When operating on vectors, casts elementwise. |
| 1174 | class TruncFOp; |
| 1175 | |
| 1176 | } // namespace mlir::arith |
| 1177 | namespace mlir::arith { |
| 1178 | |
| 1179 | /// integer truncation operation |
| 1180 | /// The integer truncation operation takes an integer input of |
| 1181 | /// width M and an integer destination type of width N. The destination |
| 1182 | /// bit-width must be smaller than the input bit-width (N < M). |
| 1183 | /// The top-most (N - M) bits of the input are discarded. |
| 1184 | /// |
| 1185 | /// This op supports `nuw`/`nsw` overflow flags which stands for "No Unsigned |
| 1186 | /// Wrap" and "No Signed Wrap", respectively. If the nuw keyword is present, |
| 1187 | /// and any of the truncated bits are non-zero, the result is a poison value. |
| 1188 | /// If the nsw keyword is present, and any of the truncated bits are not the |
| 1189 | /// same as the top bit of the truncation result, the result is a poison value. |
| 1190 | /// |
| 1191 | /// Example: |
| 1192 | /// |
| 1193 | /// ```mlir |
| 1194 | /// // Scalar truncation. |
| 1195 | /// %1 = arith.constant 21 : i5 // %1 is 0b10101 |
| 1196 | /// %2 = arith.trunci %1 : i5 to i4 // %2 is 0b0101 |
| 1197 | /// %3 = arith.trunci %1 : i5 to i3 // %3 is 0b101 |
| 1198 | /// |
| 1199 | /// // Vector truncation. |
| 1200 | /// %4 = arith.trunci %0 : vector<2 x i32> to vector<2 x i16> |
| 1201 | /// |
| 1202 | /// // Scalar truncation with overflow flags. |
| 1203 | /// %5 = arith.trunci %a overflow<nsw, nuw> : i32 to i16 |
| 1204 | /// ``` |
| 1205 | class TruncIOp; |
| 1206 | |
| 1207 | } // namespace mlir::arith |
| 1208 | namespace mlir::arith { |
| 1209 | |
| 1210 | /// cast from unsigned integer type to floating-point |
| 1211 | /// Cast from a value interpreted as unsigned integer to the corresponding |
| 1212 | /// floating-point value. When operating on vectors, casts elementwise. |
| 1213 | /// |
| 1214 | /// When the `nneg` flag is present, the operand is assumed to have |
| 1215 | /// the most significant bit set to 0. In this case, zero extension is |
| 1216 | /// equivalent to sign extension. When this assumption is violated, the |
| 1217 | /// result is poison. |
| 1218 | /// |
| 1219 | /// Example: |
| 1220 | /// |
| 1221 | /// ```mlir |
| 1222 | /// // Without nneg flag. |
| 1223 | /// %0 = arith.uitofp %a : i32 to f64 |
| 1224 | /// |
| 1225 | /// // With nneg flag. |
| 1226 | /// %1 = arith.uitofp %a nneg : i32 to f64 |
| 1227 | /// ``` |
| 1228 | class UIToFPOp; |
| 1229 | |
| 1230 | } // namespace mlir::arith |
| 1231 | namespace mlir::arith { |
| 1232 | |
| 1233 | /// integer binary xor |
| 1234 | /// The `xori` operation takes two operands and returns one result, each of |
| 1235 | /// these is required to be the same type. This type may be an integer scalar |
| 1236 | /// type, a vector whose element type is integer, or a tensor of integers. It |
| 1237 | /// has no standard attributes. |
| 1238 | /// |
| 1239 | /// Example: |
| 1240 | /// |
| 1241 | /// ```mlir |
| 1242 | /// // Scalar integer bitwise xor. |
| 1243 | /// %a = arith.xori %b, %c : i64 |
| 1244 | /// |
| 1245 | /// // SIMD vector element-wise bitwise integer xor. |
| 1246 | /// %f = arith.xori %g, %h : vector<4xi32> |
| 1247 | /// |
| 1248 | /// // Tensor element-wise bitwise integer xor. |
| 1249 | /// %x = arith.xori %y, %z : tensor<4x?xi8> |
| 1250 | /// ``` |
| 1251 | class XOrIOp; |
| 1252 | |
| 1253 | } // namespace mlir::arith |
| 1254 | namespace mlir::arith { |
| 1255 | |
| 1256 | /// select operation |
| 1257 | /// The `arith.select` operation chooses one value based on a binary condition |
| 1258 | /// supplied as its first operand. |
| 1259 | /// |
| 1260 | /// If the value of the first operand (the condition) is `1`, then the second |
| 1261 | /// operand is returned, and the third operand is ignored, even if it was poison. |
| 1262 | /// |
| 1263 | /// If the value of the first operand (the condition) is `0`, then the third |
| 1264 | /// operand is returned, and the second operand is ignored, even if it was poison. |
| 1265 | /// |
| 1266 | /// If the value of the first operand (the condition) is poison, then the |
| 1267 | /// operation returns poison. |
| 1268 | /// |
| 1269 | /// The operation applies to vectors and tensors elementwise given the _shape_ |
| 1270 | /// of all operands is identical. The choice is made for each element |
| 1271 | /// individually based on the value at the same position as the element in the |
| 1272 | /// condition operand. If an i1 is provided as the condition, the entire vector |
| 1273 | /// or tensor is chosen. |
| 1274 | /// |
| 1275 | /// Example: |
| 1276 | /// |
| 1277 | /// ```mlir |
| 1278 | /// // Custom form of scalar selection. |
| 1279 | /// %x = arith.select %cond, %true, %false : i32 |
| 1280 | /// |
| 1281 | /// // Generic form of the same operation. |
| 1282 | /// %x = "arith.select"(%cond, %true, %false) : (i1, i32, i32) -> i32 |
| 1283 | /// |
| 1284 | /// // Element-wise vector selection. |
| 1285 | /// %vx = arith.select %vcond, %vtrue, %vfalse : vector<42xi1>, vector<42xf32> |
| 1286 | /// |
| 1287 | /// // Full vector selection. |
| 1288 | /// %vx = arith.select %cond, %vtrue, %vfalse : vector<42xf32> |
| 1289 | /// ``` |
| 1290 | class SelectOp; |
| 1291 | |
| 1292 | } // namespace mlir::arith |
| 1293 | #ifdef GET_OP_CLASSES |
| 1294 | #undef GET_OP_CLASSES |
| 1295 | |
| 1296 | #include "mlir/Bytecode/BytecodeOpInterface.h" |
| 1297 | #include "mlir/IR/Attributes.h" |
| 1298 | #include "mlir/IR/BuiltinAttributeInterfaces.h" |
| 1299 | #include "mlir/IR/BuiltinAttributes.h" |
| 1300 | #include "mlir/IR/OpDefinition.h" |
| 1301 | #include "mlir/IR/OpImplementation.h" |
| 1302 | #include "mlir/IR/Types.h" |
| 1303 | #include "mlir/Interfaces/CastInterfaces.h" |
| 1304 | #include "mlir/Interfaces/ControlFlowInterfaces.h" |
| 1305 | #include "mlir/Interfaces/InferIntDivisibilityOpInterface.h" |
| 1306 | #include "mlir/Interfaces/InferIntRangeInterface.h" |
| 1307 | #include "mlir/Interfaces/InferTypeOpInterface.h" |
| 1308 | #include "mlir/Interfaces/SideEffectInterfaces.h" |
| 1309 | #include "mlir/Interfaces/VectorInterfaces.h" |
| 1310 | |
| 1311 | namespace mlir::arith { |
| 1312 | |
| 1313 | |
| 1314 | //===----------------------------------------------------------------------===// |
| 1315 | // ::mlir::arith::AddFOp declarations |
| 1316 | //===----------------------------------------------------------------------===// |
| 1317 | |
| 1318 | namespace detail { |
| 1319 | |
| 1320 | class AddFOpGenericAdaptorBase { |
| 1321 | public: |
| 1322 | struct Properties { |
| 1323 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 1324 | fastmathTy fastmath; |
| 1325 | |
| 1326 | auto getFastmath() const { |
| 1327 | auto &propStorage = this->fastmath; |
| 1328 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 1329 | } |
| 1330 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 1331 | this->fastmath = propValue; |
| 1332 | } |
| 1333 | using roundingmodeTy = ::mlir::arith::RoundingModeAttr; |
| 1334 | roundingmodeTy roundingmode; |
| 1335 | |
| 1336 | auto getRoundingmode() const { |
| 1337 | auto &propStorage = this->roundingmode; |
| 1338 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: propStorage); |
| 1339 | } |
| 1340 | void setRoundingmode(const ::mlir::arith::RoundingModeAttr &propValue) { |
| 1341 | this->roundingmode = propValue; |
| 1342 | } |
| 1343 | bool operator==(const Properties &rhs) const { |
| 1344 | return |
| 1345 | rhs.fastmath == this->fastmath && |
| 1346 | rhs.roundingmode == this->roundingmode && |
| 1347 | true; |
| 1348 | } |
| 1349 | bool operator!=(const Properties &rhs) const { |
| 1350 | return !(*this == rhs); |
| 1351 | } |
| 1352 | }; |
| 1353 | protected: |
| 1354 | ::mlir::DictionaryAttr odsAttrs; |
| 1355 | ::std::optional<::mlir::OperationName> odsOpName; |
| 1356 | Properties properties; |
| 1357 | ::mlir::RegionRange odsRegions; |
| 1358 | public: |
| 1359 | AddFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 1360 | odsOpName.emplace(args: "arith.addf" , args: odsAttrs.getContext()); |
| 1361 | } |
| 1362 | |
| 1363 | AddFOpGenericAdaptorBase(AddFOp op); |
| 1364 | |
| 1365 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 1366 | return {index, 1}; |
| 1367 | } |
| 1368 | |
| 1369 | const Properties &getProperties() { |
| 1370 | return properties; |
| 1371 | } |
| 1372 | |
| 1373 | ::mlir::DictionaryAttr getAttributes() { |
| 1374 | return odsAttrs; |
| 1375 | } |
| 1376 | |
| 1377 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 1378 | ::mlir::arith::FastMathFlags getFastmath(); |
| 1379 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 1380 | auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: getProperties().roundingmode); |
| 1381 | return attr; |
| 1382 | } |
| 1383 | |
| 1384 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 1385 | }; |
| 1386 | |
| 1387 | } // namespace detail |
| 1388 | template <typename RangeT> |
| 1389 | class AddFOpGenericAdaptor : public detail::AddFOpGenericAdaptorBase { |
| 1390 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 1391 | using Base = detail::AddFOpGenericAdaptorBase; |
| 1392 | static constexpr int odsIndex_lhs = 0; |
| 1393 | static constexpr int odsIndex_rhs = 1; |
| 1394 | public: |
| 1395 | AddFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 1396 | |
| 1397 | AddFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : AddFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 1398 | |
| 1399 | AddFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : AddFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 1400 | |
| 1401 | AddFOpGenericAdaptor(RangeT values, const AddFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 1402 | |
| 1403 | template <typename LateInst = AddFOp, typename = std::enable_if_t<std::is_same_v<LateInst, AddFOp>>> |
| 1404 | AddFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 1405 | |
| 1406 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1407 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 1408 | } |
| 1409 | |
| 1410 | RangeT getODSOperands(unsigned index) { |
| 1411 | auto valueRange = getODSOperandIndexAndLength(index); |
| 1412 | return {std::next(odsOperands.begin(), valueRange.first), |
| 1413 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 1414 | } |
| 1415 | |
| 1416 | ValueT getLhs() { |
| 1417 | return (*getODSOperands(index: 0).begin()); |
| 1418 | } |
| 1419 | |
| 1420 | ValueT getRhs() { |
| 1421 | return (*getODSOperands(index: 1).begin()); |
| 1422 | } |
| 1423 | |
| 1424 | RangeT getOperands() { |
| 1425 | return odsOperands; |
| 1426 | } |
| 1427 | |
| 1428 | private: |
| 1429 | RangeT odsOperands; |
| 1430 | }; |
| 1431 | class AddFOpAdaptor : public AddFOpGenericAdaptor<::mlir::ValueRange> { |
| 1432 | public: |
| 1433 | using AddFOpGenericAdaptor::AddFOpGenericAdaptor; |
| 1434 | AddFOpAdaptor(AddFOp op); |
| 1435 | |
| 1436 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 1437 | }; |
| 1438 | class AddFOp : public ::mlir::Op<AddFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::arith::ArithRoundingModeInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 1439 | public: |
| 1440 | using Op::Op; |
| 1441 | using Op::print; |
| 1442 | using Adaptor = AddFOpAdaptor; |
| 1443 | template <typename RangeT> |
| 1444 | using GenericAdaptor = AddFOpGenericAdaptor<RangeT>; |
| 1445 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 1446 | static constexpr int odsIndex_lhs = 0; |
| 1447 | static constexpr int odsIndex_rhs = 1; |
| 1448 | static constexpr int odsIndex_result = 0; |
| 1449 | using Properties = FoldAdaptor::Properties; |
| 1450 | using ::mlir::arith::ArithFastMathInterface::Trait<AddFOp>::getFastMathFlagsAttr; |
| 1451 | using ::mlir::arith::ArithFastMathInterface::Trait<AddFOp>::getFastMathAttrName; |
| 1452 | using ::mlir::arith::ArithRoundingModeInterface::Trait<AddFOp>::getRoundingModeAttr; |
| 1453 | using ::mlir::arith::ArithRoundingModeInterface::Trait<AddFOp>::getRoundingModeAttrName; |
| 1454 | using ::mlir::VectorUnrollOpInterface::Trait<AddFOp>::getIterationShapeToUnroll; |
| 1455 | using ::mlir::VectorUnrollOpInterface::Trait<AddFOp>::getDefaultUnrollTargetShape; |
| 1456 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 1457 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" ), ::llvm::StringRef("roundingmode" )}; |
| 1458 | return ::llvm::ArrayRef(attrNames); |
| 1459 | } |
| 1460 | |
| 1461 | ::mlir::StringAttr getFastmathAttrName() { |
| 1462 | return getAttributeNameForIndex(index: 0); |
| 1463 | } |
| 1464 | |
| 1465 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 1466 | return getAttributeNameForIndex(name, index: 0); |
| 1467 | } |
| 1468 | |
| 1469 | ::mlir::StringAttr getRoundingmodeAttrName() { |
| 1470 | return getAttributeNameForIndex(index: 1); |
| 1471 | } |
| 1472 | |
| 1473 | static ::mlir::StringAttr getRoundingmodeAttrName(::mlir::OperationName name) { |
| 1474 | return getAttributeNameForIndex(name, index: 1); |
| 1475 | } |
| 1476 | |
| 1477 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 1478 | return ::llvm::StringLiteral("arith.addf" ); |
| 1479 | } |
| 1480 | |
| 1481 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1482 | return {index, 1}; |
| 1483 | } |
| 1484 | |
| 1485 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 1486 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 1487 | return getOperation()->getOperands().slice(n: start, m: length); |
| 1488 | } |
| 1489 | |
| 1490 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 1491 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 1492 | } |
| 1493 | |
| 1494 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 1495 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 1496 | } |
| 1497 | |
| 1498 | ::mlir::OpOperand &getLhsMutable() { |
| 1499 | auto range = getODSOperandIndexAndLength(index: 0); |
| 1500 | return getOperation()->getOpOperand(idx: range.first); |
| 1501 | } |
| 1502 | |
| 1503 | ::mlir::OpOperand &getRhsMutable() { |
| 1504 | auto range = getODSOperandIndexAndLength(index: 1); |
| 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 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 1519 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 1520 | } |
| 1521 | |
| 1522 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1523 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 1524 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 1525 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 1526 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 1527 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 1528 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1529 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 1530 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 1531 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 1532 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 1533 | } |
| 1534 | |
| 1535 | ::mlir::arith::FastMathFlags getFastmath(); |
| 1536 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 1537 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val&: getProperties().roundingmode); |
| 1538 | } |
| 1539 | |
| 1540 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 1541 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 1542 | getProperties().fastmath = attr; |
| 1543 | } |
| 1544 | |
| 1545 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 1546 | void setRoundingmodeAttr(::mlir::arith::RoundingModeAttr attr) { |
| 1547 | getProperties().roundingmode = attr; |
| 1548 | } |
| 1549 | |
| 1550 | void setRoundingmode(::std::optional<::mlir::arith::RoundingMode> attrValue); |
| 1551 | ::mlir::Attribute removeRoundingmodeAttr() { |
| 1552 | auto attr = getProperties().roundingmode; |
| 1553 | getProperties().roundingmode = {}; |
| 1554 | return attr; |
| 1555 | } |
| 1556 | |
| 1557 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 1558 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 1559 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 1560 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value lhs, Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 1561 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value lhs, Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 1562 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, Value lhs, Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 1563 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type type, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 1564 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Type type, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 1565 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, Type type, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 1566 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1567 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1568 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1569 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1570 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1571 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1572 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1573 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1574 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1575 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1576 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1577 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1578 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1579 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1580 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1581 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1582 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1583 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 1584 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1585 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1586 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1587 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1588 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1589 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1590 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1591 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1592 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1593 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1594 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1595 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1596 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1597 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1598 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1599 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1600 | static AddFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1601 | static AddFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1602 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 1603 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 1604 | ::llvm::LogicalResult verifyInvariants(); |
| 1605 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 1606 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 1607 | 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); |
| 1608 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 1609 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 1610 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 1611 | private: |
| 1612 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 1613 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 1614 | } |
| 1615 | |
| 1616 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 1617 | assert(index < 2 && "invalid attribute index" ); |
| 1618 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 1619 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 1620 | "dependent dialect loading?" ); |
| 1621 | return name.getAttributeNames()[index]; |
| 1622 | } |
| 1623 | |
| 1624 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 1625 | public: |
| 1626 | }; |
| 1627 | |
| 1628 | } // namespace mlir::arith |
| 1629 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::AddFOp) |
| 1630 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::AddFOpGenericAdaptorBase::Properties) |
| 1631 | |
| 1632 | namespace mlir::arith { |
| 1633 | |
| 1634 | |
| 1635 | //===----------------------------------------------------------------------===// |
| 1636 | // ::mlir::arith::AddIOp declarations |
| 1637 | //===----------------------------------------------------------------------===// |
| 1638 | |
| 1639 | namespace detail { |
| 1640 | |
| 1641 | class AddIOpGenericAdaptorBase { |
| 1642 | public: |
| 1643 | struct Properties { |
| 1644 | using overflowFlagsTy = ::mlir::arith::IntegerOverflowFlagsAttr; |
| 1645 | overflowFlagsTy overflowFlags; |
| 1646 | |
| 1647 | auto getOverflowFlags() const { |
| 1648 | auto &propStorage = this->overflowFlags; |
| 1649 | return ::llvm::dyn_cast_or_null<::mlir::arith::IntegerOverflowFlagsAttr>(Val: propStorage); |
| 1650 | } |
| 1651 | void setOverflowFlags(const ::mlir::arith::IntegerOverflowFlagsAttr &propValue) { |
| 1652 | this->overflowFlags = propValue; |
| 1653 | } |
| 1654 | bool operator==(const Properties &rhs) const { |
| 1655 | return |
| 1656 | rhs.overflowFlags == this->overflowFlags && |
| 1657 | true; |
| 1658 | } |
| 1659 | bool operator!=(const Properties &rhs) const { |
| 1660 | return !(*this == rhs); |
| 1661 | } |
| 1662 | }; |
| 1663 | protected: |
| 1664 | ::mlir::DictionaryAttr odsAttrs; |
| 1665 | ::std::optional<::mlir::OperationName> odsOpName; |
| 1666 | Properties properties; |
| 1667 | ::mlir::RegionRange odsRegions; |
| 1668 | public: |
| 1669 | AddIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 1670 | odsOpName.emplace(args: "arith.addi" , args: odsAttrs.getContext()); |
| 1671 | } |
| 1672 | |
| 1673 | AddIOpGenericAdaptorBase(AddIOp op); |
| 1674 | |
| 1675 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 1676 | return {index, 1}; |
| 1677 | } |
| 1678 | |
| 1679 | const Properties &getProperties() { |
| 1680 | return properties; |
| 1681 | } |
| 1682 | |
| 1683 | ::mlir::DictionaryAttr getAttributes() { |
| 1684 | return odsAttrs; |
| 1685 | } |
| 1686 | |
| 1687 | ::mlir::arith::IntegerOverflowFlagsAttr getOverflowFlagsAttr(); |
| 1688 | ::mlir::arith::IntegerOverflowFlags getOverflowFlags(); |
| 1689 | }; |
| 1690 | |
| 1691 | } // namespace detail |
| 1692 | template <typename RangeT> |
| 1693 | class AddIOpGenericAdaptor : public detail::AddIOpGenericAdaptorBase { |
| 1694 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 1695 | using Base = detail::AddIOpGenericAdaptorBase; |
| 1696 | static constexpr int odsIndex_lhs = 0; |
| 1697 | static constexpr int odsIndex_rhs = 1; |
| 1698 | public: |
| 1699 | AddIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 1700 | |
| 1701 | AddIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : AddIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 1702 | |
| 1703 | AddIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : AddIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 1704 | |
| 1705 | AddIOpGenericAdaptor(RangeT values, const AddIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 1706 | |
| 1707 | template <typename LateInst = AddIOp, typename = std::enable_if_t<std::is_same_v<LateInst, AddIOp>>> |
| 1708 | AddIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 1709 | |
| 1710 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1711 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 1712 | } |
| 1713 | |
| 1714 | RangeT getODSOperands(unsigned index) { |
| 1715 | auto valueRange = getODSOperandIndexAndLength(index); |
| 1716 | return {std::next(odsOperands.begin(), valueRange.first), |
| 1717 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 1718 | } |
| 1719 | |
| 1720 | ValueT getLhs() { |
| 1721 | return (*getODSOperands(index: 0).begin()); |
| 1722 | } |
| 1723 | |
| 1724 | ValueT getRhs() { |
| 1725 | return (*getODSOperands(index: 1).begin()); |
| 1726 | } |
| 1727 | |
| 1728 | RangeT getOperands() { |
| 1729 | return odsOperands; |
| 1730 | } |
| 1731 | |
| 1732 | private: |
| 1733 | RangeT odsOperands; |
| 1734 | }; |
| 1735 | class AddIOpAdaptor : public AddIOpGenericAdaptor<::mlir::ValueRange> { |
| 1736 | public: |
| 1737 | using AddIOpGenericAdaptor::AddIOpGenericAdaptor; |
| 1738 | AddIOpAdaptor(AddIOp op); |
| 1739 | |
| 1740 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 1741 | }; |
| 1742 | class AddIOp : public ::mlir::Op<AddIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::InferIntDivisibilityOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 1743 | public: |
| 1744 | using Op::Op; |
| 1745 | using Op::print; |
| 1746 | using Adaptor = AddIOpAdaptor; |
| 1747 | template <typename RangeT> |
| 1748 | using GenericAdaptor = AddIOpGenericAdaptor<RangeT>; |
| 1749 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 1750 | static constexpr int odsIndex_lhs = 0; |
| 1751 | static constexpr int odsIndex_rhs = 1; |
| 1752 | static constexpr int odsIndex_result = 0; |
| 1753 | using Properties = FoldAdaptor::Properties; |
| 1754 | using ::mlir::InferIntRangeInterface::Trait<AddIOp>::inferResultRangesFromOptional; |
| 1755 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<AddIOp>::getOverflowAttr; |
| 1756 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<AddIOp>::hasNoUnsignedWrap; |
| 1757 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<AddIOp>::hasNoSignedWrap; |
| 1758 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<AddIOp>::getIntegerOverflowAttrName; |
| 1759 | using ::mlir::VectorUnrollOpInterface::Trait<AddIOp>::getIterationShapeToUnroll; |
| 1760 | using ::mlir::VectorUnrollOpInterface::Trait<AddIOp>::getDefaultUnrollTargetShape; |
| 1761 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 1762 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("overflowFlags" )}; |
| 1763 | return ::llvm::ArrayRef(attrNames); |
| 1764 | } |
| 1765 | |
| 1766 | ::mlir::StringAttr getOverflowFlagsAttrName() { |
| 1767 | return getAttributeNameForIndex(index: 0); |
| 1768 | } |
| 1769 | |
| 1770 | static ::mlir::StringAttr getOverflowFlagsAttrName(::mlir::OperationName name) { |
| 1771 | return getAttributeNameForIndex(name, index: 0); |
| 1772 | } |
| 1773 | |
| 1774 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 1775 | return ::llvm::StringLiteral("arith.addi" ); |
| 1776 | } |
| 1777 | |
| 1778 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1779 | return {index, 1}; |
| 1780 | } |
| 1781 | |
| 1782 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 1783 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 1784 | return getOperation()->getOperands().slice(n: start, m: length); |
| 1785 | } |
| 1786 | |
| 1787 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 1788 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 1789 | } |
| 1790 | |
| 1791 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 1792 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 1793 | } |
| 1794 | |
| 1795 | ::mlir::OpOperand &getLhsMutable() { |
| 1796 | auto range = getODSOperandIndexAndLength(index: 0); |
| 1797 | return getOperation()->getOpOperand(idx: range.first); |
| 1798 | } |
| 1799 | |
| 1800 | ::mlir::OpOperand &getRhsMutable() { |
| 1801 | auto range = getODSOperandIndexAndLength(index: 1); |
| 1802 | return getOperation()->getOpOperand(idx: range.first); |
| 1803 | } |
| 1804 | |
| 1805 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 1806 | return {index, 1}; |
| 1807 | } |
| 1808 | |
| 1809 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 1810 | auto valueRange = getODSResultIndexAndLength(index); |
| 1811 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 1812 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 1813 | } |
| 1814 | |
| 1815 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 1816 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 1817 | } |
| 1818 | |
| 1819 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1820 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 1821 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 1822 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 1823 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 1824 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 1825 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 1826 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 1827 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 1828 | ::mlir::arith::IntegerOverflowFlagsAttr getOverflowFlagsAttr() { |
| 1829 | return ::llvm::dyn_cast_or_null<::mlir::arith::IntegerOverflowFlagsAttr>(Val&: getProperties().overflowFlags); |
| 1830 | } |
| 1831 | |
| 1832 | ::mlir::arith::IntegerOverflowFlags getOverflowFlags(); |
| 1833 | void setOverflowFlagsAttr(::mlir::arith::IntegerOverflowFlagsAttr attr) { |
| 1834 | getProperties().overflowFlags = attr; |
| 1835 | } |
| 1836 | |
| 1837 | void setOverflowFlags(::mlir::arith::IntegerOverflowFlags attrValue); |
| 1838 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 1839 | static AddIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 1840 | static AddIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 1841 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 1842 | static AddIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 1843 | static AddIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 1844 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 1845 | static AddIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 1846 | static AddIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 1847 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 1848 | static AddIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 1849 | static AddIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 1850 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 1851 | static AddIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 1852 | static AddIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 1853 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 1854 | static AddIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 1855 | static AddIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 1856 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1857 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1858 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1859 | static AddIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1860 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1861 | static AddIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1862 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1863 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1864 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1865 | static AddIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1866 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 1867 | static AddIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 1868 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1869 | static AddIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1870 | static AddIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1871 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1872 | static AddIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1873 | static AddIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 1874 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 1875 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 1876 | ::llvm::LogicalResult verifyInvariants(); |
| 1877 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 1878 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 1879 | 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); |
| 1880 | void inferResultDivisibility(::llvm::ArrayRef<::mlir::IntegerDivisibility> argDivs, ::mlir::SetIntDivisibilityFn setResultDivs); |
| 1881 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 1882 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 1883 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 1884 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 1885 | private: |
| 1886 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 1887 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 1888 | } |
| 1889 | |
| 1890 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 1891 | assert(index < 1 && "invalid attribute index" ); |
| 1892 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 1893 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 1894 | "dependent dialect loading?" ); |
| 1895 | return name.getAttributeNames()[index]; |
| 1896 | } |
| 1897 | |
| 1898 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 1899 | public: |
| 1900 | }; |
| 1901 | |
| 1902 | } // namespace mlir::arith |
| 1903 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::AddIOp) |
| 1904 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::AddIOpGenericAdaptorBase::Properties) |
| 1905 | |
| 1906 | namespace mlir::arith { |
| 1907 | |
| 1908 | |
| 1909 | //===----------------------------------------------------------------------===// |
| 1910 | // ::mlir::arith::AddUIExtendedOp declarations |
| 1911 | //===----------------------------------------------------------------------===// |
| 1912 | |
| 1913 | namespace detail { |
| 1914 | |
| 1915 | class AddUIExtendedOpGenericAdaptorBase { |
| 1916 | public: |
| 1917 | using Properties = ::mlir::EmptyProperties; |
| 1918 | protected: |
| 1919 | ::mlir::DictionaryAttr odsAttrs; |
| 1920 | ::std::optional<::mlir::OperationName> odsOpName; |
| 1921 | Properties properties; |
| 1922 | ::mlir::RegionRange odsRegions; |
| 1923 | public: |
| 1924 | AddUIExtendedOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 1925 | odsOpName.emplace(args: "arith.addui_extended" , args: odsAttrs.getContext()); |
| 1926 | } |
| 1927 | |
| 1928 | AddUIExtendedOpGenericAdaptorBase(AddUIExtendedOp op); |
| 1929 | |
| 1930 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 1931 | return {index, 1}; |
| 1932 | } |
| 1933 | |
| 1934 | const Properties &getProperties() { |
| 1935 | return properties; |
| 1936 | } |
| 1937 | |
| 1938 | ::mlir::DictionaryAttr getAttributes() { |
| 1939 | return odsAttrs; |
| 1940 | } |
| 1941 | |
| 1942 | }; |
| 1943 | |
| 1944 | } // namespace detail |
| 1945 | template <typename RangeT> |
| 1946 | class AddUIExtendedOpGenericAdaptor : public detail::AddUIExtendedOpGenericAdaptorBase { |
| 1947 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 1948 | using Base = detail::AddUIExtendedOpGenericAdaptorBase; |
| 1949 | static constexpr int odsIndex_lhs = 0; |
| 1950 | static constexpr int odsIndex_rhs = 1; |
| 1951 | public: |
| 1952 | AddUIExtendedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 1953 | |
| 1954 | AddUIExtendedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : AddUIExtendedOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 1955 | |
| 1956 | AddUIExtendedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : AddUIExtendedOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 1957 | |
| 1958 | AddUIExtendedOpGenericAdaptor(RangeT values, const AddUIExtendedOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 1959 | |
| 1960 | template <typename LateInst = AddUIExtendedOp, typename = std::enable_if_t<std::is_same_v<LateInst, AddUIExtendedOp>>> |
| 1961 | AddUIExtendedOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 1962 | |
| 1963 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 1964 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 1965 | } |
| 1966 | |
| 1967 | RangeT getODSOperands(unsigned index) { |
| 1968 | auto valueRange = getODSOperandIndexAndLength(index); |
| 1969 | return {std::next(odsOperands.begin(), valueRange.first), |
| 1970 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 1971 | } |
| 1972 | |
| 1973 | ValueT getLhs() { |
| 1974 | return (*getODSOperands(index: 0).begin()); |
| 1975 | } |
| 1976 | |
| 1977 | ValueT getRhs() { |
| 1978 | return (*getODSOperands(index: 1).begin()); |
| 1979 | } |
| 1980 | |
| 1981 | RangeT getOperands() { |
| 1982 | return odsOperands; |
| 1983 | } |
| 1984 | |
| 1985 | private: |
| 1986 | RangeT odsOperands; |
| 1987 | }; |
| 1988 | class AddUIExtendedOpAdaptor : public AddUIExtendedOpGenericAdaptor<::mlir::ValueRange> { |
| 1989 | public: |
| 1990 | using AddUIExtendedOpGenericAdaptor::AddUIExtendedOpGenericAdaptor; |
| 1991 | AddUIExtendedOpAdaptor(AddUIExtendedOp op); |
| 1992 | |
| 1993 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 1994 | }; |
| 1995 | class AddUIExtendedOp : public ::mlir::Op<AddUIExtendedOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::NResults<2>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::OpAsmOpInterface::Trait> { |
| 1996 | public: |
| 1997 | using Op::Op; |
| 1998 | using Op::print; |
| 1999 | using Adaptor = AddUIExtendedOpAdaptor; |
| 2000 | template <typename RangeT> |
| 2001 | using GenericAdaptor = AddUIExtendedOpGenericAdaptor<RangeT>; |
| 2002 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 2003 | static constexpr int odsIndex_lhs = 0; |
| 2004 | static constexpr int odsIndex_rhs = 1; |
| 2005 | static constexpr int odsIndex_sum = 0; |
| 2006 | static constexpr int odsIndex_overflow = 1; |
| 2007 | using Properties = FoldAdaptor::Properties; |
| 2008 | using ::mlir::VectorUnrollOpInterface::Trait<AddUIExtendedOp>::getIterationShapeToUnroll; |
| 2009 | using ::mlir::VectorUnrollOpInterface::Trait<AddUIExtendedOp>::getDefaultUnrollTargetShape; |
| 2010 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 2011 | return {}; |
| 2012 | } |
| 2013 | |
| 2014 | void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn); |
| 2015 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 2016 | return ::llvm::StringLiteral("arith.addui_extended" ); |
| 2017 | } |
| 2018 | |
| 2019 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2020 | return {index, 1}; |
| 2021 | } |
| 2022 | |
| 2023 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 2024 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 2025 | return getOperation()->getOperands().slice(n: start, m: length); |
| 2026 | } |
| 2027 | |
| 2028 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 2029 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 2030 | } |
| 2031 | |
| 2032 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 2033 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 2034 | } |
| 2035 | |
| 2036 | ::mlir::OpOperand &getLhsMutable() { |
| 2037 | auto range = getODSOperandIndexAndLength(index: 0); |
| 2038 | return getOperation()->getOpOperand(idx: range.first); |
| 2039 | } |
| 2040 | |
| 2041 | ::mlir::OpOperand &getRhsMutable() { |
| 2042 | auto range = getODSOperandIndexAndLength(index: 1); |
| 2043 | return getOperation()->getOpOperand(idx: range.first); |
| 2044 | } |
| 2045 | |
| 2046 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 2047 | return {index, 1}; |
| 2048 | } |
| 2049 | |
| 2050 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 2051 | auto valueRange = getODSResultIndexAndLength(index); |
| 2052 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 2053 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 2054 | } |
| 2055 | |
| 2056 | ::mlir::TypedValue<::mlir::Type> getSum() { |
| 2057 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 2058 | } |
| 2059 | |
| 2060 | ::mlir::TypedValue<::mlir::Type> getOverflow() { |
| 2061 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 1).begin()); |
| 2062 | } |
| 2063 | |
| 2064 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2065 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 2066 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 2067 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 2068 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 2069 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 2070 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2071 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value lhs, Value rhs); |
| 2072 | static AddUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value lhs, Value rhs); |
| 2073 | static AddUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, Value lhs, Value rhs); |
| 2074 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type sum, ::mlir::Type overflow, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2075 | static AddUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type sum, ::mlir::Type overflow, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2076 | static AddUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type sum, ::mlir::Type overflow, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2077 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2078 | static AddUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2079 | static AddUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2080 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2081 | static AddUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2082 | static AddUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2083 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2084 | static AddUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2085 | static AddUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2086 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 2087 | ::llvm::LogicalResult verifyInvariants(); |
| 2088 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 2089 | ::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results); |
| 2090 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 2091 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 2092 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 2093 | public: |
| 2094 | std::optional<SmallVector<int64_t, 4>> getIterationShapeToUnroll(); |
| 2095 | }; |
| 2096 | |
| 2097 | } // namespace mlir::arith |
| 2098 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::AddUIExtendedOp) |
| 2099 | |
| 2100 | namespace mlir::arith { |
| 2101 | |
| 2102 | |
| 2103 | //===----------------------------------------------------------------------===// |
| 2104 | // ::mlir::arith::AndIOp declarations |
| 2105 | //===----------------------------------------------------------------------===// |
| 2106 | |
| 2107 | namespace detail { |
| 2108 | |
| 2109 | class AndIOpGenericAdaptorBase { |
| 2110 | public: |
| 2111 | using Properties = ::mlir::EmptyProperties; |
| 2112 | protected: |
| 2113 | ::mlir::DictionaryAttr odsAttrs; |
| 2114 | ::std::optional<::mlir::OperationName> odsOpName; |
| 2115 | Properties properties; |
| 2116 | ::mlir::RegionRange odsRegions; |
| 2117 | public: |
| 2118 | AndIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 2119 | odsOpName.emplace(args: "arith.andi" , args: odsAttrs.getContext()); |
| 2120 | } |
| 2121 | |
| 2122 | AndIOpGenericAdaptorBase(AndIOp op); |
| 2123 | |
| 2124 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 2125 | return {index, 1}; |
| 2126 | } |
| 2127 | |
| 2128 | const Properties &getProperties() { |
| 2129 | return properties; |
| 2130 | } |
| 2131 | |
| 2132 | ::mlir::DictionaryAttr getAttributes() { |
| 2133 | return odsAttrs; |
| 2134 | } |
| 2135 | |
| 2136 | }; |
| 2137 | |
| 2138 | } // namespace detail |
| 2139 | template <typename RangeT> |
| 2140 | class AndIOpGenericAdaptor : public detail::AndIOpGenericAdaptorBase { |
| 2141 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 2142 | using Base = detail::AndIOpGenericAdaptorBase; |
| 2143 | static constexpr int odsIndex_lhs = 0; |
| 2144 | static constexpr int odsIndex_rhs = 1; |
| 2145 | public: |
| 2146 | AndIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 2147 | |
| 2148 | AndIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : AndIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 2149 | |
| 2150 | AndIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : AndIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 2151 | |
| 2152 | AndIOpGenericAdaptor(RangeT values, const AndIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 2153 | |
| 2154 | template <typename LateInst = AndIOp, typename = std::enable_if_t<std::is_same_v<LateInst, AndIOp>>> |
| 2155 | AndIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 2156 | |
| 2157 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2158 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 2159 | } |
| 2160 | |
| 2161 | RangeT getODSOperands(unsigned index) { |
| 2162 | auto valueRange = getODSOperandIndexAndLength(index); |
| 2163 | return {std::next(odsOperands.begin(), valueRange.first), |
| 2164 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 2165 | } |
| 2166 | |
| 2167 | ValueT getLhs() { |
| 2168 | return (*getODSOperands(index: 0).begin()); |
| 2169 | } |
| 2170 | |
| 2171 | ValueT getRhs() { |
| 2172 | return (*getODSOperands(index: 1).begin()); |
| 2173 | } |
| 2174 | |
| 2175 | RangeT getOperands() { |
| 2176 | return odsOperands; |
| 2177 | } |
| 2178 | |
| 2179 | private: |
| 2180 | RangeT odsOperands; |
| 2181 | }; |
| 2182 | class AndIOpAdaptor : public AndIOpGenericAdaptor<::mlir::ValueRange> { |
| 2183 | public: |
| 2184 | using AndIOpGenericAdaptor::AndIOpGenericAdaptor; |
| 2185 | AndIOpAdaptor(AndIOp op); |
| 2186 | |
| 2187 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 2188 | }; |
| 2189 | class AndIOp : public ::mlir::Op<AndIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::IsCommutative, ::mlir::OpTrait::IsIdempotent, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 2190 | public: |
| 2191 | using Op::Op; |
| 2192 | using Op::print; |
| 2193 | using Adaptor = AndIOpAdaptor; |
| 2194 | template <typename RangeT> |
| 2195 | using GenericAdaptor = AndIOpGenericAdaptor<RangeT>; |
| 2196 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 2197 | static constexpr int odsIndex_lhs = 0; |
| 2198 | static constexpr int odsIndex_rhs = 1; |
| 2199 | static constexpr int odsIndex_result = 0; |
| 2200 | using Properties = FoldAdaptor::Properties; |
| 2201 | using ::mlir::InferIntRangeInterface::Trait<AndIOp>::inferResultRangesFromOptional; |
| 2202 | using ::mlir::VectorUnrollOpInterface::Trait<AndIOp>::getIterationShapeToUnroll; |
| 2203 | using ::mlir::VectorUnrollOpInterface::Trait<AndIOp>::getDefaultUnrollTargetShape; |
| 2204 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 2205 | return {}; |
| 2206 | } |
| 2207 | |
| 2208 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 2209 | return ::llvm::StringLiteral("arith.andi" ); |
| 2210 | } |
| 2211 | |
| 2212 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2213 | return {index, 1}; |
| 2214 | } |
| 2215 | |
| 2216 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 2217 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 2218 | return getOperation()->getOperands().slice(n: start, m: length); |
| 2219 | } |
| 2220 | |
| 2221 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 2222 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 2223 | } |
| 2224 | |
| 2225 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 2226 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 2227 | } |
| 2228 | |
| 2229 | ::mlir::OpOperand &getLhsMutable() { |
| 2230 | auto range = getODSOperandIndexAndLength(index: 0); |
| 2231 | return getOperation()->getOpOperand(idx: range.first); |
| 2232 | } |
| 2233 | |
| 2234 | ::mlir::OpOperand &getRhsMutable() { |
| 2235 | auto range = getODSOperandIndexAndLength(index: 1); |
| 2236 | return getOperation()->getOpOperand(idx: range.first); |
| 2237 | } |
| 2238 | |
| 2239 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 2240 | return {index, 1}; |
| 2241 | } |
| 2242 | |
| 2243 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 2244 | auto valueRange = getODSResultIndexAndLength(index); |
| 2245 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 2246 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 2247 | } |
| 2248 | |
| 2249 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 2250 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 2251 | } |
| 2252 | |
| 2253 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2254 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 2255 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 2256 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 2257 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 2258 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 2259 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2260 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2261 | static AndIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2262 | static AndIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2263 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2264 | static AndIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2265 | static AndIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2266 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2267 | static AndIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2268 | static AndIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2269 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2270 | static AndIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2271 | static AndIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2272 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2273 | static AndIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2274 | static AndIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2275 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2276 | static AndIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2277 | static AndIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2278 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2279 | static AndIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2280 | static AndIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2281 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 2282 | ::llvm::LogicalResult verifyInvariants(); |
| 2283 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 2284 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 2285 | 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); |
| 2286 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 2287 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 2288 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 2289 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 2290 | public: |
| 2291 | }; |
| 2292 | |
| 2293 | } // namespace mlir::arith |
| 2294 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::AndIOp) |
| 2295 | |
| 2296 | namespace mlir::arith { |
| 2297 | |
| 2298 | |
| 2299 | //===----------------------------------------------------------------------===// |
| 2300 | // ::mlir::arith::BitcastOp declarations |
| 2301 | //===----------------------------------------------------------------------===// |
| 2302 | |
| 2303 | namespace detail { |
| 2304 | |
| 2305 | class BitcastOpGenericAdaptorBase { |
| 2306 | public: |
| 2307 | using Properties = ::mlir::EmptyProperties; |
| 2308 | protected: |
| 2309 | ::mlir::DictionaryAttr odsAttrs; |
| 2310 | ::std::optional<::mlir::OperationName> odsOpName; |
| 2311 | Properties properties; |
| 2312 | ::mlir::RegionRange odsRegions; |
| 2313 | public: |
| 2314 | BitcastOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 2315 | odsOpName.emplace(args: "arith.bitcast" , args: odsAttrs.getContext()); |
| 2316 | } |
| 2317 | |
| 2318 | BitcastOpGenericAdaptorBase(BitcastOp op); |
| 2319 | |
| 2320 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 2321 | return {index, 1}; |
| 2322 | } |
| 2323 | |
| 2324 | const Properties &getProperties() { |
| 2325 | return properties; |
| 2326 | } |
| 2327 | |
| 2328 | ::mlir::DictionaryAttr getAttributes() { |
| 2329 | return odsAttrs; |
| 2330 | } |
| 2331 | |
| 2332 | }; |
| 2333 | |
| 2334 | } // namespace detail |
| 2335 | template <typename RangeT> |
| 2336 | class BitcastOpGenericAdaptor : public detail::BitcastOpGenericAdaptorBase { |
| 2337 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 2338 | using Base = detail::BitcastOpGenericAdaptorBase; |
| 2339 | static constexpr int odsIndex_in = 0; |
| 2340 | public: |
| 2341 | BitcastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 2342 | |
| 2343 | BitcastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : BitcastOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 2344 | |
| 2345 | BitcastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : BitcastOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 2346 | |
| 2347 | BitcastOpGenericAdaptor(RangeT values, const BitcastOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 2348 | |
| 2349 | template <typename LateInst = BitcastOp, typename = std::enable_if_t<std::is_same_v<LateInst, BitcastOp>>> |
| 2350 | BitcastOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 2351 | |
| 2352 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2353 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 2354 | } |
| 2355 | |
| 2356 | RangeT getODSOperands(unsigned index) { |
| 2357 | auto valueRange = getODSOperandIndexAndLength(index); |
| 2358 | return {std::next(odsOperands.begin(), valueRange.first), |
| 2359 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 2360 | } |
| 2361 | |
| 2362 | ValueT getIn() { |
| 2363 | return (*getODSOperands(index: 0).begin()); |
| 2364 | } |
| 2365 | |
| 2366 | RangeT getOperands() { |
| 2367 | return odsOperands; |
| 2368 | } |
| 2369 | |
| 2370 | private: |
| 2371 | RangeT odsOperands; |
| 2372 | }; |
| 2373 | class BitcastOpAdaptor : public BitcastOpGenericAdaptor<::mlir::ValueRange> { |
| 2374 | public: |
| 2375 | using BitcastOpGenericAdaptor::BitcastOpGenericAdaptor; |
| 2376 | BitcastOpAdaptor(BitcastOp op); |
| 2377 | |
| 2378 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 2379 | }; |
| 2380 | class BitcastOp : public ::mlir::Op<BitcastOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 2381 | public: |
| 2382 | using Op::Op; |
| 2383 | using Op::print; |
| 2384 | using Adaptor = BitcastOpAdaptor; |
| 2385 | template <typename RangeT> |
| 2386 | using GenericAdaptor = BitcastOpGenericAdaptor<RangeT>; |
| 2387 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 2388 | static constexpr int odsIndex_in = 0; |
| 2389 | static constexpr int odsIndex_out = 0; |
| 2390 | using Properties = FoldAdaptor::Properties; |
| 2391 | using ::mlir::VectorUnrollOpInterface::Trait<BitcastOp>::getIterationShapeToUnroll; |
| 2392 | using ::mlir::VectorUnrollOpInterface::Trait<BitcastOp>::getDefaultUnrollTargetShape; |
| 2393 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 2394 | return {}; |
| 2395 | } |
| 2396 | |
| 2397 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 2398 | return ::llvm::StringLiteral("arith.bitcast" ); |
| 2399 | } |
| 2400 | |
| 2401 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2402 | return {index, 1}; |
| 2403 | } |
| 2404 | |
| 2405 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 2406 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 2407 | return getOperation()->getOperands().slice(n: start, m: length); |
| 2408 | } |
| 2409 | |
| 2410 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 2411 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 2412 | } |
| 2413 | |
| 2414 | ::mlir::OpOperand &getInMutable() { |
| 2415 | auto range = getODSOperandIndexAndLength(index: 0); |
| 2416 | return getOperation()->getOpOperand(idx: range.first); |
| 2417 | } |
| 2418 | |
| 2419 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 2420 | return {index, 1}; |
| 2421 | } |
| 2422 | |
| 2423 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 2424 | auto valueRange = getODSResultIndexAndLength(index); |
| 2425 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 2426 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 2427 | } |
| 2428 | |
| 2429 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 2430 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 2431 | } |
| 2432 | |
| 2433 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2434 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 2435 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 2436 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 2437 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 2438 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 2439 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2440 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in); |
| 2441 | static BitcastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in); |
| 2442 | static BitcastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in); |
| 2443 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 2444 | static BitcastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 2445 | static BitcastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 2446 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2447 | static BitcastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2448 | static BitcastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2449 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2450 | static BitcastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2451 | static BitcastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2452 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 2453 | ::llvm::LogicalResult verifyInvariants(); |
| 2454 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 2455 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 2456 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 2457 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 2458 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 2459 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 2460 | public: |
| 2461 | }; |
| 2462 | |
| 2463 | } // namespace mlir::arith |
| 2464 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::BitcastOp) |
| 2465 | |
| 2466 | namespace mlir::arith { |
| 2467 | |
| 2468 | |
| 2469 | //===----------------------------------------------------------------------===// |
| 2470 | // ::mlir::arith::CeilDivSIOp declarations |
| 2471 | //===----------------------------------------------------------------------===// |
| 2472 | |
| 2473 | namespace detail { |
| 2474 | |
| 2475 | class CeilDivSIOpGenericAdaptorBase { |
| 2476 | public: |
| 2477 | using Properties = ::mlir::EmptyProperties; |
| 2478 | protected: |
| 2479 | ::mlir::DictionaryAttr odsAttrs; |
| 2480 | ::std::optional<::mlir::OperationName> odsOpName; |
| 2481 | Properties properties; |
| 2482 | ::mlir::RegionRange odsRegions; |
| 2483 | public: |
| 2484 | CeilDivSIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 2485 | odsOpName.emplace(args: "arith.ceildivsi" , args: odsAttrs.getContext()); |
| 2486 | } |
| 2487 | |
| 2488 | CeilDivSIOpGenericAdaptorBase(CeilDivSIOp op); |
| 2489 | |
| 2490 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 2491 | return {index, 1}; |
| 2492 | } |
| 2493 | |
| 2494 | const Properties &getProperties() { |
| 2495 | return properties; |
| 2496 | } |
| 2497 | |
| 2498 | ::mlir::DictionaryAttr getAttributes() { |
| 2499 | return odsAttrs; |
| 2500 | } |
| 2501 | |
| 2502 | }; |
| 2503 | |
| 2504 | } // namespace detail |
| 2505 | template <typename RangeT> |
| 2506 | class CeilDivSIOpGenericAdaptor : public detail::CeilDivSIOpGenericAdaptorBase { |
| 2507 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 2508 | using Base = detail::CeilDivSIOpGenericAdaptorBase; |
| 2509 | static constexpr int odsIndex_lhs = 0; |
| 2510 | static constexpr int odsIndex_rhs = 1; |
| 2511 | public: |
| 2512 | CeilDivSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 2513 | |
| 2514 | CeilDivSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CeilDivSIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 2515 | |
| 2516 | CeilDivSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CeilDivSIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 2517 | |
| 2518 | CeilDivSIOpGenericAdaptor(RangeT values, const CeilDivSIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 2519 | |
| 2520 | template <typename LateInst = CeilDivSIOp, typename = std::enable_if_t<std::is_same_v<LateInst, CeilDivSIOp>>> |
| 2521 | CeilDivSIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 2522 | |
| 2523 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2524 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 2525 | } |
| 2526 | |
| 2527 | RangeT getODSOperands(unsigned index) { |
| 2528 | auto valueRange = getODSOperandIndexAndLength(index); |
| 2529 | return {std::next(odsOperands.begin(), valueRange.first), |
| 2530 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 2531 | } |
| 2532 | |
| 2533 | ValueT getLhs() { |
| 2534 | return (*getODSOperands(index: 0).begin()); |
| 2535 | } |
| 2536 | |
| 2537 | ValueT getRhs() { |
| 2538 | return (*getODSOperands(index: 1).begin()); |
| 2539 | } |
| 2540 | |
| 2541 | RangeT getOperands() { |
| 2542 | return odsOperands; |
| 2543 | } |
| 2544 | |
| 2545 | private: |
| 2546 | RangeT odsOperands; |
| 2547 | }; |
| 2548 | class CeilDivSIOpAdaptor : public CeilDivSIOpGenericAdaptor<::mlir::ValueRange> { |
| 2549 | public: |
| 2550 | using CeilDivSIOpGenericAdaptor::CeilDivSIOpGenericAdaptor; |
| 2551 | CeilDivSIOpAdaptor(CeilDivSIOp op); |
| 2552 | |
| 2553 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 2554 | }; |
| 2555 | class CeilDivSIOp : public ::mlir::Op<CeilDivSIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 2556 | public: |
| 2557 | using Op::Op; |
| 2558 | using Op::print; |
| 2559 | using Adaptor = CeilDivSIOpAdaptor; |
| 2560 | template <typename RangeT> |
| 2561 | using GenericAdaptor = CeilDivSIOpGenericAdaptor<RangeT>; |
| 2562 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 2563 | static constexpr int odsIndex_lhs = 0; |
| 2564 | static constexpr int odsIndex_rhs = 1; |
| 2565 | static constexpr int odsIndex_result = 0; |
| 2566 | using Properties = FoldAdaptor::Properties; |
| 2567 | using ::mlir::InferIntRangeInterface::Trait<CeilDivSIOp>::inferResultRangesFromOptional; |
| 2568 | using ::mlir::VectorUnrollOpInterface::Trait<CeilDivSIOp>::getIterationShapeToUnroll; |
| 2569 | using ::mlir::VectorUnrollOpInterface::Trait<CeilDivSIOp>::getDefaultUnrollTargetShape; |
| 2570 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 2571 | return {}; |
| 2572 | } |
| 2573 | |
| 2574 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 2575 | return ::llvm::StringLiteral("arith.ceildivsi" ); |
| 2576 | } |
| 2577 | |
| 2578 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2579 | return {index, 1}; |
| 2580 | } |
| 2581 | |
| 2582 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 2583 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 2584 | return getOperation()->getOperands().slice(n: start, m: length); |
| 2585 | } |
| 2586 | |
| 2587 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 2588 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 2589 | } |
| 2590 | |
| 2591 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 2592 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 2593 | } |
| 2594 | |
| 2595 | ::mlir::OpOperand &getLhsMutable() { |
| 2596 | auto range = getODSOperandIndexAndLength(index: 0); |
| 2597 | return getOperation()->getOpOperand(idx: range.first); |
| 2598 | } |
| 2599 | |
| 2600 | ::mlir::OpOperand &getRhsMutable() { |
| 2601 | auto range = getODSOperandIndexAndLength(index: 1); |
| 2602 | return getOperation()->getOpOperand(idx: range.first); |
| 2603 | } |
| 2604 | |
| 2605 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 2606 | return {index, 1}; |
| 2607 | } |
| 2608 | |
| 2609 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 2610 | auto valueRange = getODSResultIndexAndLength(index); |
| 2611 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 2612 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 2613 | } |
| 2614 | |
| 2615 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 2616 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 2617 | } |
| 2618 | |
| 2619 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2620 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 2621 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 2622 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 2623 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 2624 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 2625 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2626 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2627 | static CeilDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2628 | static CeilDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2629 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2630 | static CeilDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2631 | static CeilDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2632 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2633 | static CeilDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2634 | static CeilDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2635 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2636 | static CeilDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2637 | static CeilDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2638 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2639 | static CeilDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2640 | static CeilDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2641 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2642 | static CeilDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2643 | static CeilDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2644 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2645 | static CeilDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2646 | static CeilDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2647 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 2648 | ::llvm::LogicalResult verifyInvariants(); |
| 2649 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 2650 | 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); |
| 2651 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 2652 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 2653 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 2654 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 2655 | public: |
| 2656 | /// Interface method for ConditionallySpeculatable. |
| 2657 | Speculation::Speculatability getSpeculatability(); |
| 2658 | }; |
| 2659 | |
| 2660 | } // namespace mlir::arith |
| 2661 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::CeilDivSIOp) |
| 2662 | |
| 2663 | namespace mlir::arith { |
| 2664 | |
| 2665 | |
| 2666 | //===----------------------------------------------------------------------===// |
| 2667 | // ::mlir::arith::CeilDivUIOp declarations |
| 2668 | //===----------------------------------------------------------------------===// |
| 2669 | |
| 2670 | namespace detail { |
| 2671 | |
| 2672 | class CeilDivUIOpGenericAdaptorBase { |
| 2673 | public: |
| 2674 | using Properties = ::mlir::EmptyProperties; |
| 2675 | protected: |
| 2676 | ::mlir::DictionaryAttr odsAttrs; |
| 2677 | ::std::optional<::mlir::OperationName> odsOpName; |
| 2678 | Properties properties; |
| 2679 | ::mlir::RegionRange odsRegions; |
| 2680 | public: |
| 2681 | CeilDivUIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 2682 | odsOpName.emplace(args: "arith.ceildivui" , args: odsAttrs.getContext()); |
| 2683 | } |
| 2684 | |
| 2685 | CeilDivUIOpGenericAdaptorBase(CeilDivUIOp op); |
| 2686 | |
| 2687 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 2688 | return {index, 1}; |
| 2689 | } |
| 2690 | |
| 2691 | const Properties &getProperties() { |
| 2692 | return properties; |
| 2693 | } |
| 2694 | |
| 2695 | ::mlir::DictionaryAttr getAttributes() { |
| 2696 | return odsAttrs; |
| 2697 | } |
| 2698 | |
| 2699 | }; |
| 2700 | |
| 2701 | } // namespace detail |
| 2702 | template <typename RangeT> |
| 2703 | class CeilDivUIOpGenericAdaptor : public detail::CeilDivUIOpGenericAdaptorBase { |
| 2704 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 2705 | using Base = detail::CeilDivUIOpGenericAdaptorBase; |
| 2706 | static constexpr int odsIndex_lhs = 0; |
| 2707 | static constexpr int odsIndex_rhs = 1; |
| 2708 | public: |
| 2709 | CeilDivUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 2710 | |
| 2711 | CeilDivUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CeilDivUIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 2712 | |
| 2713 | CeilDivUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CeilDivUIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 2714 | |
| 2715 | CeilDivUIOpGenericAdaptor(RangeT values, const CeilDivUIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 2716 | |
| 2717 | template <typename LateInst = CeilDivUIOp, typename = std::enable_if_t<std::is_same_v<LateInst, CeilDivUIOp>>> |
| 2718 | CeilDivUIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 2719 | |
| 2720 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2721 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 2722 | } |
| 2723 | |
| 2724 | RangeT getODSOperands(unsigned index) { |
| 2725 | auto valueRange = getODSOperandIndexAndLength(index); |
| 2726 | return {std::next(odsOperands.begin(), valueRange.first), |
| 2727 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 2728 | } |
| 2729 | |
| 2730 | ValueT getLhs() { |
| 2731 | return (*getODSOperands(index: 0).begin()); |
| 2732 | } |
| 2733 | |
| 2734 | ValueT getRhs() { |
| 2735 | return (*getODSOperands(index: 1).begin()); |
| 2736 | } |
| 2737 | |
| 2738 | RangeT getOperands() { |
| 2739 | return odsOperands; |
| 2740 | } |
| 2741 | |
| 2742 | private: |
| 2743 | RangeT odsOperands; |
| 2744 | }; |
| 2745 | class CeilDivUIOpAdaptor : public CeilDivUIOpGenericAdaptor<::mlir::ValueRange> { |
| 2746 | public: |
| 2747 | using CeilDivUIOpGenericAdaptor::CeilDivUIOpGenericAdaptor; |
| 2748 | CeilDivUIOpAdaptor(CeilDivUIOp op); |
| 2749 | |
| 2750 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 2751 | }; |
| 2752 | class CeilDivUIOp : public ::mlir::Op<CeilDivUIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 2753 | public: |
| 2754 | using Op::Op; |
| 2755 | using Op::print; |
| 2756 | using Adaptor = CeilDivUIOpAdaptor; |
| 2757 | template <typename RangeT> |
| 2758 | using GenericAdaptor = CeilDivUIOpGenericAdaptor<RangeT>; |
| 2759 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 2760 | static constexpr int odsIndex_lhs = 0; |
| 2761 | static constexpr int odsIndex_rhs = 1; |
| 2762 | static constexpr int odsIndex_result = 0; |
| 2763 | using Properties = FoldAdaptor::Properties; |
| 2764 | using ::mlir::InferIntRangeInterface::Trait<CeilDivUIOp>::inferResultRangesFromOptional; |
| 2765 | using ::mlir::VectorUnrollOpInterface::Trait<CeilDivUIOp>::getIterationShapeToUnroll; |
| 2766 | using ::mlir::VectorUnrollOpInterface::Trait<CeilDivUIOp>::getDefaultUnrollTargetShape; |
| 2767 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 2768 | return {}; |
| 2769 | } |
| 2770 | |
| 2771 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 2772 | return ::llvm::StringLiteral("arith.ceildivui" ); |
| 2773 | } |
| 2774 | |
| 2775 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2776 | return {index, 1}; |
| 2777 | } |
| 2778 | |
| 2779 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 2780 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 2781 | return getOperation()->getOperands().slice(n: start, m: length); |
| 2782 | } |
| 2783 | |
| 2784 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 2785 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 2786 | } |
| 2787 | |
| 2788 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 2789 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 2790 | } |
| 2791 | |
| 2792 | ::mlir::OpOperand &getLhsMutable() { |
| 2793 | auto range = getODSOperandIndexAndLength(index: 0); |
| 2794 | return getOperation()->getOpOperand(idx: range.first); |
| 2795 | } |
| 2796 | |
| 2797 | ::mlir::OpOperand &getRhsMutable() { |
| 2798 | auto range = getODSOperandIndexAndLength(index: 1); |
| 2799 | return getOperation()->getOpOperand(idx: range.first); |
| 2800 | } |
| 2801 | |
| 2802 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 2803 | return {index, 1}; |
| 2804 | } |
| 2805 | |
| 2806 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 2807 | auto valueRange = getODSResultIndexAndLength(index); |
| 2808 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 2809 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 2810 | } |
| 2811 | |
| 2812 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 2813 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 2814 | } |
| 2815 | |
| 2816 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2817 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 2818 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 2819 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 2820 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 2821 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 2822 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 2823 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2824 | static CeilDivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2825 | static CeilDivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2826 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2827 | static CeilDivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2828 | static CeilDivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2829 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2830 | static CeilDivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2831 | static CeilDivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 2832 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2833 | static CeilDivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2834 | static CeilDivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2835 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2836 | static CeilDivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2837 | static CeilDivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 2838 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2839 | static CeilDivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2840 | static CeilDivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2841 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2842 | static CeilDivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2843 | static CeilDivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 2844 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 2845 | ::llvm::LogicalResult verifyInvariants(); |
| 2846 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 2847 | 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); |
| 2848 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 2849 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 2850 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 2851 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 2852 | public: |
| 2853 | /// Interface method for ConditionallySpeculatable. |
| 2854 | Speculation::Speculatability getSpeculatability(); |
| 2855 | }; |
| 2856 | |
| 2857 | } // namespace mlir::arith |
| 2858 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::CeilDivUIOp) |
| 2859 | |
| 2860 | namespace mlir::arith { |
| 2861 | |
| 2862 | |
| 2863 | //===----------------------------------------------------------------------===// |
| 2864 | // ::mlir::arith::CmpFOp declarations |
| 2865 | //===----------------------------------------------------------------------===// |
| 2866 | |
| 2867 | namespace detail { |
| 2868 | |
| 2869 | class CmpFOpGenericAdaptorBase { |
| 2870 | public: |
| 2871 | struct Properties { |
| 2872 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 2873 | fastmathTy fastmath; |
| 2874 | |
| 2875 | auto getFastmath() const { |
| 2876 | auto &propStorage = this->fastmath; |
| 2877 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 2878 | } |
| 2879 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 2880 | this->fastmath = propValue; |
| 2881 | } |
| 2882 | using predicateTy = ::mlir::arith::CmpFPredicateAttr; |
| 2883 | predicateTy predicate; |
| 2884 | |
| 2885 | auto getPredicate() const { |
| 2886 | auto &propStorage = this->predicate; |
| 2887 | return ::llvm::cast<::mlir::arith::CmpFPredicateAttr>(Val: propStorage); |
| 2888 | } |
| 2889 | void setPredicate(const ::mlir::arith::CmpFPredicateAttr &propValue) { |
| 2890 | this->predicate = propValue; |
| 2891 | } |
| 2892 | bool operator==(const Properties &rhs) const { |
| 2893 | return |
| 2894 | rhs.fastmath == this->fastmath && |
| 2895 | rhs.predicate == this->predicate && |
| 2896 | true; |
| 2897 | } |
| 2898 | bool operator!=(const Properties &rhs) const { |
| 2899 | return !(*this == rhs); |
| 2900 | } |
| 2901 | }; |
| 2902 | protected: |
| 2903 | ::mlir::DictionaryAttr odsAttrs; |
| 2904 | ::std::optional<::mlir::OperationName> odsOpName; |
| 2905 | Properties properties; |
| 2906 | ::mlir::RegionRange odsRegions; |
| 2907 | public: |
| 2908 | CmpFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 2909 | odsOpName.emplace(args: "arith.cmpf" , args: odsAttrs.getContext()); |
| 2910 | } |
| 2911 | |
| 2912 | CmpFOpGenericAdaptorBase(CmpFOp op); |
| 2913 | |
| 2914 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 2915 | return {index, 1}; |
| 2916 | } |
| 2917 | |
| 2918 | const Properties &getProperties() { |
| 2919 | return properties; |
| 2920 | } |
| 2921 | |
| 2922 | ::mlir::DictionaryAttr getAttributes() { |
| 2923 | return odsAttrs; |
| 2924 | } |
| 2925 | |
| 2926 | ::mlir::arith::CmpFPredicateAttr getPredicateAttr() { |
| 2927 | auto attr = ::llvm::cast<::mlir::arith::CmpFPredicateAttr>(Val: getProperties().predicate); |
| 2928 | return attr; |
| 2929 | } |
| 2930 | |
| 2931 | ::mlir::arith::CmpFPredicate getPredicate(); |
| 2932 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 2933 | ::mlir::arith::FastMathFlags getFastmath(); |
| 2934 | }; |
| 2935 | |
| 2936 | } // namespace detail |
| 2937 | template <typename RangeT> |
| 2938 | class CmpFOpGenericAdaptor : public detail::CmpFOpGenericAdaptorBase { |
| 2939 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 2940 | using Base = detail::CmpFOpGenericAdaptorBase; |
| 2941 | static constexpr int odsIndex_lhs = 0; |
| 2942 | static constexpr int odsIndex_rhs = 1; |
| 2943 | public: |
| 2944 | CmpFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 2945 | |
| 2946 | CmpFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CmpFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 2947 | |
| 2948 | CmpFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CmpFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 2949 | |
| 2950 | CmpFOpGenericAdaptor(RangeT values, const CmpFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 2951 | |
| 2952 | template <typename LateInst = CmpFOp, typename = std::enable_if_t<std::is_same_v<LateInst, CmpFOp>>> |
| 2953 | CmpFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 2954 | |
| 2955 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 2956 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 2957 | } |
| 2958 | |
| 2959 | RangeT getODSOperands(unsigned index) { |
| 2960 | auto valueRange = getODSOperandIndexAndLength(index); |
| 2961 | return {std::next(odsOperands.begin(), valueRange.first), |
| 2962 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 2963 | } |
| 2964 | |
| 2965 | ValueT getLhs() { |
| 2966 | return (*getODSOperands(index: 0).begin()); |
| 2967 | } |
| 2968 | |
| 2969 | ValueT getRhs() { |
| 2970 | return (*getODSOperands(index: 1).begin()); |
| 2971 | } |
| 2972 | |
| 2973 | RangeT getOperands() { |
| 2974 | return odsOperands; |
| 2975 | } |
| 2976 | |
| 2977 | private: |
| 2978 | RangeT odsOperands; |
| 2979 | }; |
| 2980 | class CmpFOpAdaptor : public CmpFOpGenericAdaptor<::mlir::ValueRange> { |
| 2981 | public: |
| 2982 | using CmpFOpGenericAdaptor::CmpFOpGenericAdaptor; |
| 2983 | CmpFOpAdaptor(CmpFOp op); |
| 2984 | |
| 2985 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 2986 | }; |
| 2987 | class CmpFOp : public ::mlir::Op<CmpFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameTypeOperands, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 2988 | public: |
| 2989 | using Op::Op; |
| 2990 | using Op::print; |
| 2991 | using Adaptor = CmpFOpAdaptor; |
| 2992 | template <typename RangeT> |
| 2993 | using GenericAdaptor = CmpFOpGenericAdaptor<RangeT>; |
| 2994 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 2995 | static constexpr int odsIndex_lhs = 0; |
| 2996 | static constexpr int odsIndex_rhs = 1; |
| 2997 | static constexpr int odsIndex_result = 0; |
| 2998 | using Properties = FoldAdaptor::Properties; |
| 2999 | using ::mlir::arith::ArithFastMathInterface::Trait<CmpFOp>::getFastMathFlagsAttr; |
| 3000 | using ::mlir::arith::ArithFastMathInterface::Trait<CmpFOp>::getFastMathAttrName; |
| 3001 | using ::mlir::VectorUnrollOpInterface::Trait<CmpFOp>::getIterationShapeToUnroll; |
| 3002 | using ::mlir::VectorUnrollOpInterface::Trait<CmpFOp>::getDefaultUnrollTargetShape; |
| 3003 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 3004 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" ), ::llvm::StringRef("predicate" )}; |
| 3005 | return ::llvm::ArrayRef(attrNames); |
| 3006 | } |
| 3007 | |
| 3008 | ::mlir::StringAttr getFastmathAttrName() { |
| 3009 | return getAttributeNameForIndex(index: 0); |
| 3010 | } |
| 3011 | |
| 3012 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 3013 | return getAttributeNameForIndex(name, index: 0); |
| 3014 | } |
| 3015 | |
| 3016 | ::mlir::StringAttr getPredicateAttrName() { |
| 3017 | return getAttributeNameForIndex(index: 1); |
| 3018 | } |
| 3019 | |
| 3020 | static ::mlir::StringAttr getPredicateAttrName(::mlir::OperationName name) { |
| 3021 | return getAttributeNameForIndex(name, index: 1); |
| 3022 | } |
| 3023 | |
| 3024 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 3025 | return ::llvm::StringLiteral("arith.cmpf" ); |
| 3026 | } |
| 3027 | |
| 3028 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3029 | return {index, 1}; |
| 3030 | } |
| 3031 | |
| 3032 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 3033 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 3034 | return getOperation()->getOperands().slice(n: start, m: length); |
| 3035 | } |
| 3036 | |
| 3037 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 3038 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 3039 | } |
| 3040 | |
| 3041 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 3042 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 3043 | } |
| 3044 | |
| 3045 | ::mlir::OpOperand &getLhsMutable() { |
| 3046 | auto range = getODSOperandIndexAndLength(index: 0); |
| 3047 | return getOperation()->getOpOperand(idx: range.first); |
| 3048 | } |
| 3049 | |
| 3050 | ::mlir::OpOperand &getRhsMutable() { |
| 3051 | auto range = getODSOperandIndexAndLength(index: 1); |
| 3052 | return getOperation()->getOpOperand(idx: range.first); |
| 3053 | } |
| 3054 | |
| 3055 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 3056 | return {index, 1}; |
| 3057 | } |
| 3058 | |
| 3059 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 3060 | auto valueRange = getODSResultIndexAndLength(index); |
| 3061 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 3062 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 3063 | } |
| 3064 | |
| 3065 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 3066 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 3067 | } |
| 3068 | |
| 3069 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3070 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 3071 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 3072 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 3073 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 3074 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 3075 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3076 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 3077 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 3078 | ::mlir::arith::CmpFPredicateAttr getPredicateAttr() { |
| 3079 | return ::llvm::cast<::mlir::arith::CmpFPredicateAttr>(Val&: getProperties().predicate); |
| 3080 | } |
| 3081 | |
| 3082 | ::mlir::arith::CmpFPredicate getPredicate(); |
| 3083 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 3084 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 3085 | } |
| 3086 | |
| 3087 | ::mlir::arith::FastMathFlags getFastmath(); |
| 3088 | void setPredicateAttr(::mlir::arith::CmpFPredicateAttr attr) { |
| 3089 | getProperties().predicate = attr; |
| 3090 | } |
| 3091 | |
| 3092 | void setPredicate(::mlir::arith::CmpFPredicate attrValue); |
| 3093 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 3094 | getProperties().fastmath = attr; |
| 3095 | } |
| 3096 | |
| 3097 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 3098 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::arith::CmpFPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath = nullptr); |
| 3099 | static CmpFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::arith::CmpFPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath = nullptr); |
| 3100 | static CmpFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::arith::CmpFPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath = nullptr); |
| 3101 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::arith::CmpFPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath = nullptr); |
| 3102 | static CmpFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::arith::CmpFPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath = nullptr); |
| 3103 | static CmpFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::arith::CmpFPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath = nullptr); |
| 3104 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::arith::CmpFPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath = nullptr); |
| 3105 | static CmpFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::arith::CmpFPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath = nullptr); |
| 3106 | static CmpFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::arith::CmpFPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath = nullptr); |
| 3107 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::arith::CmpFPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 3108 | static CmpFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::arith::CmpFPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 3109 | static CmpFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::arith::CmpFPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 3110 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::arith::CmpFPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 3111 | static CmpFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::arith::CmpFPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 3112 | static CmpFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::arith::CmpFPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 3113 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::arith::CmpFPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 3114 | static CmpFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::arith::CmpFPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 3115 | static CmpFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::arith::CmpFPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 3116 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3117 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3118 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3119 | static CmpFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3120 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3121 | static CmpFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3122 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3123 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3124 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3125 | static CmpFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3126 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3127 | static CmpFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3128 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3129 | static CmpFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3130 | static CmpFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3131 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3132 | static CmpFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3133 | static CmpFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3134 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 3135 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 3136 | ::llvm::LogicalResult verifyInvariants(); |
| 3137 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 3138 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 3139 | 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); |
| 3140 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 3141 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 3142 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 3143 | private: |
| 3144 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 3145 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 3146 | } |
| 3147 | |
| 3148 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 3149 | assert(index < 2 && "invalid attribute index" ); |
| 3150 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 3151 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 3152 | "dependent dialect loading?" ); |
| 3153 | return name.getAttributeNames()[index]; |
| 3154 | } |
| 3155 | |
| 3156 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 3157 | public: |
| 3158 | }; |
| 3159 | |
| 3160 | } // namespace mlir::arith |
| 3161 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::CmpFOp) |
| 3162 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::CmpFOpGenericAdaptorBase::Properties) |
| 3163 | |
| 3164 | namespace mlir::arith { |
| 3165 | |
| 3166 | |
| 3167 | //===----------------------------------------------------------------------===// |
| 3168 | // ::mlir::arith::CmpIOp declarations |
| 3169 | //===----------------------------------------------------------------------===// |
| 3170 | |
| 3171 | namespace detail { |
| 3172 | |
| 3173 | class CmpIOpGenericAdaptorBase { |
| 3174 | public: |
| 3175 | struct Properties { |
| 3176 | using predicateTy = ::mlir::arith::CmpIPredicateAttr; |
| 3177 | predicateTy predicate; |
| 3178 | |
| 3179 | auto getPredicate() const { |
| 3180 | auto &propStorage = this->predicate; |
| 3181 | return ::llvm::cast<::mlir::arith::CmpIPredicateAttr>(Val: propStorage); |
| 3182 | } |
| 3183 | void setPredicate(const ::mlir::arith::CmpIPredicateAttr &propValue) { |
| 3184 | this->predicate = propValue; |
| 3185 | } |
| 3186 | bool operator==(const Properties &rhs) const { |
| 3187 | return |
| 3188 | rhs.predicate == this->predicate && |
| 3189 | true; |
| 3190 | } |
| 3191 | bool operator!=(const Properties &rhs) const { |
| 3192 | return !(*this == rhs); |
| 3193 | } |
| 3194 | }; |
| 3195 | protected: |
| 3196 | ::mlir::DictionaryAttr odsAttrs; |
| 3197 | ::std::optional<::mlir::OperationName> odsOpName; |
| 3198 | Properties properties; |
| 3199 | ::mlir::RegionRange odsRegions; |
| 3200 | public: |
| 3201 | CmpIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 3202 | odsOpName.emplace(args: "arith.cmpi" , args: odsAttrs.getContext()); |
| 3203 | } |
| 3204 | |
| 3205 | CmpIOpGenericAdaptorBase(CmpIOp op); |
| 3206 | |
| 3207 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 3208 | return {index, 1}; |
| 3209 | } |
| 3210 | |
| 3211 | const Properties &getProperties() { |
| 3212 | return properties; |
| 3213 | } |
| 3214 | |
| 3215 | ::mlir::DictionaryAttr getAttributes() { |
| 3216 | return odsAttrs; |
| 3217 | } |
| 3218 | |
| 3219 | ::mlir::arith::CmpIPredicateAttr getPredicateAttr() { |
| 3220 | auto attr = ::llvm::cast<::mlir::arith::CmpIPredicateAttr>(Val: getProperties().predicate); |
| 3221 | return attr; |
| 3222 | } |
| 3223 | |
| 3224 | ::mlir::arith::CmpIPredicate getPredicate(); |
| 3225 | }; |
| 3226 | |
| 3227 | } // namespace detail |
| 3228 | template <typename RangeT> |
| 3229 | class CmpIOpGenericAdaptor : public detail::CmpIOpGenericAdaptorBase { |
| 3230 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 3231 | using Base = detail::CmpIOpGenericAdaptorBase; |
| 3232 | static constexpr int odsIndex_lhs = 0; |
| 3233 | static constexpr int odsIndex_rhs = 1; |
| 3234 | public: |
| 3235 | CmpIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 3236 | |
| 3237 | CmpIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CmpIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 3238 | |
| 3239 | CmpIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CmpIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 3240 | |
| 3241 | CmpIOpGenericAdaptor(RangeT values, const CmpIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 3242 | |
| 3243 | template <typename LateInst = CmpIOp, typename = std::enable_if_t<std::is_same_v<LateInst, CmpIOp>>> |
| 3244 | CmpIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 3245 | |
| 3246 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3247 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 3248 | } |
| 3249 | |
| 3250 | RangeT getODSOperands(unsigned index) { |
| 3251 | auto valueRange = getODSOperandIndexAndLength(index); |
| 3252 | return {std::next(odsOperands.begin(), valueRange.first), |
| 3253 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 3254 | } |
| 3255 | |
| 3256 | ValueT getLhs() { |
| 3257 | return (*getODSOperands(index: 0).begin()); |
| 3258 | } |
| 3259 | |
| 3260 | ValueT getRhs() { |
| 3261 | return (*getODSOperands(index: 1).begin()); |
| 3262 | } |
| 3263 | |
| 3264 | RangeT getOperands() { |
| 3265 | return odsOperands; |
| 3266 | } |
| 3267 | |
| 3268 | private: |
| 3269 | RangeT odsOperands; |
| 3270 | }; |
| 3271 | class CmpIOpAdaptor : public CmpIOpGenericAdaptor<::mlir::ValueRange> { |
| 3272 | public: |
| 3273 | using CmpIOpGenericAdaptor::CmpIOpGenericAdaptor; |
| 3274 | CmpIOpAdaptor(CmpIOp op); |
| 3275 | |
| 3276 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 3277 | }; |
| 3278 | class CmpIOp : public ::mlir::Op<CmpIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameTypeOperands, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 3279 | public: |
| 3280 | using Op::Op; |
| 3281 | using Op::print; |
| 3282 | using Adaptor = CmpIOpAdaptor; |
| 3283 | template <typename RangeT> |
| 3284 | using GenericAdaptor = CmpIOpGenericAdaptor<RangeT>; |
| 3285 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 3286 | static constexpr int odsIndex_lhs = 0; |
| 3287 | static constexpr int odsIndex_rhs = 1; |
| 3288 | static constexpr int odsIndex_result = 0; |
| 3289 | using Properties = FoldAdaptor::Properties; |
| 3290 | using ::mlir::InferIntRangeInterface::Trait<CmpIOp>::inferResultRangesFromOptional; |
| 3291 | using ::mlir::VectorUnrollOpInterface::Trait<CmpIOp>::getIterationShapeToUnroll; |
| 3292 | using ::mlir::VectorUnrollOpInterface::Trait<CmpIOp>::getDefaultUnrollTargetShape; |
| 3293 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 3294 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("predicate" )}; |
| 3295 | return ::llvm::ArrayRef(attrNames); |
| 3296 | } |
| 3297 | |
| 3298 | ::mlir::StringAttr getPredicateAttrName() { |
| 3299 | return getAttributeNameForIndex(index: 0); |
| 3300 | } |
| 3301 | |
| 3302 | static ::mlir::StringAttr getPredicateAttrName(::mlir::OperationName name) { |
| 3303 | return getAttributeNameForIndex(name, index: 0); |
| 3304 | } |
| 3305 | |
| 3306 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 3307 | return ::llvm::StringLiteral("arith.cmpi" ); |
| 3308 | } |
| 3309 | |
| 3310 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3311 | return {index, 1}; |
| 3312 | } |
| 3313 | |
| 3314 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 3315 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 3316 | return getOperation()->getOperands().slice(n: start, m: length); |
| 3317 | } |
| 3318 | |
| 3319 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 3320 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 3321 | } |
| 3322 | |
| 3323 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 3324 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 3325 | } |
| 3326 | |
| 3327 | ::mlir::OpOperand &getLhsMutable() { |
| 3328 | auto range = getODSOperandIndexAndLength(index: 0); |
| 3329 | return getOperation()->getOpOperand(idx: range.first); |
| 3330 | } |
| 3331 | |
| 3332 | ::mlir::OpOperand &getRhsMutable() { |
| 3333 | auto range = getODSOperandIndexAndLength(index: 1); |
| 3334 | return getOperation()->getOpOperand(idx: range.first); |
| 3335 | } |
| 3336 | |
| 3337 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 3338 | return {index, 1}; |
| 3339 | } |
| 3340 | |
| 3341 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 3342 | auto valueRange = getODSResultIndexAndLength(index); |
| 3343 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 3344 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 3345 | } |
| 3346 | |
| 3347 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 3348 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 3349 | } |
| 3350 | |
| 3351 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3352 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 3353 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 3354 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 3355 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 3356 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 3357 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3358 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 3359 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 3360 | ::mlir::arith::CmpIPredicateAttr getPredicateAttr() { |
| 3361 | return ::llvm::cast<::mlir::arith::CmpIPredicateAttr>(Val&: getProperties().predicate); |
| 3362 | } |
| 3363 | |
| 3364 | ::mlir::arith::CmpIPredicate getPredicate(); |
| 3365 | void setPredicateAttr(::mlir::arith::CmpIPredicateAttr attr) { |
| 3366 | getProperties().predicate = attr; |
| 3367 | } |
| 3368 | |
| 3369 | void setPredicate(::mlir::arith::CmpIPredicate attrValue); |
| 3370 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::arith::CmpIPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3371 | static CmpIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::arith::CmpIPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3372 | static CmpIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::arith::CmpIPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3373 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::arith::CmpIPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3374 | static CmpIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::arith::CmpIPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3375 | static CmpIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::arith::CmpIPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3376 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::arith::CmpIPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3377 | static CmpIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::arith::CmpIPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3378 | static CmpIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::arith::CmpIPredicateAttr predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3379 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::arith::CmpIPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3380 | static CmpIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::arith::CmpIPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3381 | static CmpIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::arith::CmpIPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3382 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::arith::CmpIPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3383 | static CmpIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::arith::CmpIPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3384 | static CmpIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::arith::CmpIPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3385 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::arith::CmpIPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3386 | static CmpIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::arith::CmpIPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3387 | static CmpIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::arith::CmpIPredicate predicate, ::mlir::Value lhs, ::mlir::Value rhs); |
| 3388 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3389 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3390 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3391 | static CmpIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3392 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3393 | static CmpIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3394 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3395 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3396 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3397 | static CmpIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3398 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3399 | static CmpIOp create(::mlir::ImplicitLocOpBuilder &builder, ::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 CmpIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3402 | static CmpIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3403 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3404 | static CmpIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3405 | static CmpIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3406 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 3407 | ::llvm::LogicalResult verifyInvariants(); |
| 3408 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 3409 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 3410 | 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); |
| 3411 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 3412 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 3413 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 3414 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 3415 | private: |
| 3416 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 3417 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 3418 | } |
| 3419 | |
| 3420 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 3421 | assert(index < 1 && "invalid attribute index" ); |
| 3422 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 3423 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 3424 | "dependent dialect loading?" ); |
| 3425 | return name.getAttributeNames()[index]; |
| 3426 | } |
| 3427 | |
| 3428 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 3429 | public: |
| 3430 | }; |
| 3431 | |
| 3432 | } // namespace mlir::arith |
| 3433 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::CmpIOp) |
| 3434 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::CmpIOpGenericAdaptorBase::Properties) |
| 3435 | |
| 3436 | namespace mlir::arith { |
| 3437 | |
| 3438 | |
| 3439 | //===----------------------------------------------------------------------===// |
| 3440 | // ::mlir::arith::ConstantOp declarations |
| 3441 | //===----------------------------------------------------------------------===// |
| 3442 | |
| 3443 | namespace detail { |
| 3444 | |
| 3445 | class ConstantOpGenericAdaptorBase { |
| 3446 | public: |
| 3447 | struct Properties { |
| 3448 | using valueTy = ::mlir::TypedAttr; |
| 3449 | valueTy value; |
| 3450 | |
| 3451 | auto getValue() const { |
| 3452 | auto &propStorage = this->value; |
| 3453 | return ::llvm::cast<::mlir::TypedAttr>(Val: propStorage); |
| 3454 | } |
| 3455 | void setValue(const ::mlir::TypedAttr &propValue) { |
| 3456 | this->value = propValue; |
| 3457 | } |
| 3458 | bool operator==(const Properties &rhs) const { |
| 3459 | return |
| 3460 | rhs.value == this->value && |
| 3461 | true; |
| 3462 | } |
| 3463 | bool operator!=(const Properties &rhs) const { |
| 3464 | return !(*this == rhs); |
| 3465 | } |
| 3466 | }; |
| 3467 | protected: |
| 3468 | ::mlir::DictionaryAttr odsAttrs; |
| 3469 | ::std::optional<::mlir::OperationName> odsOpName; |
| 3470 | Properties properties; |
| 3471 | ::mlir::RegionRange odsRegions; |
| 3472 | public: |
| 3473 | ConstantOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 3474 | odsOpName.emplace(args: "arith.constant" , args: odsAttrs.getContext()); |
| 3475 | } |
| 3476 | |
| 3477 | ConstantOpGenericAdaptorBase(ConstantOp op); |
| 3478 | |
| 3479 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 3480 | return {index, 1}; |
| 3481 | } |
| 3482 | |
| 3483 | const Properties &getProperties() { |
| 3484 | return properties; |
| 3485 | } |
| 3486 | |
| 3487 | ::mlir::DictionaryAttr getAttributes() { |
| 3488 | return odsAttrs; |
| 3489 | } |
| 3490 | |
| 3491 | ::mlir::TypedAttr getValueAttr() { |
| 3492 | auto attr = ::llvm::cast<::mlir::TypedAttr>(Val: getProperties().value); |
| 3493 | return attr; |
| 3494 | } |
| 3495 | |
| 3496 | ::mlir::TypedAttr getValue(); |
| 3497 | }; |
| 3498 | |
| 3499 | } // namespace detail |
| 3500 | template <typename RangeT> |
| 3501 | class ConstantOpGenericAdaptor : public detail::ConstantOpGenericAdaptorBase { |
| 3502 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 3503 | using Base = detail::ConstantOpGenericAdaptorBase; |
| 3504 | public: |
| 3505 | ConstantOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 3506 | |
| 3507 | ConstantOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ConstantOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 3508 | |
| 3509 | ConstantOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ConstantOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 3510 | |
| 3511 | ConstantOpGenericAdaptor(RangeT values, const ConstantOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 3512 | |
| 3513 | template <typename LateInst = ConstantOp, typename = std::enable_if_t<std::is_same_v<LateInst, ConstantOp>>> |
| 3514 | ConstantOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 3515 | |
| 3516 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3517 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 3518 | } |
| 3519 | |
| 3520 | RangeT getODSOperands(unsigned index) { |
| 3521 | auto valueRange = getODSOperandIndexAndLength(index); |
| 3522 | return {std::next(odsOperands.begin(), valueRange.first), |
| 3523 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 3524 | } |
| 3525 | |
| 3526 | RangeT getOperands() { |
| 3527 | return odsOperands; |
| 3528 | } |
| 3529 | |
| 3530 | private: |
| 3531 | RangeT odsOperands; |
| 3532 | }; |
| 3533 | class ConstantOpAdaptor : public ConstantOpGenericAdaptor<::mlir::ValueRange> { |
| 3534 | public: |
| 3535 | using ConstantOpGenericAdaptor::ConstantOpGenericAdaptor; |
| 3536 | ConstantOpAdaptor(ConstantOp op); |
| 3537 | |
| 3538 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 3539 | }; |
| 3540 | class ConstantOp : public ::mlir::Op<ConstantOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::ConstantLike, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpAsmOpInterface::Trait, ::mlir::InferIntDivisibilityOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { |
| 3541 | public: |
| 3542 | using Op::Op; |
| 3543 | using Op::print; |
| 3544 | using Adaptor = ConstantOpAdaptor; |
| 3545 | template <typename RangeT> |
| 3546 | using GenericAdaptor = ConstantOpGenericAdaptor<RangeT>; |
| 3547 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 3548 | static constexpr int odsIndex_result = 0; |
| 3549 | using Properties = FoldAdaptor::Properties; |
| 3550 | using ::mlir::OpAsmOpInterface::Trait<ConstantOp>::getAsmBlockArgumentNames; |
| 3551 | using ::mlir::OpAsmOpInterface::Trait<ConstantOp>::getAsmBlockNames; |
| 3552 | using ::mlir::OpAsmOpInterface::Trait<ConstantOp>::getDefaultDialect; |
| 3553 | using ::mlir::InferIntRangeInterface::Trait<ConstantOp>::inferResultRangesFromOptional; |
| 3554 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 3555 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("value" )}; |
| 3556 | return ::llvm::ArrayRef(attrNames); |
| 3557 | } |
| 3558 | |
| 3559 | ::mlir::StringAttr getValueAttrName() { |
| 3560 | return getAttributeNameForIndex(index: 0); |
| 3561 | } |
| 3562 | |
| 3563 | static ::mlir::StringAttr getValueAttrName(::mlir::OperationName name) { |
| 3564 | return getAttributeNameForIndex(name, index: 0); |
| 3565 | } |
| 3566 | |
| 3567 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 3568 | return ::llvm::StringLiteral("arith.constant" ); |
| 3569 | } |
| 3570 | |
| 3571 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3572 | return {index, 1}; |
| 3573 | } |
| 3574 | |
| 3575 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 3576 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 3577 | return getOperation()->getOperands().slice(n: start, m: length); |
| 3578 | } |
| 3579 | |
| 3580 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 3581 | return {index, 1}; |
| 3582 | } |
| 3583 | |
| 3584 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 3585 | auto valueRange = getODSResultIndexAndLength(index); |
| 3586 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 3587 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 3588 | } |
| 3589 | |
| 3590 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 3591 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 3592 | } |
| 3593 | |
| 3594 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3595 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 3596 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 3597 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 3598 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 3599 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 3600 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3601 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 3602 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 3603 | ::mlir::TypedAttr getValueAttr() { |
| 3604 | return ::llvm::cast<::mlir::TypedAttr>(Val&: getProperties().value); |
| 3605 | } |
| 3606 | |
| 3607 | ::mlir::TypedAttr getValue(); |
| 3608 | void setValueAttr(::mlir::TypedAttr attr) { |
| 3609 | getProperties().value = attr; |
| 3610 | } |
| 3611 | |
| 3612 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::TypedAttr value); |
| 3613 | static ConstantOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::TypedAttr value); |
| 3614 | static ConstantOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::TypedAttr value); |
| 3615 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypedAttr value); |
| 3616 | static ConstantOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypedAttr value); |
| 3617 | static ConstantOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypedAttr value); |
| 3618 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::TypedAttr value); |
| 3619 | static ConstantOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::TypedAttr value); |
| 3620 | static ConstantOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::TypedAttr value); |
| 3621 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3622 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3623 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3624 | static ConstantOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3625 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3626 | static ConstantOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3627 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3628 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3629 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3630 | static ConstantOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3631 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3632 | static ConstantOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3633 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3634 | static ConstantOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3635 | static ConstantOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3636 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3637 | static ConstantOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3638 | static ConstantOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3639 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 3640 | ::llvm::LogicalResult verifyInvariants(); |
| 3641 | ::llvm::LogicalResult verify(); |
| 3642 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 3643 | 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); |
| 3644 | void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn); |
| 3645 | void inferResultDivisibility(::llvm::ArrayRef<::mlir::IntegerDivisibility> argDivs, ::mlir::SetIntDivisibilityFn setResultDivs); |
| 3646 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 3647 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 3648 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 3649 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 3650 | private: |
| 3651 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 3652 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 3653 | } |
| 3654 | |
| 3655 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 3656 | assert(index < 1 && "invalid attribute index" ); |
| 3657 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 3658 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 3659 | "dependent dialect loading?" ); |
| 3660 | return name.getAttributeNames()[index]; |
| 3661 | } |
| 3662 | |
| 3663 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 3664 | public: |
| 3665 | /// Whether the constant op can be constructed with a particular value and |
| 3666 | /// type. |
| 3667 | static bool isBuildableWith(Attribute value, Type type); |
| 3668 | |
| 3669 | /// Build the constant op with `value` and `type` if possible, otherwise |
| 3670 | /// returns null. |
| 3671 | static ConstantOp materialize(OpBuilder &builder, Attribute value, |
| 3672 | Type type, Location loc); |
| 3673 | }; |
| 3674 | |
| 3675 | } // namespace mlir::arith |
| 3676 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::ConstantOp) |
| 3677 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::ConstantOpGenericAdaptorBase::Properties) |
| 3678 | |
| 3679 | namespace mlir::arith { |
| 3680 | |
| 3681 | |
| 3682 | //===----------------------------------------------------------------------===// |
| 3683 | // ::mlir::arith::ConvertFOp declarations |
| 3684 | //===----------------------------------------------------------------------===// |
| 3685 | |
| 3686 | namespace detail { |
| 3687 | |
| 3688 | class ConvertFOpGenericAdaptorBase { |
| 3689 | public: |
| 3690 | struct Properties { |
| 3691 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 3692 | fastmathTy fastmath; |
| 3693 | |
| 3694 | auto getFastmath() const { |
| 3695 | auto &propStorage = this->fastmath; |
| 3696 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 3697 | } |
| 3698 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 3699 | this->fastmath = propValue; |
| 3700 | } |
| 3701 | using roundingmodeTy = ::mlir::arith::RoundingModeAttr; |
| 3702 | roundingmodeTy roundingmode; |
| 3703 | |
| 3704 | auto getRoundingmode() const { |
| 3705 | auto &propStorage = this->roundingmode; |
| 3706 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: propStorage); |
| 3707 | } |
| 3708 | void setRoundingmode(const ::mlir::arith::RoundingModeAttr &propValue) { |
| 3709 | this->roundingmode = propValue; |
| 3710 | } |
| 3711 | bool operator==(const Properties &rhs) const { |
| 3712 | return |
| 3713 | rhs.fastmath == this->fastmath && |
| 3714 | rhs.roundingmode == this->roundingmode && |
| 3715 | true; |
| 3716 | } |
| 3717 | bool operator!=(const Properties &rhs) const { |
| 3718 | return !(*this == rhs); |
| 3719 | } |
| 3720 | }; |
| 3721 | protected: |
| 3722 | ::mlir::DictionaryAttr odsAttrs; |
| 3723 | ::std::optional<::mlir::OperationName> odsOpName; |
| 3724 | Properties properties; |
| 3725 | ::mlir::RegionRange odsRegions; |
| 3726 | public: |
| 3727 | ConvertFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 3728 | odsOpName.emplace(args: "arith.convertf" , args: odsAttrs.getContext()); |
| 3729 | } |
| 3730 | |
| 3731 | ConvertFOpGenericAdaptorBase(ConvertFOp op); |
| 3732 | |
| 3733 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 3734 | return {index, 1}; |
| 3735 | } |
| 3736 | |
| 3737 | const Properties &getProperties() { |
| 3738 | return properties; |
| 3739 | } |
| 3740 | |
| 3741 | ::mlir::DictionaryAttr getAttributes() { |
| 3742 | return odsAttrs; |
| 3743 | } |
| 3744 | |
| 3745 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 3746 | auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: getProperties().roundingmode); |
| 3747 | return attr; |
| 3748 | } |
| 3749 | |
| 3750 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 3751 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 3752 | auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: getProperties().fastmath); |
| 3753 | return attr; |
| 3754 | } |
| 3755 | |
| 3756 | ::std::optional<::mlir::arith::FastMathFlags> getFastmath(); |
| 3757 | }; |
| 3758 | |
| 3759 | } // namespace detail |
| 3760 | template <typename RangeT> |
| 3761 | class ConvertFOpGenericAdaptor : public detail::ConvertFOpGenericAdaptorBase { |
| 3762 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 3763 | using Base = detail::ConvertFOpGenericAdaptorBase; |
| 3764 | static constexpr int odsIndex_in = 0; |
| 3765 | public: |
| 3766 | ConvertFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 3767 | |
| 3768 | ConvertFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ConvertFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 3769 | |
| 3770 | ConvertFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ConvertFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 3771 | |
| 3772 | ConvertFOpGenericAdaptor(RangeT values, const ConvertFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 3773 | |
| 3774 | template <typename LateInst = ConvertFOp, typename = std::enable_if_t<std::is_same_v<LateInst, ConvertFOp>>> |
| 3775 | ConvertFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 3776 | |
| 3777 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3778 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 3779 | } |
| 3780 | |
| 3781 | RangeT getODSOperands(unsigned index) { |
| 3782 | auto valueRange = getODSOperandIndexAndLength(index); |
| 3783 | return {std::next(odsOperands.begin(), valueRange.first), |
| 3784 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 3785 | } |
| 3786 | |
| 3787 | ValueT getIn() { |
| 3788 | return (*getODSOperands(index: 0).begin()); |
| 3789 | } |
| 3790 | |
| 3791 | RangeT getOperands() { |
| 3792 | return odsOperands; |
| 3793 | } |
| 3794 | |
| 3795 | private: |
| 3796 | RangeT odsOperands; |
| 3797 | }; |
| 3798 | class ConvertFOpAdaptor : public ConvertFOpGenericAdaptor<::mlir::ValueRange> { |
| 3799 | public: |
| 3800 | using ConvertFOpGenericAdaptor::ConvertFOpGenericAdaptor; |
| 3801 | ConvertFOpAdaptor(ConvertFOp op); |
| 3802 | |
| 3803 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 3804 | }; |
| 3805 | class ConvertFOp : public ::mlir::Op<ConvertFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::arith::ArithRoundingModeInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 3806 | public: |
| 3807 | using Op::Op; |
| 3808 | using Op::print; |
| 3809 | using Adaptor = ConvertFOpAdaptor; |
| 3810 | template <typename RangeT> |
| 3811 | using GenericAdaptor = ConvertFOpGenericAdaptor<RangeT>; |
| 3812 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 3813 | static constexpr int odsIndex_in = 0; |
| 3814 | static constexpr int odsIndex_out = 0; |
| 3815 | using Properties = FoldAdaptor::Properties; |
| 3816 | using ::mlir::arith::ArithRoundingModeInterface::Trait<ConvertFOp>::getRoundingModeAttr; |
| 3817 | using ::mlir::arith::ArithRoundingModeInterface::Trait<ConvertFOp>::getRoundingModeAttrName; |
| 3818 | using ::mlir::arith::ArithFastMathInterface::Trait<ConvertFOp>::getFastMathFlagsAttr; |
| 3819 | using ::mlir::arith::ArithFastMathInterface::Trait<ConvertFOp>::getFastMathAttrName; |
| 3820 | using ::mlir::VectorUnrollOpInterface::Trait<ConvertFOp>::getIterationShapeToUnroll; |
| 3821 | using ::mlir::VectorUnrollOpInterface::Trait<ConvertFOp>::getDefaultUnrollTargetShape; |
| 3822 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 3823 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" ), ::llvm::StringRef("roundingmode" )}; |
| 3824 | return ::llvm::ArrayRef(attrNames); |
| 3825 | } |
| 3826 | |
| 3827 | ::mlir::StringAttr getFastmathAttrName() { |
| 3828 | return getAttributeNameForIndex(index: 0); |
| 3829 | } |
| 3830 | |
| 3831 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 3832 | return getAttributeNameForIndex(name, index: 0); |
| 3833 | } |
| 3834 | |
| 3835 | ::mlir::StringAttr getRoundingmodeAttrName() { |
| 3836 | return getAttributeNameForIndex(index: 1); |
| 3837 | } |
| 3838 | |
| 3839 | static ::mlir::StringAttr getRoundingmodeAttrName(::mlir::OperationName name) { |
| 3840 | return getAttributeNameForIndex(name, index: 1); |
| 3841 | } |
| 3842 | |
| 3843 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 3844 | return ::llvm::StringLiteral("arith.convertf" ); |
| 3845 | } |
| 3846 | |
| 3847 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 3848 | return {index, 1}; |
| 3849 | } |
| 3850 | |
| 3851 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 3852 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 3853 | return getOperation()->getOperands().slice(n: start, m: length); |
| 3854 | } |
| 3855 | |
| 3856 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 3857 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 3858 | } |
| 3859 | |
| 3860 | ::mlir::OpOperand &getInMutable() { |
| 3861 | auto range = getODSOperandIndexAndLength(index: 0); |
| 3862 | return getOperation()->getOpOperand(idx: range.first); |
| 3863 | } |
| 3864 | |
| 3865 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 3866 | return {index, 1}; |
| 3867 | } |
| 3868 | |
| 3869 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 3870 | auto valueRange = getODSResultIndexAndLength(index); |
| 3871 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 3872 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 3873 | } |
| 3874 | |
| 3875 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 3876 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 3877 | } |
| 3878 | |
| 3879 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3880 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 3881 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 3882 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 3883 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 3884 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 3885 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 3886 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 3887 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 3888 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 3889 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val&: getProperties().roundingmode); |
| 3890 | } |
| 3891 | |
| 3892 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 3893 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 3894 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 3895 | } |
| 3896 | |
| 3897 | ::std::optional<::mlir::arith::FastMathFlags> getFastmath(); |
| 3898 | void setRoundingmodeAttr(::mlir::arith::RoundingModeAttr attr) { |
| 3899 | getProperties().roundingmode = attr; |
| 3900 | } |
| 3901 | |
| 3902 | void setRoundingmode(::std::optional<::mlir::arith::RoundingMode> attrValue); |
| 3903 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 3904 | getProperties().fastmath = attr; |
| 3905 | } |
| 3906 | |
| 3907 | void setFastmath(::std::optional<::mlir::arith::FastMathFlags> attrValue); |
| 3908 | ::mlir::Attribute removeRoundingmodeAttr() { |
| 3909 | auto attr = getProperties().roundingmode; |
| 3910 | getProperties().roundingmode = {}; |
| 3911 | return attr; |
| 3912 | } |
| 3913 | |
| 3914 | ::mlir::Attribute removeFastmathAttr() { |
| 3915 | auto attr = getProperties().fastmath; |
| 3916 | getProperties().fastmath = {}; |
| 3917 | return attr; |
| 3918 | } |
| 3919 | |
| 3920 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 3921 | static ConvertFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 3922 | static ConvertFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 3923 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 3924 | static ConvertFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 3925 | static ConvertFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 3926 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3927 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3928 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3929 | static ConvertFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3930 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 3931 | static ConvertFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 3932 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3933 | static ConvertFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3934 | static ConvertFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 3935 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 3936 | ::llvm::LogicalResult verifyInvariants(); |
| 3937 | ::llvm::LogicalResult verify(); |
| 3938 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 3939 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 3940 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 3941 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 3942 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 3943 | private: |
| 3944 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 3945 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 3946 | } |
| 3947 | |
| 3948 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 3949 | assert(index < 2 && "invalid attribute index" ); |
| 3950 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 3951 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 3952 | "dependent dialect loading?" ); |
| 3953 | return name.getAttributeNames()[index]; |
| 3954 | } |
| 3955 | |
| 3956 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 3957 | public: |
| 3958 | }; |
| 3959 | |
| 3960 | } // namespace mlir::arith |
| 3961 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::ConvertFOp) |
| 3962 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::ConvertFOpGenericAdaptorBase::Properties) |
| 3963 | |
| 3964 | namespace mlir::arith { |
| 3965 | |
| 3966 | |
| 3967 | //===----------------------------------------------------------------------===// |
| 3968 | // ::mlir::arith::DivFOp declarations |
| 3969 | //===----------------------------------------------------------------------===// |
| 3970 | |
| 3971 | namespace detail { |
| 3972 | |
| 3973 | class DivFOpGenericAdaptorBase { |
| 3974 | public: |
| 3975 | struct Properties { |
| 3976 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 3977 | fastmathTy fastmath; |
| 3978 | |
| 3979 | auto getFastmath() const { |
| 3980 | auto &propStorage = this->fastmath; |
| 3981 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 3982 | } |
| 3983 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 3984 | this->fastmath = propValue; |
| 3985 | } |
| 3986 | using roundingmodeTy = ::mlir::arith::RoundingModeAttr; |
| 3987 | roundingmodeTy roundingmode; |
| 3988 | |
| 3989 | auto getRoundingmode() const { |
| 3990 | auto &propStorage = this->roundingmode; |
| 3991 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: propStorage); |
| 3992 | } |
| 3993 | void setRoundingmode(const ::mlir::arith::RoundingModeAttr &propValue) { |
| 3994 | this->roundingmode = propValue; |
| 3995 | } |
| 3996 | bool operator==(const Properties &rhs) const { |
| 3997 | return |
| 3998 | rhs.fastmath == this->fastmath && |
| 3999 | rhs.roundingmode == this->roundingmode && |
| 4000 | true; |
| 4001 | } |
| 4002 | bool operator!=(const Properties &rhs) const { |
| 4003 | return !(*this == rhs); |
| 4004 | } |
| 4005 | }; |
| 4006 | protected: |
| 4007 | ::mlir::DictionaryAttr odsAttrs; |
| 4008 | ::std::optional<::mlir::OperationName> odsOpName; |
| 4009 | Properties properties; |
| 4010 | ::mlir::RegionRange odsRegions; |
| 4011 | public: |
| 4012 | DivFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 4013 | odsOpName.emplace(args: "arith.divf" , args: odsAttrs.getContext()); |
| 4014 | } |
| 4015 | |
| 4016 | DivFOpGenericAdaptorBase(DivFOp op); |
| 4017 | |
| 4018 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 4019 | return {index, 1}; |
| 4020 | } |
| 4021 | |
| 4022 | const Properties &getProperties() { |
| 4023 | return properties; |
| 4024 | } |
| 4025 | |
| 4026 | ::mlir::DictionaryAttr getAttributes() { |
| 4027 | return odsAttrs; |
| 4028 | } |
| 4029 | |
| 4030 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 4031 | ::mlir::arith::FastMathFlags getFastmath(); |
| 4032 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 4033 | auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: getProperties().roundingmode); |
| 4034 | return attr; |
| 4035 | } |
| 4036 | |
| 4037 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 4038 | }; |
| 4039 | |
| 4040 | } // namespace detail |
| 4041 | template <typename RangeT> |
| 4042 | class DivFOpGenericAdaptor : public detail::DivFOpGenericAdaptorBase { |
| 4043 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 4044 | using Base = detail::DivFOpGenericAdaptorBase; |
| 4045 | static constexpr int odsIndex_lhs = 0; |
| 4046 | static constexpr int odsIndex_rhs = 1; |
| 4047 | public: |
| 4048 | DivFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 4049 | |
| 4050 | DivFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : DivFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 4051 | |
| 4052 | DivFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : DivFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 4053 | |
| 4054 | DivFOpGenericAdaptor(RangeT values, const DivFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 4055 | |
| 4056 | template <typename LateInst = DivFOp, typename = std::enable_if_t<std::is_same_v<LateInst, DivFOp>>> |
| 4057 | DivFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 4058 | |
| 4059 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4060 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 4061 | } |
| 4062 | |
| 4063 | RangeT getODSOperands(unsigned index) { |
| 4064 | auto valueRange = getODSOperandIndexAndLength(index); |
| 4065 | return {std::next(odsOperands.begin(), valueRange.first), |
| 4066 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 4067 | } |
| 4068 | |
| 4069 | ValueT getLhs() { |
| 4070 | return (*getODSOperands(index: 0).begin()); |
| 4071 | } |
| 4072 | |
| 4073 | ValueT getRhs() { |
| 4074 | return (*getODSOperands(index: 1).begin()); |
| 4075 | } |
| 4076 | |
| 4077 | RangeT getOperands() { |
| 4078 | return odsOperands; |
| 4079 | } |
| 4080 | |
| 4081 | private: |
| 4082 | RangeT odsOperands; |
| 4083 | }; |
| 4084 | class DivFOpAdaptor : public DivFOpGenericAdaptor<::mlir::ValueRange> { |
| 4085 | public: |
| 4086 | using DivFOpGenericAdaptor::DivFOpGenericAdaptor; |
| 4087 | DivFOpAdaptor(DivFOp op); |
| 4088 | |
| 4089 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 4090 | }; |
| 4091 | class DivFOp : public ::mlir::Op<DivFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::arith::ArithRoundingModeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 4092 | public: |
| 4093 | using Op::Op; |
| 4094 | using Op::print; |
| 4095 | using Adaptor = DivFOpAdaptor; |
| 4096 | template <typename RangeT> |
| 4097 | using GenericAdaptor = DivFOpGenericAdaptor<RangeT>; |
| 4098 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 4099 | static constexpr int odsIndex_lhs = 0; |
| 4100 | static constexpr int odsIndex_rhs = 1; |
| 4101 | static constexpr int odsIndex_result = 0; |
| 4102 | using Properties = FoldAdaptor::Properties; |
| 4103 | using ::mlir::arith::ArithFastMathInterface::Trait<DivFOp>::getFastMathFlagsAttr; |
| 4104 | using ::mlir::arith::ArithFastMathInterface::Trait<DivFOp>::getFastMathAttrName; |
| 4105 | using ::mlir::arith::ArithRoundingModeInterface::Trait<DivFOp>::getRoundingModeAttr; |
| 4106 | using ::mlir::arith::ArithRoundingModeInterface::Trait<DivFOp>::getRoundingModeAttrName; |
| 4107 | using ::mlir::VectorUnrollOpInterface::Trait<DivFOp>::getIterationShapeToUnroll; |
| 4108 | using ::mlir::VectorUnrollOpInterface::Trait<DivFOp>::getDefaultUnrollTargetShape; |
| 4109 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 4110 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" ), ::llvm::StringRef("roundingmode" )}; |
| 4111 | return ::llvm::ArrayRef(attrNames); |
| 4112 | } |
| 4113 | |
| 4114 | ::mlir::StringAttr getFastmathAttrName() { |
| 4115 | return getAttributeNameForIndex(index: 0); |
| 4116 | } |
| 4117 | |
| 4118 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 4119 | return getAttributeNameForIndex(name, index: 0); |
| 4120 | } |
| 4121 | |
| 4122 | ::mlir::StringAttr getRoundingmodeAttrName() { |
| 4123 | return getAttributeNameForIndex(index: 1); |
| 4124 | } |
| 4125 | |
| 4126 | static ::mlir::StringAttr getRoundingmodeAttrName(::mlir::OperationName name) { |
| 4127 | return getAttributeNameForIndex(name, index: 1); |
| 4128 | } |
| 4129 | |
| 4130 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 4131 | return ::llvm::StringLiteral("arith.divf" ); |
| 4132 | } |
| 4133 | |
| 4134 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4135 | return {index, 1}; |
| 4136 | } |
| 4137 | |
| 4138 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 4139 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 4140 | return getOperation()->getOperands().slice(n: start, m: length); |
| 4141 | } |
| 4142 | |
| 4143 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 4144 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 4145 | } |
| 4146 | |
| 4147 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 4148 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 4149 | } |
| 4150 | |
| 4151 | ::mlir::OpOperand &getLhsMutable() { |
| 4152 | auto range = getODSOperandIndexAndLength(index: 0); |
| 4153 | return getOperation()->getOpOperand(idx: range.first); |
| 4154 | } |
| 4155 | |
| 4156 | ::mlir::OpOperand &getRhsMutable() { |
| 4157 | auto range = getODSOperandIndexAndLength(index: 1); |
| 4158 | return getOperation()->getOpOperand(idx: range.first); |
| 4159 | } |
| 4160 | |
| 4161 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 4162 | return {index, 1}; |
| 4163 | } |
| 4164 | |
| 4165 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 4166 | auto valueRange = getODSResultIndexAndLength(index); |
| 4167 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 4168 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 4169 | } |
| 4170 | |
| 4171 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 4172 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 4173 | } |
| 4174 | |
| 4175 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4176 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 4177 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 4178 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 4179 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 4180 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 4181 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4182 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 4183 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 4184 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 4185 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 4186 | } |
| 4187 | |
| 4188 | ::mlir::arith::FastMathFlags getFastmath(); |
| 4189 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 4190 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val&: getProperties().roundingmode); |
| 4191 | } |
| 4192 | |
| 4193 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 4194 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 4195 | getProperties().fastmath = attr; |
| 4196 | } |
| 4197 | |
| 4198 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 4199 | void setRoundingmodeAttr(::mlir::arith::RoundingModeAttr attr) { |
| 4200 | getProperties().roundingmode = attr; |
| 4201 | } |
| 4202 | |
| 4203 | void setRoundingmode(::std::optional<::mlir::arith::RoundingMode> attrValue); |
| 4204 | ::mlir::Attribute removeRoundingmodeAttr() { |
| 4205 | auto attr = getProperties().roundingmode; |
| 4206 | getProperties().roundingmode = {}; |
| 4207 | return attr; |
| 4208 | } |
| 4209 | |
| 4210 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 4211 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 4212 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 4213 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value lhs, Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 4214 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value lhs, Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 4215 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, Value lhs, Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 4216 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type type, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 4217 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Type type, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 4218 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, Type type, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 4219 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4220 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4221 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4222 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4223 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4224 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4225 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4226 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4227 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4228 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4229 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4230 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4231 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4232 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4233 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4234 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4235 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4236 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 4237 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4238 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4239 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4240 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4241 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4242 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4243 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4244 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4245 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4246 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4247 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4248 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4249 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4250 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4251 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4252 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4253 | static DivFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4254 | static DivFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4255 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 4256 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 4257 | ::llvm::LogicalResult verifyInvariants(); |
| 4258 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 4259 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 4260 | 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); |
| 4261 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 4262 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 4263 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 4264 | private: |
| 4265 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 4266 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 4267 | } |
| 4268 | |
| 4269 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 4270 | assert(index < 2 && "invalid attribute index" ); |
| 4271 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 4272 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 4273 | "dependent dialect loading?" ); |
| 4274 | return name.getAttributeNames()[index]; |
| 4275 | } |
| 4276 | |
| 4277 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 4278 | public: |
| 4279 | }; |
| 4280 | |
| 4281 | } // namespace mlir::arith |
| 4282 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::DivFOp) |
| 4283 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::DivFOpGenericAdaptorBase::Properties) |
| 4284 | |
| 4285 | namespace mlir::arith { |
| 4286 | |
| 4287 | |
| 4288 | //===----------------------------------------------------------------------===// |
| 4289 | // ::mlir::arith::DivSIOp declarations |
| 4290 | //===----------------------------------------------------------------------===// |
| 4291 | |
| 4292 | namespace detail { |
| 4293 | |
| 4294 | class DivSIOpGenericAdaptorBase { |
| 4295 | public: |
| 4296 | struct Properties { |
| 4297 | using isExactTy = ::mlir::UnitAttr; |
| 4298 | isExactTy isExact; |
| 4299 | |
| 4300 | auto getIsExact() const { |
| 4301 | auto &propStorage = this->isExact; |
| 4302 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val: propStorage); |
| 4303 | } |
| 4304 | void setIsExact(const ::mlir::UnitAttr &propValue) { |
| 4305 | this->isExact = propValue; |
| 4306 | } |
| 4307 | bool operator==(const Properties &rhs) const { |
| 4308 | return |
| 4309 | rhs.isExact == this->isExact && |
| 4310 | true; |
| 4311 | } |
| 4312 | bool operator!=(const Properties &rhs) const { |
| 4313 | return !(*this == rhs); |
| 4314 | } |
| 4315 | }; |
| 4316 | protected: |
| 4317 | ::mlir::DictionaryAttr odsAttrs; |
| 4318 | ::std::optional<::mlir::OperationName> odsOpName; |
| 4319 | Properties properties; |
| 4320 | ::mlir::RegionRange odsRegions; |
| 4321 | public: |
| 4322 | DivSIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 4323 | odsOpName.emplace(args: "arith.divsi" , args: odsAttrs.getContext()); |
| 4324 | } |
| 4325 | |
| 4326 | DivSIOpGenericAdaptorBase(DivSIOp op); |
| 4327 | |
| 4328 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 4329 | return {index, 1}; |
| 4330 | } |
| 4331 | |
| 4332 | const Properties &getProperties() { |
| 4333 | return properties; |
| 4334 | } |
| 4335 | |
| 4336 | ::mlir::DictionaryAttr getAttributes() { |
| 4337 | return odsAttrs; |
| 4338 | } |
| 4339 | |
| 4340 | ::mlir::UnitAttr getIsExactAttr(); |
| 4341 | bool getIsExact(); |
| 4342 | }; |
| 4343 | |
| 4344 | } // namespace detail |
| 4345 | template <typename RangeT> |
| 4346 | class DivSIOpGenericAdaptor : public detail::DivSIOpGenericAdaptorBase { |
| 4347 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 4348 | using Base = detail::DivSIOpGenericAdaptorBase; |
| 4349 | static constexpr int odsIndex_lhs = 0; |
| 4350 | static constexpr int odsIndex_rhs = 1; |
| 4351 | public: |
| 4352 | DivSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 4353 | |
| 4354 | DivSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : DivSIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 4355 | |
| 4356 | DivSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : DivSIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 4357 | |
| 4358 | DivSIOpGenericAdaptor(RangeT values, const DivSIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 4359 | |
| 4360 | template <typename LateInst = DivSIOp, typename = std::enable_if_t<std::is_same_v<LateInst, DivSIOp>>> |
| 4361 | DivSIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 4362 | |
| 4363 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4364 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 4365 | } |
| 4366 | |
| 4367 | RangeT getODSOperands(unsigned index) { |
| 4368 | auto valueRange = getODSOperandIndexAndLength(index); |
| 4369 | return {std::next(odsOperands.begin(), valueRange.first), |
| 4370 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 4371 | } |
| 4372 | |
| 4373 | ValueT getLhs() { |
| 4374 | return (*getODSOperands(index: 0).begin()); |
| 4375 | } |
| 4376 | |
| 4377 | ValueT getRhs() { |
| 4378 | return (*getODSOperands(index: 1).begin()); |
| 4379 | } |
| 4380 | |
| 4381 | RangeT getOperands() { |
| 4382 | return odsOperands; |
| 4383 | } |
| 4384 | |
| 4385 | private: |
| 4386 | RangeT odsOperands; |
| 4387 | }; |
| 4388 | class DivSIOpAdaptor : public DivSIOpGenericAdaptor<::mlir::ValueRange> { |
| 4389 | public: |
| 4390 | using DivSIOpGenericAdaptor::DivSIOpGenericAdaptor; |
| 4391 | DivSIOpAdaptor(DivSIOp op); |
| 4392 | |
| 4393 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 4394 | }; |
| 4395 | class DivSIOp : public ::mlir::Op<DivSIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 4396 | public: |
| 4397 | using Op::Op; |
| 4398 | using Op::print; |
| 4399 | using Adaptor = DivSIOpAdaptor; |
| 4400 | template <typename RangeT> |
| 4401 | using GenericAdaptor = DivSIOpGenericAdaptor<RangeT>; |
| 4402 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 4403 | static constexpr int odsIndex_lhs = 0; |
| 4404 | static constexpr int odsIndex_rhs = 1; |
| 4405 | static constexpr int odsIndex_result = 0; |
| 4406 | using Properties = FoldAdaptor::Properties; |
| 4407 | using ::mlir::InferIntRangeInterface::Trait<DivSIOp>::inferResultRangesFromOptional; |
| 4408 | using ::mlir::VectorUnrollOpInterface::Trait<DivSIOp>::getIterationShapeToUnroll; |
| 4409 | using ::mlir::VectorUnrollOpInterface::Trait<DivSIOp>::getDefaultUnrollTargetShape; |
| 4410 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 4411 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("isExact" )}; |
| 4412 | return ::llvm::ArrayRef(attrNames); |
| 4413 | } |
| 4414 | |
| 4415 | ::mlir::StringAttr getIsExactAttrName() { |
| 4416 | return getAttributeNameForIndex(index: 0); |
| 4417 | } |
| 4418 | |
| 4419 | static ::mlir::StringAttr getIsExactAttrName(::mlir::OperationName name) { |
| 4420 | return getAttributeNameForIndex(name, index: 0); |
| 4421 | } |
| 4422 | |
| 4423 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 4424 | return ::llvm::StringLiteral("arith.divsi" ); |
| 4425 | } |
| 4426 | |
| 4427 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4428 | return {index, 1}; |
| 4429 | } |
| 4430 | |
| 4431 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 4432 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 4433 | return getOperation()->getOperands().slice(n: start, m: length); |
| 4434 | } |
| 4435 | |
| 4436 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 4437 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 4438 | } |
| 4439 | |
| 4440 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 4441 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 4442 | } |
| 4443 | |
| 4444 | ::mlir::OpOperand &getLhsMutable() { |
| 4445 | auto range = getODSOperandIndexAndLength(index: 0); |
| 4446 | return getOperation()->getOpOperand(idx: range.first); |
| 4447 | } |
| 4448 | |
| 4449 | ::mlir::OpOperand &getRhsMutable() { |
| 4450 | auto range = getODSOperandIndexAndLength(index: 1); |
| 4451 | return getOperation()->getOpOperand(idx: range.first); |
| 4452 | } |
| 4453 | |
| 4454 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 4455 | return {index, 1}; |
| 4456 | } |
| 4457 | |
| 4458 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 4459 | auto valueRange = getODSResultIndexAndLength(index); |
| 4460 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 4461 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 4462 | } |
| 4463 | |
| 4464 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 4465 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 4466 | } |
| 4467 | |
| 4468 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4469 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 4470 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 4471 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 4472 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 4473 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 4474 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4475 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 4476 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 4477 | ::mlir::UnitAttr getIsExactAttr() { |
| 4478 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val&: getProperties().isExact); |
| 4479 | } |
| 4480 | |
| 4481 | bool getIsExact(); |
| 4482 | void setIsExactAttr(::mlir::UnitAttr attr) { |
| 4483 | getProperties().isExact = attr; |
| 4484 | } |
| 4485 | |
| 4486 | void setIsExact(bool attrValue); |
| 4487 | ::mlir::Attribute removeIsExactAttr() { |
| 4488 | auto attr = getProperties().isExact; |
| 4489 | getProperties().isExact = {}; |
| 4490 | return attr; |
| 4491 | } |
| 4492 | |
| 4493 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4494 | static DivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4495 | static DivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4496 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4497 | static DivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4498 | static DivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4499 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4500 | static DivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4501 | static DivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4502 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4503 | static DivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4504 | static DivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4505 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4506 | static DivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4507 | static DivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4508 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4509 | static DivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4510 | static DivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4511 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4512 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4513 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4514 | static DivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4515 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4516 | static DivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4517 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4518 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4519 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4520 | static DivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4521 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4522 | static DivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4523 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4524 | static DivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4525 | static DivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4526 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4527 | static DivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4528 | static DivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4529 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 4530 | ::llvm::LogicalResult verifyInvariants(); |
| 4531 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 4532 | 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); |
| 4533 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 4534 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 4535 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 4536 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 4537 | private: |
| 4538 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 4539 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 4540 | } |
| 4541 | |
| 4542 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 4543 | assert(index < 1 && "invalid attribute index" ); |
| 4544 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 4545 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 4546 | "dependent dialect loading?" ); |
| 4547 | return name.getAttributeNames()[index]; |
| 4548 | } |
| 4549 | |
| 4550 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 4551 | public: |
| 4552 | /// Interface method for ConditionallySpeculatable. |
| 4553 | Speculation::Speculatability getSpeculatability(); |
| 4554 | }; |
| 4555 | |
| 4556 | } // namespace mlir::arith |
| 4557 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::DivSIOp) |
| 4558 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::DivSIOpGenericAdaptorBase::Properties) |
| 4559 | |
| 4560 | namespace mlir::arith { |
| 4561 | |
| 4562 | |
| 4563 | //===----------------------------------------------------------------------===// |
| 4564 | // ::mlir::arith::DivUIOp declarations |
| 4565 | //===----------------------------------------------------------------------===// |
| 4566 | |
| 4567 | namespace detail { |
| 4568 | |
| 4569 | class DivUIOpGenericAdaptorBase { |
| 4570 | public: |
| 4571 | struct Properties { |
| 4572 | using isExactTy = ::mlir::UnitAttr; |
| 4573 | isExactTy isExact; |
| 4574 | |
| 4575 | auto getIsExact() const { |
| 4576 | auto &propStorage = this->isExact; |
| 4577 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val: propStorage); |
| 4578 | } |
| 4579 | void setIsExact(const ::mlir::UnitAttr &propValue) { |
| 4580 | this->isExact = propValue; |
| 4581 | } |
| 4582 | bool operator==(const Properties &rhs) const { |
| 4583 | return |
| 4584 | rhs.isExact == this->isExact && |
| 4585 | true; |
| 4586 | } |
| 4587 | bool operator!=(const Properties &rhs) const { |
| 4588 | return !(*this == rhs); |
| 4589 | } |
| 4590 | }; |
| 4591 | protected: |
| 4592 | ::mlir::DictionaryAttr odsAttrs; |
| 4593 | ::std::optional<::mlir::OperationName> odsOpName; |
| 4594 | Properties properties; |
| 4595 | ::mlir::RegionRange odsRegions; |
| 4596 | public: |
| 4597 | DivUIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 4598 | odsOpName.emplace(args: "arith.divui" , args: odsAttrs.getContext()); |
| 4599 | } |
| 4600 | |
| 4601 | DivUIOpGenericAdaptorBase(DivUIOp op); |
| 4602 | |
| 4603 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 4604 | return {index, 1}; |
| 4605 | } |
| 4606 | |
| 4607 | const Properties &getProperties() { |
| 4608 | return properties; |
| 4609 | } |
| 4610 | |
| 4611 | ::mlir::DictionaryAttr getAttributes() { |
| 4612 | return odsAttrs; |
| 4613 | } |
| 4614 | |
| 4615 | ::mlir::UnitAttr getIsExactAttr(); |
| 4616 | bool getIsExact(); |
| 4617 | }; |
| 4618 | |
| 4619 | } // namespace detail |
| 4620 | template <typename RangeT> |
| 4621 | class DivUIOpGenericAdaptor : public detail::DivUIOpGenericAdaptorBase { |
| 4622 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 4623 | using Base = detail::DivUIOpGenericAdaptorBase; |
| 4624 | static constexpr int odsIndex_lhs = 0; |
| 4625 | static constexpr int odsIndex_rhs = 1; |
| 4626 | public: |
| 4627 | DivUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 4628 | |
| 4629 | DivUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : DivUIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 4630 | |
| 4631 | DivUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : DivUIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 4632 | |
| 4633 | DivUIOpGenericAdaptor(RangeT values, const DivUIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 4634 | |
| 4635 | template <typename LateInst = DivUIOp, typename = std::enable_if_t<std::is_same_v<LateInst, DivUIOp>>> |
| 4636 | DivUIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 4637 | |
| 4638 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4639 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 4640 | } |
| 4641 | |
| 4642 | RangeT getODSOperands(unsigned index) { |
| 4643 | auto valueRange = getODSOperandIndexAndLength(index); |
| 4644 | return {std::next(odsOperands.begin(), valueRange.first), |
| 4645 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 4646 | } |
| 4647 | |
| 4648 | ValueT getLhs() { |
| 4649 | return (*getODSOperands(index: 0).begin()); |
| 4650 | } |
| 4651 | |
| 4652 | ValueT getRhs() { |
| 4653 | return (*getODSOperands(index: 1).begin()); |
| 4654 | } |
| 4655 | |
| 4656 | RangeT getOperands() { |
| 4657 | return odsOperands; |
| 4658 | } |
| 4659 | |
| 4660 | private: |
| 4661 | RangeT odsOperands; |
| 4662 | }; |
| 4663 | class DivUIOpAdaptor : public DivUIOpGenericAdaptor<::mlir::ValueRange> { |
| 4664 | public: |
| 4665 | using DivUIOpGenericAdaptor::DivUIOpGenericAdaptor; |
| 4666 | DivUIOpAdaptor(DivUIOp op); |
| 4667 | |
| 4668 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 4669 | }; |
| 4670 | class DivUIOp : public ::mlir::Op<DivUIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::InferIntDivisibilityOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 4671 | public: |
| 4672 | using Op::Op; |
| 4673 | using Op::print; |
| 4674 | using Adaptor = DivUIOpAdaptor; |
| 4675 | template <typename RangeT> |
| 4676 | using GenericAdaptor = DivUIOpGenericAdaptor<RangeT>; |
| 4677 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 4678 | static constexpr int odsIndex_lhs = 0; |
| 4679 | static constexpr int odsIndex_rhs = 1; |
| 4680 | static constexpr int odsIndex_result = 0; |
| 4681 | using Properties = FoldAdaptor::Properties; |
| 4682 | using ::mlir::InferIntRangeInterface::Trait<DivUIOp>::inferResultRangesFromOptional; |
| 4683 | using ::mlir::VectorUnrollOpInterface::Trait<DivUIOp>::getIterationShapeToUnroll; |
| 4684 | using ::mlir::VectorUnrollOpInterface::Trait<DivUIOp>::getDefaultUnrollTargetShape; |
| 4685 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 4686 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("isExact" )}; |
| 4687 | return ::llvm::ArrayRef(attrNames); |
| 4688 | } |
| 4689 | |
| 4690 | ::mlir::StringAttr getIsExactAttrName() { |
| 4691 | return getAttributeNameForIndex(index: 0); |
| 4692 | } |
| 4693 | |
| 4694 | static ::mlir::StringAttr getIsExactAttrName(::mlir::OperationName name) { |
| 4695 | return getAttributeNameForIndex(name, index: 0); |
| 4696 | } |
| 4697 | |
| 4698 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 4699 | return ::llvm::StringLiteral("arith.divui" ); |
| 4700 | } |
| 4701 | |
| 4702 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4703 | return {index, 1}; |
| 4704 | } |
| 4705 | |
| 4706 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 4707 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 4708 | return getOperation()->getOperands().slice(n: start, m: length); |
| 4709 | } |
| 4710 | |
| 4711 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 4712 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 4713 | } |
| 4714 | |
| 4715 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 4716 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 4717 | } |
| 4718 | |
| 4719 | ::mlir::OpOperand &getLhsMutable() { |
| 4720 | auto range = getODSOperandIndexAndLength(index: 0); |
| 4721 | return getOperation()->getOpOperand(idx: range.first); |
| 4722 | } |
| 4723 | |
| 4724 | ::mlir::OpOperand &getRhsMutable() { |
| 4725 | auto range = getODSOperandIndexAndLength(index: 1); |
| 4726 | return getOperation()->getOpOperand(idx: range.first); |
| 4727 | } |
| 4728 | |
| 4729 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 4730 | return {index, 1}; |
| 4731 | } |
| 4732 | |
| 4733 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 4734 | auto valueRange = getODSResultIndexAndLength(index); |
| 4735 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 4736 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 4737 | } |
| 4738 | |
| 4739 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 4740 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 4741 | } |
| 4742 | |
| 4743 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4744 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 4745 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 4746 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 4747 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 4748 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 4749 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 4750 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 4751 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 4752 | ::mlir::UnitAttr getIsExactAttr() { |
| 4753 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val&: getProperties().isExact); |
| 4754 | } |
| 4755 | |
| 4756 | bool getIsExact(); |
| 4757 | void setIsExactAttr(::mlir::UnitAttr attr) { |
| 4758 | getProperties().isExact = attr; |
| 4759 | } |
| 4760 | |
| 4761 | void setIsExact(bool attrValue); |
| 4762 | ::mlir::Attribute removeIsExactAttr() { |
| 4763 | auto attr = getProperties().isExact; |
| 4764 | getProperties().isExact = {}; |
| 4765 | return attr; |
| 4766 | } |
| 4767 | |
| 4768 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4769 | static DivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4770 | static DivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4771 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4772 | static DivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4773 | static DivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4774 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4775 | static DivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4776 | static DivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 4777 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4778 | static DivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4779 | static DivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4780 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4781 | static DivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4782 | static DivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4783 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4784 | static DivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4785 | static DivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 4786 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4787 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4788 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4789 | static DivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4790 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4791 | static DivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4792 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4793 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4794 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4795 | static DivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4796 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 4797 | static DivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 4798 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4799 | static DivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4800 | static DivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4801 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4802 | static DivUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4803 | static DivUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 4804 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 4805 | ::llvm::LogicalResult verifyInvariants(); |
| 4806 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 4807 | 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); |
| 4808 | void inferResultDivisibility(::llvm::ArrayRef<::mlir::IntegerDivisibility> argDivs, ::mlir::SetIntDivisibilityFn setResultDivs); |
| 4809 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 4810 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 4811 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 4812 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 4813 | private: |
| 4814 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 4815 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 4816 | } |
| 4817 | |
| 4818 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 4819 | assert(index < 1 && "invalid attribute index" ); |
| 4820 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 4821 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 4822 | "dependent dialect loading?" ); |
| 4823 | return name.getAttributeNames()[index]; |
| 4824 | } |
| 4825 | |
| 4826 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 4827 | public: |
| 4828 | /// Interface method for ConditionallySpeculatable. |
| 4829 | Speculation::Speculatability getSpeculatability(); |
| 4830 | }; |
| 4831 | |
| 4832 | } // namespace mlir::arith |
| 4833 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::DivUIOp) |
| 4834 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::DivUIOpGenericAdaptorBase::Properties) |
| 4835 | |
| 4836 | namespace mlir::arith { |
| 4837 | |
| 4838 | |
| 4839 | //===----------------------------------------------------------------------===// |
| 4840 | // ::mlir::arith::ExtFOp declarations |
| 4841 | //===----------------------------------------------------------------------===// |
| 4842 | |
| 4843 | namespace detail { |
| 4844 | |
| 4845 | class ExtFOpGenericAdaptorBase { |
| 4846 | public: |
| 4847 | struct Properties { |
| 4848 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 4849 | fastmathTy fastmath; |
| 4850 | |
| 4851 | auto getFastmath() const { |
| 4852 | auto &propStorage = this->fastmath; |
| 4853 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 4854 | } |
| 4855 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 4856 | this->fastmath = propValue; |
| 4857 | } |
| 4858 | bool operator==(const Properties &rhs) const { |
| 4859 | return |
| 4860 | rhs.fastmath == this->fastmath && |
| 4861 | true; |
| 4862 | } |
| 4863 | bool operator!=(const Properties &rhs) const { |
| 4864 | return !(*this == rhs); |
| 4865 | } |
| 4866 | }; |
| 4867 | protected: |
| 4868 | ::mlir::DictionaryAttr odsAttrs; |
| 4869 | ::std::optional<::mlir::OperationName> odsOpName; |
| 4870 | Properties properties; |
| 4871 | ::mlir::RegionRange odsRegions; |
| 4872 | public: |
| 4873 | ExtFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 4874 | odsOpName.emplace(args: "arith.extf" , args: odsAttrs.getContext()); |
| 4875 | } |
| 4876 | |
| 4877 | ExtFOpGenericAdaptorBase(ExtFOp op); |
| 4878 | |
| 4879 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 4880 | return {index, 1}; |
| 4881 | } |
| 4882 | |
| 4883 | const Properties &getProperties() { |
| 4884 | return properties; |
| 4885 | } |
| 4886 | |
| 4887 | ::mlir::DictionaryAttr getAttributes() { |
| 4888 | return odsAttrs; |
| 4889 | } |
| 4890 | |
| 4891 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 4892 | auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: getProperties().fastmath); |
| 4893 | return attr; |
| 4894 | } |
| 4895 | |
| 4896 | ::std::optional<::mlir::arith::FastMathFlags> getFastmath(); |
| 4897 | }; |
| 4898 | |
| 4899 | } // namespace detail |
| 4900 | template <typename RangeT> |
| 4901 | class ExtFOpGenericAdaptor : public detail::ExtFOpGenericAdaptorBase { |
| 4902 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 4903 | using Base = detail::ExtFOpGenericAdaptorBase; |
| 4904 | static constexpr int odsIndex_in = 0; |
| 4905 | public: |
| 4906 | ExtFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 4907 | |
| 4908 | ExtFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ExtFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 4909 | |
| 4910 | ExtFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ExtFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 4911 | |
| 4912 | ExtFOpGenericAdaptor(RangeT values, const ExtFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 4913 | |
| 4914 | template <typename LateInst = ExtFOp, typename = std::enable_if_t<std::is_same_v<LateInst, ExtFOp>>> |
| 4915 | ExtFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 4916 | |
| 4917 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4918 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 4919 | } |
| 4920 | |
| 4921 | RangeT getODSOperands(unsigned index) { |
| 4922 | auto valueRange = getODSOperandIndexAndLength(index); |
| 4923 | return {std::next(odsOperands.begin(), valueRange.first), |
| 4924 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 4925 | } |
| 4926 | |
| 4927 | ValueT getIn() { |
| 4928 | return (*getODSOperands(index: 0).begin()); |
| 4929 | } |
| 4930 | |
| 4931 | RangeT getOperands() { |
| 4932 | return odsOperands; |
| 4933 | } |
| 4934 | |
| 4935 | private: |
| 4936 | RangeT odsOperands; |
| 4937 | }; |
| 4938 | class ExtFOpAdaptor : public ExtFOpGenericAdaptor<::mlir::ValueRange> { |
| 4939 | public: |
| 4940 | using ExtFOpGenericAdaptor::ExtFOpGenericAdaptor; |
| 4941 | ExtFOpAdaptor(ExtFOp op); |
| 4942 | |
| 4943 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 4944 | }; |
| 4945 | class ExtFOp : public ::mlir::Op<ExtFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 4946 | public: |
| 4947 | using Op::Op; |
| 4948 | using Op::print; |
| 4949 | using Adaptor = ExtFOpAdaptor; |
| 4950 | template <typename RangeT> |
| 4951 | using GenericAdaptor = ExtFOpGenericAdaptor<RangeT>; |
| 4952 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 4953 | static constexpr int odsIndex_in = 0; |
| 4954 | static constexpr int odsIndex_out = 0; |
| 4955 | using Properties = FoldAdaptor::Properties; |
| 4956 | using ::mlir::arith::ArithFastMathInterface::Trait<ExtFOp>::getFastMathFlagsAttr; |
| 4957 | using ::mlir::arith::ArithFastMathInterface::Trait<ExtFOp>::getFastMathAttrName; |
| 4958 | using ::mlir::VectorUnrollOpInterface::Trait<ExtFOp>::getIterationShapeToUnroll; |
| 4959 | using ::mlir::VectorUnrollOpInterface::Trait<ExtFOp>::getDefaultUnrollTargetShape; |
| 4960 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 4961 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" )}; |
| 4962 | return ::llvm::ArrayRef(attrNames); |
| 4963 | } |
| 4964 | |
| 4965 | ::mlir::StringAttr getFastmathAttrName() { |
| 4966 | return getAttributeNameForIndex(index: 0); |
| 4967 | } |
| 4968 | |
| 4969 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 4970 | return getAttributeNameForIndex(name, index: 0); |
| 4971 | } |
| 4972 | |
| 4973 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 4974 | return ::llvm::StringLiteral("arith.extf" ); |
| 4975 | } |
| 4976 | |
| 4977 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 4978 | return {index, 1}; |
| 4979 | } |
| 4980 | |
| 4981 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 4982 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 4983 | return getOperation()->getOperands().slice(n: start, m: length); |
| 4984 | } |
| 4985 | |
| 4986 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 4987 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 4988 | } |
| 4989 | |
| 4990 | ::mlir::OpOperand &getInMutable() { |
| 4991 | auto range = getODSOperandIndexAndLength(index: 0); |
| 4992 | return getOperation()->getOpOperand(idx: range.first); |
| 4993 | } |
| 4994 | |
| 4995 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 4996 | return {index, 1}; |
| 4997 | } |
| 4998 | |
| 4999 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 5000 | auto valueRange = getODSResultIndexAndLength(index); |
| 5001 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 5002 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 5003 | } |
| 5004 | |
| 5005 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 5006 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 5007 | } |
| 5008 | |
| 5009 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5010 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 5011 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 5012 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 5013 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 5014 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 5015 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5016 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 5017 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 5018 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 5019 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 5020 | } |
| 5021 | |
| 5022 | ::std::optional<::mlir::arith::FastMathFlags> getFastmath(); |
| 5023 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 5024 | getProperties().fastmath = attr; |
| 5025 | } |
| 5026 | |
| 5027 | void setFastmath(::std::optional<::mlir::arith::FastMathFlags> attrValue); |
| 5028 | ::mlir::Attribute removeFastmathAttr() { |
| 5029 | auto attr = getProperties().fastmath; |
| 5030 | getProperties().fastmath = {}; |
| 5031 | return attr; |
| 5032 | } |
| 5033 | |
| 5034 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 5035 | static ExtFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 5036 | static ExtFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 5037 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 5038 | static ExtFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 5039 | static ExtFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 5040 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 5041 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5042 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 5043 | static ExtFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5044 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 5045 | static ExtFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5046 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5047 | static ExtFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5048 | static ExtFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5049 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 5050 | ::llvm::LogicalResult verifyInvariants(); |
| 5051 | ::llvm::LogicalResult verify(); |
| 5052 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 5053 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 5054 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 5055 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 5056 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 5057 | private: |
| 5058 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 5059 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 5060 | } |
| 5061 | |
| 5062 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 5063 | assert(index < 1 && "invalid attribute index" ); |
| 5064 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 5065 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 5066 | "dependent dialect loading?" ); |
| 5067 | return name.getAttributeNames()[index]; |
| 5068 | } |
| 5069 | |
| 5070 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 5071 | public: |
| 5072 | }; |
| 5073 | |
| 5074 | } // namespace mlir::arith |
| 5075 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::ExtFOp) |
| 5076 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::ExtFOpGenericAdaptorBase::Properties) |
| 5077 | |
| 5078 | namespace mlir::arith { |
| 5079 | |
| 5080 | |
| 5081 | //===----------------------------------------------------------------------===// |
| 5082 | // ::mlir::arith::ExtSIOp declarations |
| 5083 | //===----------------------------------------------------------------------===// |
| 5084 | |
| 5085 | namespace detail { |
| 5086 | |
| 5087 | class ExtSIOpGenericAdaptorBase { |
| 5088 | public: |
| 5089 | using Properties = ::mlir::EmptyProperties; |
| 5090 | protected: |
| 5091 | ::mlir::DictionaryAttr odsAttrs; |
| 5092 | ::std::optional<::mlir::OperationName> odsOpName; |
| 5093 | Properties properties; |
| 5094 | ::mlir::RegionRange odsRegions; |
| 5095 | public: |
| 5096 | ExtSIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 5097 | odsOpName.emplace(args: "arith.extsi" , args: odsAttrs.getContext()); |
| 5098 | } |
| 5099 | |
| 5100 | ExtSIOpGenericAdaptorBase(ExtSIOp op); |
| 5101 | |
| 5102 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 5103 | return {index, 1}; |
| 5104 | } |
| 5105 | |
| 5106 | const Properties &getProperties() { |
| 5107 | return properties; |
| 5108 | } |
| 5109 | |
| 5110 | ::mlir::DictionaryAttr getAttributes() { |
| 5111 | return odsAttrs; |
| 5112 | } |
| 5113 | |
| 5114 | }; |
| 5115 | |
| 5116 | } // namespace detail |
| 5117 | template <typename RangeT> |
| 5118 | class ExtSIOpGenericAdaptor : public detail::ExtSIOpGenericAdaptorBase { |
| 5119 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 5120 | using Base = detail::ExtSIOpGenericAdaptorBase; |
| 5121 | static constexpr int odsIndex_in = 0; |
| 5122 | public: |
| 5123 | ExtSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 5124 | |
| 5125 | ExtSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ExtSIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 5126 | |
| 5127 | ExtSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ExtSIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 5128 | |
| 5129 | ExtSIOpGenericAdaptor(RangeT values, const ExtSIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 5130 | |
| 5131 | template <typename LateInst = ExtSIOp, typename = std::enable_if_t<std::is_same_v<LateInst, ExtSIOp>>> |
| 5132 | ExtSIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 5133 | |
| 5134 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5135 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 5136 | } |
| 5137 | |
| 5138 | RangeT getODSOperands(unsigned index) { |
| 5139 | auto valueRange = getODSOperandIndexAndLength(index); |
| 5140 | return {std::next(odsOperands.begin(), valueRange.first), |
| 5141 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 5142 | } |
| 5143 | |
| 5144 | ValueT getIn() { |
| 5145 | return (*getODSOperands(index: 0).begin()); |
| 5146 | } |
| 5147 | |
| 5148 | RangeT getOperands() { |
| 5149 | return odsOperands; |
| 5150 | } |
| 5151 | |
| 5152 | private: |
| 5153 | RangeT odsOperands; |
| 5154 | }; |
| 5155 | class ExtSIOpAdaptor : public ExtSIOpGenericAdaptor<::mlir::ValueRange> { |
| 5156 | public: |
| 5157 | using ExtSIOpGenericAdaptor::ExtSIOpGenericAdaptor; |
| 5158 | ExtSIOpAdaptor(ExtSIOp op); |
| 5159 | |
| 5160 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 5161 | }; |
| 5162 | class ExtSIOp : public ::mlir::Op<ExtSIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::InferIntRangeInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 5163 | public: |
| 5164 | using Op::Op; |
| 5165 | using Op::print; |
| 5166 | using Adaptor = ExtSIOpAdaptor; |
| 5167 | template <typename RangeT> |
| 5168 | using GenericAdaptor = ExtSIOpGenericAdaptor<RangeT>; |
| 5169 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 5170 | static constexpr int odsIndex_in = 0; |
| 5171 | static constexpr int odsIndex_out = 0; |
| 5172 | using Properties = FoldAdaptor::Properties; |
| 5173 | using ::mlir::InferIntRangeInterface::Trait<ExtSIOp>::inferResultRangesFromOptional; |
| 5174 | using ::mlir::VectorUnrollOpInterface::Trait<ExtSIOp>::getIterationShapeToUnroll; |
| 5175 | using ::mlir::VectorUnrollOpInterface::Trait<ExtSIOp>::getDefaultUnrollTargetShape; |
| 5176 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 5177 | return {}; |
| 5178 | } |
| 5179 | |
| 5180 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 5181 | return ::llvm::StringLiteral("arith.extsi" ); |
| 5182 | } |
| 5183 | |
| 5184 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5185 | return {index, 1}; |
| 5186 | } |
| 5187 | |
| 5188 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 5189 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 5190 | return getOperation()->getOperands().slice(n: start, m: length); |
| 5191 | } |
| 5192 | |
| 5193 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 5194 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 5195 | } |
| 5196 | |
| 5197 | ::mlir::OpOperand &getInMutable() { |
| 5198 | auto range = getODSOperandIndexAndLength(index: 0); |
| 5199 | return getOperation()->getOpOperand(idx: range.first); |
| 5200 | } |
| 5201 | |
| 5202 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 5203 | return {index, 1}; |
| 5204 | } |
| 5205 | |
| 5206 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 5207 | auto valueRange = getODSResultIndexAndLength(index); |
| 5208 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 5209 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 5210 | } |
| 5211 | |
| 5212 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 5213 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 5214 | } |
| 5215 | |
| 5216 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5217 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 5218 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 5219 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 5220 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 5221 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 5222 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5223 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in); |
| 5224 | static ExtSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in); |
| 5225 | static ExtSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in); |
| 5226 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 5227 | static ExtSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 5228 | static ExtSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 5229 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5230 | static ExtSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5231 | static ExtSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5232 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5233 | static ExtSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5234 | static ExtSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5235 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 5236 | ::llvm::LogicalResult verifyInvariants(); |
| 5237 | ::llvm::LogicalResult verify(); |
| 5238 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 5239 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 5240 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 5241 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 5242 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 5243 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 5244 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 5245 | public: |
| 5246 | }; |
| 5247 | |
| 5248 | } // namespace mlir::arith |
| 5249 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::ExtSIOp) |
| 5250 | |
| 5251 | namespace mlir::arith { |
| 5252 | |
| 5253 | |
| 5254 | //===----------------------------------------------------------------------===// |
| 5255 | // ::mlir::arith::ExtUIOp declarations |
| 5256 | //===----------------------------------------------------------------------===// |
| 5257 | |
| 5258 | namespace detail { |
| 5259 | |
| 5260 | class ExtUIOpGenericAdaptorBase { |
| 5261 | public: |
| 5262 | struct Properties { |
| 5263 | using nonNegTy = ::mlir::UnitAttr; |
| 5264 | nonNegTy nonNeg; |
| 5265 | |
| 5266 | auto getNonNeg() const { |
| 5267 | auto &propStorage = this->nonNeg; |
| 5268 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val: propStorage); |
| 5269 | } |
| 5270 | void setNonNeg(const ::mlir::UnitAttr &propValue) { |
| 5271 | this->nonNeg = propValue; |
| 5272 | } |
| 5273 | bool operator==(const Properties &rhs) const { |
| 5274 | return |
| 5275 | rhs.nonNeg == this->nonNeg && |
| 5276 | true; |
| 5277 | } |
| 5278 | bool operator!=(const Properties &rhs) const { |
| 5279 | return !(*this == rhs); |
| 5280 | } |
| 5281 | }; |
| 5282 | protected: |
| 5283 | ::mlir::DictionaryAttr odsAttrs; |
| 5284 | ::std::optional<::mlir::OperationName> odsOpName; |
| 5285 | Properties properties; |
| 5286 | ::mlir::RegionRange odsRegions; |
| 5287 | public: |
| 5288 | ExtUIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 5289 | odsOpName.emplace(args: "arith.extui" , args: odsAttrs.getContext()); |
| 5290 | } |
| 5291 | |
| 5292 | ExtUIOpGenericAdaptorBase(ExtUIOp op); |
| 5293 | |
| 5294 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 5295 | return {index, 1}; |
| 5296 | } |
| 5297 | |
| 5298 | const Properties &getProperties() { |
| 5299 | return properties; |
| 5300 | } |
| 5301 | |
| 5302 | ::mlir::DictionaryAttr getAttributes() { |
| 5303 | return odsAttrs; |
| 5304 | } |
| 5305 | |
| 5306 | ::mlir::UnitAttr getNonNegAttr(); |
| 5307 | bool getNonNeg(); |
| 5308 | }; |
| 5309 | |
| 5310 | } // namespace detail |
| 5311 | template <typename RangeT> |
| 5312 | class ExtUIOpGenericAdaptor : public detail::ExtUIOpGenericAdaptorBase { |
| 5313 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 5314 | using Base = detail::ExtUIOpGenericAdaptorBase; |
| 5315 | static constexpr int odsIndex_in = 0; |
| 5316 | public: |
| 5317 | ExtUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 5318 | |
| 5319 | ExtUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ExtUIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 5320 | |
| 5321 | ExtUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ExtUIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 5322 | |
| 5323 | ExtUIOpGenericAdaptor(RangeT values, const ExtUIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 5324 | |
| 5325 | template <typename LateInst = ExtUIOp, typename = std::enable_if_t<std::is_same_v<LateInst, ExtUIOp>>> |
| 5326 | ExtUIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 5327 | |
| 5328 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5329 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 5330 | } |
| 5331 | |
| 5332 | RangeT getODSOperands(unsigned index) { |
| 5333 | auto valueRange = getODSOperandIndexAndLength(index); |
| 5334 | return {std::next(odsOperands.begin(), valueRange.first), |
| 5335 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 5336 | } |
| 5337 | |
| 5338 | ValueT getIn() { |
| 5339 | return (*getODSOperands(index: 0).begin()); |
| 5340 | } |
| 5341 | |
| 5342 | RangeT getOperands() { |
| 5343 | return odsOperands; |
| 5344 | } |
| 5345 | |
| 5346 | private: |
| 5347 | RangeT odsOperands; |
| 5348 | }; |
| 5349 | class ExtUIOpAdaptor : public ExtUIOpGenericAdaptor<::mlir::ValueRange> { |
| 5350 | public: |
| 5351 | using ExtUIOpGenericAdaptor::ExtUIOpGenericAdaptor; |
| 5352 | ExtUIOpAdaptor(ExtUIOp op); |
| 5353 | |
| 5354 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 5355 | }; |
| 5356 | class ExtUIOp : public ::mlir::Op<ExtUIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::arith::ArithNonNegFlagInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 5357 | public: |
| 5358 | using Op::Op; |
| 5359 | using Op::print; |
| 5360 | using Adaptor = ExtUIOpAdaptor; |
| 5361 | template <typename RangeT> |
| 5362 | using GenericAdaptor = ExtUIOpGenericAdaptor<RangeT>; |
| 5363 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 5364 | static constexpr int odsIndex_in = 0; |
| 5365 | static constexpr int odsIndex_out = 0; |
| 5366 | using Properties = FoldAdaptor::Properties; |
| 5367 | using ::mlir::arith::ArithNonNegFlagInterface::Trait<ExtUIOp>::getNonNeg; |
| 5368 | using ::mlir::arith::ArithNonNegFlagInterface::Trait<ExtUIOp>::setNonNeg; |
| 5369 | using ::mlir::arith::ArithNonNegFlagInterface::Trait<ExtUIOp>::getNonNegFlagAttrName; |
| 5370 | using ::mlir::InferIntRangeInterface::Trait<ExtUIOp>::inferResultRangesFromOptional; |
| 5371 | using ::mlir::VectorUnrollOpInterface::Trait<ExtUIOp>::getIterationShapeToUnroll; |
| 5372 | using ::mlir::VectorUnrollOpInterface::Trait<ExtUIOp>::getDefaultUnrollTargetShape; |
| 5373 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 5374 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("nonNeg" )}; |
| 5375 | return ::llvm::ArrayRef(attrNames); |
| 5376 | } |
| 5377 | |
| 5378 | ::mlir::StringAttr getNonNegAttrName() { |
| 5379 | return getAttributeNameForIndex(index: 0); |
| 5380 | } |
| 5381 | |
| 5382 | static ::mlir::StringAttr getNonNegAttrName(::mlir::OperationName name) { |
| 5383 | return getAttributeNameForIndex(name, index: 0); |
| 5384 | } |
| 5385 | |
| 5386 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 5387 | return ::llvm::StringLiteral("arith.extui" ); |
| 5388 | } |
| 5389 | |
| 5390 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5391 | return {index, 1}; |
| 5392 | } |
| 5393 | |
| 5394 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 5395 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 5396 | return getOperation()->getOperands().slice(n: start, m: length); |
| 5397 | } |
| 5398 | |
| 5399 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 5400 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 5401 | } |
| 5402 | |
| 5403 | ::mlir::OpOperand &getInMutable() { |
| 5404 | auto range = getODSOperandIndexAndLength(index: 0); |
| 5405 | return getOperation()->getOpOperand(idx: range.first); |
| 5406 | } |
| 5407 | |
| 5408 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 5409 | return {index, 1}; |
| 5410 | } |
| 5411 | |
| 5412 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 5413 | auto valueRange = getODSResultIndexAndLength(index); |
| 5414 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 5415 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 5416 | } |
| 5417 | |
| 5418 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 5419 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 5420 | } |
| 5421 | |
| 5422 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5423 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 5424 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 5425 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 5426 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 5427 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 5428 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5429 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 5430 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 5431 | ::mlir::UnitAttr getNonNegAttr() { |
| 5432 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val&: getProperties().nonNeg); |
| 5433 | } |
| 5434 | |
| 5435 | bool getNonNeg(); |
| 5436 | void setNonNegAttr(::mlir::UnitAttr attr) { |
| 5437 | getProperties().nonNeg = attr; |
| 5438 | } |
| 5439 | |
| 5440 | void setNonNeg(bool attrValue); |
| 5441 | ::mlir::Attribute removeNonNegAttr() { |
| 5442 | auto attr = getProperties().nonNeg; |
| 5443 | getProperties().nonNeg = {}; |
| 5444 | return attr; |
| 5445 | } |
| 5446 | |
| 5447 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 5448 | static ExtUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 5449 | static ExtUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 5450 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 5451 | static ExtUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 5452 | static ExtUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 5453 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 5454 | static ExtUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 5455 | static ExtUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 5456 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 5457 | static ExtUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 5458 | static ExtUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 5459 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 5460 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5461 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 5462 | static ExtUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5463 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 5464 | static ExtUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5465 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5466 | static ExtUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5467 | static ExtUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5468 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 5469 | ::llvm::LogicalResult verifyInvariants(); |
| 5470 | ::llvm::LogicalResult verify(); |
| 5471 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 5472 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 5473 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 5474 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 5475 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 5476 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 5477 | private: |
| 5478 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 5479 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 5480 | } |
| 5481 | |
| 5482 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 5483 | assert(index < 1 && "invalid attribute index" ); |
| 5484 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 5485 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 5486 | "dependent dialect loading?" ); |
| 5487 | return name.getAttributeNames()[index]; |
| 5488 | } |
| 5489 | |
| 5490 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 5491 | public: |
| 5492 | }; |
| 5493 | |
| 5494 | } // namespace mlir::arith |
| 5495 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::ExtUIOp) |
| 5496 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::ExtUIOpGenericAdaptorBase::Properties) |
| 5497 | |
| 5498 | namespace mlir::arith { |
| 5499 | |
| 5500 | |
| 5501 | //===----------------------------------------------------------------------===// |
| 5502 | // ::mlir::arith::FPToSIOp declarations |
| 5503 | //===----------------------------------------------------------------------===// |
| 5504 | |
| 5505 | namespace detail { |
| 5506 | |
| 5507 | class FPToSIOpGenericAdaptorBase { |
| 5508 | public: |
| 5509 | using Properties = ::mlir::EmptyProperties; |
| 5510 | protected: |
| 5511 | ::mlir::DictionaryAttr odsAttrs; |
| 5512 | ::std::optional<::mlir::OperationName> odsOpName; |
| 5513 | Properties properties; |
| 5514 | ::mlir::RegionRange odsRegions; |
| 5515 | public: |
| 5516 | FPToSIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 5517 | odsOpName.emplace(args: "arith.fptosi" , args: odsAttrs.getContext()); |
| 5518 | } |
| 5519 | |
| 5520 | FPToSIOpGenericAdaptorBase(FPToSIOp op); |
| 5521 | |
| 5522 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 5523 | return {index, 1}; |
| 5524 | } |
| 5525 | |
| 5526 | const Properties &getProperties() { |
| 5527 | return properties; |
| 5528 | } |
| 5529 | |
| 5530 | ::mlir::DictionaryAttr getAttributes() { |
| 5531 | return odsAttrs; |
| 5532 | } |
| 5533 | |
| 5534 | }; |
| 5535 | |
| 5536 | } // namespace detail |
| 5537 | template <typename RangeT> |
| 5538 | class FPToSIOpGenericAdaptor : public detail::FPToSIOpGenericAdaptorBase { |
| 5539 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 5540 | using Base = detail::FPToSIOpGenericAdaptorBase; |
| 5541 | static constexpr int odsIndex_in = 0; |
| 5542 | public: |
| 5543 | FPToSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 5544 | |
| 5545 | FPToSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : FPToSIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 5546 | |
| 5547 | FPToSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : FPToSIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 5548 | |
| 5549 | FPToSIOpGenericAdaptor(RangeT values, const FPToSIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 5550 | |
| 5551 | template <typename LateInst = FPToSIOp, typename = std::enable_if_t<std::is_same_v<LateInst, FPToSIOp>>> |
| 5552 | FPToSIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 5553 | |
| 5554 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5555 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 5556 | } |
| 5557 | |
| 5558 | RangeT getODSOperands(unsigned index) { |
| 5559 | auto valueRange = getODSOperandIndexAndLength(index); |
| 5560 | return {std::next(odsOperands.begin(), valueRange.first), |
| 5561 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 5562 | } |
| 5563 | |
| 5564 | ValueT getIn() { |
| 5565 | return (*getODSOperands(index: 0).begin()); |
| 5566 | } |
| 5567 | |
| 5568 | RangeT getOperands() { |
| 5569 | return odsOperands; |
| 5570 | } |
| 5571 | |
| 5572 | private: |
| 5573 | RangeT odsOperands; |
| 5574 | }; |
| 5575 | class FPToSIOpAdaptor : public FPToSIOpGenericAdaptor<::mlir::ValueRange> { |
| 5576 | public: |
| 5577 | using FPToSIOpGenericAdaptor::FPToSIOpGenericAdaptor; |
| 5578 | FPToSIOpAdaptor(FPToSIOp op); |
| 5579 | |
| 5580 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 5581 | }; |
| 5582 | class FPToSIOp : public ::mlir::Op<FPToSIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 5583 | public: |
| 5584 | using Op::Op; |
| 5585 | using Op::print; |
| 5586 | using Adaptor = FPToSIOpAdaptor; |
| 5587 | template <typename RangeT> |
| 5588 | using GenericAdaptor = FPToSIOpGenericAdaptor<RangeT>; |
| 5589 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 5590 | static constexpr int odsIndex_in = 0; |
| 5591 | static constexpr int odsIndex_out = 0; |
| 5592 | using Properties = FoldAdaptor::Properties; |
| 5593 | using ::mlir::VectorUnrollOpInterface::Trait<FPToSIOp>::getIterationShapeToUnroll; |
| 5594 | using ::mlir::VectorUnrollOpInterface::Trait<FPToSIOp>::getDefaultUnrollTargetShape; |
| 5595 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 5596 | return {}; |
| 5597 | } |
| 5598 | |
| 5599 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 5600 | return ::llvm::StringLiteral("arith.fptosi" ); |
| 5601 | } |
| 5602 | |
| 5603 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5604 | return {index, 1}; |
| 5605 | } |
| 5606 | |
| 5607 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 5608 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 5609 | return getOperation()->getOperands().slice(n: start, m: length); |
| 5610 | } |
| 5611 | |
| 5612 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 5613 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 5614 | } |
| 5615 | |
| 5616 | ::mlir::OpOperand &getInMutable() { |
| 5617 | auto range = getODSOperandIndexAndLength(index: 0); |
| 5618 | return getOperation()->getOpOperand(idx: range.first); |
| 5619 | } |
| 5620 | |
| 5621 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 5622 | return {index, 1}; |
| 5623 | } |
| 5624 | |
| 5625 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 5626 | auto valueRange = getODSResultIndexAndLength(index); |
| 5627 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 5628 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 5629 | } |
| 5630 | |
| 5631 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 5632 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 5633 | } |
| 5634 | |
| 5635 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5636 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 5637 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 5638 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 5639 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 5640 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 5641 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5642 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in); |
| 5643 | static FPToSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in); |
| 5644 | static FPToSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in); |
| 5645 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 5646 | static FPToSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 5647 | static FPToSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 5648 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5649 | static FPToSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5650 | static FPToSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5651 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5652 | static FPToSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5653 | static FPToSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5654 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 5655 | ::llvm::LogicalResult verifyInvariants(); |
| 5656 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 5657 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 5658 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 5659 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 5660 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 5661 | public: |
| 5662 | }; |
| 5663 | |
| 5664 | } // namespace mlir::arith |
| 5665 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::FPToSIOp) |
| 5666 | |
| 5667 | namespace mlir::arith { |
| 5668 | |
| 5669 | |
| 5670 | //===----------------------------------------------------------------------===// |
| 5671 | // ::mlir::arith::FPToUIOp declarations |
| 5672 | //===----------------------------------------------------------------------===// |
| 5673 | |
| 5674 | namespace detail { |
| 5675 | |
| 5676 | class FPToUIOpGenericAdaptorBase { |
| 5677 | public: |
| 5678 | using Properties = ::mlir::EmptyProperties; |
| 5679 | protected: |
| 5680 | ::mlir::DictionaryAttr odsAttrs; |
| 5681 | ::std::optional<::mlir::OperationName> odsOpName; |
| 5682 | Properties properties; |
| 5683 | ::mlir::RegionRange odsRegions; |
| 5684 | public: |
| 5685 | FPToUIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 5686 | odsOpName.emplace(args: "arith.fptoui" , args: odsAttrs.getContext()); |
| 5687 | } |
| 5688 | |
| 5689 | FPToUIOpGenericAdaptorBase(FPToUIOp op); |
| 5690 | |
| 5691 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 5692 | return {index, 1}; |
| 5693 | } |
| 5694 | |
| 5695 | const Properties &getProperties() { |
| 5696 | return properties; |
| 5697 | } |
| 5698 | |
| 5699 | ::mlir::DictionaryAttr getAttributes() { |
| 5700 | return odsAttrs; |
| 5701 | } |
| 5702 | |
| 5703 | }; |
| 5704 | |
| 5705 | } // namespace detail |
| 5706 | template <typename RangeT> |
| 5707 | class FPToUIOpGenericAdaptor : public detail::FPToUIOpGenericAdaptorBase { |
| 5708 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 5709 | using Base = detail::FPToUIOpGenericAdaptorBase; |
| 5710 | static constexpr int odsIndex_in = 0; |
| 5711 | public: |
| 5712 | FPToUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 5713 | |
| 5714 | FPToUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : FPToUIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 5715 | |
| 5716 | FPToUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : FPToUIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 5717 | |
| 5718 | FPToUIOpGenericAdaptor(RangeT values, const FPToUIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 5719 | |
| 5720 | template <typename LateInst = FPToUIOp, typename = std::enable_if_t<std::is_same_v<LateInst, FPToUIOp>>> |
| 5721 | FPToUIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 5722 | |
| 5723 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5724 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 5725 | } |
| 5726 | |
| 5727 | RangeT getODSOperands(unsigned index) { |
| 5728 | auto valueRange = getODSOperandIndexAndLength(index); |
| 5729 | return {std::next(odsOperands.begin(), valueRange.first), |
| 5730 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 5731 | } |
| 5732 | |
| 5733 | ValueT getIn() { |
| 5734 | return (*getODSOperands(index: 0).begin()); |
| 5735 | } |
| 5736 | |
| 5737 | RangeT getOperands() { |
| 5738 | return odsOperands; |
| 5739 | } |
| 5740 | |
| 5741 | private: |
| 5742 | RangeT odsOperands; |
| 5743 | }; |
| 5744 | class FPToUIOpAdaptor : public FPToUIOpGenericAdaptor<::mlir::ValueRange> { |
| 5745 | public: |
| 5746 | using FPToUIOpGenericAdaptor::FPToUIOpGenericAdaptor; |
| 5747 | FPToUIOpAdaptor(FPToUIOp op); |
| 5748 | |
| 5749 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 5750 | }; |
| 5751 | class FPToUIOp : public ::mlir::Op<FPToUIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 5752 | public: |
| 5753 | using Op::Op; |
| 5754 | using Op::print; |
| 5755 | using Adaptor = FPToUIOpAdaptor; |
| 5756 | template <typename RangeT> |
| 5757 | using GenericAdaptor = FPToUIOpGenericAdaptor<RangeT>; |
| 5758 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 5759 | static constexpr int odsIndex_in = 0; |
| 5760 | static constexpr int odsIndex_out = 0; |
| 5761 | using Properties = FoldAdaptor::Properties; |
| 5762 | using ::mlir::VectorUnrollOpInterface::Trait<FPToUIOp>::getIterationShapeToUnroll; |
| 5763 | using ::mlir::VectorUnrollOpInterface::Trait<FPToUIOp>::getDefaultUnrollTargetShape; |
| 5764 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 5765 | return {}; |
| 5766 | } |
| 5767 | |
| 5768 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 5769 | return ::llvm::StringLiteral("arith.fptoui" ); |
| 5770 | } |
| 5771 | |
| 5772 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5773 | return {index, 1}; |
| 5774 | } |
| 5775 | |
| 5776 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 5777 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 5778 | return getOperation()->getOperands().slice(n: start, m: length); |
| 5779 | } |
| 5780 | |
| 5781 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 5782 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 5783 | } |
| 5784 | |
| 5785 | ::mlir::OpOperand &getInMutable() { |
| 5786 | auto range = getODSOperandIndexAndLength(index: 0); |
| 5787 | return getOperation()->getOpOperand(idx: range.first); |
| 5788 | } |
| 5789 | |
| 5790 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 5791 | return {index, 1}; |
| 5792 | } |
| 5793 | |
| 5794 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 5795 | auto valueRange = getODSResultIndexAndLength(index); |
| 5796 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 5797 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 5798 | } |
| 5799 | |
| 5800 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 5801 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 5802 | } |
| 5803 | |
| 5804 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5805 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 5806 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 5807 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 5808 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 5809 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 5810 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5811 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in); |
| 5812 | static FPToUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in); |
| 5813 | static FPToUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in); |
| 5814 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 5815 | static FPToUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 5816 | static FPToUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 5817 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5818 | static FPToUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5819 | static FPToUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 5820 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5821 | static FPToUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5822 | static FPToUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 5823 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 5824 | ::llvm::LogicalResult verifyInvariants(); |
| 5825 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 5826 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 5827 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 5828 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 5829 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 5830 | public: |
| 5831 | }; |
| 5832 | |
| 5833 | } // namespace mlir::arith |
| 5834 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::FPToUIOp) |
| 5835 | |
| 5836 | namespace mlir::arith { |
| 5837 | |
| 5838 | |
| 5839 | //===----------------------------------------------------------------------===// |
| 5840 | // ::mlir::arith::FloorDivSIOp declarations |
| 5841 | //===----------------------------------------------------------------------===// |
| 5842 | |
| 5843 | namespace detail { |
| 5844 | |
| 5845 | class FloorDivSIOpGenericAdaptorBase { |
| 5846 | public: |
| 5847 | using Properties = ::mlir::EmptyProperties; |
| 5848 | protected: |
| 5849 | ::mlir::DictionaryAttr odsAttrs; |
| 5850 | ::std::optional<::mlir::OperationName> odsOpName; |
| 5851 | Properties properties; |
| 5852 | ::mlir::RegionRange odsRegions; |
| 5853 | public: |
| 5854 | FloorDivSIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 5855 | odsOpName.emplace(args: "arith.floordivsi" , args: odsAttrs.getContext()); |
| 5856 | } |
| 5857 | |
| 5858 | FloorDivSIOpGenericAdaptorBase(FloorDivSIOp op); |
| 5859 | |
| 5860 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 5861 | return {index, 1}; |
| 5862 | } |
| 5863 | |
| 5864 | const Properties &getProperties() { |
| 5865 | return properties; |
| 5866 | } |
| 5867 | |
| 5868 | ::mlir::DictionaryAttr getAttributes() { |
| 5869 | return odsAttrs; |
| 5870 | } |
| 5871 | |
| 5872 | }; |
| 5873 | |
| 5874 | } // namespace detail |
| 5875 | template <typename RangeT> |
| 5876 | class FloorDivSIOpGenericAdaptor : public detail::FloorDivSIOpGenericAdaptorBase { |
| 5877 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 5878 | using Base = detail::FloorDivSIOpGenericAdaptorBase; |
| 5879 | static constexpr int odsIndex_lhs = 0; |
| 5880 | static constexpr int odsIndex_rhs = 1; |
| 5881 | public: |
| 5882 | FloorDivSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 5883 | |
| 5884 | FloorDivSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : FloorDivSIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 5885 | |
| 5886 | FloorDivSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : FloorDivSIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 5887 | |
| 5888 | FloorDivSIOpGenericAdaptor(RangeT values, const FloorDivSIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 5889 | |
| 5890 | template <typename LateInst = FloorDivSIOp, typename = std::enable_if_t<std::is_same_v<LateInst, FloorDivSIOp>>> |
| 5891 | FloorDivSIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 5892 | |
| 5893 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5894 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 5895 | } |
| 5896 | |
| 5897 | RangeT getODSOperands(unsigned index) { |
| 5898 | auto valueRange = getODSOperandIndexAndLength(index); |
| 5899 | return {std::next(odsOperands.begin(), valueRange.first), |
| 5900 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 5901 | } |
| 5902 | |
| 5903 | ValueT getLhs() { |
| 5904 | return (*getODSOperands(index: 0).begin()); |
| 5905 | } |
| 5906 | |
| 5907 | ValueT getRhs() { |
| 5908 | return (*getODSOperands(index: 1).begin()); |
| 5909 | } |
| 5910 | |
| 5911 | RangeT getOperands() { |
| 5912 | return odsOperands; |
| 5913 | } |
| 5914 | |
| 5915 | private: |
| 5916 | RangeT odsOperands; |
| 5917 | }; |
| 5918 | class FloorDivSIOpAdaptor : public FloorDivSIOpGenericAdaptor<::mlir::ValueRange> { |
| 5919 | public: |
| 5920 | using FloorDivSIOpGenericAdaptor::FloorDivSIOpGenericAdaptor; |
| 5921 | FloorDivSIOpAdaptor(FloorDivSIOp op); |
| 5922 | |
| 5923 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 5924 | }; |
| 5925 | class FloorDivSIOp : public ::mlir::Op<FloorDivSIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 5926 | public: |
| 5927 | using Op::Op; |
| 5928 | using Op::print; |
| 5929 | using Adaptor = FloorDivSIOpAdaptor; |
| 5930 | template <typename RangeT> |
| 5931 | using GenericAdaptor = FloorDivSIOpGenericAdaptor<RangeT>; |
| 5932 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 5933 | static constexpr int odsIndex_lhs = 0; |
| 5934 | static constexpr int odsIndex_rhs = 1; |
| 5935 | static constexpr int odsIndex_result = 0; |
| 5936 | using Properties = FoldAdaptor::Properties; |
| 5937 | using ::mlir::InferIntRangeInterface::Trait<FloorDivSIOp>::inferResultRangesFromOptional; |
| 5938 | using ::mlir::VectorUnrollOpInterface::Trait<FloorDivSIOp>::getIterationShapeToUnroll; |
| 5939 | using ::mlir::VectorUnrollOpInterface::Trait<FloorDivSIOp>::getDefaultUnrollTargetShape; |
| 5940 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 5941 | return {}; |
| 5942 | } |
| 5943 | |
| 5944 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 5945 | return ::llvm::StringLiteral("arith.floordivsi" ); |
| 5946 | } |
| 5947 | |
| 5948 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 5949 | return {index, 1}; |
| 5950 | } |
| 5951 | |
| 5952 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 5953 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 5954 | return getOperation()->getOperands().slice(n: start, m: length); |
| 5955 | } |
| 5956 | |
| 5957 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 5958 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 5959 | } |
| 5960 | |
| 5961 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 5962 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 5963 | } |
| 5964 | |
| 5965 | ::mlir::OpOperand &getLhsMutable() { |
| 5966 | auto range = getODSOperandIndexAndLength(index: 0); |
| 5967 | return getOperation()->getOpOperand(idx: range.first); |
| 5968 | } |
| 5969 | |
| 5970 | ::mlir::OpOperand &getRhsMutable() { |
| 5971 | auto range = getODSOperandIndexAndLength(index: 1); |
| 5972 | return getOperation()->getOpOperand(idx: range.first); |
| 5973 | } |
| 5974 | |
| 5975 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 5976 | return {index, 1}; |
| 5977 | } |
| 5978 | |
| 5979 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 5980 | auto valueRange = getODSResultIndexAndLength(index); |
| 5981 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 5982 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 5983 | } |
| 5984 | |
| 5985 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 5986 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 5987 | } |
| 5988 | |
| 5989 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5990 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 5991 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 5992 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 5993 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 5994 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 5995 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 5996 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 5997 | static FloorDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 5998 | static FloorDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 5999 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 6000 | static FloorDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 6001 | static FloorDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 6002 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 6003 | static FloorDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 6004 | static FloorDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 6005 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6006 | static FloorDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6007 | static FloorDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6008 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6009 | static FloorDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6010 | static FloorDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6011 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6012 | static FloorDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6013 | static FloorDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6014 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6015 | static FloorDivSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6016 | static FloorDivSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6017 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 6018 | ::llvm::LogicalResult verifyInvariants(); |
| 6019 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 6020 | 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); |
| 6021 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 6022 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 6023 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 6024 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 6025 | public: |
| 6026 | /// Interface method for ConditionallySpeculatable. |
| 6027 | Speculation::Speculatability getSpeculatability(); |
| 6028 | }; |
| 6029 | |
| 6030 | } // namespace mlir::arith |
| 6031 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::FloorDivSIOp) |
| 6032 | |
| 6033 | namespace mlir::arith { |
| 6034 | |
| 6035 | |
| 6036 | //===----------------------------------------------------------------------===// |
| 6037 | // ::mlir::arith::FlushDenormalsOp declarations |
| 6038 | //===----------------------------------------------------------------------===// |
| 6039 | |
| 6040 | namespace detail { |
| 6041 | |
| 6042 | class FlushDenormalsOpGenericAdaptorBase { |
| 6043 | public: |
| 6044 | struct Properties { |
| 6045 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 6046 | fastmathTy fastmath; |
| 6047 | |
| 6048 | auto getFastmath() const { |
| 6049 | auto &propStorage = this->fastmath; |
| 6050 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 6051 | } |
| 6052 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 6053 | this->fastmath = propValue; |
| 6054 | } |
| 6055 | bool operator==(const Properties &rhs) const { |
| 6056 | return |
| 6057 | rhs.fastmath == this->fastmath && |
| 6058 | true; |
| 6059 | } |
| 6060 | bool operator!=(const Properties &rhs) const { |
| 6061 | return !(*this == rhs); |
| 6062 | } |
| 6063 | }; |
| 6064 | protected: |
| 6065 | ::mlir::DictionaryAttr odsAttrs; |
| 6066 | ::std::optional<::mlir::OperationName> odsOpName; |
| 6067 | Properties properties; |
| 6068 | ::mlir::RegionRange odsRegions; |
| 6069 | public: |
| 6070 | FlushDenormalsOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 6071 | odsOpName.emplace(args: "arith.flush_denormals" , args: odsAttrs.getContext()); |
| 6072 | } |
| 6073 | |
| 6074 | FlushDenormalsOpGenericAdaptorBase(FlushDenormalsOp op); |
| 6075 | |
| 6076 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 6077 | return {index, 1}; |
| 6078 | } |
| 6079 | |
| 6080 | const Properties &getProperties() { |
| 6081 | return properties; |
| 6082 | } |
| 6083 | |
| 6084 | ::mlir::DictionaryAttr getAttributes() { |
| 6085 | return odsAttrs; |
| 6086 | } |
| 6087 | |
| 6088 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 6089 | ::mlir::arith::FastMathFlags getFastmath(); |
| 6090 | }; |
| 6091 | |
| 6092 | } // namespace detail |
| 6093 | template <typename RangeT> |
| 6094 | class FlushDenormalsOpGenericAdaptor : public detail::FlushDenormalsOpGenericAdaptorBase { |
| 6095 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 6096 | using Base = detail::FlushDenormalsOpGenericAdaptorBase; |
| 6097 | static constexpr int odsIndex_operand = 0; |
| 6098 | public: |
| 6099 | FlushDenormalsOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 6100 | |
| 6101 | FlushDenormalsOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : FlushDenormalsOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 6102 | |
| 6103 | FlushDenormalsOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : FlushDenormalsOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 6104 | |
| 6105 | FlushDenormalsOpGenericAdaptor(RangeT values, const FlushDenormalsOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 6106 | |
| 6107 | template <typename LateInst = FlushDenormalsOp, typename = std::enable_if_t<std::is_same_v<LateInst, FlushDenormalsOp>>> |
| 6108 | FlushDenormalsOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 6109 | |
| 6110 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 6111 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 6112 | } |
| 6113 | |
| 6114 | RangeT getODSOperands(unsigned index) { |
| 6115 | auto valueRange = getODSOperandIndexAndLength(index); |
| 6116 | return {std::next(odsOperands.begin(), valueRange.first), |
| 6117 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 6118 | } |
| 6119 | |
| 6120 | ValueT getOperand() { |
| 6121 | return (*getODSOperands(index: 0).begin()); |
| 6122 | } |
| 6123 | |
| 6124 | RangeT getOperands() { |
| 6125 | return odsOperands; |
| 6126 | } |
| 6127 | |
| 6128 | private: |
| 6129 | RangeT odsOperands; |
| 6130 | }; |
| 6131 | class FlushDenormalsOpAdaptor : public FlushDenormalsOpGenericAdaptor<::mlir::ValueRange> { |
| 6132 | public: |
| 6133 | using FlushDenormalsOpGenericAdaptor::FlushDenormalsOpGenericAdaptor; |
| 6134 | FlushDenormalsOpAdaptor(FlushDenormalsOp op); |
| 6135 | |
| 6136 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 6137 | }; |
| 6138 | class FlushDenormalsOp : public ::mlir::Op<FlushDenormalsOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 6139 | public: |
| 6140 | using Op::Op; |
| 6141 | using Op::print; |
| 6142 | using Adaptor = FlushDenormalsOpAdaptor; |
| 6143 | template <typename RangeT> |
| 6144 | using GenericAdaptor = FlushDenormalsOpGenericAdaptor<RangeT>; |
| 6145 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 6146 | static constexpr int odsIndex_operand = 0; |
| 6147 | static constexpr int odsIndex_result = 0; |
| 6148 | using Properties = FoldAdaptor::Properties; |
| 6149 | using ::mlir::arith::ArithFastMathInterface::Trait<FlushDenormalsOp>::getFastMathFlagsAttr; |
| 6150 | using ::mlir::arith::ArithFastMathInterface::Trait<FlushDenormalsOp>::getFastMathAttrName; |
| 6151 | using ::mlir::VectorUnrollOpInterface::Trait<FlushDenormalsOp>::getIterationShapeToUnroll; |
| 6152 | using ::mlir::VectorUnrollOpInterface::Trait<FlushDenormalsOp>::getDefaultUnrollTargetShape; |
| 6153 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 6154 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" )}; |
| 6155 | return ::llvm::ArrayRef(attrNames); |
| 6156 | } |
| 6157 | |
| 6158 | ::mlir::StringAttr getFastmathAttrName() { |
| 6159 | return getAttributeNameForIndex(index: 0); |
| 6160 | } |
| 6161 | |
| 6162 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 6163 | return getAttributeNameForIndex(name, index: 0); |
| 6164 | } |
| 6165 | |
| 6166 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 6167 | return ::llvm::StringLiteral("arith.flush_denormals" ); |
| 6168 | } |
| 6169 | |
| 6170 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 6171 | return {index, 1}; |
| 6172 | } |
| 6173 | |
| 6174 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 6175 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 6176 | return getOperation()->getOperands().slice(n: start, m: length); |
| 6177 | } |
| 6178 | |
| 6179 | ::mlir::TypedValue<::mlir::Type> getOperand() { |
| 6180 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 6181 | } |
| 6182 | |
| 6183 | ::mlir::OpOperand &getOperandMutable() { |
| 6184 | auto range = getODSOperandIndexAndLength(index: 0); |
| 6185 | return getOperation()->getOpOperand(idx: range.first); |
| 6186 | } |
| 6187 | |
| 6188 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 6189 | return {index, 1}; |
| 6190 | } |
| 6191 | |
| 6192 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 6193 | auto valueRange = getODSResultIndexAndLength(index); |
| 6194 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 6195 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 6196 | } |
| 6197 | |
| 6198 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 6199 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 6200 | } |
| 6201 | |
| 6202 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 6203 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 6204 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 6205 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 6206 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 6207 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 6208 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 6209 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 6210 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 6211 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 6212 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 6213 | } |
| 6214 | |
| 6215 | ::mlir::arith::FastMathFlags getFastmath(); |
| 6216 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 6217 | getProperties().fastmath = attr; |
| 6218 | } |
| 6219 | |
| 6220 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 6221 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6222 | static FlushDenormalsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6223 | static FlushDenormalsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6224 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6225 | static FlushDenormalsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6226 | static FlushDenormalsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6227 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6228 | static FlushDenormalsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6229 | static FlushDenormalsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6230 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6231 | static FlushDenormalsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6232 | static FlushDenormalsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6233 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6234 | static FlushDenormalsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6235 | static FlushDenormalsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6236 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6237 | static FlushDenormalsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6238 | static FlushDenormalsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6239 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6240 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6241 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6242 | static FlushDenormalsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6243 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6244 | static FlushDenormalsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6245 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6246 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6247 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6248 | static FlushDenormalsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6249 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6250 | static FlushDenormalsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6251 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6252 | static FlushDenormalsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6253 | static FlushDenormalsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6254 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6255 | static FlushDenormalsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6256 | static FlushDenormalsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6257 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 6258 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 6259 | ::llvm::LogicalResult verifyInvariants(); |
| 6260 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 6261 | 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); |
| 6262 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 6263 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 6264 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 6265 | private: |
| 6266 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 6267 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 6268 | } |
| 6269 | |
| 6270 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 6271 | assert(index < 1 && "invalid attribute index" ); |
| 6272 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 6273 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 6274 | "dependent dialect loading?" ); |
| 6275 | return name.getAttributeNames()[index]; |
| 6276 | } |
| 6277 | |
| 6278 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 6279 | public: |
| 6280 | }; |
| 6281 | |
| 6282 | } // namespace mlir::arith |
| 6283 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::FlushDenormalsOp) |
| 6284 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::FlushDenormalsOpGenericAdaptorBase::Properties) |
| 6285 | |
| 6286 | namespace mlir::arith { |
| 6287 | |
| 6288 | |
| 6289 | //===----------------------------------------------------------------------===// |
| 6290 | // ::mlir::arith::IndexCastOp declarations |
| 6291 | //===----------------------------------------------------------------------===// |
| 6292 | |
| 6293 | namespace detail { |
| 6294 | |
| 6295 | class IndexCastOpGenericAdaptorBase { |
| 6296 | public: |
| 6297 | using Properties = ::mlir::EmptyProperties; |
| 6298 | protected: |
| 6299 | ::mlir::DictionaryAttr odsAttrs; |
| 6300 | ::std::optional<::mlir::OperationName> odsOpName; |
| 6301 | Properties properties; |
| 6302 | ::mlir::RegionRange odsRegions; |
| 6303 | public: |
| 6304 | IndexCastOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 6305 | odsOpName.emplace(args: "arith.index_cast" , args: odsAttrs.getContext()); |
| 6306 | } |
| 6307 | |
| 6308 | IndexCastOpGenericAdaptorBase(IndexCastOp op); |
| 6309 | |
| 6310 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 6311 | return {index, 1}; |
| 6312 | } |
| 6313 | |
| 6314 | const Properties &getProperties() { |
| 6315 | return properties; |
| 6316 | } |
| 6317 | |
| 6318 | ::mlir::DictionaryAttr getAttributes() { |
| 6319 | return odsAttrs; |
| 6320 | } |
| 6321 | |
| 6322 | }; |
| 6323 | |
| 6324 | } // namespace detail |
| 6325 | template <typename RangeT> |
| 6326 | class IndexCastOpGenericAdaptor : public detail::IndexCastOpGenericAdaptorBase { |
| 6327 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 6328 | using Base = detail::IndexCastOpGenericAdaptorBase; |
| 6329 | static constexpr int odsIndex_in = 0; |
| 6330 | public: |
| 6331 | IndexCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 6332 | |
| 6333 | IndexCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : IndexCastOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 6334 | |
| 6335 | IndexCastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : IndexCastOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 6336 | |
| 6337 | IndexCastOpGenericAdaptor(RangeT values, const IndexCastOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 6338 | |
| 6339 | template <typename LateInst = IndexCastOp, typename = std::enable_if_t<std::is_same_v<LateInst, IndexCastOp>>> |
| 6340 | IndexCastOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 6341 | |
| 6342 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 6343 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 6344 | } |
| 6345 | |
| 6346 | RangeT getODSOperands(unsigned index) { |
| 6347 | auto valueRange = getODSOperandIndexAndLength(index); |
| 6348 | return {std::next(odsOperands.begin(), valueRange.first), |
| 6349 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 6350 | } |
| 6351 | |
| 6352 | ValueT getIn() { |
| 6353 | return (*getODSOperands(index: 0).begin()); |
| 6354 | } |
| 6355 | |
| 6356 | RangeT getOperands() { |
| 6357 | return odsOperands; |
| 6358 | } |
| 6359 | |
| 6360 | private: |
| 6361 | RangeT odsOperands; |
| 6362 | }; |
| 6363 | class IndexCastOpAdaptor : public IndexCastOpGenericAdaptor<::mlir::ValueRange> { |
| 6364 | public: |
| 6365 | using IndexCastOpGenericAdaptor::IndexCastOpGenericAdaptor; |
| 6366 | IndexCastOpAdaptor(IndexCastOp op); |
| 6367 | |
| 6368 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 6369 | }; |
| 6370 | class IndexCastOp : public ::mlir::Op<IndexCastOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::InferIntRangeInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 6371 | public: |
| 6372 | using Op::Op; |
| 6373 | using Op::print; |
| 6374 | using Adaptor = IndexCastOpAdaptor; |
| 6375 | template <typename RangeT> |
| 6376 | using GenericAdaptor = IndexCastOpGenericAdaptor<RangeT>; |
| 6377 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 6378 | static constexpr int odsIndex_in = 0; |
| 6379 | static constexpr int odsIndex_out = 0; |
| 6380 | using Properties = FoldAdaptor::Properties; |
| 6381 | using ::mlir::InferIntRangeInterface::Trait<IndexCastOp>::inferResultRangesFromOptional; |
| 6382 | using ::mlir::VectorUnrollOpInterface::Trait<IndexCastOp>::getIterationShapeToUnroll; |
| 6383 | using ::mlir::VectorUnrollOpInterface::Trait<IndexCastOp>::getDefaultUnrollTargetShape; |
| 6384 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 6385 | return {}; |
| 6386 | } |
| 6387 | |
| 6388 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 6389 | return ::llvm::StringLiteral("arith.index_cast" ); |
| 6390 | } |
| 6391 | |
| 6392 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 6393 | return {index, 1}; |
| 6394 | } |
| 6395 | |
| 6396 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 6397 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 6398 | return getOperation()->getOperands().slice(n: start, m: length); |
| 6399 | } |
| 6400 | |
| 6401 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 6402 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 6403 | } |
| 6404 | |
| 6405 | ::mlir::OpOperand &getInMutable() { |
| 6406 | auto range = getODSOperandIndexAndLength(index: 0); |
| 6407 | return getOperation()->getOpOperand(idx: range.first); |
| 6408 | } |
| 6409 | |
| 6410 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 6411 | return {index, 1}; |
| 6412 | } |
| 6413 | |
| 6414 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 6415 | auto valueRange = getODSResultIndexAndLength(index); |
| 6416 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 6417 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 6418 | } |
| 6419 | |
| 6420 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 6421 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 6422 | } |
| 6423 | |
| 6424 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 6425 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 6426 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 6427 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 6428 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 6429 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 6430 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 6431 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in); |
| 6432 | static IndexCastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in); |
| 6433 | static IndexCastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in); |
| 6434 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 6435 | static IndexCastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 6436 | static IndexCastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 6437 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6438 | static IndexCastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6439 | static IndexCastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6440 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6441 | static IndexCastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6442 | static IndexCastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6443 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 6444 | ::llvm::LogicalResult verifyInvariants(); |
| 6445 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 6446 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 6447 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 6448 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 6449 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 6450 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 6451 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 6452 | public: |
| 6453 | }; |
| 6454 | |
| 6455 | } // namespace mlir::arith |
| 6456 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::IndexCastOp) |
| 6457 | |
| 6458 | namespace mlir::arith { |
| 6459 | |
| 6460 | |
| 6461 | //===----------------------------------------------------------------------===// |
| 6462 | // ::mlir::arith::IndexCastUIOp declarations |
| 6463 | //===----------------------------------------------------------------------===// |
| 6464 | |
| 6465 | namespace detail { |
| 6466 | |
| 6467 | class IndexCastUIOpGenericAdaptorBase { |
| 6468 | public: |
| 6469 | struct Properties { |
| 6470 | using nonNegTy = ::mlir::UnitAttr; |
| 6471 | nonNegTy nonNeg; |
| 6472 | |
| 6473 | auto getNonNeg() const { |
| 6474 | auto &propStorage = this->nonNeg; |
| 6475 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val: propStorage); |
| 6476 | } |
| 6477 | void setNonNeg(const ::mlir::UnitAttr &propValue) { |
| 6478 | this->nonNeg = propValue; |
| 6479 | } |
| 6480 | bool operator==(const Properties &rhs) const { |
| 6481 | return |
| 6482 | rhs.nonNeg == this->nonNeg && |
| 6483 | true; |
| 6484 | } |
| 6485 | bool operator!=(const Properties &rhs) const { |
| 6486 | return !(*this == rhs); |
| 6487 | } |
| 6488 | }; |
| 6489 | protected: |
| 6490 | ::mlir::DictionaryAttr odsAttrs; |
| 6491 | ::std::optional<::mlir::OperationName> odsOpName; |
| 6492 | Properties properties; |
| 6493 | ::mlir::RegionRange odsRegions; |
| 6494 | public: |
| 6495 | IndexCastUIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 6496 | odsOpName.emplace(args: "arith.index_castui" , args: odsAttrs.getContext()); |
| 6497 | } |
| 6498 | |
| 6499 | IndexCastUIOpGenericAdaptorBase(IndexCastUIOp op); |
| 6500 | |
| 6501 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 6502 | return {index, 1}; |
| 6503 | } |
| 6504 | |
| 6505 | const Properties &getProperties() { |
| 6506 | return properties; |
| 6507 | } |
| 6508 | |
| 6509 | ::mlir::DictionaryAttr getAttributes() { |
| 6510 | return odsAttrs; |
| 6511 | } |
| 6512 | |
| 6513 | ::mlir::UnitAttr getNonNegAttr(); |
| 6514 | bool getNonNeg(); |
| 6515 | }; |
| 6516 | |
| 6517 | } // namespace detail |
| 6518 | template <typename RangeT> |
| 6519 | class IndexCastUIOpGenericAdaptor : public detail::IndexCastUIOpGenericAdaptorBase { |
| 6520 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 6521 | using Base = detail::IndexCastUIOpGenericAdaptorBase; |
| 6522 | static constexpr int odsIndex_in = 0; |
| 6523 | public: |
| 6524 | IndexCastUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 6525 | |
| 6526 | IndexCastUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : IndexCastUIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 6527 | |
| 6528 | IndexCastUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : IndexCastUIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 6529 | |
| 6530 | IndexCastUIOpGenericAdaptor(RangeT values, const IndexCastUIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 6531 | |
| 6532 | template <typename LateInst = IndexCastUIOp, typename = std::enable_if_t<std::is_same_v<LateInst, IndexCastUIOp>>> |
| 6533 | IndexCastUIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 6534 | |
| 6535 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 6536 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 6537 | } |
| 6538 | |
| 6539 | RangeT getODSOperands(unsigned index) { |
| 6540 | auto valueRange = getODSOperandIndexAndLength(index); |
| 6541 | return {std::next(odsOperands.begin(), valueRange.first), |
| 6542 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 6543 | } |
| 6544 | |
| 6545 | ValueT getIn() { |
| 6546 | return (*getODSOperands(index: 0).begin()); |
| 6547 | } |
| 6548 | |
| 6549 | RangeT getOperands() { |
| 6550 | return odsOperands; |
| 6551 | } |
| 6552 | |
| 6553 | private: |
| 6554 | RangeT odsOperands; |
| 6555 | }; |
| 6556 | class IndexCastUIOpAdaptor : public IndexCastUIOpGenericAdaptor<::mlir::ValueRange> { |
| 6557 | public: |
| 6558 | using IndexCastUIOpGenericAdaptor::IndexCastUIOpGenericAdaptor; |
| 6559 | IndexCastUIOpAdaptor(IndexCastUIOp op); |
| 6560 | |
| 6561 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 6562 | }; |
| 6563 | class IndexCastUIOp : public ::mlir::Op<IndexCastUIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::arith::ArithNonNegFlagInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 6564 | public: |
| 6565 | using Op::Op; |
| 6566 | using Op::print; |
| 6567 | using Adaptor = IndexCastUIOpAdaptor; |
| 6568 | template <typename RangeT> |
| 6569 | using GenericAdaptor = IndexCastUIOpGenericAdaptor<RangeT>; |
| 6570 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 6571 | static constexpr int odsIndex_in = 0; |
| 6572 | static constexpr int odsIndex_out = 0; |
| 6573 | using Properties = FoldAdaptor::Properties; |
| 6574 | using ::mlir::InferIntRangeInterface::Trait<IndexCastUIOp>::inferResultRangesFromOptional; |
| 6575 | using ::mlir::arith::ArithNonNegFlagInterface::Trait<IndexCastUIOp>::getNonNeg; |
| 6576 | using ::mlir::arith::ArithNonNegFlagInterface::Trait<IndexCastUIOp>::setNonNeg; |
| 6577 | using ::mlir::arith::ArithNonNegFlagInterface::Trait<IndexCastUIOp>::getNonNegFlagAttrName; |
| 6578 | using ::mlir::VectorUnrollOpInterface::Trait<IndexCastUIOp>::getIterationShapeToUnroll; |
| 6579 | using ::mlir::VectorUnrollOpInterface::Trait<IndexCastUIOp>::getDefaultUnrollTargetShape; |
| 6580 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 6581 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("nonNeg" )}; |
| 6582 | return ::llvm::ArrayRef(attrNames); |
| 6583 | } |
| 6584 | |
| 6585 | ::mlir::StringAttr getNonNegAttrName() { |
| 6586 | return getAttributeNameForIndex(index: 0); |
| 6587 | } |
| 6588 | |
| 6589 | static ::mlir::StringAttr getNonNegAttrName(::mlir::OperationName name) { |
| 6590 | return getAttributeNameForIndex(name, index: 0); |
| 6591 | } |
| 6592 | |
| 6593 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 6594 | return ::llvm::StringLiteral("arith.index_castui" ); |
| 6595 | } |
| 6596 | |
| 6597 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 6598 | return {index, 1}; |
| 6599 | } |
| 6600 | |
| 6601 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 6602 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 6603 | return getOperation()->getOperands().slice(n: start, m: length); |
| 6604 | } |
| 6605 | |
| 6606 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 6607 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 6608 | } |
| 6609 | |
| 6610 | ::mlir::OpOperand &getInMutable() { |
| 6611 | auto range = getODSOperandIndexAndLength(index: 0); |
| 6612 | return getOperation()->getOpOperand(idx: range.first); |
| 6613 | } |
| 6614 | |
| 6615 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 6616 | return {index, 1}; |
| 6617 | } |
| 6618 | |
| 6619 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 6620 | auto valueRange = getODSResultIndexAndLength(index); |
| 6621 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 6622 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 6623 | } |
| 6624 | |
| 6625 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 6626 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 6627 | } |
| 6628 | |
| 6629 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 6630 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 6631 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 6632 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 6633 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 6634 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 6635 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 6636 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 6637 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 6638 | ::mlir::UnitAttr getNonNegAttr() { |
| 6639 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val&: getProperties().nonNeg); |
| 6640 | } |
| 6641 | |
| 6642 | bool getNonNeg(); |
| 6643 | void setNonNegAttr(::mlir::UnitAttr attr) { |
| 6644 | getProperties().nonNeg = attr; |
| 6645 | } |
| 6646 | |
| 6647 | void setNonNeg(bool attrValue); |
| 6648 | ::mlir::Attribute removeNonNegAttr() { |
| 6649 | auto attr = getProperties().nonNeg; |
| 6650 | getProperties().nonNeg = {}; |
| 6651 | return attr; |
| 6652 | } |
| 6653 | |
| 6654 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 6655 | static IndexCastUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 6656 | static IndexCastUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 6657 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 6658 | static IndexCastUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 6659 | static IndexCastUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 6660 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 6661 | static IndexCastUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 6662 | static IndexCastUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 6663 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 6664 | static IndexCastUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 6665 | static IndexCastUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 6666 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6667 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6668 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6669 | static IndexCastUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6670 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6671 | static IndexCastUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6672 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6673 | static IndexCastUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6674 | static IndexCastUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6675 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 6676 | ::llvm::LogicalResult verifyInvariants(); |
| 6677 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 6678 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 6679 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 6680 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 6681 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 6682 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 6683 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 6684 | private: |
| 6685 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 6686 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 6687 | } |
| 6688 | |
| 6689 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 6690 | assert(index < 1 && "invalid attribute index" ); |
| 6691 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 6692 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 6693 | "dependent dialect loading?" ); |
| 6694 | return name.getAttributeNames()[index]; |
| 6695 | } |
| 6696 | |
| 6697 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 6698 | public: |
| 6699 | }; |
| 6700 | |
| 6701 | } // namespace mlir::arith |
| 6702 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::IndexCastUIOp) |
| 6703 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::IndexCastUIOpGenericAdaptorBase::Properties) |
| 6704 | |
| 6705 | namespace mlir::arith { |
| 6706 | |
| 6707 | |
| 6708 | //===----------------------------------------------------------------------===// |
| 6709 | // ::mlir::arith::MaxNumFOp declarations |
| 6710 | //===----------------------------------------------------------------------===// |
| 6711 | |
| 6712 | namespace detail { |
| 6713 | |
| 6714 | class MaxNumFOpGenericAdaptorBase { |
| 6715 | public: |
| 6716 | struct Properties { |
| 6717 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 6718 | fastmathTy fastmath; |
| 6719 | |
| 6720 | auto getFastmath() const { |
| 6721 | auto &propStorage = this->fastmath; |
| 6722 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 6723 | } |
| 6724 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 6725 | this->fastmath = propValue; |
| 6726 | } |
| 6727 | bool operator==(const Properties &rhs) const { |
| 6728 | return |
| 6729 | rhs.fastmath == this->fastmath && |
| 6730 | true; |
| 6731 | } |
| 6732 | bool operator!=(const Properties &rhs) const { |
| 6733 | return !(*this == rhs); |
| 6734 | } |
| 6735 | }; |
| 6736 | protected: |
| 6737 | ::mlir::DictionaryAttr odsAttrs; |
| 6738 | ::std::optional<::mlir::OperationName> odsOpName; |
| 6739 | Properties properties; |
| 6740 | ::mlir::RegionRange odsRegions; |
| 6741 | public: |
| 6742 | MaxNumFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 6743 | odsOpName.emplace(args: "arith.maxnumf" , args: odsAttrs.getContext()); |
| 6744 | } |
| 6745 | |
| 6746 | MaxNumFOpGenericAdaptorBase(MaxNumFOp op); |
| 6747 | |
| 6748 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 6749 | return {index, 1}; |
| 6750 | } |
| 6751 | |
| 6752 | const Properties &getProperties() { |
| 6753 | return properties; |
| 6754 | } |
| 6755 | |
| 6756 | ::mlir::DictionaryAttr getAttributes() { |
| 6757 | return odsAttrs; |
| 6758 | } |
| 6759 | |
| 6760 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 6761 | ::mlir::arith::FastMathFlags getFastmath(); |
| 6762 | }; |
| 6763 | |
| 6764 | } // namespace detail |
| 6765 | template <typename RangeT> |
| 6766 | class MaxNumFOpGenericAdaptor : public detail::MaxNumFOpGenericAdaptorBase { |
| 6767 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 6768 | using Base = detail::MaxNumFOpGenericAdaptorBase; |
| 6769 | static constexpr int odsIndex_lhs = 0; |
| 6770 | static constexpr int odsIndex_rhs = 1; |
| 6771 | public: |
| 6772 | MaxNumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 6773 | |
| 6774 | MaxNumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MaxNumFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 6775 | |
| 6776 | MaxNumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MaxNumFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 6777 | |
| 6778 | MaxNumFOpGenericAdaptor(RangeT values, const MaxNumFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 6779 | |
| 6780 | template <typename LateInst = MaxNumFOp, typename = std::enable_if_t<std::is_same_v<LateInst, MaxNumFOp>>> |
| 6781 | MaxNumFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 6782 | |
| 6783 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 6784 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 6785 | } |
| 6786 | |
| 6787 | RangeT getODSOperands(unsigned index) { |
| 6788 | auto valueRange = getODSOperandIndexAndLength(index); |
| 6789 | return {std::next(odsOperands.begin(), valueRange.first), |
| 6790 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 6791 | } |
| 6792 | |
| 6793 | ValueT getLhs() { |
| 6794 | return (*getODSOperands(index: 0).begin()); |
| 6795 | } |
| 6796 | |
| 6797 | ValueT getRhs() { |
| 6798 | return (*getODSOperands(index: 1).begin()); |
| 6799 | } |
| 6800 | |
| 6801 | RangeT getOperands() { |
| 6802 | return odsOperands; |
| 6803 | } |
| 6804 | |
| 6805 | private: |
| 6806 | RangeT odsOperands; |
| 6807 | }; |
| 6808 | class MaxNumFOpAdaptor : public MaxNumFOpGenericAdaptor<::mlir::ValueRange> { |
| 6809 | public: |
| 6810 | using MaxNumFOpGenericAdaptor::MaxNumFOpGenericAdaptor; |
| 6811 | MaxNumFOpAdaptor(MaxNumFOp op); |
| 6812 | |
| 6813 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 6814 | }; |
| 6815 | class MaxNumFOp : public ::mlir::Op<MaxNumFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 6816 | public: |
| 6817 | using Op::Op; |
| 6818 | using Op::print; |
| 6819 | using Adaptor = MaxNumFOpAdaptor; |
| 6820 | template <typename RangeT> |
| 6821 | using GenericAdaptor = MaxNumFOpGenericAdaptor<RangeT>; |
| 6822 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 6823 | static constexpr int odsIndex_lhs = 0; |
| 6824 | static constexpr int odsIndex_rhs = 1; |
| 6825 | static constexpr int odsIndex_result = 0; |
| 6826 | using Properties = FoldAdaptor::Properties; |
| 6827 | using ::mlir::arith::ArithFastMathInterface::Trait<MaxNumFOp>::getFastMathFlagsAttr; |
| 6828 | using ::mlir::arith::ArithFastMathInterface::Trait<MaxNumFOp>::getFastMathAttrName; |
| 6829 | using ::mlir::VectorUnrollOpInterface::Trait<MaxNumFOp>::getIterationShapeToUnroll; |
| 6830 | using ::mlir::VectorUnrollOpInterface::Trait<MaxNumFOp>::getDefaultUnrollTargetShape; |
| 6831 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 6832 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" )}; |
| 6833 | return ::llvm::ArrayRef(attrNames); |
| 6834 | } |
| 6835 | |
| 6836 | ::mlir::StringAttr getFastmathAttrName() { |
| 6837 | return getAttributeNameForIndex(index: 0); |
| 6838 | } |
| 6839 | |
| 6840 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 6841 | return getAttributeNameForIndex(name, index: 0); |
| 6842 | } |
| 6843 | |
| 6844 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 6845 | return ::llvm::StringLiteral("arith.maxnumf" ); |
| 6846 | } |
| 6847 | |
| 6848 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 6849 | return {index, 1}; |
| 6850 | } |
| 6851 | |
| 6852 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 6853 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 6854 | return getOperation()->getOperands().slice(n: start, m: length); |
| 6855 | } |
| 6856 | |
| 6857 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 6858 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 6859 | } |
| 6860 | |
| 6861 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 6862 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 6863 | } |
| 6864 | |
| 6865 | ::mlir::OpOperand &getLhsMutable() { |
| 6866 | auto range = getODSOperandIndexAndLength(index: 0); |
| 6867 | return getOperation()->getOpOperand(idx: range.first); |
| 6868 | } |
| 6869 | |
| 6870 | ::mlir::OpOperand &getRhsMutable() { |
| 6871 | auto range = getODSOperandIndexAndLength(index: 1); |
| 6872 | return getOperation()->getOpOperand(idx: range.first); |
| 6873 | } |
| 6874 | |
| 6875 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 6876 | return {index, 1}; |
| 6877 | } |
| 6878 | |
| 6879 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 6880 | auto valueRange = getODSResultIndexAndLength(index); |
| 6881 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 6882 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 6883 | } |
| 6884 | |
| 6885 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 6886 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 6887 | } |
| 6888 | |
| 6889 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 6890 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 6891 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 6892 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 6893 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 6894 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 6895 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 6896 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 6897 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 6898 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 6899 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 6900 | } |
| 6901 | |
| 6902 | ::mlir::arith::FastMathFlags getFastmath(); |
| 6903 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 6904 | getProperties().fastmath = attr; |
| 6905 | } |
| 6906 | |
| 6907 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 6908 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6909 | static MaxNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6910 | static MaxNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6911 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6912 | static MaxNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6913 | static MaxNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6914 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6915 | static MaxNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6916 | static MaxNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 6917 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6918 | static MaxNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6919 | static MaxNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6920 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6921 | static MaxNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6922 | static MaxNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6923 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6924 | static MaxNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6925 | static MaxNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 6926 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6927 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6928 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6929 | static MaxNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6930 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6931 | static MaxNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6932 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6933 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6934 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6935 | static MaxNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6936 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 6937 | static MaxNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 6938 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6939 | static MaxNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6940 | static MaxNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6941 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6942 | static MaxNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6943 | static MaxNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 6944 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 6945 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 6946 | ::llvm::LogicalResult verifyInvariants(); |
| 6947 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 6948 | 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); |
| 6949 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 6950 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 6951 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 6952 | private: |
| 6953 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 6954 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 6955 | } |
| 6956 | |
| 6957 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 6958 | assert(index < 1 && "invalid attribute index" ); |
| 6959 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 6960 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 6961 | "dependent dialect loading?" ); |
| 6962 | return name.getAttributeNames()[index]; |
| 6963 | } |
| 6964 | |
| 6965 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 6966 | public: |
| 6967 | }; |
| 6968 | |
| 6969 | } // namespace mlir::arith |
| 6970 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MaxNumFOp) |
| 6971 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::MaxNumFOpGenericAdaptorBase::Properties) |
| 6972 | |
| 6973 | namespace mlir::arith { |
| 6974 | |
| 6975 | |
| 6976 | //===----------------------------------------------------------------------===// |
| 6977 | // ::mlir::arith::MaxSIOp declarations |
| 6978 | //===----------------------------------------------------------------------===// |
| 6979 | |
| 6980 | namespace detail { |
| 6981 | |
| 6982 | class MaxSIOpGenericAdaptorBase { |
| 6983 | public: |
| 6984 | using Properties = ::mlir::EmptyProperties; |
| 6985 | protected: |
| 6986 | ::mlir::DictionaryAttr odsAttrs; |
| 6987 | ::std::optional<::mlir::OperationName> odsOpName; |
| 6988 | Properties properties; |
| 6989 | ::mlir::RegionRange odsRegions; |
| 6990 | public: |
| 6991 | MaxSIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 6992 | odsOpName.emplace(args: "arith.maxsi" , args: odsAttrs.getContext()); |
| 6993 | } |
| 6994 | |
| 6995 | MaxSIOpGenericAdaptorBase(MaxSIOp op); |
| 6996 | |
| 6997 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 6998 | return {index, 1}; |
| 6999 | } |
| 7000 | |
| 7001 | const Properties &getProperties() { |
| 7002 | return properties; |
| 7003 | } |
| 7004 | |
| 7005 | ::mlir::DictionaryAttr getAttributes() { |
| 7006 | return odsAttrs; |
| 7007 | } |
| 7008 | |
| 7009 | }; |
| 7010 | |
| 7011 | } // namespace detail |
| 7012 | template <typename RangeT> |
| 7013 | class MaxSIOpGenericAdaptor : public detail::MaxSIOpGenericAdaptorBase { |
| 7014 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 7015 | using Base = detail::MaxSIOpGenericAdaptorBase; |
| 7016 | static constexpr int odsIndex_lhs = 0; |
| 7017 | static constexpr int odsIndex_rhs = 1; |
| 7018 | public: |
| 7019 | MaxSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 7020 | |
| 7021 | MaxSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MaxSIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 7022 | |
| 7023 | MaxSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MaxSIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 7024 | |
| 7025 | MaxSIOpGenericAdaptor(RangeT values, const MaxSIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 7026 | |
| 7027 | template <typename LateInst = MaxSIOp, typename = std::enable_if_t<std::is_same_v<LateInst, MaxSIOp>>> |
| 7028 | MaxSIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 7029 | |
| 7030 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 7031 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 7032 | } |
| 7033 | |
| 7034 | RangeT getODSOperands(unsigned index) { |
| 7035 | auto valueRange = getODSOperandIndexAndLength(index); |
| 7036 | return {std::next(odsOperands.begin(), valueRange.first), |
| 7037 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 7038 | } |
| 7039 | |
| 7040 | ValueT getLhs() { |
| 7041 | return (*getODSOperands(index: 0).begin()); |
| 7042 | } |
| 7043 | |
| 7044 | ValueT getRhs() { |
| 7045 | return (*getODSOperands(index: 1).begin()); |
| 7046 | } |
| 7047 | |
| 7048 | RangeT getOperands() { |
| 7049 | return odsOperands; |
| 7050 | } |
| 7051 | |
| 7052 | private: |
| 7053 | RangeT odsOperands; |
| 7054 | }; |
| 7055 | class MaxSIOpAdaptor : public MaxSIOpGenericAdaptor<::mlir::ValueRange> { |
| 7056 | public: |
| 7057 | using MaxSIOpGenericAdaptor::MaxSIOpGenericAdaptor; |
| 7058 | MaxSIOpAdaptor(MaxSIOp op); |
| 7059 | |
| 7060 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 7061 | }; |
| 7062 | class MaxSIOp : public ::mlir::Op<MaxSIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::IsCommutative, ::mlir::InferIntDivisibilityOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 7063 | public: |
| 7064 | using Op::Op; |
| 7065 | using Op::print; |
| 7066 | using Adaptor = MaxSIOpAdaptor; |
| 7067 | template <typename RangeT> |
| 7068 | using GenericAdaptor = MaxSIOpGenericAdaptor<RangeT>; |
| 7069 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 7070 | static constexpr int odsIndex_lhs = 0; |
| 7071 | static constexpr int odsIndex_rhs = 1; |
| 7072 | static constexpr int odsIndex_result = 0; |
| 7073 | using Properties = FoldAdaptor::Properties; |
| 7074 | using ::mlir::InferIntRangeInterface::Trait<MaxSIOp>::inferResultRangesFromOptional; |
| 7075 | using ::mlir::VectorUnrollOpInterface::Trait<MaxSIOp>::getIterationShapeToUnroll; |
| 7076 | using ::mlir::VectorUnrollOpInterface::Trait<MaxSIOp>::getDefaultUnrollTargetShape; |
| 7077 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 7078 | return {}; |
| 7079 | } |
| 7080 | |
| 7081 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 7082 | return ::llvm::StringLiteral("arith.maxsi" ); |
| 7083 | } |
| 7084 | |
| 7085 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 7086 | return {index, 1}; |
| 7087 | } |
| 7088 | |
| 7089 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 7090 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 7091 | return getOperation()->getOperands().slice(n: start, m: length); |
| 7092 | } |
| 7093 | |
| 7094 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 7095 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 7096 | } |
| 7097 | |
| 7098 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 7099 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 7100 | } |
| 7101 | |
| 7102 | ::mlir::OpOperand &getLhsMutable() { |
| 7103 | auto range = getODSOperandIndexAndLength(index: 0); |
| 7104 | return getOperation()->getOpOperand(idx: range.first); |
| 7105 | } |
| 7106 | |
| 7107 | ::mlir::OpOperand &getRhsMutable() { |
| 7108 | auto range = getODSOperandIndexAndLength(index: 1); |
| 7109 | return getOperation()->getOpOperand(idx: range.first); |
| 7110 | } |
| 7111 | |
| 7112 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 7113 | return {index, 1}; |
| 7114 | } |
| 7115 | |
| 7116 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 7117 | auto valueRange = getODSResultIndexAndLength(index); |
| 7118 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 7119 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 7120 | } |
| 7121 | |
| 7122 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 7123 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 7124 | } |
| 7125 | |
| 7126 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 7127 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 7128 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 7129 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 7130 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 7131 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 7132 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 7133 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7134 | static MaxSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7135 | static MaxSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7136 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7137 | static MaxSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7138 | static MaxSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7139 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7140 | static MaxSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7141 | static MaxSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7142 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7143 | static MaxSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7144 | static MaxSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7145 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7146 | static MaxSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7147 | static MaxSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7148 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7149 | static MaxSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7150 | static MaxSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7151 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7152 | static MaxSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7153 | static MaxSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7154 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 7155 | ::llvm::LogicalResult verifyInvariants(); |
| 7156 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 7157 | 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); |
| 7158 | void inferResultDivisibility(::llvm::ArrayRef<::mlir::IntegerDivisibility> argDivs, ::mlir::SetIntDivisibilityFn setResultDivs); |
| 7159 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 7160 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 7161 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 7162 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 7163 | public: |
| 7164 | }; |
| 7165 | |
| 7166 | } // namespace mlir::arith |
| 7167 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MaxSIOp) |
| 7168 | |
| 7169 | namespace mlir::arith { |
| 7170 | |
| 7171 | |
| 7172 | //===----------------------------------------------------------------------===// |
| 7173 | // ::mlir::arith::MaxUIOp declarations |
| 7174 | //===----------------------------------------------------------------------===// |
| 7175 | |
| 7176 | namespace detail { |
| 7177 | |
| 7178 | class MaxUIOpGenericAdaptorBase { |
| 7179 | public: |
| 7180 | using Properties = ::mlir::EmptyProperties; |
| 7181 | protected: |
| 7182 | ::mlir::DictionaryAttr odsAttrs; |
| 7183 | ::std::optional<::mlir::OperationName> odsOpName; |
| 7184 | Properties properties; |
| 7185 | ::mlir::RegionRange odsRegions; |
| 7186 | public: |
| 7187 | MaxUIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 7188 | odsOpName.emplace(args: "arith.maxui" , args: odsAttrs.getContext()); |
| 7189 | } |
| 7190 | |
| 7191 | MaxUIOpGenericAdaptorBase(MaxUIOp op); |
| 7192 | |
| 7193 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 7194 | return {index, 1}; |
| 7195 | } |
| 7196 | |
| 7197 | const Properties &getProperties() { |
| 7198 | return properties; |
| 7199 | } |
| 7200 | |
| 7201 | ::mlir::DictionaryAttr getAttributes() { |
| 7202 | return odsAttrs; |
| 7203 | } |
| 7204 | |
| 7205 | }; |
| 7206 | |
| 7207 | } // namespace detail |
| 7208 | template <typename RangeT> |
| 7209 | class MaxUIOpGenericAdaptor : public detail::MaxUIOpGenericAdaptorBase { |
| 7210 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 7211 | using Base = detail::MaxUIOpGenericAdaptorBase; |
| 7212 | static constexpr int odsIndex_lhs = 0; |
| 7213 | static constexpr int odsIndex_rhs = 1; |
| 7214 | public: |
| 7215 | MaxUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 7216 | |
| 7217 | MaxUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MaxUIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 7218 | |
| 7219 | MaxUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MaxUIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 7220 | |
| 7221 | MaxUIOpGenericAdaptor(RangeT values, const MaxUIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 7222 | |
| 7223 | template <typename LateInst = MaxUIOp, typename = std::enable_if_t<std::is_same_v<LateInst, MaxUIOp>>> |
| 7224 | MaxUIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 7225 | |
| 7226 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 7227 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 7228 | } |
| 7229 | |
| 7230 | RangeT getODSOperands(unsigned index) { |
| 7231 | auto valueRange = getODSOperandIndexAndLength(index); |
| 7232 | return {std::next(odsOperands.begin(), valueRange.first), |
| 7233 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 7234 | } |
| 7235 | |
| 7236 | ValueT getLhs() { |
| 7237 | return (*getODSOperands(index: 0).begin()); |
| 7238 | } |
| 7239 | |
| 7240 | ValueT getRhs() { |
| 7241 | return (*getODSOperands(index: 1).begin()); |
| 7242 | } |
| 7243 | |
| 7244 | RangeT getOperands() { |
| 7245 | return odsOperands; |
| 7246 | } |
| 7247 | |
| 7248 | private: |
| 7249 | RangeT odsOperands; |
| 7250 | }; |
| 7251 | class MaxUIOpAdaptor : public MaxUIOpGenericAdaptor<::mlir::ValueRange> { |
| 7252 | public: |
| 7253 | using MaxUIOpGenericAdaptor::MaxUIOpGenericAdaptor; |
| 7254 | MaxUIOpAdaptor(MaxUIOp op); |
| 7255 | |
| 7256 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 7257 | }; |
| 7258 | class MaxUIOp : public ::mlir::Op<MaxUIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::IsCommutative, ::mlir::InferIntDivisibilityOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 7259 | public: |
| 7260 | using Op::Op; |
| 7261 | using Op::print; |
| 7262 | using Adaptor = MaxUIOpAdaptor; |
| 7263 | template <typename RangeT> |
| 7264 | using GenericAdaptor = MaxUIOpGenericAdaptor<RangeT>; |
| 7265 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 7266 | static constexpr int odsIndex_lhs = 0; |
| 7267 | static constexpr int odsIndex_rhs = 1; |
| 7268 | static constexpr int odsIndex_result = 0; |
| 7269 | using Properties = FoldAdaptor::Properties; |
| 7270 | using ::mlir::InferIntRangeInterface::Trait<MaxUIOp>::inferResultRangesFromOptional; |
| 7271 | using ::mlir::VectorUnrollOpInterface::Trait<MaxUIOp>::getIterationShapeToUnroll; |
| 7272 | using ::mlir::VectorUnrollOpInterface::Trait<MaxUIOp>::getDefaultUnrollTargetShape; |
| 7273 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 7274 | return {}; |
| 7275 | } |
| 7276 | |
| 7277 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 7278 | return ::llvm::StringLiteral("arith.maxui" ); |
| 7279 | } |
| 7280 | |
| 7281 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 7282 | return {index, 1}; |
| 7283 | } |
| 7284 | |
| 7285 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 7286 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 7287 | return getOperation()->getOperands().slice(n: start, m: length); |
| 7288 | } |
| 7289 | |
| 7290 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 7291 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 7292 | } |
| 7293 | |
| 7294 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 7295 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 7296 | } |
| 7297 | |
| 7298 | ::mlir::OpOperand &getLhsMutable() { |
| 7299 | auto range = getODSOperandIndexAndLength(index: 0); |
| 7300 | return getOperation()->getOpOperand(idx: range.first); |
| 7301 | } |
| 7302 | |
| 7303 | ::mlir::OpOperand &getRhsMutable() { |
| 7304 | auto range = getODSOperandIndexAndLength(index: 1); |
| 7305 | return getOperation()->getOpOperand(idx: range.first); |
| 7306 | } |
| 7307 | |
| 7308 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 7309 | return {index, 1}; |
| 7310 | } |
| 7311 | |
| 7312 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 7313 | auto valueRange = getODSResultIndexAndLength(index); |
| 7314 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 7315 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 7316 | } |
| 7317 | |
| 7318 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 7319 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 7320 | } |
| 7321 | |
| 7322 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 7323 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 7324 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 7325 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 7326 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 7327 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 7328 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 7329 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7330 | static MaxUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7331 | static MaxUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7332 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7333 | static MaxUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7334 | static MaxUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7335 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7336 | static MaxUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7337 | static MaxUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 7338 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7339 | static MaxUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7340 | static MaxUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7341 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7342 | static MaxUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7343 | static MaxUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7344 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7345 | static MaxUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7346 | static MaxUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7347 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7348 | static MaxUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7349 | static MaxUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7350 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 7351 | ::llvm::LogicalResult verifyInvariants(); |
| 7352 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 7353 | 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); |
| 7354 | void inferResultDivisibility(::llvm::ArrayRef<::mlir::IntegerDivisibility> argDivs, ::mlir::SetIntDivisibilityFn setResultDivs); |
| 7355 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 7356 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 7357 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 7358 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 7359 | public: |
| 7360 | }; |
| 7361 | |
| 7362 | } // namespace mlir::arith |
| 7363 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MaxUIOp) |
| 7364 | |
| 7365 | namespace mlir::arith { |
| 7366 | |
| 7367 | |
| 7368 | //===----------------------------------------------------------------------===// |
| 7369 | // ::mlir::arith::MaximumFOp declarations |
| 7370 | //===----------------------------------------------------------------------===// |
| 7371 | |
| 7372 | namespace detail { |
| 7373 | |
| 7374 | class MaximumFOpGenericAdaptorBase { |
| 7375 | public: |
| 7376 | struct Properties { |
| 7377 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 7378 | fastmathTy fastmath; |
| 7379 | |
| 7380 | auto getFastmath() const { |
| 7381 | auto &propStorage = this->fastmath; |
| 7382 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 7383 | } |
| 7384 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 7385 | this->fastmath = propValue; |
| 7386 | } |
| 7387 | bool operator==(const Properties &rhs) const { |
| 7388 | return |
| 7389 | rhs.fastmath == this->fastmath && |
| 7390 | true; |
| 7391 | } |
| 7392 | bool operator!=(const Properties &rhs) const { |
| 7393 | return !(*this == rhs); |
| 7394 | } |
| 7395 | }; |
| 7396 | protected: |
| 7397 | ::mlir::DictionaryAttr odsAttrs; |
| 7398 | ::std::optional<::mlir::OperationName> odsOpName; |
| 7399 | Properties properties; |
| 7400 | ::mlir::RegionRange odsRegions; |
| 7401 | public: |
| 7402 | MaximumFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 7403 | odsOpName.emplace(args: "arith.maximumf" , args: odsAttrs.getContext()); |
| 7404 | } |
| 7405 | |
| 7406 | MaximumFOpGenericAdaptorBase(MaximumFOp op); |
| 7407 | |
| 7408 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 7409 | return {index, 1}; |
| 7410 | } |
| 7411 | |
| 7412 | const Properties &getProperties() { |
| 7413 | return properties; |
| 7414 | } |
| 7415 | |
| 7416 | ::mlir::DictionaryAttr getAttributes() { |
| 7417 | return odsAttrs; |
| 7418 | } |
| 7419 | |
| 7420 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 7421 | ::mlir::arith::FastMathFlags getFastmath(); |
| 7422 | }; |
| 7423 | |
| 7424 | } // namespace detail |
| 7425 | template <typename RangeT> |
| 7426 | class MaximumFOpGenericAdaptor : public detail::MaximumFOpGenericAdaptorBase { |
| 7427 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 7428 | using Base = detail::MaximumFOpGenericAdaptorBase; |
| 7429 | static constexpr int odsIndex_lhs = 0; |
| 7430 | static constexpr int odsIndex_rhs = 1; |
| 7431 | public: |
| 7432 | MaximumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 7433 | |
| 7434 | MaximumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MaximumFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 7435 | |
| 7436 | MaximumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MaximumFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 7437 | |
| 7438 | MaximumFOpGenericAdaptor(RangeT values, const MaximumFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 7439 | |
| 7440 | template <typename LateInst = MaximumFOp, typename = std::enable_if_t<std::is_same_v<LateInst, MaximumFOp>>> |
| 7441 | MaximumFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 7442 | |
| 7443 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 7444 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 7445 | } |
| 7446 | |
| 7447 | RangeT getODSOperands(unsigned index) { |
| 7448 | auto valueRange = getODSOperandIndexAndLength(index); |
| 7449 | return {std::next(odsOperands.begin(), valueRange.first), |
| 7450 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 7451 | } |
| 7452 | |
| 7453 | ValueT getLhs() { |
| 7454 | return (*getODSOperands(index: 0).begin()); |
| 7455 | } |
| 7456 | |
| 7457 | ValueT getRhs() { |
| 7458 | return (*getODSOperands(index: 1).begin()); |
| 7459 | } |
| 7460 | |
| 7461 | RangeT getOperands() { |
| 7462 | return odsOperands; |
| 7463 | } |
| 7464 | |
| 7465 | private: |
| 7466 | RangeT odsOperands; |
| 7467 | }; |
| 7468 | class MaximumFOpAdaptor : public MaximumFOpGenericAdaptor<::mlir::ValueRange> { |
| 7469 | public: |
| 7470 | using MaximumFOpGenericAdaptor::MaximumFOpGenericAdaptor; |
| 7471 | MaximumFOpAdaptor(MaximumFOp op); |
| 7472 | |
| 7473 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 7474 | }; |
| 7475 | class MaximumFOp : public ::mlir::Op<MaximumFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 7476 | public: |
| 7477 | using Op::Op; |
| 7478 | using Op::print; |
| 7479 | using Adaptor = MaximumFOpAdaptor; |
| 7480 | template <typename RangeT> |
| 7481 | using GenericAdaptor = MaximumFOpGenericAdaptor<RangeT>; |
| 7482 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 7483 | static constexpr int odsIndex_lhs = 0; |
| 7484 | static constexpr int odsIndex_rhs = 1; |
| 7485 | static constexpr int odsIndex_result = 0; |
| 7486 | using Properties = FoldAdaptor::Properties; |
| 7487 | using ::mlir::arith::ArithFastMathInterface::Trait<MaximumFOp>::getFastMathFlagsAttr; |
| 7488 | using ::mlir::arith::ArithFastMathInterface::Trait<MaximumFOp>::getFastMathAttrName; |
| 7489 | using ::mlir::VectorUnrollOpInterface::Trait<MaximumFOp>::getIterationShapeToUnroll; |
| 7490 | using ::mlir::VectorUnrollOpInterface::Trait<MaximumFOp>::getDefaultUnrollTargetShape; |
| 7491 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 7492 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" )}; |
| 7493 | return ::llvm::ArrayRef(attrNames); |
| 7494 | } |
| 7495 | |
| 7496 | ::mlir::StringAttr getFastmathAttrName() { |
| 7497 | return getAttributeNameForIndex(index: 0); |
| 7498 | } |
| 7499 | |
| 7500 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 7501 | return getAttributeNameForIndex(name, index: 0); |
| 7502 | } |
| 7503 | |
| 7504 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 7505 | return ::llvm::StringLiteral("arith.maximumf" ); |
| 7506 | } |
| 7507 | |
| 7508 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 7509 | return {index, 1}; |
| 7510 | } |
| 7511 | |
| 7512 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 7513 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 7514 | return getOperation()->getOperands().slice(n: start, m: length); |
| 7515 | } |
| 7516 | |
| 7517 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 7518 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 7519 | } |
| 7520 | |
| 7521 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 7522 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 7523 | } |
| 7524 | |
| 7525 | ::mlir::OpOperand &getLhsMutable() { |
| 7526 | auto range = getODSOperandIndexAndLength(index: 0); |
| 7527 | return getOperation()->getOpOperand(idx: range.first); |
| 7528 | } |
| 7529 | |
| 7530 | ::mlir::OpOperand &getRhsMutable() { |
| 7531 | auto range = getODSOperandIndexAndLength(index: 1); |
| 7532 | return getOperation()->getOpOperand(idx: range.first); |
| 7533 | } |
| 7534 | |
| 7535 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 7536 | return {index, 1}; |
| 7537 | } |
| 7538 | |
| 7539 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 7540 | auto valueRange = getODSResultIndexAndLength(index); |
| 7541 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 7542 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 7543 | } |
| 7544 | |
| 7545 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 7546 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 7547 | } |
| 7548 | |
| 7549 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 7550 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 7551 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 7552 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 7553 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 7554 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 7555 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 7556 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 7557 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 7558 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 7559 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 7560 | } |
| 7561 | |
| 7562 | ::mlir::arith::FastMathFlags getFastmath(); |
| 7563 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 7564 | getProperties().fastmath = attr; |
| 7565 | } |
| 7566 | |
| 7567 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 7568 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7569 | static MaximumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7570 | static MaximumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7571 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7572 | static MaximumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7573 | static MaximumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7574 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7575 | static MaximumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7576 | static MaximumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7577 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7578 | static MaximumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7579 | static MaximumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7580 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7581 | static MaximumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7582 | static MaximumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7583 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7584 | static MaximumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7585 | static MaximumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7586 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 7587 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7588 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 7589 | static MaximumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7590 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 7591 | static MaximumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7592 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 7593 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7594 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 7595 | static MaximumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7596 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 7597 | static MaximumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7598 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7599 | static MaximumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7600 | static MaximumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7601 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7602 | static MaximumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7603 | static MaximumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7604 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 7605 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 7606 | ::llvm::LogicalResult verifyInvariants(); |
| 7607 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 7608 | 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); |
| 7609 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 7610 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 7611 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 7612 | private: |
| 7613 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 7614 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 7615 | } |
| 7616 | |
| 7617 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 7618 | assert(index < 1 && "invalid attribute index" ); |
| 7619 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 7620 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 7621 | "dependent dialect loading?" ); |
| 7622 | return name.getAttributeNames()[index]; |
| 7623 | } |
| 7624 | |
| 7625 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 7626 | public: |
| 7627 | }; |
| 7628 | |
| 7629 | } // namespace mlir::arith |
| 7630 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MaximumFOp) |
| 7631 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::MaximumFOpGenericAdaptorBase::Properties) |
| 7632 | |
| 7633 | namespace mlir::arith { |
| 7634 | |
| 7635 | |
| 7636 | //===----------------------------------------------------------------------===// |
| 7637 | // ::mlir::arith::MaximumNumFOp declarations |
| 7638 | //===----------------------------------------------------------------------===// |
| 7639 | |
| 7640 | namespace detail { |
| 7641 | |
| 7642 | class MaximumNumFOpGenericAdaptorBase { |
| 7643 | public: |
| 7644 | struct Properties { |
| 7645 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 7646 | fastmathTy fastmath; |
| 7647 | |
| 7648 | auto getFastmath() const { |
| 7649 | auto &propStorage = this->fastmath; |
| 7650 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 7651 | } |
| 7652 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 7653 | this->fastmath = propValue; |
| 7654 | } |
| 7655 | bool operator==(const Properties &rhs) const { |
| 7656 | return |
| 7657 | rhs.fastmath == this->fastmath && |
| 7658 | true; |
| 7659 | } |
| 7660 | bool operator!=(const Properties &rhs) const { |
| 7661 | return !(*this == rhs); |
| 7662 | } |
| 7663 | }; |
| 7664 | protected: |
| 7665 | ::mlir::DictionaryAttr odsAttrs; |
| 7666 | ::std::optional<::mlir::OperationName> odsOpName; |
| 7667 | Properties properties; |
| 7668 | ::mlir::RegionRange odsRegions; |
| 7669 | public: |
| 7670 | MaximumNumFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 7671 | odsOpName.emplace(args: "arith.maximumnumf" , args: odsAttrs.getContext()); |
| 7672 | } |
| 7673 | |
| 7674 | MaximumNumFOpGenericAdaptorBase(MaximumNumFOp op); |
| 7675 | |
| 7676 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 7677 | return {index, 1}; |
| 7678 | } |
| 7679 | |
| 7680 | const Properties &getProperties() { |
| 7681 | return properties; |
| 7682 | } |
| 7683 | |
| 7684 | ::mlir::DictionaryAttr getAttributes() { |
| 7685 | return odsAttrs; |
| 7686 | } |
| 7687 | |
| 7688 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 7689 | ::mlir::arith::FastMathFlags getFastmath(); |
| 7690 | }; |
| 7691 | |
| 7692 | } // namespace detail |
| 7693 | template <typename RangeT> |
| 7694 | class MaximumNumFOpGenericAdaptor : public detail::MaximumNumFOpGenericAdaptorBase { |
| 7695 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 7696 | using Base = detail::MaximumNumFOpGenericAdaptorBase; |
| 7697 | static constexpr int odsIndex_lhs = 0; |
| 7698 | static constexpr int odsIndex_rhs = 1; |
| 7699 | public: |
| 7700 | MaximumNumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 7701 | |
| 7702 | MaximumNumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MaximumNumFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 7703 | |
| 7704 | MaximumNumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MaximumNumFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 7705 | |
| 7706 | MaximumNumFOpGenericAdaptor(RangeT values, const MaximumNumFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 7707 | |
| 7708 | template <typename LateInst = MaximumNumFOp, typename = std::enable_if_t<std::is_same_v<LateInst, MaximumNumFOp>>> |
| 7709 | MaximumNumFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 7710 | |
| 7711 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 7712 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 7713 | } |
| 7714 | |
| 7715 | RangeT getODSOperands(unsigned index) { |
| 7716 | auto valueRange = getODSOperandIndexAndLength(index); |
| 7717 | return {std::next(odsOperands.begin(), valueRange.first), |
| 7718 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 7719 | } |
| 7720 | |
| 7721 | ValueT getLhs() { |
| 7722 | return (*getODSOperands(index: 0).begin()); |
| 7723 | } |
| 7724 | |
| 7725 | ValueT getRhs() { |
| 7726 | return (*getODSOperands(index: 1).begin()); |
| 7727 | } |
| 7728 | |
| 7729 | RangeT getOperands() { |
| 7730 | return odsOperands; |
| 7731 | } |
| 7732 | |
| 7733 | private: |
| 7734 | RangeT odsOperands; |
| 7735 | }; |
| 7736 | class MaximumNumFOpAdaptor : public MaximumNumFOpGenericAdaptor<::mlir::ValueRange> { |
| 7737 | public: |
| 7738 | using MaximumNumFOpGenericAdaptor::MaximumNumFOpGenericAdaptor; |
| 7739 | MaximumNumFOpAdaptor(MaximumNumFOp op); |
| 7740 | |
| 7741 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 7742 | }; |
| 7743 | class MaximumNumFOp : public ::mlir::Op<MaximumNumFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 7744 | public: |
| 7745 | using Op::Op; |
| 7746 | using Op::print; |
| 7747 | using Adaptor = MaximumNumFOpAdaptor; |
| 7748 | template <typename RangeT> |
| 7749 | using GenericAdaptor = MaximumNumFOpGenericAdaptor<RangeT>; |
| 7750 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 7751 | static constexpr int odsIndex_lhs = 0; |
| 7752 | static constexpr int odsIndex_rhs = 1; |
| 7753 | static constexpr int odsIndex_result = 0; |
| 7754 | using Properties = FoldAdaptor::Properties; |
| 7755 | using ::mlir::arith::ArithFastMathInterface::Trait<MaximumNumFOp>::getFastMathFlagsAttr; |
| 7756 | using ::mlir::arith::ArithFastMathInterface::Trait<MaximumNumFOp>::getFastMathAttrName; |
| 7757 | using ::mlir::VectorUnrollOpInterface::Trait<MaximumNumFOp>::getIterationShapeToUnroll; |
| 7758 | using ::mlir::VectorUnrollOpInterface::Trait<MaximumNumFOp>::getDefaultUnrollTargetShape; |
| 7759 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 7760 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" )}; |
| 7761 | return ::llvm::ArrayRef(attrNames); |
| 7762 | } |
| 7763 | |
| 7764 | ::mlir::StringAttr getFastmathAttrName() { |
| 7765 | return getAttributeNameForIndex(index: 0); |
| 7766 | } |
| 7767 | |
| 7768 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 7769 | return getAttributeNameForIndex(name, index: 0); |
| 7770 | } |
| 7771 | |
| 7772 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 7773 | return ::llvm::StringLiteral("arith.maximumnumf" ); |
| 7774 | } |
| 7775 | |
| 7776 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 7777 | return {index, 1}; |
| 7778 | } |
| 7779 | |
| 7780 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 7781 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 7782 | return getOperation()->getOperands().slice(n: start, m: length); |
| 7783 | } |
| 7784 | |
| 7785 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 7786 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 7787 | } |
| 7788 | |
| 7789 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 7790 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 7791 | } |
| 7792 | |
| 7793 | ::mlir::OpOperand &getLhsMutable() { |
| 7794 | auto range = getODSOperandIndexAndLength(index: 0); |
| 7795 | return getOperation()->getOpOperand(idx: range.first); |
| 7796 | } |
| 7797 | |
| 7798 | ::mlir::OpOperand &getRhsMutable() { |
| 7799 | auto range = getODSOperandIndexAndLength(index: 1); |
| 7800 | return getOperation()->getOpOperand(idx: range.first); |
| 7801 | } |
| 7802 | |
| 7803 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 7804 | return {index, 1}; |
| 7805 | } |
| 7806 | |
| 7807 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 7808 | auto valueRange = getODSResultIndexAndLength(index); |
| 7809 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 7810 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 7811 | } |
| 7812 | |
| 7813 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 7814 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 7815 | } |
| 7816 | |
| 7817 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 7818 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 7819 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 7820 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 7821 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 7822 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 7823 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 7824 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 7825 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 7826 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 7827 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 7828 | } |
| 7829 | |
| 7830 | ::mlir::arith::FastMathFlags getFastmath(); |
| 7831 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 7832 | getProperties().fastmath = attr; |
| 7833 | } |
| 7834 | |
| 7835 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 7836 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7837 | static MaximumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7838 | static MaximumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7839 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7840 | static MaximumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7841 | static MaximumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7842 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7843 | static MaximumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7844 | static MaximumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 7845 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7846 | static MaximumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7847 | static MaximumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7848 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7849 | static MaximumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7850 | static MaximumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7851 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7852 | static MaximumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7853 | static MaximumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 7854 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 7855 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7856 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 7857 | static MaximumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7858 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 7859 | static MaximumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7860 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 7861 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7862 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 7863 | static MaximumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7864 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 7865 | static MaximumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 7866 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7867 | static MaximumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7868 | static MaximumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7869 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7870 | static MaximumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7871 | static MaximumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 7872 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 7873 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 7874 | ::llvm::LogicalResult verifyInvariants(); |
| 7875 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 7876 | 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); |
| 7877 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 7878 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 7879 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 7880 | private: |
| 7881 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 7882 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 7883 | } |
| 7884 | |
| 7885 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 7886 | assert(index < 1 && "invalid attribute index" ); |
| 7887 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 7888 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 7889 | "dependent dialect loading?" ); |
| 7890 | return name.getAttributeNames()[index]; |
| 7891 | } |
| 7892 | |
| 7893 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 7894 | public: |
| 7895 | }; |
| 7896 | |
| 7897 | } // namespace mlir::arith |
| 7898 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MaximumNumFOp) |
| 7899 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::MaximumNumFOpGenericAdaptorBase::Properties) |
| 7900 | |
| 7901 | namespace mlir::arith { |
| 7902 | |
| 7903 | |
| 7904 | //===----------------------------------------------------------------------===// |
| 7905 | // ::mlir::arith::MinNumFOp declarations |
| 7906 | //===----------------------------------------------------------------------===// |
| 7907 | |
| 7908 | namespace detail { |
| 7909 | |
| 7910 | class MinNumFOpGenericAdaptorBase { |
| 7911 | public: |
| 7912 | struct Properties { |
| 7913 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 7914 | fastmathTy fastmath; |
| 7915 | |
| 7916 | auto getFastmath() const { |
| 7917 | auto &propStorage = this->fastmath; |
| 7918 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 7919 | } |
| 7920 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 7921 | this->fastmath = propValue; |
| 7922 | } |
| 7923 | bool operator==(const Properties &rhs) const { |
| 7924 | return |
| 7925 | rhs.fastmath == this->fastmath && |
| 7926 | true; |
| 7927 | } |
| 7928 | bool operator!=(const Properties &rhs) const { |
| 7929 | return !(*this == rhs); |
| 7930 | } |
| 7931 | }; |
| 7932 | protected: |
| 7933 | ::mlir::DictionaryAttr odsAttrs; |
| 7934 | ::std::optional<::mlir::OperationName> odsOpName; |
| 7935 | Properties properties; |
| 7936 | ::mlir::RegionRange odsRegions; |
| 7937 | public: |
| 7938 | MinNumFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 7939 | odsOpName.emplace(args: "arith.minnumf" , args: odsAttrs.getContext()); |
| 7940 | } |
| 7941 | |
| 7942 | MinNumFOpGenericAdaptorBase(MinNumFOp op); |
| 7943 | |
| 7944 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 7945 | return {index, 1}; |
| 7946 | } |
| 7947 | |
| 7948 | const Properties &getProperties() { |
| 7949 | return properties; |
| 7950 | } |
| 7951 | |
| 7952 | ::mlir::DictionaryAttr getAttributes() { |
| 7953 | return odsAttrs; |
| 7954 | } |
| 7955 | |
| 7956 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 7957 | ::mlir::arith::FastMathFlags getFastmath(); |
| 7958 | }; |
| 7959 | |
| 7960 | } // namespace detail |
| 7961 | template <typename RangeT> |
| 7962 | class MinNumFOpGenericAdaptor : public detail::MinNumFOpGenericAdaptorBase { |
| 7963 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 7964 | using Base = detail::MinNumFOpGenericAdaptorBase; |
| 7965 | static constexpr int odsIndex_lhs = 0; |
| 7966 | static constexpr int odsIndex_rhs = 1; |
| 7967 | public: |
| 7968 | MinNumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 7969 | |
| 7970 | MinNumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MinNumFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 7971 | |
| 7972 | MinNumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MinNumFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 7973 | |
| 7974 | MinNumFOpGenericAdaptor(RangeT values, const MinNumFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 7975 | |
| 7976 | template <typename LateInst = MinNumFOp, typename = std::enable_if_t<std::is_same_v<LateInst, MinNumFOp>>> |
| 7977 | MinNumFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 7978 | |
| 7979 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 7980 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 7981 | } |
| 7982 | |
| 7983 | RangeT getODSOperands(unsigned index) { |
| 7984 | auto valueRange = getODSOperandIndexAndLength(index); |
| 7985 | return {std::next(odsOperands.begin(), valueRange.first), |
| 7986 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 7987 | } |
| 7988 | |
| 7989 | ValueT getLhs() { |
| 7990 | return (*getODSOperands(index: 0).begin()); |
| 7991 | } |
| 7992 | |
| 7993 | ValueT getRhs() { |
| 7994 | return (*getODSOperands(index: 1).begin()); |
| 7995 | } |
| 7996 | |
| 7997 | RangeT getOperands() { |
| 7998 | return odsOperands; |
| 7999 | } |
| 8000 | |
| 8001 | private: |
| 8002 | RangeT odsOperands; |
| 8003 | }; |
| 8004 | class MinNumFOpAdaptor : public MinNumFOpGenericAdaptor<::mlir::ValueRange> { |
| 8005 | public: |
| 8006 | using MinNumFOpGenericAdaptor::MinNumFOpGenericAdaptor; |
| 8007 | MinNumFOpAdaptor(MinNumFOp op); |
| 8008 | |
| 8009 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 8010 | }; |
| 8011 | class MinNumFOp : public ::mlir::Op<MinNumFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 8012 | public: |
| 8013 | using Op::Op; |
| 8014 | using Op::print; |
| 8015 | using Adaptor = MinNumFOpAdaptor; |
| 8016 | template <typename RangeT> |
| 8017 | using GenericAdaptor = MinNumFOpGenericAdaptor<RangeT>; |
| 8018 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 8019 | static constexpr int odsIndex_lhs = 0; |
| 8020 | static constexpr int odsIndex_rhs = 1; |
| 8021 | static constexpr int odsIndex_result = 0; |
| 8022 | using Properties = FoldAdaptor::Properties; |
| 8023 | using ::mlir::arith::ArithFastMathInterface::Trait<MinNumFOp>::getFastMathFlagsAttr; |
| 8024 | using ::mlir::arith::ArithFastMathInterface::Trait<MinNumFOp>::getFastMathAttrName; |
| 8025 | using ::mlir::VectorUnrollOpInterface::Trait<MinNumFOp>::getIterationShapeToUnroll; |
| 8026 | using ::mlir::VectorUnrollOpInterface::Trait<MinNumFOp>::getDefaultUnrollTargetShape; |
| 8027 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 8028 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" )}; |
| 8029 | return ::llvm::ArrayRef(attrNames); |
| 8030 | } |
| 8031 | |
| 8032 | ::mlir::StringAttr getFastmathAttrName() { |
| 8033 | return getAttributeNameForIndex(index: 0); |
| 8034 | } |
| 8035 | |
| 8036 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 8037 | return getAttributeNameForIndex(name, index: 0); |
| 8038 | } |
| 8039 | |
| 8040 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 8041 | return ::llvm::StringLiteral("arith.minnumf" ); |
| 8042 | } |
| 8043 | |
| 8044 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 8045 | return {index, 1}; |
| 8046 | } |
| 8047 | |
| 8048 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 8049 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 8050 | return getOperation()->getOperands().slice(n: start, m: length); |
| 8051 | } |
| 8052 | |
| 8053 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 8054 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 8055 | } |
| 8056 | |
| 8057 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 8058 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 8059 | } |
| 8060 | |
| 8061 | ::mlir::OpOperand &getLhsMutable() { |
| 8062 | auto range = getODSOperandIndexAndLength(index: 0); |
| 8063 | return getOperation()->getOpOperand(idx: range.first); |
| 8064 | } |
| 8065 | |
| 8066 | ::mlir::OpOperand &getRhsMutable() { |
| 8067 | auto range = getODSOperandIndexAndLength(index: 1); |
| 8068 | return getOperation()->getOpOperand(idx: range.first); |
| 8069 | } |
| 8070 | |
| 8071 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 8072 | return {index, 1}; |
| 8073 | } |
| 8074 | |
| 8075 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 8076 | auto valueRange = getODSResultIndexAndLength(index); |
| 8077 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 8078 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 8079 | } |
| 8080 | |
| 8081 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 8082 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 8083 | } |
| 8084 | |
| 8085 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 8086 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 8087 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 8088 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 8089 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 8090 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 8091 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 8092 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 8093 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 8094 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 8095 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 8096 | } |
| 8097 | |
| 8098 | ::mlir::arith::FastMathFlags getFastmath(); |
| 8099 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 8100 | getProperties().fastmath = attr; |
| 8101 | } |
| 8102 | |
| 8103 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 8104 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8105 | static MinNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8106 | static MinNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8107 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8108 | static MinNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8109 | static MinNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8110 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8111 | static MinNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8112 | static MinNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8113 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8114 | static MinNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8115 | static MinNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8116 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8117 | static MinNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8118 | static MinNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8119 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8120 | static MinNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8121 | static MinNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8122 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 8123 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8124 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 8125 | static MinNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8126 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 8127 | static MinNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8128 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 8129 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8130 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 8131 | static MinNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8132 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 8133 | static MinNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8134 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8135 | static MinNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8136 | static MinNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8137 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8138 | static MinNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8139 | static MinNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8140 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 8141 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 8142 | ::llvm::LogicalResult verifyInvariants(); |
| 8143 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 8144 | 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); |
| 8145 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 8146 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 8147 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 8148 | private: |
| 8149 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 8150 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 8151 | } |
| 8152 | |
| 8153 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 8154 | assert(index < 1 && "invalid attribute index" ); |
| 8155 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 8156 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 8157 | "dependent dialect loading?" ); |
| 8158 | return name.getAttributeNames()[index]; |
| 8159 | } |
| 8160 | |
| 8161 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 8162 | public: |
| 8163 | }; |
| 8164 | |
| 8165 | } // namespace mlir::arith |
| 8166 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MinNumFOp) |
| 8167 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::MinNumFOpGenericAdaptorBase::Properties) |
| 8168 | |
| 8169 | namespace mlir::arith { |
| 8170 | |
| 8171 | |
| 8172 | //===----------------------------------------------------------------------===// |
| 8173 | // ::mlir::arith::MinSIOp declarations |
| 8174 | //===----------------------------------------------------------------------===// |
| 8175 | |
| 8176 | namespace detail { |
| 8177 | |
| 8178 | class MinSIOpGenericAdaptorBase { |
| 8179 | public: |
| 8180 | using Properties = ::mlir::EmptyProperties; |
| 8181 | protected: |
| 8182 | ::mlir::DictionaryAttr odsAttrs; |
| 8183 | ::std::optional<::mlir::OperationName> odsOpName; |
| 8184 | Properties properties; |
| 8185 | ::mlir::RegionRange odsRegions; |
| 8186 | public: |
| 8187 | MinSIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 8188 | odsOpName.emplace(args: "arith.minsi" , args: odsAttrs.getContext()); |
| 8189 | } |
| 8190 | |
| 8191 | MinSIOpGenericAdaptorBase(MinSIOp op); |
| 8192 | |
| 8193 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 8194 | return {index, 1}; |
| 8195 | } |
| 8196 | |
| 8197 | const Properties &getProperties() { |
| 8198 | return properties; |
| 8199 | } |
| 8200 | |
| 8201 | ::mlir::DictionaryAttr getAttributes() { |
| 8202 | return odsAttrs; |
| 8203 | } |
| 8204 | |
| 8205 | }; |
| 8206 | |
| 8207 | } // namespace detail |
| 8208 | template <typename RangeT> |
| 8209 | class MinSIOpGenericAdaptor : public detail::MinSIOpGenericAdaptorBase { |
| 8210 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 8211 | using Base = detail::MinSIOpGenericAdaptorBase; |
| 8212 | static constexpr int odsIndex_lhs = 0; |
| 8213 | static constexpr int odsIndex_rhs = 1; |
| 8214 | public: |
| 8215 | MinSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 8216 | |
| 8217 | MinSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MinSIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 8218 | |
| 8219 | MinSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MinSIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 8220 | |
| 8221 | MinSIOpGenericAdaptor(RangeT values, const MinSIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 8222 | |
| 8223 | template <typename LateInst = MinSIOp, typename = std::enable_if_t<std::is_same_v<LateInst, MinSIOp>>> |
| 8224 | MinSIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 8225 | |
| 8226 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 8227 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 8228 | } |
| 8229 | |
| 8230 | RangeT getODSOperands(unsigned index) { |
| 8231 | auto valueRange = getODSOperandIndexAndLength(index); |
| 8232 | return {std::next(odsOperands.begin(), valueRange.first), |
| 8233 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 8234 | } |
| 8235 | |
| 8236 | ValueT getLhs() { |
| 8237 | return (*getODSOperands(index: 0).begin()); |
| 8238 | } |
| 8239 | |
| 8240 | ValueT getRhs() { |
| 8241 | return (*getODSOperands(index: 1).begin()); |
| 8242 | } |
| 8243 | |
| 8244 | RangeT getOperands() { |
| 8245 | return odsOperands; |
| 8246 | } |
| 8247 | |
| 8248 | private: |
| 8249 | RangeT odsOperands; |
| 8250 | }; |
| 8251 | class MinSIOpAdaptor : public MinSIOpGenericAdaptor<::mlir::ValueRange> { |
| 8252 | public: |
| 8253 | using MinSIOpGenericAdaptor::MinSIOpGenericAdaptor; |
| 8254 | MinSIOpAdaptor(MinSIOp op); |
| 8255 | |
| 8256 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 8257 | }; |
| 8258 | class MinSIOp : public ::mlir::Op<MinSIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::IsCommutative, ::mlir::InferIntDivisibilityOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 8259 | public: |
| 8260 | using Op::Op; |
| 8261 | using Op::print; |
| 8262 | using Adaptor = MinSIOpAdaptor; |
| 8263 | template <typename RangeT> |
| 8264 | using GenericAdaptor = MinSIOpGenericAdaptor<RangeT>; |
| 8265 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 8266 | static constexpr int odsIndex_lhs = 0; |
| 8267 | static constexpr int odsIndex_rhs = 1; |
| 8268 | static constexpr int odsIndex_result = 0; |
| 8269 | using Properties = FoldAdaptor::Properties; |
| 8270 | using ::mlir::InferIntRangeInterface::Trait<MinSIOp>::inferResultRangesFromOptional; |
| 8271 | using ::mlir::VectorUnrollOpInterface::Trait<MinSIOp>::getIterationShapeToUnroll; |
| 8272 | using ::mlir::VectorUnrollOpInterface::Trait<MinSIOp>::getDefaultUnrollTargetShape; |
| 8273 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 8274 | return {}; |
| 8275 | } |
| 8276 | |
| 8277 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 8278 | return ::llvm::StringLiteral("arith.minsi" ); |
| 8279 | } |
| 8280 | |
| 8281 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 8282 | return {index, 1}; |
| 8283 | } |
| 8284 | |
| 8285 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 8286 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 8287 | return getOperation()->getOperands().slice(n: start, m: length); |
| 8288 | } |
| 8289 | |
| 8290 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 8291 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 8292 | } |
| 8293 | |
| 8294 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 8295 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 8296 | } |
| 8297 | |
| 8298 | ::mlir::OpOperand &getLhsMutable() { |
| 8299 | auto range = getODSOperandIndexAndLength(index: 0); |
| 8300 | return getOperation()->getOpOperand(idx: range.first); |
| 8301 | } |
| 8302 | |
| 8303 | ::mlir::OpOperand &getRhsMutable() { |
| 8304 | auto range = getODSOperandIndexAndLength(index: 1); |
| 8305 | return getOperation()->getOpOperand(idx: range.first); |
| 8306 | } |
| 8307 | |
| 8308 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 8309 | return {index, 1}; |
| 8310 | } |
| 8311 | |
| 8312 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 8313 | auto valueRange = getODSResultIndexAndLength(index); |
| 8314 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 8315 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 8316 | } |
| 8317 | |
| 8318 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 8319 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 8320 | } |
| 8321 | |
| 8322 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 8323 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 8324 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 8325 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 8326 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 8327 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 8328 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 8329 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8330 | static MinSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8331 | static MinSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8332 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8333 | static MinSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8334 | static MinSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8335 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8336 | static MinSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8337 | static MinSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8338 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8339 | static MinSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8340 | static MinSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8341 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8342 | static MinSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8343 | static MinSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8344 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8345 | static MinSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8346 | static MinSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8347 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8348 | static MinSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8349 | static MinSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8350 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 8351 | ::llvm::LogicalResult verifyInvariants(); |
| 8352 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 8353 | 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); |
| 8354 | void inferResultDivisibility(::llvm::ArrayRef<::mlir::IntegerDivisibility> argDivs, ::mlir::SetIntDivisibilityFn setResultDivs); |
| 8355 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 8356 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 8357 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 8358 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 8359 | public: |
| 8360 | }; |
| 8361 | |
| 8362 | } // namespace mlir::arith |
| 8363 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MinSIOp) |
| 8364 | |
| 8365 | namespace mlir::arith { |
| 8366 | |
| 8367 | |
| 8368 | //===----------------------------------------------------------------------===// |
| 8369 | // ::mlir::arith::MinUIOp declarations |
| 8370 | //===----------------------------------------------------------------------===// |
| 8371 | |
| 8372 | namespace detail { |
| 8373 | |
| 8374 | class MinUIOpGenericAdaptorBase { |
| 8375 | public: |
| 8376 | using Properties = ::mlir::EmptyProperties; |
| 8377 | protected: |
| 8378 | ::mlir::DictionaryAttr odsAttrs; |
| 8379 | ::std::optional<::mlir::OperationName> odsOpName; |
| 8380 | Properties properties; |
| 8381 | ::mlir::RegionRange odsRegions; |
| 8382 | public: |
| 8383 | MinUIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 8384 | odsOpName.emplace(args: "arith.minui" , args: odsAttrs.getContext()); |
| 8385 | } |
| 8386 | |
| 8387 | MinUIOpGenericAdaptorBase(MinUIOp op); |
| 8388 | |
| 8389 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 8390 | return {index, 1}; |
| 8391 | } |
| 8392 | |
| 8393 | const Properties &getProperties() { |
| 8394 | return properties; |
| 8395 | } |
| 8396 | |
| 8397 | ::mlir::DictionaryAttr getAttributes() { |
| 8398 | return odsAttrs; |
| 8399 | } |
| 8400 | |
| 8401 | }; |
| 8402 | |
| 8403 | } // namespace detail |
| 8404 | template <typename RangeT> |
| 8405 | class MinUIOpGenericAdaptor : public detail::MinUIOpGenericAdaptorBase { |
| 8406 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 8407 | using Base = detail::MinUIOpGenericAdaptorBase; |
| 8408 | static constexpr int odsIndex_lhs = 0; |
| 8409 | static constexpr int odsIndex_rhs = 1; |
| 8410 | public: |
| 8411 | MinUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 8412 | |
| 8413 | MinUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MinUIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 8414 | |
| 8415 | MinUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MinUIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 8416 | |
| 8417 | MinUIOpGenericAdaptor(RangeT values, const MinUIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 8418 | |
| 8419 | template <typename LateInst = MinUIOp, typename = std::enable_if_t<std::is_same_v<LateInst, MinUIOp>>> |
| 8420 | MinUIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 8421 | |
| 8422 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 8423 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 8424 | } |
| 8425 | |
| 8426 | RangeT getODSOperands(unsigned index) { |
| 8427 | auto valueRange = getODSOperandIndexAndLength(index); |
| 8428 | return {std::next(odsOperands.begin(), valueRange.first), |
| 8429 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 8430 | } |
| 8431 | |
| 8432 | ValueT getLhs() { |
| 8433 | return (*getODSOperands(index: 0).begin()); |
| 8434 | } |
| 8435 | |
| 8436 | ValueT getRhs() { |
| 8437 | return (*getODSOperands(index: 1).begin()); |
| 8438 | } |
| 8439 | |
| 8440 | RangeT getOperands() { |
| 8441 | return odsOperands; |
| 8442 | } |
| 8443 | |
| 8444 | private: |
| 8445 | RangeT odsOperands; |
| 8446 | }; |
| 8447 | class MinUIOpAdaptor : public MinUIOpGenericAdaptor<::mlir::ValueRange> { |
| 8448 | public: |
| 8449 | using MinUIOpGenericAdaptor::MinUIOpGenericAdaptor; |
| 8450 | MinUIOpAdaptor(MinUIOp op); |
| 8451 | |
| 8452 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 8453 | }; |
| 8454 | class MinUIOp : public ::mlir::Op<MinUIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::IsCommutative, ::mlir::InferIntDivisibilityOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 8455 | public: |
| 8456 | using Op::Op; |
| 8457 | using Op::print; |
| 8458 | using Adaptor = MinUIOpAdaptor; |
| 8459 | template <typename RangeT> |
| 8460 | using GenericAdaptor = MinUIOpGenericAdaptor<RangeT>; |
| 8461 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 8462 | static constexpr int odsIndex_lhs = 0; |
| 8463 | static constexpr int odsIndex_rhs = 1; |
| 8464 | static constexpr int odsIndex_result = 0; |
| 8465 | using Properties = FoldAdaptor::Properties; |
| 8466 | using ::mlir::InferIntRangeInterface::Trait<MinUIOp>::inferResultRangesFromOptional; |
| 8467 | using ::mlir::VectorUnrollOpInterface::Trait<MinUIOp>::getIterationShapeToUnroll; |
| 8468 | using ::mlir::VectorUnrollOpInterface::Trait<MinUIOp>::getDefaultUnrollTargetShape; |
| 8469 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 8470 | return {}; |
| 8471 | } |
| 8472 | |
| 8473 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 8474 | return ::llvm::StringLiteral("arith.minui" ); |
| 8475 | } |
| 8476 | |
| 8477 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 8478 | return {index, 1}; |
| 8479 | } |
| 8480 | |
| 8481 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 8482 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 8483 | return getOperation()->getOperands().slice(n: start, m: length); |
| 8484 | } |
| 8485 | |
| 8486 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 8487 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 8488 | } |
| 8489 | |
| 8490 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 8491 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 8492 | } |
| 8493 | |
| 8494 | ::mlir::OpOperand &getLhsMutable() { |
| 8495 | auto range = getODSOperandIndexAndLength(index: 0); |
| 8496 | return getOperation()->getOpOperand(idx: range.first); |
| 8497 | } |
| 8498 | |
| 8499 | ::mlir::OpOperand &getRhsMutable() { |
| 8500 | auto range = getODSOperandIndexAndLength(index: 1); |
| 8501 | return getOperation()->getOpOperand(idx: range.first); |
| 8502 | } |
| 8503 | |
| 8504 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 8505 | return {index, 1}; |
| 8506 | } |
| 8507 | |
| 8508 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 8509 | auto valueRange = getODSResultIndexAndLength(index); |
| 8510 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 8511 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 8512 | } |
| 8513 | |
| 8514 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 8515 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 8516 | } |
| 8517 | |
| 8518 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 8519 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 8520 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 8521 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 8522 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 8523 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 8524 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 8525 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8526 | static MinUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8527 | static MinUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8528 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8529 | static MinUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8530 | static MinUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8531 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8532 | static MinUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8533 | static MinUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 8534 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8535 | static MinUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8536 | static MinUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8537 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8538 | static MinUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8539 | static MinUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8540 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8541 | static MinUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8542 | static MinUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8543 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8544 | static MinUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8545 | static MinUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8546 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 8547 | ::llvm::LogicalResult verifyInvariants(); |
| 8548 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 8549 | 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); |
| 8550 | void inferResultDivisibility(::llvm::ArrayRef<::mlir::IntegerDivisibility> argDivs, ::mlir::SetIntDivisibilityFn setResultDivs); |
| 8551 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 8552 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 8553 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 8554 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 8555 | public: |
| 8556 | }; |
| 8557 | |
| 8558 | } // namespace mlir::arith |
| 8559 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MinUIOp) |
| 8560 | |
| 8561 | namespace mlir::arith { |
| 8562 | |
| 8563 | |
| 8564 | //===----------------------------------------------------------------------===// |
| 8565 | // ::mlir::arith::MinimumFOp declarations |
| 8566 | //===----------------------------------------------------------------------===// |
| 8567 | |
| 8568 | namespace detail { |
| 8569 | |
| 8570 | class MinimumFOpGenericAdaptorBase { |
| 8571 | public: |
| 8572 | struct Properties { |
| 8573 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 8574 | fastmathTy fastmath; |
| 8575 | |
| 8576 | auto getFastmath() const { |
| 8577 | auto &propStorage = this->fastmath; |
| 8578 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 8579 | } |
| 8580 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 8581 | this->fastmath = propValue; |
| 8582 | } |
| 8583 | bool operator==(const Properties &rhs) const { |
| 8584 | return |
| 8585 | rhs.fastmath == this->fastmath && |
| 8586 | true; |
| 8587 | } |
| 8588 | bool operator!=(const Properties &rhs) const { |
| 8589 | return !(*this == rhs); |
| 8590 | } |
| 8591 | }; |
| 8592 | protected: |
| 8593 | ::mlir::DictionaryAttr odsAttrs; |
| 8594 | ::std::optional<::mlir::OperationName> odsOpName; |
| 8595 | Properties properties; |
| 8596 | ::mlir::RegionRange odsRegions; |
| 8597 | public: |
| 8598 | MinimumFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 8599 | odsOpName.emplace(args: "arith.minimumf" , args: odsAttrs.getContext()); |
| 8600 | } |
| 8601 | |
| 8602 | MinimumFOpGenericAdaptorBase(MinimumFOp op); |
| 8603 | |
| 8604 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 8605 | return {index, 1}; |
| 8606 | } |
| 8607 | |
| 8608 | const Properties &getProperties() { |
| 8609 | return properties; |
| 8610 | } |
| 8611 | |
| 8612 | ::mlir::DictionaryAttr getAttributes() { |
| 8613 | return odsAttrs; |
| 8614 | } |
| 8615 | |
| 8616 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 8617 | ::mlir::arith::FastMathFlags getFastmath(); |
| 8618 | }; |
| 8619 | |
| 8620 | } // namespace detail |
| 8621 | template <typename RangeT> |
| 8622 | class MinimumFOpGenericAdaptor : public detail::MinimumFOpGenericAdaptorBase { |
| 8623 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 8624 | using Base = detail::MinimumFOpGenericAdaptorBase; |
| 8625 | static constexpr int odsIndex_lhs = 0; |
| 8626 | static constexpr int odsIndex_rhs = 1; |
| 8627 | public: |
| 8628 | MinimumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 8629 | |
| 8630 | MinimumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MinimumFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 8631 | |
| 8632 | MinimumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MinimumFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 8633 | |
| 8634 | MinimumFOpGenericAdaptor(RangeT values, const MinimumFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 8635 | |
| 8636 | template <typename LateInst = MinimumFOp, typename = std::enable_if_t<std::is_same_v<LateInst, MinimumFOp>>> |
| 8637 | MinimumFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 8638 | |
| 8639 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 8640 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 8641 | } |
| 8642 | |
| 8643 | RangeT getODSOperands(unsigned index) { |
| 8644 | auto valueRange = getODSOperandIndexAndLength(index); |
| 8645 | return {std::next(odsOperands.begin(), valueRange.first), |
| 8646 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 8647 | } |
| 8648 | |
| 8649 | ValueT getLhs() { |
| 8650 | return (*getODSOperands(index: 0).begin()); |
| 8651 | } |
| 8652 | |
| 8653 | ValueT getRhs() { |
| 8654 | return (*getODSOperands(index: 1).begin()); |
| 8655 | } |
| 8656 | |
| 8657 | RangeT getOperands() { |
| 8658 | return odsOperands; |
| 8659 | } |
| 8660 | |
| 8661 | private: |
| 8662 | RangeT odsOperands; |
| 8663 | }; |
| 8664 | class MinimumFOpAdaptor : public MinimumFOpGenericAdaptor<::mlir::ValueRange> { |
| 8665 | public: |
| 8666 | using MinimumFOpGenericAdaptor::MinimumFOpGenericAdaptor; |
| 8667 | MinimumFOpAdaptor(MinimumFOp op); |
| 8668 | |
| 8669 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 8670 | }; |
| 8671 | class MinimumFOp : public ::mlir::Op<MinimumFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 8672 | public: |
| 8673 | using Op::Op; |
| 8674 | using Op::print; |
| 8675 | using Adaptor = MinimumFOpAdaptor; |
| 8676 | template <typename RangeT> |
| 8677 | using GenericAdaptor = MinimumFOpGenericAdaptor<RangeT>; |
| 8678 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 8679 | static constexpr int odsIndex_lhs = 0; |
| 8680 | static constexpr int odsIndex_rhs = 1; |
| 8681 | static constexpr int odsIndex_result = 0; |
| 8682 | using Properties = FoldAdaptor::Properties; |
| 8683 | using ::mlir::arith::ArithFastMathInterface::Trait<MinimumFOp>::getFastMathFlagsAttr; |
| 8684 | using ::mlir::arith::ArithFastMathInterface::Trait<MinimumFOp>::getFastMathAttrName; |
| 8685 | using ::mlir::VectorUnrollOpInterface::Trait<MinimumFOp>::getIterationShapeToUnroll; |
| 8686 | using ::mlir::VectorUnrollOpInterface::Trait<MinimumFOp>::getDefaultUnrollTargetShape; |
| 8687 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 8688 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" )}; |
| 8689 | return ::llvm::ArrayRef(attrNames); |
| 8690 | } |
| 8691 | |
| 8692 | ::mlir::StringAttr getFastmathAttrName() { |
| 8693 | return getAttributeNameForIndex(index: 0); |
| 8694 | } |
| 8695 | |
| 8696 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 8697 | return getAttributeNameForIndex(name, index: 0); |
| 8698 | } |
| 8699 | |
| 8700 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 8701 | return ::llvm::StringLiteral("arith.minimumf" ); |
| 8702 | } |
| 8703 | |
| 8704 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 8705 | return {index, 1}; |
| 8706 | } |
| 8707 | |
| 8708 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 8709 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 8710 | return getOperation()->getOperands().slice(n: start, m: length); |
| 8711 | } |
| 8712 | |
| 8713 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 8714 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 8715 | } |
| 8716 | |
| 8717 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 8718 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 8719 | } |
| 8720 | |
| 8721 | ::mlir::OpOperand &getLhsMutable() { |
| 8722 | auto range = getODSOperandIndexAndLength(index: 0); |
| 8723 | return getOperation()->getOpOperand(idx: range.first); |
| 8724 | } |
| 8725 | |
| 8726 | ::mlir::OpOperand &getRhsMutable() { |
| 8727 | auto range = getODSOperandIndexAndLength(index: 1); |
| 8728 | return getOperation()->getOpOperand(idx: range.first); |
| 8729 | } |
| 8730 | |
| 8731 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 8732 | return {index, 1}; |
| 8733 | } |
| 8734 | |
| 8735 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 8736 | auto valueRange = getODSResultIndexAndLength(index); |
| 8737 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 8738 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 8739 | } |
| 8740 | |
| 8741 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 8742 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 8743 | } |
| 8744 | |
| 8745 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 8746 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 8747 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 8748 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 8749 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 8750 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 8751 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 8752 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 8753 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 8754 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 8755 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 8756 | } |
| 8757 | |
| 8758 | ::mlir::arith::FastMathFlags getFastmath(); |
| 8759 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 8760 | getProperties().fastmath = attr; |
| 8761 | } |
| 8762 | |
| 8763 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 8764 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8765 | static MinimumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8766 | static MinimumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8767 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8768 | static MinimumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8769 | static MinimumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8770 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8771 | static MinimumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8772 | static MinimumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 8773 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8774 | static MinimumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8775 | static MinimumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8776 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8777 | static MinimumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8778 | static MinimumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8779 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8780 | static MinimumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8781 | static MinimumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 8782 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 8783 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8784 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 8785 | static MinimumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8786 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 8787 | static MinimumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8788 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 8789 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8790 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 8791 | static MinimumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8792 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 8793 | static MinimumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 8794 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8795 | static MinimumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8796 | static MinimumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8797 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8798 | static MinimumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8799 | static MinimumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 8800 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 8801 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 8802 | ::llvm::LogicalResult verifyInvariants(); |
| 8803 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 8804 | 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); |
| 8805 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 8806 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 8807 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 8808 | private: |
| 8809 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 8810 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 8811 | } |
| 8812 | |
| 8813 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 8814 | assert(index < 1 && "invalid attribute index" ); |
| 8815 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 8816 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 8817 | "dependent dialect loading?" ); |
| 8818 | return name.getAttributeNames()[index]; |
| 8819 | } |
| 8820 | |
| 8821 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 8822 | public: |
| 8823 | }; |
| 8824 | |
| 8825 | } // namespace mlir::arith |
| 8826 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MinimumFOp) |
| 8827 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::MinimumFOpGenericAdaptorBase::Properties) |
| 8828 | |
| 8829 | namespace mlir::arith { |
| 8830 | |
| 8831 | |
| 8832 | //===----------------------------------------------------------------------===// |
| 8833 | // ::mlir::arith::MinimumNumFOp declarations |
| 8834 | //===----------------------------------------------------------------------===// |
| 8835 | |
| 8836 | namespace detail { |
| 8837 | |
| 8838 | class MinimumNumFOpGenericAdaptorBase { |
| 8839 | public: |
| 8840 | struct Properties { |
| 8841 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 8842 | fastmathTy fastmath; |
| 8843 | |
| 8844 | auto getFastmath() const { |
| 8845 | auto &propStorage = this->fastmath; |
| 8846 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 8847 | } |
| 8848 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 8849 | this->fastmath = propValue; |
| 8850 | } |
| 8851 | bool operator==(const Properties &rhs) const { |
| 8852 | return |
| 8853 | rhs.fastmath == this->fastmath && |
| 8854 | true; |
| 8855 | } |
| 8856 | bool operator!=(const Properties &rhs) const { |
| 8857 | return !(*this == rhs); |
| 8858 | } |
| 8859 | }; |
| 8860 | protected: |
| 8861 | ::mlir::DictionaryAttr odsAttrs; |
| 8862 | ::std::optional<::mlir::OperationName> odsOpName; |
| 8863 | Properties properties; |
| 8864 | ::mlir::RegionRange odsRegions; |
| 8865 | public: |
| 8866 | MinimumNumFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 8867 | odsOpName.emplace(args: "arith.minimumnumf" , args: odsAttrs.getContext()); |
| 8868 | } |
| 8869 | |
| 8870 | MinimumNumFOpGenericAdaptorBase(MinimumNumFOp op); |
| 8871 | |
| 8872 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 8873 | return {index, 1}; |
| 8874 | } |
| 8875 | |
| 8876 | const Properties &getProperties() { |
| 8877 | return properties; |
| 8878 | } |
| 8879 | |
| 8880 | ::mlir::DictionaryAttr getAttributes() { |
| 8881 | return odsAttrs; |
| 8882 | } |
| 8883 | |
| 8884 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 8885 | ::mlir::arith::FastMathFlags getFastmath(); |
| 8886 | }; |
| 8887 | |
| 8888 | } // namespace detail |
| 8889 | template <typename RangeT> |
| 8890 | class MinimumNumFOpGenericAdaptor : public detail::MinimumNumFOpGenericAdaptorBase { |
| 8891 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 8892 | using Base = detail::MinimumNumFOpGenericAdaptorBase; |
| 8893 | static constexpr int odsIndex_lhs = 0; |
| 8894 | static constexpr int odsIndex_rhs = 1; |
| 8895 | public: |
| 8896 | MinimumNumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 8897 | |
| 8898 | MinimumNumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MinimumNumFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 8899 | |
| 8900 | MinimumNumFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MinimumNumFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 8901 | |
| 8902 | MinimumNumFOpGenericAdaptor(RangeT values, const MinimumNumFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 8903 | |
| 8904 | template <typename LateInst = MinimumNumFOp, typename = std::enable_if_t<std::is_same_v<LateInst, MinimumNumFOp>>> |
| 8905 | MinimumNumFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 8906 | |
| 8907 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 8908 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 8909 | } |
| 8910 | |
| 8911 | RangeT getODSOperands(unsigned index) { |
| 8912 | auto valueRange = getODSOperandIndexAndLength(index); |
| 8913 | return {std::next(odsOperands.begin(), valueRange.first), |
| 8914 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 8915 | } |
| 8916 | |
| 8917 | ValueT getLhs() { |
| 8918 | return (*getODSOperands(index: 0).begin()); |
| 8919 | } |
| 8920 | |
| 8921 | ValueT getRhs() { |
| 8922 | return (*getODSOperands(index: 1).begin()); |
| 8923 | } |
| 8924 | |
| 8925 | RangeT getOperands() { |
| 8926 | return odsOperands; |
| 8927 | } |
| 8928 | |
| 8929 | private: |
| 8930 | RangeT odsOperands; |
| 8931 | }; |
| 8932 | class MinimumNumFOpAdaptor : public MinimumNumFOpGenericAdaptor<::mlir::ValueRange> { |
| 8933 | public: |
| 8934 | using MinimumNumFOpGenericAdaptor::MinimumNumFOpGenericAdaptor; |
| 8935 | MinimumNumFOpAdaptor(MinimumNumFOp op); |
| 8936 | |
| 8937 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 8938 | }; |
| 8939 | class MinimumNumFOp : public ::mlir::Op<MinimumNumFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 8940 | public: |
| 8941 | using Op::Op; |
| 8942 | using Op::print; |
| 8943 | using Adaptor = MinimumNumFOpAdaptor; |
| 8944 | template <typename RangeT> |
| 8945 | using GenericAdaptor = MinimumNumFOpGenericAdaptor<RangeT>; |
| 8946 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 8947 | static constexpr int odsIndex_lhs = 0; |
| 8948 | static constexpr int odsIndex_rhs = 1; |
| 8949 | static constexpr int odsIndex_result = 0; |
| 8950 | using Properties = FoldAdaptor::Properties; |
| 8951 | using ::mlir::arith::ArithFastMathInterface::Trait<MinimumNumFOp>::getFastMathFlagsAttr; |
| 8952 | using ::mlir::arith::ArithFastMathInterface::Trait<MinimumNumFOp>::getFastMathAttrName; |
| 8953 | using ::mlir::VectorUnrollOpInterface::Trait<MinimumNumFOp>::getIterationShapeToUnroll; |
| 8954 | using ::mlir::VectorUnrollOpInterface::Trait<MinimumNumFOp>::getDefaultUnrollTargetShape; |
| 8955 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 8956 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" )}; |
| 8957 | return ::llvm::ArrayRef(attrNames); |
| 8958 | } |
| 8959 | |
| 8960 | ::mlir::StringAttr getFastmathAttrName() { |
| 8961 | return getAttributeNameForIndex(index: 0); |
| 8962 | } |
| 8963 | |
| 8964 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 8965 | return getAttributeNameForIndex(name, index: 0); |
| 8966 | } |
| 8967 | |
| 8968 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 8969 | return ::llvm::StringLiteral("arith.minimumnumf" ); |
| 8970 | } |
| 8971 | |
| 8972 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 8973 | return {index, 1}; |
| 8974 | } |
| 8975 | |
| 8976 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 8977 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 8978 | return getOperation()->getOperands().slice(n: start, m: length); |
| 8979 | } |
| 8980 | |
| 8981 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 8982 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 8983 | } |
| 8984 | |
| 8985 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 8986 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 8987 | } |
| 8988 | |
| 8989 | ::mlir::OpOperand &getLhsMutable() { |
| 8990 | auto range = getODSOperandIndexAndLength(index: 0); |
| 8991 | return getOperation()->getOpOperand(idx: range.first); |
| 8992 | } |
| 8993 | |
| 8994 | ::mlir::OpOperand &getRhsMutable() { |
| 8995 | auto range = getODSOperandIndexAndLength(index: 1); |
| 8996 | return getOperation()->getOpOperand(idx: range.first); |
| 8997 | } |
| 8998 | |
| 8999 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 9000 | return {index, 1}; |
| 9001 | } |
| 9002 | |
| 9003 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 9004 | auto valueRange = getODSResultIndexAndLength(index); |
| 9005 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 9006 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 9007 | } |
| 9008 | |
| 9009 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 9010 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 9011 | } |
| 9012 | |
| 9013 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 9014 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 9015 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 9016 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 9017 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 9018 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 9019 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 9020 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 9021 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 9022 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 9023 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 9024 | } |
| 9025 | |
| 9026 | ::mlir::arith::FastMathFlags getFastmath(); |
| 9027 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 9028 | getProperties().fastmath = attr; |
| 9029 | } |
| 9030 | |
| 9031 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 9032 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 9033 | static MinimumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 9034 | static MinimumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 9035 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 9036 | static MinimumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 9037 | static MinimumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 9038 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 9039 | static MinimumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 9040 | static MinimumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 9041 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9042 | static MinimumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9043 | static MinimumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9044 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9045 | static MinimumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9046 | static MinimumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9047 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9048 | static MinimumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9049 | static MinimumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9050 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9051 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9052 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9053 | static MinimumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9054 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9055 | static MinimumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9056 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9057 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9058 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9059 | static MinimumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9060 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9061 | static MinimumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9062 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9063 | static MinimumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9064 | static MinimumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9065 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9066 | static MinimumNumFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9067 | static MinimumNumFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9068 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 9069 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 9070 | ::llvm::LogicalResult verifyInvariants(); |
| 9071 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 9072 | 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); |
| 9073 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 9074 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 9075 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 9076 | private: |
| 9077 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 9078 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 9079 | } |
| 9080 | |
| 9081 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 9082 | assert(index < 1 && "invalid attribute index" ); |
| 9083 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 9084 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 9085 | "dependent dialect loading?" ); |
| 9086 | return name.getAttributeNames()[index]; |
| 9087 | } |
| 9088 | |
| 9089 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 9090 | public: |
| 9091 | }; |
| 9092 | |
| 9093 | } // namespace mlir::arith |
| 9094 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MinimumNumFOp) |
| 9095 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::MinimumNumFOpGenericAdaptorBase::Properties) |
| 9096 | |
| 9097 | namespace mlir::arith { |
| 9098 | |
| 9099 | |
| 9100 | //===----------------------------------------------------------------------===// |
| 9101 | // ::mlir::arith::MulFOp declarations |
| 9102 | //===----------------------------------------------------------------------===// |
| 9103 | |
| 9104 | namespace detail { |
| 9105 | |
| 9106 | class MulFOpGenericAdaptorBase { |
| 9107 | public: |
| 9108 | struct Properties { |
| 9109 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 9110 | fastmathTy fastmath; |
| 9111 | |
| 9112 | auto getFastmath() const { |
| 9113 | auto &propStorage = this->fastmath; |
| 9114 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 9115 | } |
| 9116 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 9117 | this->fastmath = propValue; |
| 9118 | } |
| 9119 | using roundingmodeTy = ::mlir::arith::RoundingModeAttr; |
| 9120 | roundingmodeTy roundingmode; |
| 9121 | |
| 9122 | auto getRoundingmode() const { |
| 9123 | auto &propStorage = this->roundingmode; |
| 9124 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: propStorage); |
| 9125 | } |
| 9126 | void setRoundingmode(const ::mlir::arith::RoundingModeAttr &propValue) { |
| 9127 | this->roundingmode = propValue; |
| 9128 | } |
| 9129 | bool operator==(const Properties &rhs) const { |
| 9130 | return |
| 9131 | rhs.fastmath == this->fastmath && |
| 9132 | rhs.roundingmode == this->roundingmode && |
| 9133 | true; |
| 9134 | } |
| 9135 | bool operator!=(const Properties &rhs) const { |
| 9136 | return !(*this == rhs); |
| 9137 | } |
| 9138 | }; |
| 9139 | protected: |
| 9140 | ::mlir::DictionaryAttr odsAttrs; |
| 9141 | ::std::optional<::mlir::OperationName> odsOpName; |
| 9142 | Properties properties; |
| 9143 | ::mlir::RegionRange odsRegions; |
| 9144 | public: |
| 9145 | MulFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 9146 | odsOpName.emplace(args: "arith.mulf" , args: odsAttrs.getContext()); |
| 9147 | } |
| 9148 | |
| 9149 | MulFOpGenericAdaptorBase(MulFOp op); |
| 9150 | |
| 9151 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 9152 | return {index, 1}; |
| 9153 | } |
| 9154 | |
| 9155 | const Properties &getProperties() { |
| 9156 | return properties; |
| 9157 | } |
| 9158 | |
| 9159 | ::mlir::DictionaryAttr getAttributes() { |
| 9160 | return odsAttrs; |
| 9161 | } |
| 9162 | |
| 9163 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 9164 | ::mlir::arith::FastMathFlags getFastmath(); |
| 9165 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 9166 | auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: getProperties().roundingmode); |
| 9167 | return attr; |
| 9168 | } |
| 9169 | |
| 9170 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 9171 | }; |
| 9172 | |
| 9173 | } // namespace detail |
| 9174 | template <typename RangeT> |
| 9175 | class MulFOpGenericAdaptor : public detail::MulFOpGenericAdaptorBase { |
| 9176 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 9177 | using Base = detail::MulFOpGenericAdaptorBase; |
| 9178 | static constexpr int odsIndex_lhs = 0; |
| 9179 | static constexpr int odsIndex_rhs = 1; |
| 9180 | public: |
| 9181 | MulFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 9182 | |
| 9183 | MulFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MulFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 9184 | |
| 9185 | MulFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MulFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 9186 | |
| 9187 | MulFOpGenericAdaptor(RangeT values, const MulFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 9188 | |
| 9189 | template <typename LateInst = MulFOp, typename = std::enable_if_t<std::is_same_v<LateInst, MulFOp>>> |
| 9190 | MulFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 9191 | |
| 9192 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 9193 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 9194 | } |
| 9195 | |
| 9196 | RangeT getODSOperands(unsigned index) { |
| 9197 | auto valueRange = getODSOperandIndexAndLength(index); |
| 9198 | return {std::next(odsOperands.begin(), valueRange.first), |
| 9199 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 9200 | } |
| 9201 | |
| 9202 | ValueT getLhs() { |
| 9203 | return (*getODSOperands(index: 0).begin()); |
| 9204 | } |
| 9205 | |
| 9206 | ValueT getRhs() { |
| 9207 | return (*getODSOperands(index: 1).begin()); |
| 9208 | } |
| 9209 | |
| 9210 | RangeT getOperands() { |
| 9211 | return odsOperands; |
| 9212 | } |
| 9213 | |
| 9214 | private: |
| 9215 | RangeT odsOperands; |
| 9216 | }; |
| 9217 | class MulFOpAdaptor : public MulFOpGenericAdaptor<::mlir::ValueRange> { |
| 9218 | public: |
| 9219 | using MulFOpGenericAdaptor::MulFOpGenericAdaptor; |
| 9220 | MulFOpAdaptor(MulFOp op); |
| 9221 | |
| 9222 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 9223 | }; |
| 9224 | class MulFOp : public ::mlir::Op<MulFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::arith::ArithRoundingModeInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 9225 | public: |
| 9226 | using Op::Op; |
| 9227 | using Op::print; |
| 9228 | using Adaptor = MulFOpAdaptor; |
| 9229 | template <typename RangeT> |
| 9230 | using GenericAdaptor = MulFOpGenericAdaptor<RangeT>; |
| 9231 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 9232 | static constexpr int odsIndex_lhs = 0; |
| 9233 | static constexpr int odsIndex_rhs = 1; |
| 9234 | static constexpr int odsIndex_result = 0; |
| 9235 | using Properties = FoldAdaptor::Properties; |
| 9236 | using ::mlir::arith::ArithFastMathInterface::Trait<MulFOp>::getFastMathFlagsAttr; |
| 9237 | using ::mlir::arith::ArithFastMathInterface::Trait<MulFOp>::getFastMathAttrName; |
| 9238 | using ::mlir::arith::ArithRoundingModeInterface::Trait<MulFOp>::getRoundingModeAttr; |
| 9239 | using ::mlir::arith::ArithRoundingModeInterface::Trait<MulFOp>::getRoundingModeAttrName; |
| 9240 | using ::mlir::VectorUnrollOpInterface::Trait<MulFOp>::getIterationShapeToUnroll; |
| 9241 | using ::mlir::VectorUnrollOpInterface::Trait<MulFOp>::getDefaultUnrollTargetShape; |
| 9242 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 9243 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" ), ::llvm::StringRef("roundingmode" )}; |
| 9244 | return ::llvm::ArrayRef(attrNames); |
| 9245 | } |
| 9246 | |
| 9247 | ::mlir::StringAttr getFastmathAttrName() { |
| 9248 | return getAttributeNameForIndex(index: 0); |
| 9249 | } |
| 9250 | |
| 9251 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 9252 | return getAttributeNameForIndex(name, index: 0); |
| 9253 | } |
| 9254 | |
| 9255 | ::mlir::StringAttr getRoundingmodeAttrName() { |
| 9256 | return getAttributeNameForIndex(index: 1); |
| 9257 | } |
| 9258 | |
| 9259 | static ::mlir::StringAttr getRoundingmodeAttrName(::mlir::OperationName name) { |
| 9260 | return getAttributeNameForIndex(name, index: 1); |
| 9261 | } |
| 9262 | |
| 9263 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 9264 | return ::llvm::StringLiteral("arith.mulf" ); |
| 9265 | } |
| 9266 | |
| 9267 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 9268 | return {index, 1}; |
| 9269 | } |
| 9270 | |
| 9271 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 9272 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 9273 | return getOperation()->getOperands().slice(n: start, m: length); |
| 9274 | } |
| 9275 | |
| 9276 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 9277 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 9278 | } |
| 9279 | |
| 9280 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 9281 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 9282 | } |
| 9283 | |
| 9284 | ::mlir::OpOperand &getLhsMutable() { |
| 9285 | auto range = getODSOperandIndexAndLength(index: 0); |
| 9286 | return getOperation()->getOpOperand(idx: range.first); |
| 9287 | } |
| 9288 | |
| 9289 | ::mlir::OpOperand &getRhsMutable() { |
| 9290 | auto range = getODSOperandIndexAndLength(index: 1); |
| 9291 | return getOperation()->getOpOperand(idx: range.first); |
| 9292 | } |
| 9293 | |
| 9294 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 9295 | return {index, 1}; |
| 9296 | } |
| 9297 | |
| 9298 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 9299 | auto valueRange = getODSResultIndexAndLength(index); |
| 9300 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 9301 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 9302 | } |
| 9303 | |
| 9304 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 9305 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 9306 | } |
| 9307 | |
| 9308 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 9309 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 9310 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 9311 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 9312 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 9313 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 9314 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 9315 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 9316 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 9317 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 9318 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 9319 | } |
| 9320 | |
| 9321 | ::mlir::arith::FastMathFlags getFastmath(); |
| 9322 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 9323 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val&: getProperties().roundingmode); |
| 9324 | } |
| 9325 | |
| 9326 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 9327 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 9328 | getProperties().fastmath = attr; |
| 9329 | } |
| 9330 | |
| 9331 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 9332 | void setRoundingmodeAttr(::mlir::arith::RoundingModeAttr attr) { |
| 9333 | getProperties().roundingmode = attr; |
| 9334 | } |
| 9335 | |
| 9336 | void setRoundingmode(::std::optional<::mlir::arith::RoundingMode> attrValue); |
| 9337 | ::mlir::Attribute removeRoundingmodeAttr() { |
| 9338 | auto attr = getProperties().roundingmode; |
| 9339 | getProperties().roundingmode = {}; |
| 9340 | return attr; |
| 9341 | } |
| 9342 | |
| 9343 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9344 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9345 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9346 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value lhs, Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 9347 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value lhs, Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 9348 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, Value lhs, Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 9349 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type type, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9350 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Type type, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9351 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, Type type, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 9352 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9353 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9354 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9355 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9356 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9357 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9358 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9359 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9360 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9361 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9362 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9363 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9364 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9365 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9366 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9367 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9368 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9369 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 9370 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9371 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9372 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9373 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9374 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9375 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9376 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9377 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9378 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9379 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9380 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9381 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9382 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9383 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9384 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9385 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9386 | static MulFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9387 | static MulFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9388 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 9389 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 9390 | ::llvm::LogicalResult verifyInvariants(); |
| 9391 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 9392 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 9393 | 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); |
| 9394 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 9395 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 9396 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 9397 | private: |
| 9398 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 9399 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 9400 | } |
| 9401 | |
| 9402 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 9403 | assert(index < 2 && "invalid attribute index" ); |
| 9404 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 9405 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 9406 | "dependent dialect loading?" ); |
| 9407 | return name.getAttributeNames()[index]; |
| 9408 | } |
| 9409 | |
| 9410 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 9411 | public: |
| 9412 | }; |
| 9413 | |
| 9414 | } // namespace mlir::arith |
| 9415 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MulFOp) |
| 9416 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::MulFOpGenericAdaptorBase::Properties) |
| 9417 | |
| 9418 | namespace mlir::arith { |
| 9419 | |
| 9420 | |
| 9421 | //===----------------------------------------------------------------------===// |
| 9422 | // ::mlir::arith::MulIOp declarations |
| 9423 | //===----------------------------------------------------------------------===// |
| 9424 | |
| 9425 | namespace detail { |
| 9426 | |
| 9427 | class MulIOpGenericAdaptorBase { |
| 9428 | public: |
| 9429 | struct Properties { |
| 9430 | using overflowFlagsTy = ::mlir::arith::IntegerOverflowFlagsAttr; |
| 9431 | overflowFlagsTy overflowFlags; |
| 9432 | |
| 9433 | auto getOverflowFlags() const { |
| 9434 | auto &propStorage = this->overflowFlags; |
| 9435 | return ::llvm::dyn_cast_or_null<::mlir::arith::IntegerOverflowFlagsAttr>(Val: propStorage); |
| 9436 | } |
| 9437 | void setOverflowFlags(const ::mlir::arith::IntegerOverflowFlagsAttr &propValue) { |
| 9438 | this->overflowFlags = propValue; |
| 9439 | } |
| 9440 | bool operator==(const Properties &rhs) const { |
| 9441 | return |
| 9442 | rhs.overflowFlags == this->overflowFlags && |
| 9443 | true; |
| 9444 | } |
| 9445 | bool operator!=(const Properties &rhs) const { |
| 9446 | return !(*this == rhs); |
| 9447 | } |
| 9448 | }; |
| 9449 | protected: |
| 9450 | ::mlir::DictionaryAttr odsAttrs; |
| 9451 | ::std::optional<::mlir::OperationName> odsOpName; |
| 9452 | Properties properties; |
| 9453 | ::mlir::RegionRange odsRegions; |
| 9454 | public: |
| 9455 | MulIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 9456 | odsOpName.emplace(args: "arith.muli" , args: odsAttrs.getContext()); |
| 9457 | } |
| 9458 | |
| 9459 | MulIOpGenericAdaptorBase(MulIOp op); |
| 9460 | |
| 9461 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 9462 | return {index, 1}; |
| 9463 | } |
| 9464 | |
| 9465 | const Properties &getProperties() { |
| 9466 | return properties; |
| 9467 | } |
| 9468 | |
| 9469 | ::mlir::DictionaryAttr getAttributes() { |
| 9470 | return odsAttrs; |
| 9471 | } |
| 9472 | |
| 9473 | ::mlir::arith::IntegerOverflowFlagsAttr getOverflowFlagsAttr(); |
| 9474 | ::mlir::arith::IntegerOverflowFlags getOverflowFlags(); |
| 9475 | }; |
| 9476 | |
| 9477 | } // namespace detail |
| 9478 | template <typename RangeT> |
| 9479 | class MulIOpGenericAdaptor : public detail::MulIOpGenericAdaptorBase { |
| 9480 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 9481 | using Base = detail::MulIOpGenericAdaptorBase; |
| 9482 | static constexpr int odsIndex_lhs = 0; |
| 9483 | static constexpr int odsIndex_rhs = 1; |
| 9484 | public: |
| 9485 | MulIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 9486 | |
| 9487 | MulIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MulIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 9488 | |
| 9489 | MulIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MulIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 9490 | |
| 9491 | MulIOpGenericAdaptor(RangeT values, const MulIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 9492 | |
| 9493 | template <typename LateInst = MulIOp, typename = std::enable_if_t<std::is_same_v<LateInst, MulIOp>>> |
| 9494 | MulIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 9495 | |
| 9496 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 9497 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 9498 | } |
| 9499 | |
| 9500 | RangeT getODSOperands(unsigned index) { |
| 9501 | auto valueRange = getODSOperandIndexAndLength(index); |
| 9502 | return {std::next(odsOperands.begin(), valueRange.first), |
| 9503 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 9504 | } |
| 9505 | |
| 9506 | ValueT getLhs() { |
| 9507 | return (*getODSOperands(index: 0).begin()); |
| 9508 | } |
| 9509 | |
| 9510 | ValueT getRhs() { |
| 9511 | return (*getODSOperands(index: 1).begin()); |
| 9512 | } |
| 9513 | |
| 9514 | RangeT getOperands() { |
| 9515 | return odsOperands; |
| 9516 | } |
| 9517 | |
| 9518 | private: |
| 9519 | RangeT odsOperands; |
| 9520 | }; |
| 9521 | class MulIOpAdaptor : public MulIOpGenericAdaptor<::mlir::ValueRange> { |
| 9522 | public: |
| 9523 | using MulIOpGenericAdaptor::MulIOpGenericAdaptor; |
| 9524 | MulIOpAdaptor(MulIOp op); |
| 9525 | |
| 9526 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 9527 | }; |
| 9528 | class MulIOp : public ::mlir::Op<MulIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::InferIntDivisibilityOpInterface::Trait, ::mlir::OpAsmOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 9529 | public: |
| 9530 | using Op::Op; |
| 9531 | using Op::print; |
| 9532 | using Adaptor = MulIOpAdaptor; |
| 9533 | template <typename RangeT> |
| 9534 | using GenericAdaptor = MulIOpGenericAdaptor<RangeT>; |
| 9535 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 9536 | static constexpr int odsIndex_lhs = 0; |
| 9537 | static constexpr int odsIndex_rhs = 1; |
| 9538 | static constexpr int odsIndex_result = 0; |
| 9539 | using Properties = FoldAdaptor::Properties; |
| 9540 | using ::mlir::OpAsmOpInterface::Trait<MulIOp>::getAsmBlockArgumentNames; |
| 9541 | using ::mlir::OpAsmOpInterface::Trait<MulIOp>::getAsmBlockNames; |
| 9542 | using ::mlir::OpAsmOpInterface::Trait<MulIOp>::getDefaultDialect; |
| 9543 | using ::mlir::InferIntRangeInterface::Trait<MulIOp>::inferResultRangesFromOptional; |
| 9544 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<MulIOp>::getOverflowAttr; |
| 9545 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<MulIOp>::hasNoUnsignedWrap; |
| 9546 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<MulIOp>::hasNoSignedWrap; |
| 9547 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<MulIOp>::getIntegerOverflowAttrName; |
| 9548 | using ::mlir::VectorUnrollOpInterface::Trait<MulIOp>::getIterationShapeToUnroll; |
| 9549 | using ::mlir::VectorUnrollOpInterface::Trait<MulIOp>::getDefaultUnrollTargetShape; |
| 9550 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 9551 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("overflowFlags" )}; |
| 9552 | return ::llvm::ArrayRef(attrNames); |
| 9553 | } |
| 9554 | |
| 9555 | ::mlir::StringAttr getOverflowFlagsAttrName() { |
| 9556 | return getAttributeNameForIndex(index: 0); |
| 9557 | } |
| 9558 | |
| 9559 | static ::mlir::StringAttr getOverflowFlagsAttrName(::mlir::OperationName name) { |
| 9560 | return getAttributeNameForIndex(name, index: 0); |
| 9561 | } |
| 9562 | |
| 9563 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 9564 | return ::llvm::StringLiteral("arith.muli" ); |
| 9565 | } |
| 9566 | |
| 9567 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 9568 | return {index, 1}; |
| 9569 | } |
| 9570 | |
| 9571 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 9572 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 9573 | return getOperation()->getOperands().slice(n: start, m: length); |
| 9574 | } |
| 9575 | |
| 9576 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 9577 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 9578 | } |
| 9579 | |
| 9580 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 9581 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 9582 | } |
| 9583 | |
| 9584 | ::mlir::OpOperand &getLhsMutable() { |
| 9585 | auto range = getODSOperandIndexAndLength(index: 0); |
| 9586 | return getOperation()->getOpOperand(idx: range.first); |
| 9587 | } |
| 9588 | |
| 9589 | ::mlir::OpOperand &getRhsMutable() { |
| 9590 | auto range = getODSOperandIndexAndLength(index: 1); |
| 9591 | return getOperation()->getOpOperand(idx: range.first); |
| 9592 | } |
| 9593 | |
| 9594 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 9595 | return {index, 1}; |
| 9596 | } |
| 9597 | |
| 9598 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 9599 | auto valueRange = getODSResultIndexAndLength(index); |
| 9600 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 9601 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 9602 | } |
| 9603 | |
| 9604 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 9605 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 9606 | } |
| 9607 | |
| 9608 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 9609 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 9610 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 9611 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 9612 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 9613 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 9614 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 9615 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 9616 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 9617 | ::mlir::arith::IntegerOverflowFlagsAttr getOverflowFlagsAttr() { |
| 9618 | return ::llvm::dyn_cast_or_null<::mlir::arith::IntegerOverflowFlagsAttr>(Val&: getProperties().overflowFlags); |
| 9619 | } |
| 9620 | |
| 9621 | ::mlir::arith::IntegerOverflowFlags getOverflowFlags(); |
| 9622 | void setOverflowFlagsAttr(::mlir::arith::IntegerOverflowFlagsAttr attr) { |
| 9623 | getProperties().overflowFlags = attr; |
| 9624 | } |
| 9625 | |
| 9626 | void setOverflowFlags(::mlir::arith::IntegerOverflowFlags attrValue); |
| 9627 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 9628 | static MulIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 9629 | static MulIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 9630 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 9631 | static MulIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 9632 | static MulIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 9633 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 9634 | static MulIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 9635 | static MulIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 9636 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 9637 | static MulIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 9638 | static MulIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 9639 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 9640 | static MulIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 9641 | static MulIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 9642 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 9643 | static MulIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 9644 | static MulIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 9645 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9646 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9647 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9648 | static MulIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9649 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9650 | static MulIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9651 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9652 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9653 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9654 | static MulIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9655 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 9656 | static MulIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9657 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9658 | static MulIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9659 | static MulIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9660 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9661 | static MulIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9662 | static MulIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9663 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 9664 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 9665 | ::llvm::LogicalResult verifyInvariants(); |
| 9666 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 9667 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 9668 | 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); |
| 9669 | void inferResultDivisibility(::llvm::ArrayRef<::mlir::IntegerDivisibility> argDivs, ::mlir::SetIntDivisibilityFn setResultDivs); |
| 9670 | void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn); |
| 9671 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 9672 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 9673 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 9674 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 9675 | private: |
| 9676 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 9677 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 9678 | } |
| 9679 | |
| 9680 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 9681 | assert(index < 1 && "invalid attribute index" ); |
| 9682 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 9683 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 9684 | "dependent dialect loading?" ); |
| 9685 | return name.getAttributeNames()[index]; |
| 9686 | } |
| 9687 | |
| 9688 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 9689 | public: |
| 9690 | }; |
| 9691 | |
| 9692 | } // namespace mlir::arith |
| 9693 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MulIOp) |
| 9694 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::MulIOpGenericAdaptorBase::Properties) |
| 9695 | |
| 9696 | namespace mlir::arith { |
| 9697 | |
| 9698 | |
| 9699 | //===----------------------------------------------------------------------===// |
| 9700 | // ::mlir::arith::MulSIExtendedOp declarations |
| 9701 | //===----------------------------------------------------------------------===// |
| 9702 | |
| 9703 | namespace detail { |
| 9704 | |
| 9705 | class MulSIExtendedOpGenericAdaptorBase { |
| 9706 | public: |
| 9707 | using Properties = ::mlir::EmptyProperties; |
| 9708 | protected: |
| 9709 | ::mlir::DictionaryAttr odsAttrs; |
| 9710 | ::std::optional<::mlir::OperationName> odsOpName; |
| 9711 | Properties properties; |
| 9712 | ::mlir::RegionRange odsRegions; |
| 9713 | public: |
| 9714 | MulSIExtendedOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 9715 | odsOpName.emplace(args: "arith.mulsi_extended" , args: odsAttrs.getContext()); |
| 9716 | } |
| 9717 | |
| 9718 | MulSIExtendedOpGenericAdaptorBase(MulSIExtendedOp op); |
| 9719 | |
| 9720 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 9721 | return {index, 1}; |
| 9722 | } |
| 9723 | |
| 9724 | const Properties &getProperties() { |
| 9725 | return properties; |
| 9726 | } |
| 9727 | |
| 9728 | ::mlir::DictionaryAttr getAttributes() { |
| 9729 | return odsAttrs; |
| 9730 | } |
| 9731 | |
| 9732 | }; |
| 9733 | |
| 9734 | } // namespace detail |
| 9735 | template <typename RangeT> |
| 9736 | class MulSIExtendedOpGenericAdaptor : public detail::MulSIExtendedOpGenericAdaptorBase { |
| 9737 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 9738 | using Base = detail::MulSIExtendedOpGenericAdaptorBase; |
| 9739 | static constexpr int odsIndex_lhs = 0; |
| 9740 | static constexpr int odsIndex_rhs = 1; |
| 9741 | public: |
| 9742 | MulSIExtendedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 9743 | |
| 9744 | MulSIExtendedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MulSIExtendedOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 9745 | |
| 9746 | MulSIExtendedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MulSIExtendedOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 9747 | |
| 9748 | MulSIExtendedOpGenericAdaptor(RangeT values, const MulSIExtendedOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 9749 | |
| 9750 | template <typename LateInst = MulSIExtendedOp, typename = std::enable_if_t<std::is_same_v<LateInst, MulSIExtendedOp>>> |
| 9751 | MulSIExtendedOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 9752 | |
| 9753 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 9754 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 9755 | } |
| 9756 | |
| 9757 | RangeT getODSOperands(unsigned index) { |
| 9758 | auto valueRange = getODSOperandIndexAndLength(index); |
| 9759 | return {std::next(odsOperands.begin(), valueRange.first), |
| 9760 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 9761 | } |
| 9762 | |
| 9763 | ValueT getLhs() { |
| 9764 | return (*getODSOperands(index: 0).begin()); |
| 9765 | } |
| 9766 | |
| 9767 | ValueT getRhs() { |
| 9768 | return (*getODSOperands(index: 1).begin()); |
| 9769 | } |
| 9770 | |
| 9771 | RangeT getOperands() { |
| 9772 | return odsOperands; |
| 9773 | } |
| 9774 | |
| 9775 | private: |
| 9776 | RangeT odsOperands; |
| 9777 | }; |
| 9778 | class MulSIExtendedOpAdaptor : public MulSIExtendedOpGenericAdaptor<::mlir::ValueRange> { |
| 9779 | public: |
| 9780 | using MulSIExtendedOpGenericAdaptor::MulSIExtendedOpGenericAdaptor; |
| 9781 | MulSIExtendedOpAdaptor(MulSIExtendedOp op); |
| 9782 | |
| 9783 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 9784 | }; |
| 9785 | class MulSIExtendedOp : public ::mlir::Op<MulSIExtendedOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::NResults<2>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait, ::mlir::OpAsmOpInterface::Trait> { |
| 9786 | public: |
| 9787 | using Op::Op; |
| 9788 | using Op::print; |
| 9789 | using Adaptor = MulSIExtendedOpAdaptor; |
| 9790 | template <typename RangeT> |
| 9791 | using GenericAdaptor = MulSIExtendedOpGenericAdaptor<RangeT>; |
| 9792 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 9793 | static constexpr int odsIndex_lhs = 0; |
| 9794 | static constexpr int odsIndex_rhs = 1; |
| 9795 | static constexpr int odsIndex_low = 0; |
| 9796 | static constexpr int odsIndex_high = 1; |
| 9797 | using Properties = FoldAdaptor::Properties; |
| 9798 | using ::mlir::VectorUnrollOpInterface::Trait<MulSIExtendedOp>::getIterationShapeToUnroll; |
| 9799 | using ::mlir::VectorUnrollOpInterface::Trait<MulSIExtendedOp>::getDefaultUnrollTargetShape; |
| 9800 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 9801 | return {}; |
| 9802 | } |
| 9803 | |
| 9804 | void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn); |
| 9805 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 9806 | return ::llvm::StringLiteral("arith.mulsi_extended" ); |
| 9807 | } |
| 9808 | |
| 9809 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 9810 | return {index, 1}; |
| 9811 | } |
| 9812 | |
| 9813 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 9814 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 9815 | return getOperation()->getOperands().slice(n: start, m: length); |
| 9816 | } |
| 9817 | |
| 9818 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 9819 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 9820 | } |
| 9821 | |
| 9822 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 9823 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 9824 | } |
| 9825 | |
| 9826 | ::mlir::OpOperand &getLhsMutable() { |
| 9827 | auto range = getODSOperandIndexAndLength(index: 0); |
| 9828 | return getOperation()->getOpOperand(idx: range.first); |
| 9829 | } |
| 9830 | |
| 9831 | ::mlir::OpOperand &getRhsMutable() { |
| 9832 | auto range = getODSOperandIndexAndLength(index: 1); |
| 9833 | return getOperation()->getOpOperand(idx: range.first); |
| 9834 | } |
| 9835 | |
| 9836 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 9837 | return {index, 1}; |
| 9838 | } |
| 9839 | |
| 9840 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 9841 | auto valueRange = getODSResultIndexAndLength(index); |
| 9842 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 9843 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 9844 | } |
| 9845 | |
| 9846 | ::mlir::TypedValue<::mlir::Type> getLow() { |
| 9847 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 9848 | } |
| 9849 | |
| 9850 | ::mlir::TypedValue<::mlir::Type> getHigh() { |
| 9851 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 1).begin()); |
| 9852 | } |
| 9853 | |
| 9854 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 9855 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 9856 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 9857 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 9858 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 9859 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 9860 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 9861 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type low, ::mlir::Type high, ::mlir::Value lhs, ::mlir::Value rhs); |
| 9862 | static MulSIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type low, ::mlir::Type high, ::mlir::Value lhs, ::mlir::Value rhs); |
| 9863 | static MulSIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type low, ::mlir::Type high, ::mlir::Value lhs, ::mlir::Value rhs); |
| 9864 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 9865 | static MulSIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 9866 | static MulSIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 9867 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 9868 | static MulSIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 9869 | static MulSIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 9870 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9871 | static MulSIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9872 | static MulSIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9873 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9874 | static MulSIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9875 | static MulSIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 9876 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9877 | static MulSIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9878 | static MulSIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9879 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9880 | static MulSIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9881 | static MulSIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 9882 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 9883 | ::llvm::LogicalResult verifyInvariants(); |
| 9884 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 9885 | ::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results); |
| 9886 | 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); |
| 9887 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 9888 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 9889 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 9890 | public: |
| 9891 | std::optional<SmallVector<int64_t, 4>> getIterationShapeToUnroll(); |
| 9892 | }; |
| 9893 | |
| 9894 | } // namespace mlir::arith |
| 9895 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MulSIExtendedOp) |
| 9896 | |
| 9897 | namespace mlir::arith { |
| 9898 | |
| 9899 | |
| 9900 | //===----------------------------------------------------------------------===// |
| 9901 | // ::mlir::arith::MulUIExtendedOp declarations |
| 9902 | //===----------------------------------------------------------------------===// |
| 9903 | |
| 9904 | namespace detail { |
| 9905 | |
| 9906 | class MulUIExtendedOpGenericAdaptorBase { |
| 9907 | public: |
| 9908 | using Properties = ::mlir::EmptyProperties; |
| 9909 | protected: |
| 9910 | ::mlir::DictionaryAttr odsAttrs; |
| 9911 | ::std::optional<::mlir::OperationName> odsOpName; |
| 9912 | Properties properties; |
| 9913 | ::mlir::RegionRange odsRegions; |
| 9914 | public: |
| 9915 | MulUIExtendedOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 9916 | odsOpName.emplace(args: "arith.mului_extended" , args: odsAttrs.getContext()); |
| 9917 | } |
| 9918 | |
| 9919 | MulUIExtendedOpGenericAdaptorBase(MulUIExtendedOp op); |
| 9920 | |
| 9921 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 9922 | return {index, 1}; |
| 9923 | } |
| 9924 | |
| 9925 | const Properties &getProperties() { |
| 9926 | return properties; |
| 9927 | } |
| 9928 | |
| 9929 | ::mlir::DictionaryAttr getAttributes() { |
| 9930 | return odsAttrs; |
| 9931 | } |
| 9932 | |
| 9933 | }; |
| 9934 | |
| 9935 | } // namespace detail |
| 9936 | template <typename RangeT> |
| 9937 | class MulUIExtendedOpGenericAdaptor : public detail::MulUIExtendedOpGenericAdaptorBase { |
| 9938 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 9939 | using Base = detail::MulUIExtendedOpGenericAdaptorBase; |
| 9940 | static constexpr int odsIndex_lhs = 0; |
| 9941 | static constexpr int odsIndex_rhs = 1; |
| 9942 | public: |
| 9943 | MulUIExtendedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 9944 | |
| 9945 | MulUIExtendedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MulUIExtendedOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 9946 | |
| 9947 | MulUIExtendedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MulUIExtendedOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 9948 | |
| 9949 | MulUIExtendedOpGenericAdaptor(RangeT values, const MulUIExtendedOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 9950 | |
| 9951 | template <typename LateInst = MulUIExtendedOp, typename = std::enable_if_t<std::is_same_v<LateInst, MulUIExtendedOp>>> |
| 9952 | MulUIExtendedOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 9953 | |
| 9954 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 9955 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 9956 | } |
| 9957 | |
| 9958 | RangeT getODSOperands(unsigned index) { |
| 9959 | auto valueRange = getODSOperandIndexAndLength(index); |
| 9960 | return {std::next(odsOperands.begin(), valueRange.first), |
| 9961 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 9962 | } |
| 9963 | |
| 9964 | ValueT getLhs() { |
| 9965 | return (*getODSOperands(index: 0).begin()); |
| 9966 | } |
| 9967 | |
| 9968 | ValueT getRhs() { |
| 9969 | return (*getODSOperands(index: 1).begin()); |
| 9970 | } |
| 9971 | |
| 9972 | RangeT getOperands() { |
| 9973 | return odsOperands; |
| 9974 | } |
| 9975 | |
| 9976 | private: |
| 9977 | RangeT odsOperands; |
| 9978 | }; |
| 9979 | class MulUIExtendedOpAdaptor : public MulUIExtendedOpGenericAdaptor<::mlir::ValueRange> { |
| 9980 | public: |
| 9981 | using MulUIExtendedOpGenericAdaptor::MulUIExtendedOpGenericAdaptor; |
| 9982 | MulUIExtendedOpAdaptor(MulUIExtendedOp op); |
| 9983 | |
| 9984 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 9985 | }; |
| 9986 | class MulUIExtendedOp : public ::mlir::Op<MulUIExtendedOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::NResults<2>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::IsCommutative, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait, ::mlir::OpAsmOpInterface::Trait> { |
| 9987 | public: |
| 9988 | using Op::Op; |
| 9989 | using Op::print; |
| 9990 | using Adaptor = MulUIExtendedOpAdaptor; |
| 9991 | template <typename RangeT> |
| 9992 | using GenericAdaptor = MulUIExtendedOpGenericAdaptor<RangeT>; |
| 9993 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 9994 | static constexpr int odsIndex_lhs = 0; |
| 9995 | static constexpr int odsIndex_rhs = 1; |
| 9996 | static constexpr int odsIndex_low = 0; |
| 9997 | static constexpr int odsIndex_high = 1; |
| 9998 | using Properties = FoldAdaptor::Properties; |
| 9999 | using ::mlir::VectorUnrollOpInterface::Trait<MulUIExtendedOp>::getIterationShapeToUnroll; |
| 10000 | using ::mlir::VectorUnrollOpInterface::Trait<MulUIExtendedOp>::getDefaultUnrollTargetShape; |
| 10001 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 10002 | return {}; |
| 10003 | } |
| 10004 | |
| 10005 | void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn); |
| 10006 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 10007 | return ::llvm::StringLiteral("arith.mului_extended" ); |
| 10008 | } |
| 10009 | |
| 10010 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 10011 | return {index, 1}; |
| 10012 | } |
| 10013 | |
| 10014 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 10015 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 10016 | return getOperation()->getOperands().slice(n: start, m: length); |
| 10017 | } |
| 10018 | |
| 10019 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 10020 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 10021 | } |
| 10022 | |
| 10023 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 10024 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 10025 | } |
| 10026 | |
| 10027 | ::mlir::OpOperand &getLhsMutable() { |
| 10028 | auto range = getODSOperandIndexAndLength(index: 0); |
| 10029 | return getOperation()->getOpOperand(idx: range.first); |
| 10030 | } |
| 10031 | |
| 10032 | ::mlir::OpOperand &getRhsMutable() { |
| 10033 | auto range = getODSOperandIndexAndLength(index: 1); |
| 10034 | return getOperation()->getOpOperand(idx: range.first); |
| 10035 | } |
| 10036 | |
| 10037 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 10038 | return {index, 1}; |
| 10039 | } |
| 10040 | |
| 10041 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 10042 | auto valueRange = getODSResultIndexAndLength(index); |
| 10043 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 10044 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 10045 | } |
| 10046 | |
| 10047 | ::mlir::TypedValue<::mlir::Type> getLow() { |
| 10048 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 10049 | } |
| 10050 | |
| 10051 | ::mlir::TypedValue<::mlir::Type> getHigh() { |
| 10052 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 1).begin()); |
| 10053 | } |
| 10054 | |
| 10055 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 10056 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 10057 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 10058 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 10059 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 10060 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 10061 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 10062 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type low, ::mlir::Type high, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10063 | static MulUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type low, ::mlir::Type high, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10064 | static MulUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type low, ::mlir::Type high, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10065 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10066 | static MulUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10067 | static MulUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10068 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10069 | static MulUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10070 | static MulUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10071 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10072 | static MulUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10073 | static MulUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10074 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10075 | static MulUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10076 | static MulUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10077 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10078 | static MulUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10079 | static MulUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10080 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10081 | static MulUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10082 | static MulUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10083 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 10084 | ::llvm::LogicalResult verifyInvariants(); |
| 10085 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 10086 | ::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results); |
| 10087 | 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); |
| 10088 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 10089 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 10090 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 10091 | public: |
| 10092 | std::optional<SmallVector<int64_t, 4>> getIterationShapeToUnroll(); |
| 10093 | }; |
| 10094 | |
| 10095 | } // namespace mlir::arith |
| 10096 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::MulUIExtendedOp) |
| 10097 | |
| 10098 | namespace mlir::arith { |
| 10099 | |
| 10100 | |
| 10101 | //===----------------------------------------------------------------------===// |
| 10102 | // ::mlir::arith::NegFOp declarations |
| 10103 | //===----------------------------------------------------------------------===// |
| 10104 | |
| 10105 | namespace detail { |
| 10106 | |
| 10107 | class NegFOpGenericAdaptorBase { |
| 10108 | public: |
| 10109 | struct Properties { |
| 10110 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 10111 | fastmathTy fastmath; |
| 10112 | |
| 10113 | auto getFastmath() const { |
| 10114 | auto &propStorage = this->fastmath; |
| 10115 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 10116 | } |
| 10117 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 10118 | this->fastmath = propValue; |
| 10119 | } |
| 10120 | bool operator==(const Properties &rhs) const { |
| 10121 | return |
| 10122 | rhs.fastmath == this->fastmath && |
| 10123 | true; |
| 10124 | } |
| 10125 | bool operator!=(const Properties &rhs) const { |
| 10126 | return !(*this == rhs); |
| 10127 | } |
| 10128 | }; |
| 10129 | protected: |
| 10130 | ::mlir::DictionaryAttr odsAttrs; |
| 10131 | ::std::optional<::mlir::OperationName> odsOpName; |
| 10132 | Properties properties; |
| 10133 | ::mlir::RegionRange odsRegions; |
| 10134 | public: |
| 10135 | NegFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 10136 | odsOpName.emplace(args: "arith.negf" , args: odsAttrs.getContext()); |
| 10137 | } |
| 10138 | |
| 10139 | NegFOpGenericAdaptorBase(NegFOp op); |
| 10140 | |
| 10141 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 10142 | return {index, 1}; |
| 10143 | } |
| 10144 | |
| 10145 | const Properties &getProperties() { |
| 10146 | return properties; |
| 10147 | } |
| 10148 | |
| 10149 | ::mlir::DictionaryAttr getAttributes() { |
| 10150 | return odsAttrs; |
| 10151 | } |
| 10152 | |
| 10153 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 10154 | ::mlir::arith::FastMathFlags getFastmath(); |
| 10155 | }; |
| 10156 | |
| 10157 | } // namespace detail |
| 10158 | template <typename RangeT> |
| 10159 | class NegFOpGenericAdaptor : public detail::NegFOpGenericAdaptorBase { |
| 10160 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 10161 | using Base = detail::NegFOpGenericAdaptorBase; |
| 10162 | static constexpr int odsIndex_operand = 0; |
| 10163 | public: |
| 10164 | NegFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 10165 | |
| 10166 | NegFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : NegFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 10167 | |
| 10168 | NegFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : NegFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 10169 | |
| 10170 | NegFOpGenericAdaptor(RangeT values, const NegFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 10171 | |
| 10172 | template <typename LateInst = NegFOp, typename = std::enable_if_t<std::is_same_v<LateInst, NegFOp>>> |
| 10173 | NegFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 10174 | |
| 10175 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 10176 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 10177 | } |
| 10178 | |
| 10179 | RangeT getODSOperands(unsigned index) { |
| 10180 | auto valueRange = getODSOperandIndexAndLength(index); |
| 10181 | return {std::next(odsOperands.begin(), valueRange.first), |
| 10182 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 10183 | } |
| 10184 | |
| 10185 | ValueT getOperand() { |
| 10186 | return (*getODSOperands(index: 0).begin()); |
| 10187 | } |
| 10188 | |
| 10189 | RangeT getOperands() { |
| 10190 | return odsOperands; |
| 10191 | } |
| 10192 | |
| 10193 | private: |
| 10194 | RangeT odsOperands; |
| 10195 | }; |
| 10196 | class NegFOpAdaptor : public NegFOpGenericAdaptor<::mlir::ValueRange> { |
| 10197 | public: |
| 10198 | using NegFOpGenericAdaptor::NegFOpGenericAdaptor; |
| 10199 | NegFOpAdaptor(NegFOp op); |
| 10200 | |
| 10201 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 10202 | }; |
| 10203 | class NegFOp : public ::mlir::Op<NegFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 10204 | public: |
| 10205 | using Op::Op; |
| 10206 | using Op::print; |
| 10207 | using Adaptor = NegFOpAdaptor; |
| 10208 | template <typename RangeT> |
| 10209 | using GenericAdaptor = NegFOpGenericAdaptor<RangeT>; |
| 10210 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 10211 | static constexpr int odsIndex_operand = 0; |
| 10212 | static constexpr int odsIndex_result = 0; |
| 10213 | using Properties = FoldAdaptor::Properties; |
| 10214 | using ::mlir::arith::ArithFastMathInterface::Trait<NegFOp>::getFastMathFlagsAttr; |
| 10215 | using ::mlir::arith::ArithFastMathInterface::Trait<NegFOp>::getFastMathAttrName; |
| 10216 | using ::mlir::VectorUnrollOpInterface::Trait<NegFOp>::getIterationShapeToUnroll; |
| 10217 | using ::mlir::VectorUnrollOpInterface::Trait<NegFOp>::getDefaultUnrollTargetShape; |
| 10218 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 10219 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" )}; |
| 10220 | return ::llvm::ArrayRef(attrNames); |
| 10221 | } |
| 10222 | |
| 10223 | ::mlir::StringAttr getFastmathAttrName() { |
| 10224 | return getAttributeNameForIndex(index: 0); |
| 10225 | } |
| 10226 | |
| 10227 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 10228 | return getAttributeNameForIndex(name, index: 0); |
| 10229 | } |
| 10230 | |
| 10231 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 10232 | return ::llvm::StringLiteral("arith.negf" ); |
| 10233 | } |
| 10234 | |
| 10235 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 10236 | return {index, 1}; |
| 10237 | } |
| 10238 | |
| 10239 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 10240 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 10241 | return getOperation()->getOperands().slice(n: start, m: length); |
| 10242 | } |
| 10243 | |
| 10244 | ::mlir::TypedValue<::mlir::Type> getOperand() { |
| 10245 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 10246 | } |
| 10247 | |
| 10248 | ::mlir::OpOperand &getOperandMutable() { |
| 10249 | auto range = getODSOperandIndexAndLength(index: 0); |
| 10250 | return getOperation()->getOpOperand(idx: range.first); |
| 10251 | } |
| 10252 | |
| 10253 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 10254 | return {index, 1}; |
| 10255 | } |
| 10256 | |
| 10257 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 10258 | auto valueRange = getODSResultIndexAndLength(index); |
| 10259 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 10260 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 10261 | } |
| 10262 | |
| 10263 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 10264 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 10265 | } |
| 10266 | |
| 10267 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 10268 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 10269 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 10270 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 10271 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 10272 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 10273 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 10274 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 10275 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 10276 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 10277 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 10278 | } |
| 10279 | |
| 10280 | ::mlir::arith::FastMathFlags getFastmath(); |
| 10281 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 10282 | getProperties().fastmath = attr; |
| 10283 | } |
| 10284 | |
| 10285 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 10286 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10287 | static NegFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10288 | static NegFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10289 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10290 | static NegFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10291 | static NegFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10292 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10293 | static NegFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10294 | static NegFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10295 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10296 | static NegFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10297 | static NegFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10298 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10299 | static NegFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10300 | static NegFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10301 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10302 | static NegFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10303 | static NegFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10304 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 10305 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10306 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 10307 | static NegFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10308 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 10309 | static NegFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10310 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 10311 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10312 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 10313 | static NegFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10314 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 10315 | static NegFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10316 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10317 | static NegFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10318 | static NegFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10319 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10320 | static NegFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10321 | static NegFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10322 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 10323 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 10324 | ::llvm::LogicalResult verifyInvariants(); |
| 10325 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 10326 | 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); |
| 10327 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 10328 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 10329 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 10330 | private: |
| 10331 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 10332 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 10333 | } |
| 10334 | |
| 10335 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 10336 | assert(index < 1 && "invalid attribute index" ); |
| 10337 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 10338 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 10339 | "dependent dialect loading?" ); |
| 10340 | return name.getAttributeNames()[index]; |
| 10341 | } |
| 10342 | |
| 10343 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 10344 | public: |
| 10345 | }; |
| 10346 | |
| 10347 | } // namespace mlir::arith |
| 10348 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::NegFOp) |
| 10349 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::NegFOpGenericAdaptorBase::Properties) |
| 10350 | |
| 10351 | namespace mlir::arith { |
| 10352 | |
| 10353 | |
| 10354 | //===----------------------------------------------------------------------===// |
| 10355 | // ::mlir::arith::OrIOp declarations |
| 10356 | //===----------------------------------------------------------------------===// |
| 10357 | |
| 10358 | namespace detail { |
| 10359 | |
| 10360 | class OrIOpGenericAdaptorBase { |
| 10361 | public: |
| 10362 | using Properties = ::mlir::EmptyProperties; |
| 10363 | protected: |
| 10364 | ::mlir::DictionaryAttr odsAttrs; |
| 10365 | ::std::optional<::mlir::OperationName> odsOpName; |
| 10366 | Properties properties; |
| 10367 | ::mlir::RegionRange odsRegions; |
| 10368 | public: |
| 10369 | OrIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 10370 | odsOpName.emplace(args: "arith.ori" , args: odsAttrs.getContext()); |
| 10371 | } |
| 10372 | |
| 10373 | OrIOpGenericAdaptorBase(OrIOp op); |
| 10374 | |
| 10375 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 10376 | return {index, 1}; |
| 10377 | } |
| 10378 | |
| 10379 | const Properties &getProperties() { |
| 10380 | return properties; |
| 10381 | } |
| 10382 | |
| 10383 | ::mlir::DictionaryAttr getAttributes() { |
| 10384 | return odsAttrs; |
| 10385 | } |
| 10386 | |
| 10387 | }; |
| 10388 | |
| 10389 | } // namespace detail |
| 10390 | template <typename RangeT> |
| 10391 | class OrIOpGenericAdaptor : public detail::OrIOpGenericAdaptorBase { |
| 10392 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 10393 | using Base = detail::OrIOpGenericAdaptorBase; |
| 10394 | static constexpr int odsIndex_lhs = 0; |
| 10395 | static constexpr int odsIndex_rhs = 1; |
| 10396 | public: |
| 10397 | OrIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 10398 | |
| 10399 | OrIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : OrIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 10400 | |
| 10401 | OrIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : OrIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 10402 | |
| 10403 | OrIOpGenericAdaptor(RangeT values, const OrIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 10404 | |
| 10405 | template <typename LateInst = OrIOp, typename = std::enable_if_t<std::is_same_v<LateInst, OrIOp>>> |
| 10406 | OrIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 10407 | |
| 10408 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 10409 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 10410 | } |
| 10411 | |
| 10412 | RangeT getODSOperands(unsigned index) { |
| 10413 | auto valueRange = getODSOperandIndexAndLength(index); |
| 10414 | return {std::next(odsOperands.begin(), valueRange.first), |
| 10415 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 10416 | } |
| 10417 | |
| 10418 | ValueT getLhs() { |
| 10419 | return (*getODSOperands(index: 0).begin()); |
| 10420 | } |
| 10421 | |
| 10422 | ValueT getRhs() { |
| 10423 | return (*getODSOperands(index: 1).begin()); |
| 10424 | } |
| 10425 | |
| 10426 | RangeT getOperands() { |
| 10427 | return odsOperands; |
| 10428 | } |
| 10429 | |
| 10430 | private: |
| 10431 | RangeT odsOperands; |
| 10432 | }; |
| 10433 | class OrIOpAdaptor : public OrIOpGenericAdaptor<::mlir::ValueRange> { |
| 10434 | public: |
| 10435 | using OrIOpGenericAdaptor::OrIOpGenericAdaptor; |
| 10436 | OrIOpAdaptor(OrIOp op); |
| 10437 | |
| 10438 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 10439 | }; |
| 10440 | class OrIOp : public ::mlir::Op<OrIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::IsCommutative, ::mlir::OpTrait::IsIdempotent, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 10441 | public: |
| 10442 | using Op::Op; |
| 10443 | using Op::print; |
| 10444 | using Adaptor = OrIOpAdaptor; |
| 10445 | template <typename RangeT> |
| 10446 | using GenericAdaptor = OrIOpGenericAdaptor<RangeT>; |
| 10447 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 10448 | static constexpr int odsIndex_lhs = 0; |
| 10449 | static constexpr int odsIndex_rhs = 1; |
| 10450 | static constexpr int odsIndex_result = 0; |
| 10451 | using Properties = FoldAdaptor::Properties; |
| 10452 | using ::mlir::InferIntRangeInterface::Trait<OrIOp>::inferResultRangesFromOptional; |
| 10453 | using ::mlir::VectorUnrollOpInterface::Trait<OrIOp>::getIterationShapeToUnroll; |
| 10454 | using ::mlir::VectorUnrollOpInterface::Trait<OrIOp>::getDefaultUnrollTargetShape; |
| 10455 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 10456 | return {}; |
| 10457 | } |
| 10458 | |
| 10459 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 10460 | return ::llvm::StringLiteral("arith.ori" ); |
| 10461 | } |
| 10462 | |
| 10463 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 10464 | return {index, 1}; |
| 10465 | } |
| 10466 | |
| 10467 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 10468 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 10469 | return getOperation()->getOperands().slice(n: start, m: length); |
| 10470 | } |
| 10471 | |
| 10472 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 10473 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 10474 | } |
| 10475 | |
| 10476 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 10477 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 10478 | } |
| 10479 | |
| 10480 | ::mlir::OpOperand &getLhsMutable() { |
| 10481 | auto range = getODSOperandIndexAndLength(index: 0); |
| 10482 | return getOperation()->getOpOperand(idx: range.first); |
| 10483 | } |
| 10484 | |
| 10485 | ::mlir::OpOperand &getRhsMutable() { |
| 10486 | auto range = getODSOperandIndexAndLength(index: 1); |
| 10487 | return getOperation()->getOpOperand(idx: range.first); |
| 10488 | } |
| 10489 | |
| 10490 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 10491 | return {index, 1}; |
| 10492 | } |
| 10493 | |
| 10494 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 10495 | auto valueRange = getODSResultIndexAndLength(index); |
| 10496 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 10497 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 10498 | } |
| 10499 | |
| 10500 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 10501 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 10502 | } |
| 10503 | |
| 10504 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 10505 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 10506 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 10507 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 10508 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 10509 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 10510 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 10511 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10512 | static OrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10513 | static OrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10514 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10515 | static OrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10516 | static OrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10517 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10518 | static OrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10519 | static OrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10520 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10521 | static OrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10522 | static OrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10523 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10524 | static OrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10525 | static OrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10526 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10527 | static OrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10528 | static OrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10529 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10530 | static OrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10531 | static OrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10532 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 10533 | ::llvm::LogicalResult verifyInvariants(); |
| 10534 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 10535 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 10536 | 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); |
| 10537 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 10538 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 10539 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 10540 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 10541 | public: |
| 10542 | }; |
| 10543 | |
| 10544 | } // namespace mlir::arith |
| 10545 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::OrIOp) |
| 10546 | |
| 10547 | namespace mlir::arith { |
| 10548 | |
| 10549 | |
| 10550 | //===----------------------------------------------------------------------===// |
| 10551 | // ::mlir::arith::RemFOp declarations |
| 10552 | //===----------------------------------------------------------------------===// |
| 10553 | |
| 10554 | namespace detail { |
| 10555 | |
| 10556 | class RemFOpGenericAdaptorBase { |
| 10557 | public: |
| 10558 | struct Properties { |
| 10559 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 10560 | fastmathTy fastmath; |
| 10561 | |
| 10562 | auto getFastmath() const { |
| 10563 | auto &propStorage = this->fastmath; |
| 10564 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 10565 | } |
| 10566 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 10567 | this->fastmath = propValue; |
| 10568 | } |
| 10569 | bool operator==(const Properties &rhs) const { |
| 10570 | return |
| 10571 | rhs.fastmath == this->fastmath && |
| 10572 | true; |
| 10573 | } |
| 10574 | bool operator!=(const Properties &rhs) const { |
| 10575 | return !(*this == rhs); |
| 10576 | } |
| 10577 | }; |
| 10578 | protected: |
| 10579 | ::mlir::DictionaryAttr odsAttrs; |
| 10580 | ::std::optional<::mlir::OperationName> odsOpName; |
| 10581 | Properties properties; |
| 10582 | ::mlir::RegionRange odsRegions; |
| 10583 | public: |
| 10584 | RemFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 10585 | odsOpName.emplace(args: "arith.remf" , args: odsAttrs.getContext()); |
| 10586 | } |
| 10587 | |
| 10588 | RemFOpGenericAdaptorBase(RemFOp op); |
| 10589 | |
| 10590 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 10591 | return {index, 1}; |
| 10592 | } |
| 10593 | |
| 10594 | const Properties &getProperties() { |
| 10595 | return properties; |
| 10596 | } |
| 10597 | |
| 10598 | ::mlir::DictionaryAttr getAttributes() { |
| 10599 | return odsAttrs; |
| 10600 | } |
| 10601 | |
| 10602 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 10603 | ::mlir::arith::FastMathFlags getFastmath(); |
| 10604 | }; |
| 10605 | |
| 10606 | } // namespace detail |
| 10607 | template <typename RangeT> |
| 10608 | class RemFOpGenericAdaptor : public detail::RemFOpGenericAdaptorBase { |
| 10609 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 10610 | using Base = detail::RemFOpGenericAdaptorBase; |
| 10611 | static constexpr int odsIndex_lhs = 0; |
| 10612 | static constexpr int odsIndex_rhs = 1; |
| 10613 | public: |
| 10614 | RemFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 10615 | |
| 10616 | RemFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RemFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 10617 | |
| 10618 | RemFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RemFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 10619 | |
| 10620 | RemFOpGenericAdaptor(RangeT values, const RemFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 10621 | |
| 10622 | template <typename LateInst = RemFOp, typename = std::enable_if_t<std::is_same_v<LateInst, RemFOp>>> |
| 10623 | RemFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 10624 | |
| 10625 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 10626 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 10627 | } |
| 10628 | |
| 10629 | RangeT getODSOperands(unsigned index) { |
| 10630 | auto valueRange = getODSOperandIndexAndLength(index); |
| 10631 | return {std::next(odsOperands.begin(), valueRange.first), |
| 10632 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 10633 | } |
| 10634 | |
| 10635 | ValueT getLhs() { |
| 10636 | return (*getODSOperands(index: 0).begin()); |
| 10637 | } |
| 10638 | |
| 10639 | ValueT getRhs() { |
| 10640 | return (*getODSOperands(index: 1).begin()); |
| 10641 | } |
| 10642 | |
| 10643 | RangeT getOperands() { |
| 10644 | return odsOperands; |
| 10645 | } |
| 10646 | |
| 10647 | private: |
| 10648 | RangeT odsOperands; |
| 10649 | }; |
| 10650 | class RemFOpAdaptor : public RemFOpGenericAdaptor<::mlir::ValueRange> { |
| 10651 | public: |
| 10652 | using RemFOpGenericAdaptor::RemFOpGenericAdaptor; |
| 10653 | RemFOpAdaptor(RemFOp op); |
| 10654 | |
| 10655 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 10656 | }; |
| 10657 | class RemFOp : public ::mlir::Op<RemFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 10658 | public: |
| 10659 | using Op::Op; |
| 10660 | using Op::print; |
| 10661 | using Adaptor = RemFOpAdaptor; |
| 10662 | template <typename RangeT> |
| 10663 | using GenericAdaptor = RemFOpGenericAdaptor<RangeT>; |
| 10664 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 10665 | static constexpr int odsIndex_lhs = 0; |
| 10666 | static constexpr int odsIndex_rhs = 1; |
| 10667 | static constexpr int odsIndex_result = 0; |
| 10668 | using Properties = FoldAdaptor::Properties; |
| 10669 | using ::mlir::arith::ArithFastMathInterface::Trait<RemFOp>::getFastMathFlagsAttr; |
| 10670 | using ::mlir::arith::ArithFastMathInterface::Trait<RemFOp>::getFastMathAttrName; |
| 10671 | using ::mlir::VectorUnrollOpInterface::Trait<RemFOp>::getIterationShapeToUnroll; |
| 10672 | using ::mlir::VectorUnrollOpInterface::Trait<RemFOp>::getDefaultUnrollTargetShape; |
| 10673 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 10674 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" )}; |
| 10675 | return ::llvm::ArrayRef(attrNames); |
| 10676 | } |
| 10677 | |
| 10678 | ::mlir::StringAttr getFastmathAttrName() { |
| 10679 | return getAttributeNameForIndex(index: 0); |
| 10680 | } |
| 10681 | |
| 10682 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 10683 | return getAttributeNameForIndex(name, index: 0); |
| 10684 | } |
| 10685 | |
| 10686 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 10687 | return ::llvm::StringLiteral("arith.remf" ); |
| 10688 | } |
| 10689 | |
| 10690 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 10691 | return {index, 1}; |
| 10692 | } |
| 10693 | |
| 10694 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 10695 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 10696 | return getOperation()->getOperands().slice(n: start, m: length); |
| 10697 | } |
| 10698 | |
| 10699 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 10700 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 10701 | } |
| 10702 | |
| 10703 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 10704 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 10705 | } |
| 10706 | |
| 10707 | ::mlir::OpOperand &getLhsMutable() { |
| 10708 | auto range = getODSOperandIndexAndLength(index: 0); |
| 10709 | return getOperation()->getOpOperand(idx: range.first); |
| 10710 | } |
| 10711 | |
| 10712 | ::mlir::OpOperand &getRhsMutable() { |
| 10713 | auto range = getODSOperandIndexAndLength(index: 1); |
| 10714 | return getOperation()->getOpOperand(idx: range.first); |
| 10715 | } |
| 10716 | |
| 10717 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 10718 | return {index, 1}; |
| 10719 | } |
| 10720 | |
| 10721 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 10722 | auto valueRange = getODSResultIndexAndLength(index); |
| 10723 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 10724 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 10725 | } |
| 10726 | |
| 10727 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 10728 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 10729 | } |
| 10730 | |
| 10731 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 10732 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 10733 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 10734 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 10735 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 10736 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 10737 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 10738 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 10739 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 10740 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 10741 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 10742 | } |
| 10743 | |
| 10744 | ::mlir::arith::FastMathFlags getFastmath(); |
| 10745 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 10746 | getProperties().fastmath = attr; |
| 10747 | } |
| 10748 | |
| 10749 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 10750 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10751 | static RemFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10752 | static RemFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10753 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10754 | static RemFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10755 | static RemFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10756 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10757 | static RemFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10758 | static RemFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 10759 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10760 | static RemFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10761 | static RemFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10762 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10763 | static RemFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10764 | static RemFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10765 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10766 | static RemFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10767 | static RemFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 10768 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 10769 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10770 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 10771 | static RemFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10772 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 10773 | static RemFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10774 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 10775 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10776 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 10777 | static RemFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10778 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 10779 | static RemFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10780 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10781 | static RemFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10782 | static RemFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10783 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10784 | static RemFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10785 | static RemFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10786 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 10787 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 10788 | ::llvm::LogicalResult verifyInvariants(); |
| 10789 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 10790 | 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); |
| 10791 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 10792 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 10793 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 10794 | private: |
| 10795 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 10796 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 10797 | } |
| 10798 | |
| 10799 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 10800 | assert(index < 1 && "invalid attribute index" ); |
| 10801 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 10802 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 10803 | "dependent dialect loading?" ); |
| 10804 | return name.getAttributeNames()[index]; |
| 10805 | } |
| 10806 | |
| 10807 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 10808 | public: |
| 10809 | }; |
| 10810 | |
| 10811 | } // namespace mlir::arith |
| 10812 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::RemFOp) |
| 10813 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::RemFOpGenericAdaptorBase::Properties) |
| 10814 | |
| 10815 | namespace mlir::arith { |
| 10816 | |
| 10817 | |
| 10818 | //===----------------------------------------------------------------------===// |
| 10819 | // ::mlir::arith::RemSIOp declarations |
| 10820 | //===----------------------------------------------------------------------===// |
| 10821 | |
| 10822 | namespace detail { |
| 10823 | |
| 10824 | class RemSIOpGenericAdaptorBase { |
| 10825 | public: |
| 10826 | using Properties = ::mlir::EmptyProperties; |
| 10827 | protected: |
| 10828 | ::mlir::DictionaryAttr odsAttrs; |
| 10829 | ::std::optional<::mlir::OperationName> odsOpName; |
| 10830 | Properties properties; |
| 10831 | ::mlir::RegionRange odsRegions; |
| 10832 | public: |
| 10833 | RemSIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 10834 | odsOpName.emplace(args: "arith.remsi" , args: odsAttrs.getContext()); |
| 10835 | } |
| 10836 | |
| 10837 | RemSIOpGenericAdaptorBase(RemSIOp op); |
| 10838 | |
| 10839 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 10840 | return {index, 1}; |
| 10841 | } |
| 10842 | |
| 10843 | const Properties &getProperties() { |
| 10844 | return properties; |
| 10845 | } |
| 10846 | |
| 10847 | ::mlir::DictionaryAttr getAttributes() { |
| 10848 | return odsAttrs; |
| 10849 | } |
| 10850 | |
| 10851 | }; |
| 10852 | |
| 10853 | } // namespace detail |
| 10854 | template <typename RangeT> |
| 10855 | class RemSIOpGenericAdaptor : public detail::RemSIOpGenericAdaptorBase { |
| 10856 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 10857 | using Base = detail::RemSIOpGenericAdaptorBase; |
| 10858 | static constexpr int odsIndex_lhs = 0; |
| 10859 | static constexpr int odsIndex_rhs = 1; |
| 10860 | public: |
| 10861 | RemSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 10862 | |
| 10863 | RemSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RemSIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 10864 | |
| 10865 | RemSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RemSIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 10866 | |
| 10867 | RemSIOpGenericAdaptor(RangeT values, const RemSIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 10868 | |
| 10869 | template <typename LateInst = RemSIOp, typename = std::enable_if_t<std::is_same_v<LateInst, RemSIOp>>> |
| 10870 | RemSIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 10871 | |
| 10872 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 10873 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 10874 | } |
| 10875 | |
| 10876 | RangeT getODSOperands(unsigned index) { |
| 10877 | auto valueRange = getODSOperandIndexAndLength(index); |
| 10878 | return {std::next(odsOperands.begin(), valueRange.first), |
| 10879 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 10880 | } |
| 10881 | |
| 10882 | ValueT getLhs() { |
| 10883 | return (*getODSOperands(index: 0).begin()); |
| 10884 | } |
| 10885 | |
| 10886 | ValueT getRhs() { |
| 10887 | return (*getODSOperands(index: 1).begin()); |
| 10888 | } |
| 10889 | |
| 10890 | RangeT getOperands() { |
| 10891 | return odsOperands; |
| 10892 | } |
| 10893 | |
| 10894 | private: |
| 10895 | RangeT odsOperands; |
| 10896 | }; |
| 10897 | class RemSIOpAdaptor : public RemSIOpGenericAdaptor<::mlir::ValueRange> { |
| 10898 | public: |
| 10899 | using RemSIOpGenericAdaptor::RemSIOpGenericAdaptor; |
| 10900 | RemSIOpAdaptor(RemSIOp op); |
| 10901 | |
| 10902 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 10903 | }; |
| 10904 | class RemSIOp : public ::mlir::Op<RemSIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 10905 | public: |
| 10906 | using Op::Op; |
| 10907 | using Op::print; |
| 10908 | using Adaptor = RemSIOpAdaptor; |
| 10909 | template <typename RangeT> |
| 10910 | using GenericAdaptor = RemSIOpGenericAdaptor<RangeT>; |
| 10911 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 10912 | static constexpr int odsIndex_lhs = 0; |
| 10913 | static constexpr int odsIndex_rhs = 1; |
| 10914 | static constexpr int odsIndex_result = 0; |
| 10915 | using Properties = FoldAdaptor::Properties; |
| 10916 | using ::mlir::InferIntRangeInterface::Trait<RemSIOp>::inferResultRangesFromOptional; |
| 10917 | using ::mlir::VectorUnrollOpInterface::Trait<RemSIOp>::getIterationShapeToUnroll; |
| 10918 | using ::mlir::VectorUnrollOpInterface::Trait<RemSIOp>::getDefaultUnrollTargetShape; |
| 10919 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 10920 | return {}; |
| 10921 | } |
| 10922 | |
| 10923 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 10924 | return ::llvm::StringLiteral("arith.remsi" ); |
| 10925 | } |
| 10926 | |
| 10927 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 10928 | return {index, 1}; |
| 10929 | } |
| 10930 | |
| 10931 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 10932 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 10933 | return getOperation()->getOperands().slice(n: start, m: length); |
| 10934 | } |
| 10935 | |
| 10936 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 10937 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 10938 | } |
| 10939 | |
| 10940 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 10941 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 10942 | } |
| 10943 | |
| 10944 | ::mlir::OpOperand &getLhsMutable() { |
| 10945 | auto range = getODSOperandIndexAndLength(index: 0); |
| 10946 | return getOperation()->getOpOperand(idx: range.first); |
| 10947 | } |
| 10948 | |
| 10949 | ::mlir::OpOperand &getRhsMutable() { |
| 10950 | auto range = getODSOperandIndexAndLength(index: 1); |
| 10951 | return getOperation()->getOpOperand(idx: range.first); |
| 10952 | } |
| 10953 | |
| 10954 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 10955 | return {index, 1}; |
| 10956 | } |
| 10957 | |
| 10958 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 10959 | auto valueRange = getODSResultIndexAndLength(index); |
| 10960 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 10961 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 10962 | } |
| 10963 | |
| 10964 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 10965 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 10966 | } |
| 10967 | |
| 10968 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 10969 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 10970 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 10971 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 10972 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 10973 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 10974 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 10975 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10976 | static RemSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10977 | static RemSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10978 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10979 | static RemSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10980 | static RemSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10981 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10982 | static RemSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10983 | static RemSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 10984 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10985 | static RemSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10986 | static RemSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10987 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10988 | static RemSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10989 | static RemSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 10990 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10991 | static RemSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10992 | static RemSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10993 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10994 | static RemSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10995 | static RemSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 10996 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 10997 | ::llvm::LogicalResult verifyInvariants(); |
| 10998 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 10999 | 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); |
| 11000 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 11001 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 11002 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 11003 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 11004 | public: |
| 11005 | /// Interface method for ConditionallySpeculatable. |
| 11006 | Speculation::Speculatability getSpeculatability(); |
| 11007 | }; |
| 11008 | |
| 11009 | } // namespace mlir::arith |
| 11010 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::RemSIOp) |
| 11011 | |
| 11012 | namespace mlir::arith { |
| 11013 | |
| 11014 | |
| 11015 | //===----------------------------------------------------------------------===// |
| 11016 | // ::mlir::arith::RemUIOp declarations |
| 11017 | //===----------------------------------------------------------------------===// |
| 11018 | |
| 11019 | namespace detail { |
| 11020 | |
| 11021 | class RemUIOpGenericAdaptorBase { |
| 11022 | public: |
| 11023 | using Properties = ::mlir::EmptyProperties; |
| 11024 | protected: |
| 11025 | ::mlir::DictionaryAttr odsAttrs; |
| 11026 | ::std::optional<::mlir::OperationName> odsOpName; |
| 11027 | Properties properties; |
| 11028 | ::mlir::RegionRange odsRegions; |
| 11029 | public: |
| 11030 | RemUIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 11031 | odsOpName.emplace(args: "arith.remui" , args: odsAttrs.getContext()); |
| 11032 | } |
| 11033 | |
| 11034 | RemUIOpGenericAdaptorBase(RemUIOp op); |
| 11035 | |
| 11036 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 11037 | return {index, 1}; |
| 11038 | } |
| 11039 | |
| 11040 | const Properties &getProperties() { |
| 11041 | return properties; |
| 11042 | } |
| 11043 | |
| 11044 | ::mlir::DictionaryAttr getAttributes() { |
| 11045 | return odsAttrs; |
| 11046 | } |
| 11047 | |
| 11048 | }; |
| 11049 | |
| 11050 | } // namespace detail |
| 11051 | template <typename RangeT> |
| 11052 | class RemUIOpGenericAdaptor : public detail::RemUIOpGenericAdaptorBase { |
| 11053 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 11054 | using Base = detail::RemUIOpGenericAdaptorBase; |
| 11055 | static constexpr int odsIndex_lhs = 0; |
| 11056 | static constexpr int odsIndex_rhs = 1; |
| 11057 | public: |
| 11058 | RemUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 11059 | |
| 11060 | RemUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RemUIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 11061 | |
| 11062 | RemUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RemUIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 11063 | |
| 11064 | RemUIOpGenericAdaptor(RangeT values, const RemUIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 11065 | |
| 11066 | template <typename LateInst = RemUIOp, typename = std::enable_if_t<std::is_same_v<LateInst, RemUIOp>>> |
| 11067 | RemUIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 11068 | |
| 11069 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 11070 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 11071 | } |
| 11072 | |
| 11073 | RangeT getODSOperands(unsigned index) { |
| 11074 | auto valueRange = getODSOperandIndexAndLength(index); |
| 11075 | return {std::next(odsOperands.begin(), valueRange.first), |
| 11076 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 11077 | } |
| 11078 | |
| 11079 | ValueT getLhs() { |
| 11080 | return (*getODSOperands(index: 0).begin()); |
| 11081 | } |
| 11082 | |
| 11083 | ValueT getRhs() { |
| 11084 | return (*getODSOperands(index: 1).begin()); |
| 11085 | } |
| 11086 | |
| 11087 | RangeT getOperands() { |
| 11088 | return odsOperands; |
| 11089 | } |
| 11090 | |
| 11091 | private: |
| 11092 | RangeT odsOperands; |
| 11093 | }; |
| 11094 | class RemUIOpAdaptor : public RemUIOpGenericAdaptor<::mlir::ValueRange> { |
| 11095 | public: |
| 11096 | using RemUIOpGenericAdaptor::RemUIOpGenericAdaptor; |
| 11097 | RemUIOpAdaptor(RemUIOp op); |
| 11098 | |
| 11099 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 11100 | }; |
| 11101 | class RemUIOp : public ::mlir::Op<RemUIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 11102 | public: |
| 11103 | using Op::Op; |
| 11104 | using Op::print; |
| 11105 | using Adaptor = RemUIOpAdaptor; |
| 11106 | template <typename RangeT> |
| 11107 | using GenericAdaptor = RemUIOpGenericAdaptor<RangeT>; |
| 11108 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 11109 | static constexpr int odsIndex_lhs = 0; |
| 11110 | static constexpr int odsIndex_rhs = 1; |
| 11111 | static constexpr int odsIndex_result = 0; |
| 11112 | using Properties = FoldAdaptor::Properties; |
| 11113 | using ::mlir::InferIntRangeInterface::Trait<RemUIOp>::inferResultRangesFromOptional; |
| 11114 | using ::mlir::VectorUnrollOpInterface::Trait<RemUIOp>::getIterationShapeToUnroll; |
| 11115 | using ::mlir::VectorUnrollOpInterface::Trait<RemUIOp>::getDefaultUnrollTargetShape; |
| 11116 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 11117 | return {}; |
| 11118 | } |
| 11119 | |
| 11120 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 11121 | return ::llvm::StringLiteral("arith.remui" ); |
| 11122 | } |
| 11123 | |
| 11124 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 11125 | return {index, 1}; |
| 11126 | } |
| 11127 | |
| 11128 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 11129 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 11130 | return getOperation()->getOperands().slice(n: start, m: length); |
| 11131 | } |
| 11132 | |
| 11133 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 11134 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 11135 | } |
| 11136 | |
| 11137 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 11138 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 11139 | } |
| 11140 | |
| 11141 | ::mlir::OpOperand &getLhsMutable() { |
| 11142 | auto range = getODSOperandIndexAndLength(index: 0); |
| 11143 | return getOperation()->getOpOperand(idx: range.first); |
| 11144 | } |
| 11145 | |
| 11146 | ::mlir::OpOperand &getRhsMutable() { |
| 11147 | auto range = getODSOperandIndexAndLength(index: 1); |
| 11148 | return getOperation()->getOpOperand(idx: range.first); |
| 11149 | } |
| 11150 | |
| 11151 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 11152 | return {index, 1}; |
| 11153 | } |
| 11154 | |
| 11155 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 11156 | auto valueRange = getODSResultIndexAndLength(index); |
| 11157 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 11158 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 11159 | } |
| 11160 | |
| 11161 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 11162 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 11163 | } |
| 11164 | |
| 11165 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 11166 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 11167 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 11168 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 11169 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 11170 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 11171 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 11172 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 11173 | static RemUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 11174 | static RemUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 11175 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 11176 | static RemUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 11177 | static RemUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 11178 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 11179 | static RemUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 11180 | static RemUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 11181 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11182 | static RemUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11183 | static RemUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11184 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11185 | static RemUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11186 | static RemUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11187 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11188 | static RemUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11189 | static RemUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11190 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11191 | static RemUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11192 | static RemUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11193 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 11194 | ::llvm::LogicalResult verifyInvariants(); |
| 11195 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 11196 | 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); |
| 11197 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 11198 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 11199 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 11200 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 11201 | public: |
| 11202 | /// Interface method for ConditionallySpeculatable. |
| 11203 | Speculation::Speculatability getSpeculatability(); |
| 11204 | }; |
| 11205 | |
| 11206 | } // namespace mlir::arith |
| 11207 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::RemUIOp) |
| 11208 | |
| 11209 | namespace mlir::arith { |
| 11210 | |
| 11211 | |
| 11212 | //===----------------------------------------------------------------------===// |
| 11213 | // ::mlir::arith::SIToFPOp declarations |
| 11214 | //===----------------------------------------------------------------------===// |
| 11215 | |
| 11216 | namespace detail { |
| 11217 | |
| 11218 | class SIToFPOpGenericAdaptorBase { |
| 11219 | public: |
| 11220 | using Properties = ::mlir::EmptyProperties; |
| 11221 | protected: |
| 11222 | ::mlir::DictionaryAttr odsAttrs; |
| 11223 | ::std::optional<::mlir::OperationName> odsOpName; |
| 11224 | Properties properties; |
| 11225 | ::mlir::RegionRange odsRegions; |
| 11226 | public: |
| 11227 | SIToFPOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 11228 | odsOpName.emplace(args: "arith.sitofp" , args: odsAttrs.getContext()); |
| 11229 | } |
| 11230 | |
| 11231 | SIToFPOpGenericAdaptorBase(SIToFPOp op); |
| 11232 | |
| 11233 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 11234 | return {index, 1}; |
| 11235 | } |
| 11236 | |
| 11237 | const Properties &getProperties() { |
| 11238 | return properties; |
| 11239 | } |
| 11240 | |
| 11241 | ::mlir::DictionaryAttr getAttributes() { |
| 11242 | return odsAttrs; |
| 11243 | } |
| 11244 | |
| 11245 | }; |
| 11246 | |
| 11247 | } // namespace detail |
| 11248 | template <typename RangeT> |
| 11249 | class SIToFPOpGenericAdaptor : public detail::SIToFPOpGenericAdaptorBase { |
| 11250 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 11251 | using Base = detail::SIToFPOpGenericAdaptorBase; |
| 11252 | static constexpr int odsIndex_in = 0; |
| 11253 | public: |
| 11254 | SIToFPOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 11255 | |
| 11256 | SIToFPOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : SIToFPOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 11257 | |
| 11258 | SIToFPOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : SIToFPOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 11259 | |
| 11260 | SIToFPOpGenericAdaptor(RangeT values, const SIToFPOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 11261 | |
| 11262 | template <typename LateInst = SIToFPOp, typename = std::enable_if_t<std::is_same_v<LateInst, SIToFPOp>>> |
| 11263 | SIToFPOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 11264 | |
| 11265 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 11266 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 11267 | } |
| 11268 | |
| 11269 | RangeT getODSOperands(unsigned index) { |
| 11270 | auto valueRange = getODSOperandIndexAndLength(index); |
| 11271 | return {std::next(odsOperands.begin(), valueRange.first), |
| 11272 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 11273 | } |
| 11274 | |
| 11275 | ValueT getIn() { |
| 11276 | return (*getODSOperands(index: 0).begin()); |
| 11277 | } |
| 11278 | |
| 11279 | RangeT getOperands() { |
| 11280 | return odsOperands; |
| 11281 | } |
| 11282 | |
| 11283 | private: |
| 11284 | RangeT odsOperands; |
| 11285 | }; |
| 11286 | class SIToFPOpAdaptor : public SIToFPOpGenericAdaptor<::mlir::ValueRange> { |
| 11287 | public: |
| 11288 | using SIToFPOpGenericAdaptor::SIToFPOpGenericAdaptor; |
| 11289 | SIToFPOpAdaptor(SIToFPOp op); |
| 11290 | |
| 11291 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 11292 | }; |
| 11293 | class SIToFPOp : public ::mlir::Op<SIToFPOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 11294 | public: |
| 11295 | using Op::Op; |
| 11296 | using Op::print; |
| 11297 | using Adaptor = SIToFPOpAdaptor; |
| 11298 | template <typename RangeT> |
| 11299 | using GenericAdaptor = SIToFPOpGenericAdaptor<RangeT>; |
| 11300 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 11301 | static constexpr int odsIndex_in = 0; |
| 11302 | static constexpr int odsIndex_out = 0; |
| 11303 | using Properties = FoldAdaptor::Properties; |
| 11304 | using ::mlir::VectorUnrollOpInterface::Trait<SIToFPOp>::getIterationShapeToUnroll; |
| 11305 | using ::mlir::VectorUnrollOpInterface::Trait<SIToFPOp>::getDefaultUnrollTargetShape; |
| 11306 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 11307 | return {}; |
| 11308 | } |
| 11309 | |
| 11310 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 11311 | return ::llvm::StringLiteral("arith.sitofp" ); |
| 11312 | } |
| 11313 | |
| 11314 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 11315 | return {index, 1}; |
| 11316 | } |
| 11317 | |
| 11318 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 11319 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 11320 | return getOperation()->getOperands().slice(n: start, m: length); |
| 11321 | } |
| 11322 | |
| 11323 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 11324 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 11325 | } |
| 11326 | |
| 11327 | ::mlir::OpOperand &getInMutable() { |
| 11328 | auto range = getODSOperandIndexAndLength(index: 0); |
| 11329 | return getOperation()->getOpOperand(idx: range.first); |
| 11330 | } |
| 11331 | |
| 11332 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 11333 | return {index, 1}; |
| 11334 | } |
| 11335 | |
| 11336 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 11337 | auto valueRange = getODSResultIndexAndLength(index); |
| 11338 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 11339 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 11340 | } |
| 11341 | |
| 11342 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 11343 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 11344 | } |
| 11345 | |
| 11346 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 11347 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 11348 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 11349 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 11350 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 11351 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 11352 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 11353 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in); |
| 11354 | static SIToFPOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in); |
| 11355 | static SIToFPOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in); |
| 11356 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 11357 | static SIToFPOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 11358 | static SIToFPOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in); |
| 11359 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11360 | static SIToFPOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11361 | static SIToFPOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11362 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11363 | static SIToFPOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11364 | static SIToFPOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11365 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 11366 | ::llvm::LogicalResult verifyInvariants(); |
| 11367 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 11368 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 11369 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 11370 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 11371 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 11372 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 11373 | public: |
| 11374 | }; |
| 11375 | |
| 11376 | } // namespace mlir::arith |
| 11377 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::SIToFPOp) |
| 11378 | |
| 11379 | namespace mlir::arith { |
| 11380 | |
| 11381 | |
| 11382 | //===----------------------------------------------------------------------===// |
| 11383 | // ::mlir::arith::ScalingExtFOp declarations |
| 11384 | //===----------------------------------------------------------------------===// |
| 11385 | |
| 11386 | namespace detail { |
| 11387 | |
| 11388 | class ScalingExtFOpGenericAdaptorBase { |
| 11389 | public: |
| 11390 | struct Properties { |
| 11391 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 11392 | fastmathTy fastmath; |
| 11393 | |
| 11394 | auto getFastmath() const { |
| 11395 | auto &propStorage = this->fastmath; |
| 11396 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 11397 | } |
| 11398 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 11399 | this->fastmath = propValue; |
| 11400 | } |
| 11401 | bool operator==(const Properties &rhs) const { |
| 11402 | return |
| 11403 | rhs.fastmath == this->fastmath && |
| 11404 | true; |
| 11405 | } |
| 11406 | bool operator!=(const Properties &rhs) const { |
| 11407 | return !(*this == rhs); |
| 11408 | } |
| 11409 | }; |
| 11410 | protected: |
| 11411 | ::mlir::DictionaryAttr odsAttrs; |
| 11412 | ::std::optional<::mlir::OperationName> odsOpName; |
| 11413 | Properties properties; |
| 11414 | ::mlir::RegionRange odsRegions; |
| 11415 | public: |
| 11416 | ScalingExtFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 11417 | odsOpName.emplace(args: "arith.scaling_extf" , args: odsAttrs.getContext()); |
| 11418 | } |
| 11419 | |
| 11420 | ScalingExtFOpGenericAdaptorBase(ScalingExtFOp op); |
| 11421 | |
| 11422 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 11423 | return {index, 1}; |
| 11424 | } |
| 11425 | |
| 11426 | const Properties &getProperties() { |
| 11427 | return properties; |
| 11428 | } |
| 11429 | |
| 11430 | ::mlir::DictionaryAttr getAttributes() { |
| 11431 | return odsAttrs; |
| 11432 | } |
| 11433 | |
| 11434 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 11435 | auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: getProperties().fastmath); |
| 11436 | return attr; |
| 11437 | } |
| 11438 | |
| 11439 | ::std::optional<::mlir::arith::FastMathFlags> getFastmath(); |
| 11440 | }; |
| 11441 | |
| 11442 | } // namespace detail |
| 11443 | template <typename RangeT> |
| 11444 | class ScalingExtFOpGenericAdaptor : public detail::ScalingExtFOpGenericAdaptorBase { |
| 11445 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 11446 | using Base = detail::ScalingExtFOpGenericAdaptorBase; |
| 11447 | static constexpr int odsIndex_in = 0; |
| 11448 | static constexpr int odsIndex_scale = 1; |
| 11449 | public: |
| 11450 | ScalingExtFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 11451 | |
| 11452 | ScalingExtFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ScalingExtFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 11453 | |
| 11454 | ScalingExtFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ScalingExtFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 11455 | |
| 11456 | ScalingExtFOpGenericAdaptor(RangeT values, const ScalingExtFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 11457 | |
| 11458 | template <typename LateInst = ScalingExtFOp, typename = std::enable_if_t<std::is_same_v<LateInst, ScalingExtFOp>>> |
| 11459 | ScalingExtFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 11460 | |
| 11461 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 11462 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 11463 | } |
| 11464 | |
| 11465 | RangeT getODSOperands(unsigned index) { |
| 11466 | auto valueRange = getODSOperandIndexAndLength(index); |
| 11467 | return {std::next(odsOperands.begin(), valueRange.first), |
| 11468 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 11469 | } |
| 11470 | |
| 11471 | ValueT getIn() { |
| 11472 | return (*getODSOperands(index: 0).begin()); |
| 11473 | } |
| 11474 | |
| 11475 | ValueT getScale() { |
| 11476 | return (*getODSOperands(index: 1).begin()); |
| 11477 | } |
| 11478 | |
| 11479 | RangeT getOperands() { |
| 11480 | return odsOperands; |
| 11481 | } |
| 11482 | |
| 11483 | private: |
| 11484 | RangeT odsOperands; |
| 11485 | }; |
| 11486 | class ScalingExtFOpAdaptor : public ScalingExtFOpGenericAdaptor<::mlir::ValueRange> { |
| 11487 | public: |
| 11488 | using ScalingExtFOpGenericAdaptor::ScalingExtFOpGenericAdaptor; |
| 11489 | ScalingExtFOpAdaptor(ScalingExtFOp op); |
| 11490 | |
| 11491 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 11492 | }; |
| 11493 | class ScalingExtFOp : public ::mlir::Op<ScalingExtFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 11494 | public: |
| 11495 | using Op::Op; |
| 11496 | using Op::print; |
| 11497 | using Adaptor = ScalingExtFOpAdaptor; |
| 11498 | template <typename RangeT> |
| 11499 | using GenericAdaptor = ScalingExtFOpGenericAdaptor<RangeT>; |
| 11500 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 11501 | static constexpr int odsIndex_in = 0; |
| 11502 | static constexpr int odsIndex_scale = 1; |
| 11503 | static constexpr int odsIndex_out = 0; |
| 11504 | using Properties = FoldAdaptor::Properties; |
| 11505 | using ::mlir::arith::ArithFastMathInterface::Trait<ScalingExtFOp>::getFastMathFlagsAttr; |
| 11506 | using ::mlir::arith::ArithFastMathInterface::Trait<ScalingExtFOp>::getFastMathAttrName; |
| 11507 | using ::mlir::VectorUnrollOpInterface::Trait<ScalingExtFOp>::getIterationShapeToUnroll; |
| 11508 | using ::mlir::VectorUnrollOpInterface::Trait<ScalingExtFOp>::getDefaultUnrollTargetShape; |
| 11509 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 11510 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" )}; |
| 11511 | return ::llvm::ArrayRef(attrNames); |
| 11512 | } |
| 11513 | |
| 11514 | ::mlir::StringAttr getFastmathAttrName() { |
| 11515 | return getAttributeNameForIndex(index: 0); |
| 11516 | } |
| 11517 | |
| 11518 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 11519 | return getAttributeNameForIndex(name, index: 0); |
| 11520 | } |
| 11521 | |
| 11522 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 11523 | return ::llvm::StringLiteral("arith.scaling_extf" ); |
| 11524 | } |
| 11525 | |
| 11526 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 11527 | return {index, 1}; |
| 11528 | } |
| 11529 | |
| 11530 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 11531 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 11532 | return getOperation()->getOperands().slice(n: start, m: length); |
| 11533 | } |
| 11534 | |
| 11535 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 11536 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 11537 | } |
| 11538 | |
| 11539 | ::mlir::TypedValue<::mlir::Type> getScale() { |
| 11540 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 11541 | } |
| 11542 | |
| 11543 | ::mlir::OpOperand &getInMutable() { |
| 11544 | auto range = getODSOperandIndexAndLength(index: 0); |
| 11545 | return getOperation()->getOpOperand(idx: range.first); |
| 11546 | } |
| 11547 | |
| 11548 | ::mlir::OpOperand &getScaleMutable() { |
| 11549 | auto range = getODSOperandIndexAndLength(index: 1); |
| 11550 | return getOperation()->getOpOperand(idx: range.first); |
| 11551 | } |
| 11552 | |
| 11553 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 11554 | return {index, 1}; |
| 11555 | } |
| 11556 | |
| 11557 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 11558 | auto valueRange = getODSResultIndexAndLength(index); |
| 11559 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 11560 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 11561 | } |
| 11562 | |
| 11563 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 11564 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 11565 | } |
| 11566 | |
| 11567 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 11568 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 11569 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 11570 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 11571 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 11572 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 11573 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 11574 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 11575 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 11576 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 11577 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 11578 | } |
| 11579 | |
| 11580 | ::std::optional<::mlir::arith::FastMathFlags> getFastmath(); |
| 11581 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 11582 | getProperties().fastmath = attr; |
| 11583 | } |
| 11584 | |
| 11585 | void setFastmath(::std::optional<::mlir::arith::FastMathFlags> attrValue); |
| 11586 | ::mlir::Attribute removeFastmathAttr() { |
| 11587 | auto attr = getProperties().fastmath; |
| 11588 | getProperties().fastmath = {}; |
| 11589 | return attr; |
| 11590 | } |
| 11591 | |
| 11592 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, ::mlir::Value scale, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 11593 | static ScalingExtFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, ::mlir::Value scale, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 11594 | static ScalingExtFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, ::mlir::Value scale, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 11595 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::Value scale, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 11596 | static ScalingExtFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::Value scale, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 11597 | static ScalingExtFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::Value scale, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 11598 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 11599 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11600 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 11601 | static ScalingExtFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11602 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 11603 | static ScalingExtFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11604 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11605 | static ScalingExtFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11606 | static ScalingExtFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11607 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 11608 | ::llvm::LogicalResult verifyInvariants(); |
| 11609 | ::llvm::LogicalResult verify(); |
| 11610 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 11611 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 11612 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 11613 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 11614 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 11615 | private: |
| 11616 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 11617 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 11618 | } |
| 11619 | |
| 11620 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 11621 | assert(index < 1 && "invalid attribute index" ); |
| 11622 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 11623 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 11624 | "dependent dialect loading?" ); |
| 11625 | return name.getAttributeNames()[index]; |
| 11626 | } |
| 11627 | |
| 11628 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 11629 | public: |
| 11630 | }; |
| 11631 | |
| 11632 | } // namespace mlir::arith |
| 11633 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::ScalingExtFOp) |
| 11634 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::ScalingExtFOpGenericAdaptorBase::Properties) |
| 11635 | |
| 11636 | namespace mlir::arith { |
| 11637 | |
| 11638 | |
| 11639 | //===----------------------------------------------------------------------===// |
| 11640 | // ::mlir::arith::ScalingTruncFOp declarations |
| 11641 | //===----------------------------------------------------------------------===// |
| 11642 | |
| 11643 | namespace detail { |
| 11644 | |
| 11645 | class ScalingTruncFOpGenericAdaptorBase { |
| 11646 | public: |
| 11647 | struct Properties { |
| 11648 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 11649 | fastmathTy fastmath; |
| 11650 | |
| 11651 | auto getFastmath() const { |
| 11652 | auto &propStorage = this->fastmath; |
| 11653 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 11654 | } |
| 11655 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 11656 | this->fastmath = propValue; |
| 11657 | } |
| 11658 | using roundingmodeTy = ::mlir::arith::RoundingModeAttr; |
| 11659 | roundingmodeTy roundingmode; |
| 11660 | |
| 11661 | auto getRoundingmode() const { |
| 11662 | auto &propStorage = this->roundingmode; |
| 11663 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: propStorage); |
| 11664 | } |
| 11665 | void setRoundingmode(const ::mlir::arith::RoundingModeAttr &propValue) { |
| 11666 | this->roundingmode = propValue; |
| 11667 | } |
| 11668 | bool operator==(const Properties &rhs) const { |
| 11669 | return |
| 11670 | rhs.fastmath == this->fastmath && |
| 11671 | rhs.roundingmode == this->roundingmode && |
| 11672 | true; |
| 11673 | } |
| 11674 | bool operator!=(const Properties &rhs) const { |
| 11675 | return !(*this == rhs); |
| 11676 | } |
| 11677 | }; |
| 11678 | protected: |
| 11679 | ::mlir::DictionaryAttr odsAttrs; |
| 11680 | ::std::optional<::mlir::OperationName> odsOpName; |
| 11681 | Properties properties; |
| 11682 | ::mlir::RegionRange odsRegions; |
| 11683 | public: |
| 11684 | ScalingTruncFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 11685 | odsOpName.emplace(args: "arith.scaling_truncf" , args: odsAttrs.getContext()); |
| 11686 | } |
| 11687 | |
| 11688 | ScalingTruncFOpGenericAdaptorBase(ScalingTruncFOp op); |
| 11689 | |
| 11690 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 11691 | return {index, 1}; |
| 11692 | } |
| 11693 | |
| 11694 | const Properties &getProperties() { |
| 11695 | return properties; |
| 11696 | } |
| 11697 | |
| 11698 | ::mlir::DictionaryAttr getAttributes() { |
| 11699 | return odsAttrs; |
| 11700 | } |
| 11701 | |
| 11702 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 11703 | auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: getProperties().roundingmode); |
| 11704 | return attr; |
| 11705 | } |
| 11706 | |
| 11707 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 11708 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 11709 | auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: getProperties().fastmath); |
| 11710 | return attr; |
| 11711 | } |
| 11712 | |
| 11713 | ::std::optional<::mlir::arith::FastMathFlags> getFastmath(); |
| 11714 | }; |
| 11715 | |
| 11716 | } // namespace detail |
| 11717 | template <typename RangeT> |
| 11718 | class ScalingTruncFOpGenericAdaptor : public detail::ScalingTruncFOpGenericAdaptorBase { |
| 11719 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 11720 | using Base = detail::ScalingTruncFOpGenericAdaptorBase; |
| 11721 | static constexpr int odsIndex_in = 0; |
| 11722 | static constexpr int odsIndex_scale = 1; |
| 11723 | public: |
| 11724 | ScalingTruncFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 11725 | |
| 11726 | ScalingTruncFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ScalingTruncFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 11727 | |
| 11728 | ScalingTruncFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ScalingTruncFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 11729 | |
| 11730 | ScalingTruncFOpGenericAdaptor(RangeT values, const ScalingTruncFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 11731 | |
| 11732 | template <typename LateInst = ScalingTruncFOp, typename = std::enable_if_t<std::is_same_v<LateInst, ScalingTruncFOp>>> |
| 11733 | ScalingTruncFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 11734 | |
| 11735 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 11736 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 11737 | } |
| 11738 | |
| 11739 | RangeT getODSOperands(unsigned index) { |
| 11740 | auto valueRange = getODSOperandIndexAndLength(index); |
| 11741 | return {std::next(odsOperands.begin(), valueRange.first), |
| 11742 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 11743 | } |
| 11744 | |
| 11745 | ValueT getIn() { |
| 11746 | return (*getODSOperands(index: 0).begin()); |
| 11747 | } |
| 11748 | |
| 11749 | ValueT getScale() { |
| 11750 | return (*getODSOperands(index: 1).begin()); |
| 11751 | } |
| 11752 | |
| 11753 | RangeT getOperands() { |
| 11754 | return odsOperands; |
| 11755 | } |
| 11756 | |
| 11757 | private: |
| 11758 | RangeT odsOperands; |
| 11759 | }; |
| 11760 | class ScalingTruncFOpAdaptor : public ScalingTruncFOpGenericAdaptor<::mlir::ValueRange> { |
| 11761 | public: |
| 11762 | using ScalingTruncFOpGenericAdaptor::ScalingTruncFOpGenericAdaptor; |
| 11763 | ScalingTruncFOpAdaptor(ScalingTruncFOp op); |
| 11764 | |
| 11765 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 11766 | }; |
| 11767 | class ScalingTruncFOp : public ::mlir::Op<ScalingTruncFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithRoundingModeInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 11768 | public: |
| 11769 | using Op::Op; |
| 11770 | using Op::print; |
| 11771 | using Adaptor = ScalingTruncFOpAdaptor; |
| 11772 | template <typename RangeT> |
| 11773 | using GenericAdaptor = ScalingTruncFOpGenericAdaptor<RangeT>; |
| 11774 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 11775 | static constexpr int odsIndex_in = 0; |
| 11776 | static constexpr int odsIndex_scale = 1; |
| 11777 | static constexpr int odsIndex_out = 0; |
| 11778 | using Properties = FoldAdaptor::Properties; |
| 11779 | using ::mlir::arith::ArithRoundingModeInterface::Trait<ScalingTruncFOp>::getRoundingModeAttr; |
| 11780 | using ::mlir::arith::ArithRoundingModeInterface::Trait<ScalingTruncFOp>::getRoundingModeAttrName; |
| 11781 | using ::mlir::arith::ArithFastMathInterface::Trait<ScalingTruncFOp>::getFastMathFlagsAttr; |
| 11782 | using ::mlir::arith::ArithFastMathInterface::Trait<ScalingTruncFOp>::getFastMathAttrName; |
| 11783 | using ::mlir::VectorUnrollOpInterface::Trait<ScalingTruncFOp>::getIterationShapeToUnroll; |
| 11784 | using ::mlir::VectorUnrollOpInterface::Trait<ScalingTruncFOp>::getDefaultUnrollTargetShape; |
| 11785 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 11786 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" ), ::llvm::StringRef("roundingmode" )}; |
| 11787 | return ::llvm::ArrayRef(attrNames); |
| 11788 | } |
| 11789 | |
| 11790 | ::mlir::StringAttr getFastmathAttrName() { |
| 11791 | return getAttributeNameForIndex(index: 0); |
| 11792 | } |
| 11793 | |
| 11794 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 11795 | return getAttributeNameForIndex(name, index: 0); |
| 11796 | } |
| 11797 | |
| 11798 | ::mlir::StringAttr getRoundingmodeAttrName() { |
| 11799 | return getAttributeNameForIndex(index: 1); |
| 11800 | } |
| 11801 | |
| 11802 | static ::mlir::StringAttr getRoundingmodeAttrName(::mlir::OperationName name) { |
| 11803 | return getAttributeNameForIndex(name, index: 1); |
| 11804 | } |
| 11805 | |
| 11806 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 11807 | return ::llvm::StringLiteral("arith.scaling_truncf" ); |
| 11808 | } |
| 11809 | |
| 11810 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 11811 | return {index, 1}; |
| 11812 | } |
| 11813 | |
| 11814 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 11815 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 11816 | return getOperation()->getOperands().slice(n: start, m: length); |
| 11817 | } |
| 11818 | |
| 11819 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 11820 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 11821 | } |
| 11822 | |
| 11823 | ::mlir::TypedValue<::mlir::Type> getScale() { |
| 11824 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 11825 | } |
| 11826 | |
| 11827 | ::mlir::OpOperand &getInMutable() { |
| 11828 | auto range = getODSOperandIndexAndLength(index: 0); |
| 11829 | return getOperation()->getOpOperand(idx: range.first); |
| 11830 | } |
| 11831 | |
| 11832 | ::mlir::OpOperand &getScaleMutable() { |
| 11833 | auto range = getODSOperandIndexAndLength(index: 1); |
| 11834 | return getOperation()->getOpOperand(idx: range.first); |
| 11835 | } |
| 11836 | |
| 11837 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 11838 | return {index, 1}; |
| 11839 | } |
| 11840 | |
| 11841 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 11842 | auto valueRange = getODSResultIndexAndLength(index); |
| 11843 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 11844 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 11845 | } |
| 11846 | |
| 11847 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 11848 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 11849 | } |
| 11850 | |
| 11851 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 11852 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 11853 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 11854 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 11855 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 11856 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 11857 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 11858 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 11859 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 11860 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 11861 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val&: getProperties().roundingmode); |
| 11862 | } |
| 11863 | |
| 11864 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 11865 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 11866 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 11867 | } |
| 11868 | |
| 11869 | ::std::optional<::mlir::arith::FastMathFlags> getFastmath(); |
| 11870 | void setRoundingmodeAttr(::mlir::arith::RoundingModeAttr attr) { |
| 11871 | getProperties().roundingmode = attr; |
| 11872 | } |
| 11873 | |
| 11874 | void setRoundingmode(::std::optional<::mlir::arith::RoundingMode> attrValue); |
| 11875 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 11876 | getProperties().fastmath = attr; |
| 11877 | } |
| 11878 | |
| 11879 | void setFastmath(::std::optional<::mlir::arith::FastMathFlags> attrValue); |
| 11880 | ::mlir::Attribute removeRoundingmodeAttr() { |
| 11881 | auto attr = getProperties().roundingmode; |
| 11882 | getProperties().roundingmode = {}; |
| 11883 | return attr; |
| 11884 | } |
| 11885 | |
| 11886 | ::mlir::Attribute removeFastmathAttr() { |
| 11887 | auto attr = getProperties().fastmath; |
| 11888 | getProperties().fastmath = {}; |
| 11889 | return attr; |
| 11890 | } |
| 11891 | |
| 11892 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, ::mlir::Value scale, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 11893 | static ScalingTruncFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, ::mlir::Value scale, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 11894 | static ScalingTruncFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, ::mlir::Value scale, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 11895 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::Value scale, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 11896 | static ScalingTruncFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::Value scale, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 11897 | static ScalingTruncFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::Value scale, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 11898 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 11899 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11900 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 11901 | static ScalingTruncFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11902 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 11903 | static ScalingTruncFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 11904 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11905 | static ScalingTruncFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11906 | static ScalingTruncFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 11907 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 11908 | ::llvm::LogicalResult verifyInvariants(); |
| 11909 | ::llvm::LogicalResult verify(); |
| 11910 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 11911 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 11912 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 11913 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 11914 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 11915 | private: |
| 11916 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 11917 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 11918 | } |
| 11919 | |
| 11920 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 11921 | assert(index < 2 && "invalid attribute index" ); |
| 11922 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 11923 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 11924 | "dependent dialect loading?" ); |
| 11925 | return name.getAttributeNames()[index]; |
| 11926 | } |
| 11927 | |
| 11928 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 11929 | public: |
| 11930 | }; |
| 11931 | |
| 11932 | } // namespace mlir::arith |
| 11933 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::ScalingTruncFOp) |
| 11934 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::ScalingTruncFOpGenericAdaptorBase::Properties) |
| 11935 | |
| 11936 | namespace mlir::arith { |
| 11937 | |
| 11938 | |
| 11939 | //===----------------------------------------------------------------------===// |
| 11940 | // ::mlir::arith::ShLIOp declarations |
| 11941 | //===----------------------------------------------------------------------===// |
| 11942 | |
| 11943 | namespace detail { |
| 11944 | |
| 11945 | class ShLIOpGenericAdaptorBase { |
| 11946 | public: |
| 11947 | struct Properties { |
| 11948 | using overflowFlagsTy = ::mlir::arith::IntegerOverflowFlagsAttr; |
| 11949 | overflowFlagsTy overflowFlags; |
| 11950 | |
| 11951 | auto getOverflowFlags() const { |
| 11952 | auto &propStorage = this->overflowFlags; |
| 11953 | return ::llvm::dyn_cast_or_null<::mlir::arith::IntegerOverflowFlagsAttr>(Val: propStorage); |
| 11954 | } |
| 11955 | void setOverflowFlags(const ::mlir::arith::IntegerOverflowFlagsAttr &propValue) { |
| 11956 | this->overflowFlags = propValue; |
| 11957 | } |
| 11958 | bool operator==(const Properties &rhs) const { |
| 11959 | return |
| 11960 | rhs.overflowFlags == this->overflowFlags && |
| 11961 | true; |
| 11962 | } |
| 11963 | bool operator!=(const Properties &rhs) const { |
| 11964 | return !(*this == rhs); |
| 11965 | } |
| 11966 | }; |
| 11967 | protected: |
| 11968 | ::mlir::DictionaryAttr odsAttrs; |
| 11969 | ::std::optional<::mlir::OperationName> odsOpName; |
| 11970 | Properties properties; |
| 11971 | ::mlir::RegionRange odsRegions; |
| 11972 | public: |
| 11973 | ShLIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 11974 | odsOpName.emplace(args: "arith.shli" , args: odsAttrs.getContext()); |
| 11975 | } |
| 11976 | |
| 11977 | ShLIOpGenericAdaptorBase(ShLIOp op); |
| 11978 | |
| 11979 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 11980 | return {index, 1}; |
| 11981 | } |
| 11982 | |
| 11983 | const Properties &getProperties() { |
| 11984 | return properties; |
| 11985 | } |
| 11986 | |
| 11987 | ::mlir::DictionaryAttr getAttributes() { |
| 11988 | return odsAttrs; |
| 11989 | } |
| 11990 | |
| 11991 | ::mlir::arith::IntegerOverflowFlagsAttr getOverflowFlagsAttr(); |
| 11992 | ::mlir::arith::IntegerOverflowFlags getOverflowFlags(); |
| 11993 | }; |
| 11994 | |
| 11995 | } // namespace detail |
| 11996 | template <typename RangeT> |
| 11997 | class ShLIOpGenericAdaptor : public detail::ShLIOpGenericAdaptorBase { |
| 11998 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 11999 | using Base = detail::ShLIOpGenericAdaptorBase; |
| 12000 | static constexpr int odsIndex_lhs = 0; |
| 12001 | static constexpr int odsIndex_rhs = 1; |
| 12002 | public: |
| 12003 | ShLIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 12004 | |
| 12005 | ShLIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ShLIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 12006 | |
| 12007 | ShLIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ShLIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 12008 | |
| 12009 | ShLIOpGenericAdaptor(RangeT values, const ShLIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 12010 | |
| 12011 | template <typename LateInst = ShLIOp, typename = std::enable_if_t<std::is_same_v<LateInst, ShLIOp>>> |
| 12012 | ShLIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 12013 | |
| 12014 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 12015 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 12016 | } |
| 12017 | |
| 12018 | RangeT getODSOperands(unsigned index) { |
| 12019 | auto valueRange = getODSOperandIndexAndLength(index); |
| 12020 | return {std::next(odsOperands.begin(), valueRange.first), |
| 12021 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 12022 | } |
| 12023 | |
| 12024 | ValueT getLhs() { |
| 12025 | return (*getODSOperands(index: 0).begin()); |
| 12026 | } |
| 12027 | |
| 12028 | ValueT getRhs() { |
| 12029 | return (*getODSOperands(index: 1).begin()); |
| 12030 | } |
| 12031 | |
| 12032 | RangeT getOperands() { |
| 12033 | return odsOperands; |
| 12034 | } |
| 12035 | |
| 12036 | private: |
| 12037 | RangeT odsOperands; |
| 12038 | }; |
| 12039 | class ShLIOpAdaptor : public ShLIOpGenericAdaptor<::mlir::ValueRange> { |
| 12040 | public: |
| 12041 | using ShLIOpGenericAdaptor::ShLIOpGenericAdaptor; |
| 12042 | ShLIOpAdaptor(ShLIOp op); |
| 12043 | |
| 12044 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 12045 | }; |
| 12046 | class ShLIOp : public ::mlir::Op<ShLIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 12047 | public: |
| 12048 | using Op::Op; |
| 12049 | using Op::print; |
| 12050 | using Adaptor = ShLIOpAdaptor; |
| 12051 | template <typename RangeT> |
| 12052 | using GenericAdaptor = ShLIOpGenericAdaptor<RangeT>; |
| 12053 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 12054 | static constexpr int odsIndex_lhs = 0; |
| 12055 | static constexpr int odsIndex_rhs = 1; |
| 12056 | static constexpr int odsIndex_result = 0; |
| 12057 | using Properties = FoldAdaptor::Properties; |
| 12058 | using ::mlir::InferIntRangeInterface::Trait<ShLIOp>::inferResultRangesFromOptional; |
| 12059 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<ShLIOp>::getOverflowAttr; |
| 12060 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<ShLIOp>::hasNoUnsignedWrap; |
| 12061 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<ShLIOp>::hasNoSignedWrap; |
| 12062 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<ShLIOp>::getIntegerOverflowAttrName; |
| 12063 | using ::mlir::VectorUnrollOpInterface::Trait<ShLIOp>::getIterationShapeToUnroll; |
| 12064 | using ::mlir::VectorUnrollOpInterface::Trait<ShLIOp>::getDefaultUnrollTargetShape; |
| 12065 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 12066 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("overflowFlags" )}; |
| 12067 | return ::llvm::ArrayRef(attrNames); |
| 12068 | } |
| 12069 | |
| 12070 | ::mlir::StringAttr getOverflowFlagsAttrName() { |
| 12071 | return getAttributeNameForIndex(index: 0); |
| 12072 | } |
| 12073 | |
| 12074 | static ::mlir::StringAttr getOverflowFlagsAttrName(::mlir::OperationName name) { |
| 12075 | return getAttributeNameForIndex(name, index: 0); |
| 12076 | } |
| 12077 | |
| 12078 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 12079 | return ::llvm::StringLiteral("arith.shli" ); |
| 12080 | } |
| 12081 | |
| 12082 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 12083 | return {index, 1}; |
| 12084 | } |
| 12085 | |
| 12086 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 12087 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 12088 | return getOperation()->getOperands().slice(n: start, m: length); |
| 12089 | } |
| 12090 | |
| 12091 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 12092 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 12093 | } |
| 12094 | |
| 12095 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 12096 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 12097 | } |
| 12098 | |
| 12099 | ::mlir::OpOperand &getLhsMutable() { |
| 12100 | auto range = getODSOperandIndexAndLength(index: 0); |
| 12101 | return getOperation()->getOpOperand(idx: range.first); |
| 12102 | } |
| 12103 | |
| 12104 | ::mlir::OpOperand &getRhsMutable() { |
| 12105 | auto range = getODSOperandIndexAndLength(index: 1); |
| 12106 | return getOperation()->getOpOperand(idx: range.first); |
| 12107 | } |
| 12108 | |
| 12109 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 12110 | return {index, 1}; |
| 12111 | } |
| 12112 | |
| 12113 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 12114 | auto valueRange = getODSResultIndexAndLength(index); |
| 12115 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 12116 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 12117 | } |
| 12118 | |
| 12119 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 12120 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 12121 | } |
| 12122 | |
| 12123 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 12124 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 12125 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 12126 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 12127 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 12128 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 12129 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 12130 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 12131 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 12132 | ::mlir::arith::IntegerOverflowFlagsAttr getOverflowFlagsAttr() { |
| 12133 | return ::llvm::dyn_cast_or_null<::mlir::arith::IntegerOverflowFlagsAttr>(Val&: getProperties().overflowFlags); |
| 12134 | } |
| 12135 | |
| 12136 | ::mlir::arith::IntegerOverflowFlags getOverflowFlags(); |
| 12137 | void setOverflowFlagsAttr(::mlir::arith::IntegerOverflowFlagsAttr attr) { |
| 12138 | getProperties().overflowFlags = attr; |
| 12139 | } |
| 12140 | |
| 12141 | void setOverflowFlags(::mlir::arith::IntegerOverflowFlags attrValue); |
| 12142 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 12143 | static ShLIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 12144 | static ShLIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 12145 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 12146 | static ShLIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 12147 | static ShLIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 12148 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 12149 | static ShLIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 12150 | static ShLIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 12151 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 12152 | static ShLIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 12153 | static ShLIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 12154 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 12155 | static ShLIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 12156 | static ShLIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 12157 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 12158 | static ShLIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 12159 | static ShLIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 12160 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12161 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12162 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12163 | static ShLIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12164 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12165 | static ShLIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12166 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12167 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12168 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12169 | static ShLIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12170 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12171 | static ShLIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12172 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12173 | static ShLIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12174 | static ShLIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12175 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12176 | static ShLIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12177 | static ShLIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12178 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 12179 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 12180 | ::llvm::LogicalResult verifyInvariants(); |
| 12181 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 12182 | 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); |
| 12183 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 12184 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 12185 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 12186 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 12187 | private: |
| 12188 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 12189 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 12190 | } |
| 12191 | |
| 12192 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 12193 | assert(index < 1 && "invalid attribute index" ); |
| 12194 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 12195 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 12196 | "dependent dialect loading?" ); |
| 12197 | return name.getAttributeNames()[index]; |
| 12198 | } |
| 12199 | |
| 12200 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 12201 | public: |
| 12202 | }; |
| 12203 | |
| 12204 | } // namespace mlir::arith |
| 12205 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::ShLIOp) |
| 12206 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::ShLIOpGenericAdaptorBase::Properties) |
| 12207 | |
| 12208 | namespace mlir::arith { |
| 12209 | |
| 12210 | |
| 12211 | //===----------------------------------------------------------------------===// |
| 12212 | // ::mlir::arith::ShRSIOp declarations |
| 12213 | //===----------------------------------------------------------------------===// |
| 12214 | |
| 12215 | namespace detail { |
| 12216 | |
| 12217 | class ShRSIOpGenericAdaptorBase { |
| 12218 | public: |
| 12219 | struct Properties { |
| 12220 | using isExactTy = ::mlir::UnitAttr; |
| 12221 | isExactTy isExact; |
| 12222 | |
| 12223 | auto getIsExact() const { |
| 12224 | auto &propStorage = this->isExact; |
| 12225 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val: propStorage); |
| 12226 | } |
| 12227 | void setIsExact(const ::mlir::UnitAttr &propValue) { |
| 12228 | this->isExact = propValue; |
| 12229 | } |
| 12230 | bool operator==(const Properties &rhs) const { |
| 12231 | return |
| 12232 | rhs.isExact == this->isExact && |
| 12233 | true; |
| 12234 | } |
| 12235 | bool operator!=(const Properties &rhs) const { |
| 12236 | return !(*this == rhs); |
| 12237 | } |
| 12238 | }; |
| 12239 | protected: |
| 12240 | ::mlir::DictionaryAttr odsAttrs; |
| 12241 | ::std::optional<::mlir::OperationName> odsOpName; |
| 12242 | Properties properties; |
| 12243 | ::mlir::RegionRange odsRegions; |
| 12244 | public: |
| 12245 | ShRSIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 12246 | odsOpName.emplace(args: "arith.shrsi" , args: odsAttrs.getContext()); |
| 12247 | } |
| 12248 | |
| 12249 | ShRSIOpGenericAdaptorBase(ShRSIOp op); |
| 12250 | |
| 12251 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 12252 | return {index, 1}; |
| 12253 | } |
| 12254 | |
| 12255 | const Properties &getProperties() { |
| 12256 | return properties; |
| 12257 | } |
| 12258 | |
| 12259 | ::mlir::DictionaryAttr getAttributes() { |
| 12260 | return odsAttrs; |
| 12261 | } |
| 12262 | |
| 12263 | ::mlir::UnitAttr getIsExactAttr(); |
| 12264 | bool getIsExact(); |
| 12265 | }; |
| 12266 | |
| 12267 | } // namespace detail |
| 12268 | template <typename RangeT> |
| 12269 | class ShRSIOpGenericAdaptor : public detail::ShRSIOpGenericAdaptorBase { |
| 12270 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 12271 | using Base = detail::ShRSIOpGenericAdaptorBase; |
| 12272 | static constexpr int odsIndex_lhs = 0; |
| 12273 | static constexpr int odsIndex_rhs = 1; |
| 12274 | public: |
| 12275 | ShRSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 12276 | |
| 12277 | ShRSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ShRSIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 12278 | |
| 12279 | ShRSIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ShRSIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 12280 | |
| 12281 | ShRSIOpGenericAdaptor(RangeT values, const ShRSIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 12282 | |
| 12283 | template <typename LateInst = ShRSIOp, typename = std::enable_if_t<std::is_same_v<LateInst, ShRSIOp>>> |
| 12284 | ShRSIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 12285 | |
| 12286 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 12287 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 12288 | } |
| 12289 | |
| 12290 | RangeT getODSOperands(unsigned index) { |
| 12291 | auto valueRange = getODSOperandIndexAndLength(index); |
| 12292 | return {std::next(odsOperands.begin(), valueRange.first), |
| 12293 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 12294 | } |
| 12295 | |
| 12296 | ValueT getLhs() { |
| 12297 | return (*getODSOperands(index: 0).begin()); |
| 12298 | } |
| 12299 | |
| 12300 | ValueT getRhs() { |
| 12301 | return (*getODSOperands(index: 1).begin()); |
| 12302 | } |
| 12303 | |
| 12304 | RangeT getOperands() { |
| 12305 | return odsOperands; |
| 12306 | } |
| 12307 | |
| 12308 | private: |
| 12309 | RangeT odsOperands; |
| 12310 | }; |
| 12311 | class ShRSIOpAdaptor : public ShRSIOpGenericAdaptor<::mlir::ValueRange> { |
| 12312 | public: |
| 12313 | using ShRSIOpGenericAdaptor::ShRSIOpGenericAdaptor; |
| 12314 | ShRSIOpAdaptor(ShRSIOp op); |
| 12315 | |
| 12316 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 12317 | }; |
| 12318 | class ShRSIOp : public ::mlir::Op<ShRSIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 12319 | public: |
| 12320 | using Op::Op; |
| 12321 | using Op::print; |
| 12322 | using Adaptor = ShRSIOpAdaptor; |
| 12323 | template <typename RangeT> |
| 12324 | using GenericAdaptor = ShRSIOpGenericAdaptor<RangeT>; |
| 12325 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 12326 | static constexpr int odsIndex_lhs = 0; |
| 12327 | static constexpr int odsIndex_rhs = 1; |
| 12328 | static constexpr int odsIndex_result = 0; |
| 12329 | using Properties = FoldAdaptor::Properties; |
| 12330 | using ::mlir::InferIntRangeInterface::Trait<ShRSIOp>::inferResultRangesFromOptional; |
| 12331 | using ::mlir::VectorUnrollOpInterface::Trait<ShRSIOp>::getIterationShapeToUnroll; |
| 12332 | using ::mlir::VectorUnrollOpInterface::Trait<ShRSIOp>::getDefaultUnrollTargetShape; |
| 12333 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 12334 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("isExact" )}; |
| 12335 | return ::llvm::ArrayRef(attrNames); |
| 12336 | } |
| 12337 | |
| 12338 | ::mlir::StringAttr getIsExactAttrName() { |
| 12339 | return getAttributeNameForIndex(index: 0); |
| 12340 | } |
| 12341 | |
| 12342 | static ::mlir::StringAttr getIsExactAttrName(::mlir::OperationName name) { |
| 12343 | return getAttributeNameForIndex(name, index: 0); |
| 12344 | } |
| 12345 | |
| 12346 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 12347 | return ::llvm::StringLiteral("arith.shrsi" ); |
| 12348 | } |
| 12349 | |
| 12350 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 12351 | return {index, 1}; |
| 12352 | } |
| 12353 | |
| 12354 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 12355 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 12356 | return getOperation()->getOperands().slice(n: start, m: length); |
| 12357 | } |
| 12358 | |
| 12359 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 12360 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 12361 | } |
| 12362 | |
| 12363 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 12364 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 12365 | } |
| 12366 | |
| 12367 | ::mlir::OpOperand &getLhsMutable() { |
| 12368 | auto range = getODSOperandIndexAndLength(index: 0); |
| 12369 | return getOperation()->getOpOperand(idx: range.first); |
| 12370 | } |
| 12371 | |
| 12372 | ::mlir::OpOperand &getRhsMutable() { |
| 12373 | auto range = getODSOperandIndexAndLength(index: 1); |
| 12374 | return getOperation()->getOpOperand(idx: range.first); |
| 12375 | } |
| 12376 | |
| 12377 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 12378 | return {index, 1}; |
| 12379 | } |
| 12380 | |
| 12381 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 12382 | auto valueRange = getODSResultIndexAndLength(index); |
| 12383 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 12384 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 12385 | } |
| 12386 | |
| 12387 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 12388 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 12389 | } |
| 12390 | |
| 12391 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 12392 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 12393 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 12394 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 12395 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 12396 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 12397 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 12398 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 12399 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 12400 | ::mlir::UnitAttr getIsExactAttr() { |
| 12401 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val&: getProperties().isExact); |
| 12402 | } |
| 12403 | |
| 12404 | bool getIsExact(); |
| 12405 | void setIsExactAttr(::mlir::UnitAttr attr) { |
| 12406 | getProperties().isExact = attr; |
| 12407 | } |
| 12408 | |
| 12409 | void setIsExact(bool attrValue); |
| 12410 | ::mlir::Attribute removeIsExactAttr() { |
| 12411 | auto attr = getProperties().isExact; |
| 12412 | getProperties().isExact = {}; |
| 12413 | return attr; |
| 12414 | } |
| 12415 | |
| 12416 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12417 | static ShRSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12418 | static ShRSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12419 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12420 | static ShRSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12421 | static ShRSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12422 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12423 | static ShRSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12424 | static ShRSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12425 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12426 | static ShRSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12427 | static ShRSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12428 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12429 | static ShRSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12430 | static ShRSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12431 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12432 | static ShRSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12433 | static ShRSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12434 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12435 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12436 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12437 | static ShRSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12438 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12439 | static ShRSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12440 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12441 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12442 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12443 | static ShRSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12444 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12445 | static ShRSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12446 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12447 | static ShRSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12448 | static ShRSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12449 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12450 | static ShRSIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12451 | static ShRSIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12452 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 12453 | ::llvm::LogicalResult verifyInvariants(); |
| 12454 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 12455 | 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); |
| 12456 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 12457 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 12458 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 12459 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 12460 | private: |
| 12461 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 12462 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 12463 | } |
| 12464 | |
| 12465 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 12466 | assert(index < 1 && "invalid attribute index" ); |
| 12467 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 12468 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 12469 | "dependent dialect loading?" ); |
| 12470 | return name.getAttributeNames()[index]; |
| 12471 | } |
| 12472 | |
| 12473 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 12474 | public: |
| 12475 | }; |
| 12476 | |
| 12477 | } // namespace mlir::arith |
| 12478 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::ShRSIOp) |
| 12479 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::ShRSIOpGenericAdaptorBase::Properties) |
| 12480 | |
| 12481 | namespace mlir::arith { |
| 12482 | |
| 12483 | |
| 12484 | //===----------------------------------------------------------------------===// |
| 12485 | // ::mlir::arith::ShRUIOp declarations |
| 12486 | //===----------------------------------------------------------------------===// |
| 12487 | |
| 12488 | namespace detail { |
| 12489 | |
| 12490 | class ShRUIOpGenericAdaptorBase { |
| 12491 | public: |
| 12492 | struct Properties { |
| 12493 | using isExactTy = ::mlir::UnitAttr; |
| 12494 | isExactTy isExact; |
| 12495 | |
| 12496 | auto getIsExact() const { |
| 12497 | auto &propStorage = this->isExact; |
| 12498 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val: propStorage); |
| 12499 | } |
| 12500 | void setIsExact(const ::mlir::UnitAttr &propValue) { |
| 12501 | this->isExact = propValue; |
| 12502 | } |
| 12503 | bool operator==(const Properties &rhs) const { |
| 12504 | return |
| 12505 | rhs.isExact == this->isExact && |
| 12506 | true; |
| 12507 | } |
| 12508 | bool operator!=(const Properties &rhs) const { |
| 12509 | return !(*this == rhs); |
| 12510 | } |
| 12511 | }; |
| 12512 | protected: |
| 12513 | ::mlir::DictionaryAttr odsAttrs; |
| 12514 | ::std::optional<::mlir::OperationName> odsOpName; |
| 12515 | Properties properties; |
| 12516 | ::mlir::RegionRange odsRegions; |
| 12517 | public: |
| 12518 | ShRUIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 12519 | odsOpName.emplace(args: "arith.shrui" , args: odsAttrs.getContext()); |
| 12520 | } |
| 12521 | |
| 12522 | ShRUIOpGenericAdaptorBase(ShRUIOp op); |
| 12523 | |
| 12524 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 12525 | return {index, 1}; |
| 12526 | } |
| 12527 | |
| 12528 | const Properties &getProperties() { |
| 12529 | return properties; |
| 12530 | } |
| 12531 | |
| 12532 | ::mlir::DictionaryAttr getAttributes() { |
| 12533 | return odsAttrs; |
| 12534 | } |
| 12535 | |
| 12536 | ::mlir::UnitAttr getIsExactAttr(); |
| 12537 | bool getIsExact(); |
| 12538 | }; |
| 12539 | |
| 12540 | } // namespace detail |
| 12541 | template <typename RangeT> |
| 12542 | class ShRUIOpGenericAdaptor : public detail::ShRUIOpGenericAdaptorBase { |
| 12543 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 12544 | using Base = detail::ShRUIOpGenericAdaptorBase; |
| 12545 | static constexpr int odsIndex_lhs = 0; |
| 12546 | static constexpr int odsIndex_rhs = 1; |
| 12547 | public: |
| 12548 | ShRUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 12549 | |
| 12550 | ShRUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ShRUIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 12551 | |
| 12552 | ShRUIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ShRUIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 12553 | |
| 12554 | ShRUIOpGenericAdaptor(RangeT values, const ShRUIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 12555 | |
| 12556 | template <typename LateInst = ShRUIOp, typename = std::enable_if_t<std::is_same_v<LateInst, ShRUIOp>>> |
| 12557 | ShRUIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 12558 | |
| 12559 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 12560 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 12561 | } |
| 12562 | |
| 12563 | RangeT getODSOperands(unsigned index) { |
| 12564 | auto valueRange = getODSOperandIndexAndLength(index); |
| 12565 | return {std::next(odsOperands.begin(), valueRange.first), |
| 12566 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 12567 | } |
| 12568 | |
| 12569 | ValueT getLhs() { |
| 12570 | return (*getODSOperands(index: 0).begin()); |
| 12571 | } |
| 12572 | |
| 12573 | ValueT getRhs() { |
| 12574 | return (*getODSOperands(index: 1).begin()); |
| 12575 | } |
| 12576 | |
| 12577 | RangeT getOperands() { |
| 12578 | return odsOperands; |
| 12579 | } |
| 12580 | |
| 12581 | private: |
| 12582 | RangeT odsOperands; |
| 12583 | }; |
| 12584 | class ShRUIOpAdaptor : public ShRUIOpGenericAdaptor<::mlir::ValueRange> { |
| 12585 | public: |
| 12586 | using ShRUIOpGenericAdaptor::ShRUIOpGenericAdaptor; |
| 12587 | ShRUIOpAdaptor(ShRUIOp op); |
| 12588 | |
| 12589 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 12590 | }; |
| 12591 | class ShRUIOp : public ::mlir::Op<ShRUIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 12592 | public: |
| 12593 | using Op::Op; |
| 12594 | using Op::print; |
| 12595 | using Adaptor = ShRUIOpAdaptor; |
| 12596 | template <typename RangeT> |
| 12597 | using GenericAdaptor = ShRUIOpGenericAdaptor<RangeT>; |
| 12598 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 12599 | static constexpr int odsIndex_lhs = 0; |
| 12600 | static constexpr int odsIndex_rhs = 1; |
| 12601 | static constexpr int odsIndex_result = 0; |
| 12602 | using Properties = FoldAdaptor::Properties; |
| 12603 | using ::mlir::InferIntRangeInterface::Trait<ShRUIOp>::inferResultRangesFromOptional; |
| 12604 | using ::mlir::VectorUnrollOpInterface::Trait<ShRUIOp>::getIterationShapeToUnroll; |
| 12605 | using ::mlir::VectorUnrollOpInterface::Trait<ShRUIOp>::getDefaultUnrollTargetShape; |
| 12606 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 12607 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("isExact" )}; |
| 12608 | return ::llvm::ArrayRef(attrNames); |
| 12609 | } |
| 12610 | |
| 12611 | ::mlir::StringAttr getIsExactAttrName() { |
| 12612 | return getAttributeNameForIndex(index: 0); |
| 12613 | } |
| 12614 | |
| 12615 | static ::mlir::StringAttr getIsExactAttrName(::mlir::OperationName name) { |
| 12616 | return getAttributeNameForIndex(name, index: 0); |
| 12617 | } |
| 12618 | |
| 12619 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 12620 | return ::llvm::StringLiteral("arith.shrui" ); |
| 12621 | } |
| 12622 | |
| 12623 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 12624 | return {index, 1}; |
| 12625 | } |
| 12626 | |
| 12627 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 12628 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 12629 | return getOperation()->getOperands().slice(n: start, m: length); |
| 12630 | } |
| 12631 | |
| 12632 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 12633 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 12634 | } |
| 12635 | |
| 12636 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 12637 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 12638 | } |
| 12639 | |
| 12640 | ::mlir::OpOperand &getLhsMutable() { |
| 12641 | auto range = getODSOperandIndexAndLength(index: 0); |
| 12642 | return getOperation()->getOpOperand(idx: range.first); |
| 12643 | } |
| 12644 | |
| 12645 | ::mlir::OpOperand &getRhsMutable() { |
| 12646 | auto range = getODSOperandIndexAndLength(index: 1); |
| 12647 | return getOperation()->getOpOperand(idx: range.first); |
| 12648 | } |
| 12649 | |
| 12650 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 12651 | return {index, 1}; |
| 12652 | } |
| 12653 | |
| 12654 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 12655 | auto valueRange = getODSResultIndexAndLength(index); |
| 12656 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 12657 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 12658 | } |
| 12659 | |
| 12660 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 12661 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 12662 | } |
| 12663 | |
| 12664 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 12665 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 12666 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 12667 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 12668 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 12669 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 12670 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 12671 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 12672 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 12673 | ::mlir::UnitAttr getIsExactAttr() { |
| 12674 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val&: getProperties().isExact); |
| 12675 | } |
| 12676 | |
| 12677 | bool getIsExact(); |
| 12678 | void setIsExactAttr(::mlir::UnitAttr attr) { |
| 12679 | getProperties().isExact = attr; |
| 12680 | } |
| 12681 | |
| 12682 | void setIsExact(bool attrValue); |
| 12683 | ::mlir::Attribute removeIsExactAttr() { |
| 12684 | auto attr = getProperties().isExact; |
| 12685 | getProperties().isExact = {}; |
| 12686 | return attr; |
| 12687 | } |
| 12688 | |
| 12689 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12690 | static ShRUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12691 | static ShRUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12692 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12693 | static ShRUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12694 | static ShRUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12695 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12696 | static ShRUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12697 | static ShRUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::UnitAttr isExact); |
| 12698 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12699 | static ShRUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12700 | static ShRUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12701 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12702 | static ShRUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12703 | static ShRUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12704 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12705 | static ShRUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12706 | static ShRUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/bool isExact = false); |
| 12707 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12708 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12709 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12710 | static ShRUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12711 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12712 | static ShRUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12713 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12714 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12715 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12716 | static ShRUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12717 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 12718 | static ShRUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 12719 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12720 | static ShRUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12721 | static ShRUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12722 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12723 | static ShRUIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12724 | static ShRUIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 12725 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 12726 | ::llvm::LogicalResult verifyInvariants(); |
| 12727 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 12728 | 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); |
| 12729 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 12730 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 12731 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 12732 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 12733 | private: |
| 12734 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 12735 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 12736 | } |
| 12737 | |
| 12738 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 12739 | assert(index < 1 && "invalid attribute index" ); |
| 12740 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 12741 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 12742 | "dependent dialect loading?" ); |
| 12743 | return name.getAttributeNames()[index]; |
| 12744 | } |
| 12745 | |
| 12746 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 12747 | public: |
| 12748 | }; |
| 12749 | |
| 12750 | } // namespace mlir::arith |
| 12751 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::ShRUIOp) |
| 12752 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::ShRUIOpGenericAdaptorBase::Properties) |
| 12753 | |
| 12754 | namespace mlir::arith { |
| 12755 | |
| 12756 | |
| 12757 | //===----------------------------------------------------------------------===// |
| 12758 | // ::mlir::arith::SubFOp declarations |
| 12759 | //===----------------------------------------------------------------------===// |
| 12760 | |
| 12761 | namespace detail { |
| 12762 | |
| 12763 | class SubFOpGenericAdaptorBase { |
| 12764 | public: |
| 12765 | struct Properties { |
| 12766 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 12767 | fastmathTy fastmath; |
| 12768 | |
| 12769 | auto getFastmath() const { |
| 12770 | auto &propStorage = this->fastmath; |
| 12771 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 12772 | } |
| 12773 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 12774 | this->fastmath = propValue; |
| 12775 | } |
| 12776 | using roundingmodeTy = ::mlir::arith::RoundingModeAttr; |
| 12777 | roundingmodeTy roundingmode; |
| 12778 | |
| 12779 | auto getRoundingmode() const { |
| 12780 | auto &propStorage = this->roundingmode; |
| 12781 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: propStorage); |
| 12782 | } |
| 12783 | void setRoundingmode(const ::mlir::arith::RoundingModeAttr &propValue) { |
| 12784 | this->roundingmode = propValue; |
| 12785 | } |
| 12786 | bool operator==(const Properties &rhs) const { |
| 12787 | return |
| 12788 | rhs.fastmath == this->fastmath && |
| 12789 | rhs.roundingmode == this->roundingmode && |
| 12790 | true; |
| 12791 | } |
| 12792 | bool operator!=(const Properties &rhs) const { |
| 12793 | return !(*this == rhs); |
| 12794 | } |
| 12795 | }; |
| 12796 | protected: |
| 12797 | ::mlir::DictionaryAttr odsAttrs; |
| 12798 | ::std::optional<::mlir::OperationName> odsOpName; |
| 12799 | Properties properties; |
| 12800 | ::mlir::RegionRange odsRegions; |
| 12801 | public: |
| 12802 | SubFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 12803 | odsOpName.emplace(args: "arith.subf" , args: odsAttrs.getContext()); |
| 12804 | } |
| 12805 | |
| 12806 | SubFOpGenericAdaptorBase(SubFOp op); |
| 12807 | |
| 12808 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 12809 | return {index, 1}; |
| 12810 | } |
| 12811 | |
| 12812 | const Properties &getProperties() { |
| 12813 | return properties; |
| 12814 | } |
| 12815 | |
| 12816 | ::mlir::DictionaryAttr getAttributes() { |
| 12817 | return odsAttrs; |
| 12818 | } |
| 12819 | |
| 12820 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); |
| 12821 | ::mlir::arith::FastMathFlags getFastmath(); |
| 12822 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 12823 | auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: getProperties().roundingmode); |
| 12824 | return attr; |
| 12825 | } |
| 12826 | |
| 12827 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 12828 | }; |
| 12829 | |
| 12830 | } // namespace detail |
| 12831 | template <typename RangeT> |
| 12832 | class SubFOpGenericAdaptor : public detail::SubFOpGenericAdaptorBase { |
| 12833 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 12834 | using Base = detail::SubFOpGenericAdaptorBase; |
| 12835 | static constexpr int odsIndex_lhs = 0; |
| 12836 | static constexpr int odsIndex_rhs = 1; |
| 12837 | public: |
| 12838 | SubFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 12839 | |
| 12840 | SubFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : SubFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 12841 | |
| 12842 | SubFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : SubFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 12843 | |
| 12844 | SubFOpGenericAdaptor(RangeT values, const SubFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 12845 | |
| 12846 | template <typename LateInst = SubFOp, typename = std::enable_if_t<std::is_same_v<LateInst, SubFOp>>> |
| 12847 | SubFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 12848 | |
| 12849 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 12850 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 12851 | } |
| 12852 | |
| 12853 | RangeT getODSOperands(unsigned index) { |
| 12854 | auto valueRange = getODSOperandIndexAndLength(index); |
| 12855 | return {std::next(odsOperands.begin(), valueRange.first), |
| 12856 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 12857 | } |
| 12858 | |
| 12859 | ValueT getLhs() { |
| 12860 | return (*getODSOperands(index: 0).begin()); |
| 12861 | } |
| 12862 | |
| 12863 | ValueT getRhs() { |
| 12864 | return (*getODSOperands(index: 1).begin()); |
| 12865 | } |
| 12866 | |
| 12867 | RangeT getOperands() { |
| 12868 | return odsOperands; |
| 12869 | } |
| 12870 | |
| 12871 | private: |
| 12872 | RangeT odsOperands; |
| 12873 | }; |
| 12874 | class SubFOpAdaptor : public SubFOpGenericAdaptor<::mlir::ValueRange> { |
| 12875 | public: |
| 12876 | using SubFOpGenericAdaptor::SubFOpGenericAdaptor; |
| 12877 | SubFOpAdaptor(SubFOp op); |
| 12878 | |
| 12879 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 12880 | }; |
| 12881 | class SubFOp : public ::mlir::Op<SubFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::arith::ArithRoundingModeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 12882 | public: |
| 12883 | using Op::Op; |
| 12884 | using Op::print; |
| 12885 | using Adaptor = SubFOpAdaptor; |
| 12886 | template <typename RangeT> |
| 12887 | using GenericAdaptor = SubFOpGenericAdaptor<RangeT>; |
| 12888 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 12889 | static constexpr int odsIndex_lhs = 0; |
| 12890 | static constexpr int odsIndex_rhs = 1; |
| 12891 | static constexpr int odsIndex_result = 0; |
| 12892 | using Properties = FoldAdaptor::Properties; |
| 12893 | using ::mlir::arith::ArithFastMathInterface::Trait<SubFOp>::getFastMathFlagsAttr; |
| 12894 | using ::mlir::arith::ArithFastMathInterface::Trait<SubFOp>::getFastMathAttrName; |
| 12895 | using ::mlir::arith::ArithRoundingModeInterface::Trait<SubFOp>::getRoundingModeAttr; |
| 12896 | using ::mlir::arith::ArithRoundingModeInterface::Trait<SubFOp>::getRoundingModeAttrName; |
| 12897 | using ::mlir::VectorUnrollOpInterface::Trait<SubFOp>::getIterationShapeToUnroll; |
| 12898 | using ::mlir::VectorUnrollOpInterface::Trait<SubFOp>::getDefaultUnrollTargetShape; |
| 12899 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 12900 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" ), ::llvm::StringRef("roundingmode" )}; |
| 12901 | return ::llvm::ArrayRef(attrNames); |
| 12902 | } |
| 12903 | |
| 12904 | ::mlir::StringAttr getFastmathAttrName() { |
| 12905 | return getAttributeNameForIndex(index: 0); |
| 12906 | } |
| 12907 | |
| 12908 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 12909 | return getAttributeNameForIndex(name, index: 0); |
| 12910 | } |
| 12911 | |
| 12912 | ::mlir::StringAttr getRoundingmodeAttrName() { |
| 12913 | return getAttributeNameForIndex(index: 1); |
| 12914 | } |
| 12915 | |
| 12916 | static ::mlir::StringAttr getRoundingmodeAttrName(::mlir::OperationName name) { |
| 12917 | return getAttributeNameForIndex(name, index: 1); |
| 12918 | } |
| 12919 | |
| 12920 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 12921 | return ::llvm::StringLiteral("arith.subf" ); |
| 12922 | } |
| 12923 | |
| 12924 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 12925 | return {index, 1}; |
| 12926 | } |
| 12927 | |
| 12928 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 12929 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 12930 | return getOperation()->getOperands().slice(n: start, m: length); |
| 12931 | } |
| 12932 | |
| 12933 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 12934 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 12935 | } |
| 12936 | |
| 12937 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 12938 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 12939 | } |
| 12940 | |
| 12941 | ::mlir::OpOperand &getLhsMutable() { |
| 12942 | auto range = getODSOperandIndexAndLength(index: 0); |
| 12943 | return getOperation()->getOpOperand(idx: range.first); |
| 12944 | } |
| 12945 | |
| 12946 | ::mlir::OpOperand &getRhsMutable() { |
| 12947 | auto range = getODSOperandIndexAndLength(index: 1); |
| 12948 | return getOperation()->getOpOperand(idx: range.first); |
| 12949 | } |
| 12950 | |
| 12951 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 12952 | return {index, 1}; |
| 12953 | } |
| 12954 | |
| 12955 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 12956 | auto valueRange = getODSResultIndexAndLength(index); |
| 12957 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 12958 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 12959 | } |
| 12960 | |
| 12961 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 12962 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 12963 | } |
| 12964 | |
| 12965 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 12966 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 12967 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 12968 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 12969 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 12970 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 12971 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 12972 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 12973 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 12974 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 12975 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 12976 | } |
| 12977 | |
| 12978 | ::mlir::arith::FastMathFlags getFastmath(); |
| 12979 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 12980 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val&: getProperties().roundingmode); |
| 12981 | } |
| 12982 | |
| 12983 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 12984 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 12985 | getProperties().fastmath = attr; |
| 12986 | } |
| 12987 | |
| 12988 | void setFastmath(::mlir::arith::FastMathFlags attrValue); |
| 12989 | void setRoundingmodeAttr(::mlir::arith::RoundingModeAttr attr) { |
| 12990 | getProperties().roundingmode = attr; |
| 12991 | } |
| 12992 | |
| 12993 | void setRoundingmode(::std::optional<::mlir::arith::RoundingMode> attrValue); |
| 12994 | ::mlir::Attribute removeRoundingmodeAttr() { |
| 12995 | auto attr = getProperties().roundingmode; |
| 12996 | getProperties().roundingmode = {}; |
| 12997 | return attr; |
| 12998 | } |
| 12999 | |
| 13000 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 13001 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 13002 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 13003 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value lhs, Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 13004 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value lhs, Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 13005 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, Value lhs, Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); |
| 13006 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type type, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 13007 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Type type, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 13008 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, Type type, Value lhs, Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); |
| 13009 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13010 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13011 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13012 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13013 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13014 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13015 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13016 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13017 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13018 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13019 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13020 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13021 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13022 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13023 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13024 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13025 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13026 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath, /*optional*/::mlir::arith::RoundingModeAttr roundingmode); |
| 13027 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13028 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13029 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13030 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13031 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13032 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13033 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13034 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13035 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13036 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13037 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13038 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13039 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13040 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13041 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13042 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13043 | static SubFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13044 | static SubFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13045 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 13046 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 13047 | ::llvm::LogicalResult verifyInvariants(); |
| 13048 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 13049 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 13050 | 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); |
| 13051 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 13052 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 13053 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 13054 | private: |
| 13055 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 13056 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 13057 | } |
| 13058 | |
| 13059 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 13060 | assert(index < 2 && "invalid attribute index" ); |
| 13061 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 13062 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 13063 | "dependent dialect loading?" ); |
| 13064 | return name.getAttributeNames()[index]; |
| 13065 | } |
| 13066 | |
| 13067 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 13068 | public: |
| 13069 | }; |
| 13070 | |
| 13071 | } // namespace mlir::arith |
| 13072 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::SubFOp) |
| 13073 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::SubFOpGenericAdaptorBase::Properties) |
| 13074 | |
| 13075 | namespace mlir::arith { |
| 13076 | |
| 13077 | |
| 13078 | //===----------------------------------------------------------------------===// |
| 13079 | // ::mlir::arith::SubIOp declarations |
| 13080 | //===----------------------------------------------------------------------===// |
| 13081 | |
| 13082 | namespace detail { |
| 13083 | |
| 13084 | class SubIOpGenericAdaptorBase { |
| 13085 | public: |
| 13086 | struct Properties { |
| 13087 | using overflowFlagsTy = ::mlir::arith::IntegerOverflowFlagsAttr; |
| 13088 | overflowFlagsTy overflowFlags; |
| 13089 | |
| 13090 | auto getOverflowFlags() const { |
| 13091 | auto &propStorage = this->overflowFlags; |
| 13092 | return ::llvm::dyn_cast_or_null<::mlir::arith::IntegerOverflowFlagsAttr>(Val: propStorage); |
| 13093 | } |
| 13094 | void setOverflowFlags(const ::mlir::arith::IntegerOverflowFlagsAttr &propValue) { |
| 13095 | this->overflowFlags = propValue; |
| 13096 | } |
| 13097 | bool operator==(const Properties &rhs) const { |
| 13098 | return |
| 13099 | rhs.overflowFlags == this->overflowFlags && |
| 13100 | true; |
| 13101 | } |
| 13102 | bool operator!=(const Properties &rhs) const { |
| 13103 | return !(*this == rhs); |
| 13104 | } |
| 13105 | }; |
| 13106 | protected: |
| 13107 | ::mlir::DictionaryAttr odsAttrs; |
| 13108 | ::std::optional<::mlir::OperationName> odsOpName; |
| 13109 | Properties properties; |
| 13110 | ::mlir::RegionRange odsRegions; |
| 13111 | public: |
| 13112 | SubIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 13113 | odsOpName.emplace(args: "arith.subi" , args: odsAttrs.getContext()); |
| 13114 | } |
| 13115 | |
| 13116 | SubIOpGenericAdaptorBase(SubIOp op); |
| 13117 | |
| 13118 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 13119 | return {index, 1}; |
| 13120 | } |
| 13121 | |
| 13122 | const Properties &getProperties() { |
| 13123 | return properties; |
| 13124 | } |
| 13125 | |
| 13126 | ::mlir::DictionaryAttr getAttributes() { |
| 13127 | return odsAttrs; |
| 13128 | } |
| 13129 | |
| 13130 | ::mlir::arith::IntegerOverflowFlagsAttr getOverflowFlagsAttr(); |
| 13131 | ::mlir::arith::IntegerOverflowFlags getOverflowFlags(); |
| 13132 | }; |
| 13133 | |
| 13134 | } // namespace detail |
| 13135 | template <typename RangeT> |
| 13136 | class SubIOpGenericAdaptor : public detail::SubIOpGenericAdaptorBase { |
| 13137 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 13138 | using Base = detail::SubIOpGenericAdaptorBase; |
| 13139 | static constexpr int odsIndex_lhs = 0; |
| 13140 | static constexpr int odsIndex_rhs = 1; |
| 13141 | public: |
| 13142 | SubIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 13143 | |
| 13144 | SubIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : SubIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 13145 | |
| 13146 | SubIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : SubIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 13147 | |
| 13148 | SubIOpGenericAdaptor(RangeT values, const SubIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 13149 | |
| 13150 | template <typename LateInst = SubIOp, typename = std::enable_if_t<std::is_same_v<LateInst, SubIOp>>> |
| 13151 | SubIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 13152 | |
| 13153 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 13154 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 13155 | } |
| 13156 | |
| 13157 | RangeT getODSOperands(unsigned index) { |
| 13158 | auto valueRange = getODSOperandIndexAndLength(index); |
| 13159 | return {std::next(odsOperands.begin(), valueRange.first), |
| 13160 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 13161 | } |
| 13162 | |
| 13163 | ValueT getLhs() { |
| 13164 | return (*getODSOperands(index: 0).begin()); |
| 13165 | } |
| 13166 | |
| 13167 | ValueT getRhs() { |
| 13168 | return (*getODSOperands(index: 1).begin()); |
| 13169 | } |
| 13170 | |
| 13171 | RangeT getOperands() { |
| 13172 | return odsOperands; |
| 13173 | } |
| 13174 | |
| 13175 | private: |
| 13176 | RangeT odsOperands; |
| 13177 | }; |
| 13178 | class SubIOpAdaptor : public SubIOpGenericAdaptor<::mlir::ValueRange> { |
| 13179 | public: |
| 13180 | using SubIOpGenericAdaptor::SubIOpGenericAdaptor; |
| 13181 | SubIOpAdaptor(SubIOp op); |
| 13182 | |
| 13183 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 13184 | }; |
| 13185 | class SubIOp : public ::mlir::Op<SubIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::InferIntDivisibilityOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 13186 | public: |
| 13187 | using Op::Op; |
| 13188 | using Op::print; |
| 13189 | using Adaptor = SubIOpAdaptor; |
| 13190 | template <typename RangeT> |
| 13191 | using GenericAdaptor = SubIOpGenericAdaptor<RangeT>; |
| 13192 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 13193 | static constexpr int odsIndex_lhs = 0; |
| 13194 | static constexpr int odsIndex_rhs = 1; |
| 13195 | static constexpr int odsIndex_result = 0; |
| 13196 | using Properties = FoldAdaptor::Properties; |
| 13197 | using ::mlir::InferIntRangeInterface::Trait<SubIOp>::inferResultRangesFromOptional; |
| 13198 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<SubIOp>::getOverflowAttr; |
| 13199 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<SubIOp>::hasNoUnsignedWrap; |
| 13200 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<SubIOp>::hasNoSignedWrap; |
| 13201 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<SubIOp>::getIntegerOverflowAttrName; |
| 13202 | using ::mlir::VectorUnrollOpInterface::Trait<SubIOp>::getIterationShapeToUnroll; |
| 13203 | using ::mlir::VectorUnrollOpInterface::Trait<SubIOp>::getDefaultUnrollTargetShape; |
| 13204 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 13205 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("overflowFlags" )}; |
| 13206 | return ::llvm::ArrayRef(attrNames); |
| 13207 | } |
| 13208 | |
| 13209 | ::mlir::StringAttr getOverflowFlagsAttrName() { |
| 13210 | return getAttributeNameForIndex(index: 0); |
| 13211 | } |
| 13212 | |
| 13213 | static ::mlir::StringAttr getOverflowFlagsAttrName(::mlir::OperationName name) { |
| 13214 | return getAttributeNameForIndex(name, index: 0); |
| 13215 | } |
| 13216 | |
| 13217 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 13218 | return ::llvm::StringLiteral("arith.subi" ); |
| 13219 | } |
| 13220 | |
| 13221 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 13222 | return {index, 1}; |
| 13223 | } |
| 13224 | |
| 13225 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 13226 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 13227 | return getOperation()->getOperands().slice(n: start, m: length); |
| 13228 | } |
| 13229 | |
| 13230 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 13231 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 13232 | } |
| 13233 | |
| 13234 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 13235 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 13236 | } |
| 13237 | |
| 13238 | ::mlir::OpOperand &getLhsMutable() { |
| 13239 | auto range = getODSOperandIndexAndLength(index: 0); |
| 13240 | return getOperation()->getOpOperand(idx: range.first); |
| 13241 | } |
| 13242 | |
| 13243 | ::mlir::OpOperand &getRhsMutable() { |
| 13244 | auto range = getODSOperandIndexAndLength(index: 1); |
| 13245 | return getOperation()->getOpOperand(idx: range.first); |
| 13246 | } |
| 13247 | |
| 13248 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 13249 | return {index, 1}; |
| 13250 | } |
| 13251 | |
| 13252 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 13253 | auto valueRange = getODSResultIndexAndLength(index); |
| 13254 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 13255 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 13256 | } |
| 13257 | |
| 13258 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 13259 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 13260 | } |
| 13261 | |
| 13262 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 13263 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 13264 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 13265 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 13266 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 13267 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 13268 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 13269 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 13270 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 13271 | ::mlir::arith::IntegerOverflowFlagsAttr getOverflowFlagsAttr() { |
| 13272 | return ::llvm::dyn_cast_or_null<::mlir::arith::IntegerOverflowFlagsAttr>(Val&: getProperties().overflowFlags); |
| 13273 | } |
| 13274 | |
| 13275 | ::mlir::arith::IntegerOverflowFlags getOverflowFlags(); |
| 13276 | void setOverflowFlagsAttr(::mlir::arith::IntegerOverflowFlagsAttr attr) { |
| 13277 | getProperties().overflowFlags = attr; |
| 13278 | } |
| 13279 | |
| 13280 | void setOverflowFlags(::mlir::arith::IntegerOverflowFlags attrValue); |
| 13281 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 13282 | static SubIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 13283 | static SubIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 13284 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 13285 | static SubIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 13286 | static SubIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 13287 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 13288 | static SubIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 13289 | static SubIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 13290 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 13291 | static SubIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 13292 | static SubIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 13293 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 13294 | static SubIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 13295 | static SubIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 13296 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 13297 | static SubIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 13298 | static SubIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 13299 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13300 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13301 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13302 | static SubIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13303 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13304 | static SubIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13305 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13306 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13307 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13308 | static SubIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13309 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13310 | static SubIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13311 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13312 | static SubIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13313 | static SubIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13314 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13315 | static SubIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13316 | static SubIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13317 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 13318 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 13319 | ::llvm::LogicalResult verifyInvariants(); |
| 13320 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 13321 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 13322 | 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); |
| 13323 | void inferResultDivisibility(::llvm::ArrayRef<::mlir::IntegerDivisibility> argDivs, ::mlir::SetIntDivisibilityFn setResultDivs); |
| 13324 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 13325 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 13326 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 13327 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 13328 | private: |
| 13329 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 13330 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 13331 | } |
| 13332 | |
| 13333 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 13334 | assert(index < 1 && "invalid attribute index" ); |
| 13335 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 13336 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 13337 | "dependent dialect loading?" ); |
| 13338 | return name.getAttributeNames()[index]; |
| 13339 | } |
| 13340 | |
| 13341 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 13342 | public: |
| 13343 | }; |
| 13344 | |
| 13345 | } // namespace mlir::arith |
| 13346 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::SubIOp) |
| 13347 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::SubIOpGenericAdaptorBase::Properties) |
| 13348 | |
| 13349 | namespace mlir::arith { |
| 13350 | |
| 13351 | |
| 13352 | //===----------------------------------------------------------------------===// |
| 13353 | // ::mlir::arith::SubUIExtendedOp declarations |
| 13354 | //===----------------------------------------------------------------------===// |
| 13355 | |
| 13356 | namespace detail { |
| 13357 | |
| 13358 | class SubUIExtendedOpGenericAdaptorBase { |
| 13359 | public: |
| 13360 | using Properties = ::mlir::EmptyProperties; |
| 13361 | protected: |
| 13362 | ::mlir::DictionaryAttr odsAttrs; |
| 13363 | ::std::optional<::mlir::OperationName> odsOpName; |
| 13364 | Properties properties; |
| 13365 | ::mlir::RegionRange odsRegions; |
| 13366 | public: |
| 13367 | SubUIExtendedOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 13368 | odsOpName.emplace(args: "arith.subui_extended" , args: odsAttrs.getContext()); |
| 13369 | } |
| 13370 | |
| 13371 | SubUIExtendedOpGenericAdaptorBase(SubUIExtendedOp op); |
| 13372 | |
| 13373 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 13374 | return {index, 1}; |
| 13375 | } |
| 13376 | |
| 13377 | const Properties &getProperties() { |
| 13378 | return properties; |
| 13379 | } |
| 13380 | |
| 13381 | ::mlir::DictionaryAttr getAttributes() { |
| 13382 | return odsAttrs; |
| 13383 | } |
| 13384 | |
| 13385 | }; |
| 13386 | |
| 13387 | } // namespace detail |
| 13388 | template <typename RangeT> |
| 13389 | class SubUIExtendedOpGenericAdaptor : public detail::SubUIExtendedOpGenericAdaptorBase { |
| 13390 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 13391 | using Base = detail::SubUIExtendedOpGenericAdaptorBase; |
| 13392 | static constexpr int odsIndex_lhs = 0; |
| 13393 | static constexpr int odsIndex_rhs = 1; |
| 13394 | public: |
| 13395 | SubUIExtendedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 13396 | |
| 13397 | SubUIExtendedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : SubUIExtendedOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 13398 | |
| 13399 | SubUIExtendedOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : SubUIExtendedOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 13400 | |
| 13401 | SubUIExtendedOpGenericAdaptor(RangeT values, const SubUIExtendedOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 13402 | |
| 13403 | template <typename LateInst = SubUIExtendedOp, typename = std::enable_if_t<std::is_same_v<LateInst, SubUIExtendedOp>>> |
| 13404 | SubUIExtendedOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 13405 | |
| 13406 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 13407 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 13408 | } |
| 13409 | |
| 13410 | RangeT getODSOperands(unsigned index) { |
| 13411 | auto valueRange = getODSOperandIndexAndLength(index); |
| 13412 | return {std::next(odsOperands.begin(), valueRange.first), |
| 13413 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 13414 | } |
| 13415 | |
| 13416 | ValueT getLhs() { |
| 13417 | return (*getODSOperands(index: 0).begin()); |
| 13418 | } |
| 13419 | |
| 13420 | ValueT getRhs() { |
| 13421 | return (*getODSOperands(index: 1).begin()); |
| 13422 | } |
| 13423 | |
| 13424 | RangeT getOperands() { |
| 13425 | return odsOperands; |
| 13426 | } |
| 13427 | |
| 13428 | private: |
| 13429 | RangeT odsOperands; |
| 13430 | }; |
| 13431 | class SubUIExtendedOpAdaptor : public SubUIExtendedOpGenericAdaptor<::mlir::ValueRange> { |
| 13432 | public: |
| 13433 | using SubUIExtendedOpGenericAdaptor::SubUIExtendedOpGenericAdaptor; |
| 13434 | SubUIExtendedOpAdaptor(SubUIExtendedOp op); |
| 13435 | |
| 13436 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 13437 | }; |
| 13438 | class SubUIExtendedOp : public ::mlir::Op<SubUIExtendedOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::NResults<2>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::OpAsmOpInterface::Trait> { |
| 13439 | public: |
| 13440 | using Op::Op; |
| 13441 | using Op::print; |
| 13442 | using Adaptor = SubUIExtendedOpAdaptor; |
| 13443 | template <typename RangeT> |
| 13444 | using GenericAdaptor = SubUIExtendedOpGenericAdaptor<RangeT>; |
| 13445 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 13446 | static constexpr int odsIndex_lhs = 0; |
| 13447 | static constexpr int odsIndex_rhs = 1; |
| 13448 | static constexpr int odsIndex_diff = 0; |
| 13449 | static constexpr int odsIndex_borrow = 1; |
| 13450 | using Properties = FoldAdaptor::Properties; |
| 13451 | using ::mlir::VectorUnrollOpInterface::Trait<SubUIExtendedOp>::getIterationShapeToUnroll; |
| 13452 | using ::mlir::VectorUnrollOpInterface::Trait<SubUIExtendedOp>::getDefaultUnrollTargetShape; |
| 13453 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 13454 | return {}; |
| 13455 | } |
| 13456 | |
| 13457 | void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn); |
| 13458 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 13459 | return ::llvm::StringLiteral("arith.subui_extended" ); |
| 13460 | } |
| 13461 | |
| 13462 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 13463 | return {index, 1}; |
| 13464 | } |
| 13465 | |
| 13466 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 13467 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 13468 | return getOperation()->getOperands().slice(n: start, m: length); |
| 13469 | } |
| 13470 | |
| 13471 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 13472 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 13473 | } |
| 13474 | |
| 13475 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 13476 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 13477 | } |
| 13478 | |
| 13479 | ::mlir::OpOperand &getLhsMutable() { |
| 13480 | auto range = getODSOperandIndexAndLength(index: 0); |
| 13481 | return getOperation()->getOpOperand(idx: range.first); |
| 13482 | } |
| 13483 | |
| 13484 | ::mlir::OpOperand &getRhsMutable() { |
| 13485 | auto range = getODSOperandIndexAndLength(index: 1); |
| 13486 | return getOperation()->getOpOperand(idx: range.first); |
| 13487 | } |
| 13488 | |
| 13489 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 13490 | return {index, 1}; |
| 13491 | } |
| 13492 | |
| 13493 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 13494 | auto valueRange = getODSResultIndexAndLength(index); |
| 13495 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 13496 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 13497 | } |
| 13498 | |
| 13499 | ::mlir::TypedValue<::mlir::Type> getDiff() { |
| 13500 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 13501 | } |
| 13502 | |
| 13503 | ::mlir::TypedValue<::mlir::Type> getBorrow() { |
| 13504 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 1).begin()); |
| 13505 | } |
| 13506 | |
| 13507 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 13508 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 13509 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 13510 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 13511 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 13512 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 13513 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 13514 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value lhs, Value rhs); |
| 13515 | static SubUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Value lhs, Value rhs); |
| 13516 | static SubUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, Value lhs, Value rhs); |
| 13517 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type diff, ::mlir::Type borrow, ::mlir::Value lhs, ::mlir::Value rhs); |
| 13518 | static SubUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type diff, ::mlir::Type borrow, ::mlir::Value lhs, ::mlir::Value rhs); |
| 13519 | static SubUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type diff, ::mlir::Type borrow, ::mlir::Value lhs, ::mlir::Value rhs); |
| 13520 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 13521 | static SubUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 13522 | static SubUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 13523 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13524 | static SubUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13525 | static SubUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13526 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13527 | static SubUIExtendedOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13528 | static SubUIExtendedOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13529 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 13530 | ::llvm::LogicalResult verifyInvariants(); |
| 13531 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 13532 | ::llvm::LogicalResult fold(FoldAdaptor adaptor, ::llvm::SmallVectorImpl<::mlir::OpFoldResult> &results); |
| 13533 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 13534 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 13535 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 13536 | public: |
| 13537 | std::optional<SmallVector<int64_t, 4>> getIterationShapeToUnroll(); |
| 13538 | }; |
| 13539 | |
| 13540 | } // namespace mlir::arith |
| 13541 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::SubUIExtendedOp) |
| 13542 | |
| 13543 | namespace mlir::arith { |
| 13544 | |
| 13545 | |
| 13546 | //===----------------------------------------------------------------------===// |
| 13547 | // ::mlir::arith::TruncFOp declarations |
| 13548 | //===----------------------------------------------------------------------===// |
| 13549 | |
| 13550 | namespace detail { |
| 13551 | |
| 13552 | class TruncFOpGenericAdaptorBase { |
| 13553 | public: |
| 13554 | struct Properties { |
| 13555 | using fastmathTy = ::mlir::arith::FastMathFlagsAttr; |
| 13556 | fastmathTy fastmath; |
| 13557 | |
| 13558 | auto getFastmath() const { |
| 13559 | auto &propStorage = this->fastmath; |
| 13560 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: propStorage); |
| 13561 | } |
| 13562 | void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { |
| 13563 | this->fastmath = propValue; |
| 13564 | } |
| 13565 | using roundingmodeTy = ::mlir::arith::RoundingModeAttr; |
| 13566 | roundingmodeTy roundingmode; |
| 13567 | |
| 13568 | auto getRoundingmode() const { |
| 13569 | auto &propStorage = this->roundingmode; |
| 13570 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: propStorage); |
| 13571 | } |
| 13572 | void setRoundingmode(const ::mlir::arith::RoundingModeAttr &propValue) { |
| 13573 | this->roundingmode = propValue; |
| 13574 | } |
| 13575 | bool operator==(const Properties &rhs) const { |
| 13576 | return |
| 13577 | rhs.fastmath == this->fastmath && |
| 13578 | rhs.roundingmode == this->roundingmode && |
| 13579 | true; |
| 13580 | } |
| 13581 | bool operator!=(const Properties &rhs) const { |
| 13582 | return !(*this == rhs); |
| 13583 | } |
| 13584 | }; |
| 13585 | protected: |
| 13586 | ::mlir::DictionaryAttr odsAttrs; |
| 13587 | ::std::optional<::mlir::OperationName> odsOpName; |
| 13588 | Properties properties; |
| 13589 | ::mlir::RegionRange odsRegions; |
| 13590 | public: |
| 13591 | TruncFOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 13592 | odsOpName.emplace(args: "arith.truncf" , args: odsAttrs.getContext()); |
| 13593 | } |
| 13594 | |
| 13595 | TruncFOpGenericAdaptorBase(TruncFOp op); |
| 13596 | |
| 13597 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 13598 | return {index, 1}; |
| 13599 | } |
| 13600 | |
| 13601 | const Properties &getProperties() { |
| 13602 | return properties; |
| 13603 | } |
| 13604 | |
| 13605 | ::mlir::DictionaryAttr getAttributes() { |
| 13606 | return odsAttrs; |
| 13607 | } |
| 13608 | |
| 13609 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 13610 | auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val: getProperties().roundingmode); |
| 13611 | return attr; |
| 13612 | } |
| 13613 | |
| 13614 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 13615 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 13616 | auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val: getProperties().fastmath); |
| 13617 | return attr; |
| 13618 | } |
| 13619 | |
| 13620 | ::std::optional<::mlir::arith::FastMathFlags> getFastmath(); |
| 13621 | }; |
| 13622 | |
| 13623 | } // namespace detail |
| 13624 | template <typename RangeT> |
| 13625 | class TruncFOpGenericAdaptor : public detail::TruncFOpGenericAdaptorBase { |
| 13626 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 13627 | using Base = detail::TruncFOpGenericAdaptorBase; |
| 13628 | static constexpr int odsIndex_in = 0; |
| 13629 | public: |
| 13630 | TruncFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 13631 | |
| 13632 | TruncFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : TruncFOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 13633 | |
| 13634 | TruncFOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : TruncFOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 13635 | |
| 13636 | TruncFOpGenericAdaptor(RangeT values, const TruncFOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 13637 | |
| 13638 | template <typename LateInst = TruncFOp, typename = std::enable_if_t<std::is_same_v<LateInst, TruncFOp>>> |
| 13639 | TruncFOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 13640 | |
| 13641 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 13642 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 13643 | } |
| 13644 | |
| 13645 | RangeT getODSOperands(unsigned index) { |
| 13646 | auto valueRange = getODSOperandIndexAndLength(index); |
| 13647 | return {std::next(odsOperands.begin(), valueRange.first), |
| 13648 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 13649 | } |
| 13650 | |
| 13651 | ValueT getIn() { |
| 13652 | return (*getODSOperands(index: 0).begin()); |
| 13653 | } |
| 13654 | |
| 13655 | RangeT getOperands() { |
| 13656 | return odsOperands; |
| 13657 | } |
| 13658 | |
| 13659 | private: |
| 13660 | RangeT odsOperands; |
| 13661 | }; |
| 13662 | class TruncFOpAdaptor : public TruncFOpGenericAdaptor<::mlir::ValueRange> { |
| 13663 | public: |
| 13664 | using TruncFOpGenericAdaptor::TruncFOpGenericAdaptor; |
| 13665 | TruncFOpAdaptor(TruncFOp op); |
| 13666 | |
| 13667 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 13668 | }; |
| 13669 | class TruncFOp : public ::mlir::Op<TruncFOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::arith::ArithRoundingModeInterface::Trait, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 13670 | public: |
| 13671 | using Op::Op; |
| 13672 | using Op::print; |
| 13673 | using Adaptor = TruncFOpAdaptor; |
| 13674 | template <typename RangeT> |
| 13675 | using GenericAdaptor = TruncFOpGenericAdaptor<RangeT>; |
| 13676 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 13677 | static constexpr int odsIndex_in = 0; |
| 13678 | static constexpr int odsIndex_out = 0; |
| 13679 | using Properties = FoldAdaptor::Properties; |
| 13680 | using ::mlir::arith::ArithRoundingModeInterface::Trait<TruncFOp>::getRoundingModeAttr; |
| 13681 | using ::mlir::arith::ArithRoundingModeInterface::Trait<TruncFOp>::getRoundingModeAttrName; |
| 13682 | using ::mlir::arith::ArithFastMathInterface::Trait<TruncFOp>::getFastMathFlagsAttr; |
| 13683 | using ::mlir::arith::ArithFastMathInterface::Trait<TruncFOp>::getFastMathAttrName; |
| 13684 | using ::mlir::VectorUnrollOpInterface::Trait<TruncFOp>::getIterationShapeToUnroll; |
| 13685 | using ::mlir::VectorUnrollOpInterface::Trait<TruncFOp>::getDefaultUnrollTargetShape; |
| 13686 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 13687 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath" ), ::llvm::StringRef("roundingmode" )}; |
| 13688 | return ::llvm::ArrayRef(attrNames); |
| 13689 | } |
| 13690 | |
| 13691 | ::mlir::StringAttr getFastmathAttrName() { |
| 13692 | return getAttributeNameForIndex(index: 0); |
| 13693 | } |
| 13694 | |
| 13695 | static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { |
| 13696 | return getAttributeNameForIndex(name, index: 0); |
| 13697 | } |
| 13698 | |
| 13699 | ::mlir::StringAttr getRoundingmodeAttrName() { |
| 13700 | return getAttributeNameForIndex(index: 1); |
| 13701 | } |
| 13702 | |
| 13703 | static ::mlir::StringAttr getRoundingmodeAttrName(::mlir::OperationName name) { |
| 13704 | return getAttributeNameForIndex(name, index: 1); |
| 13705 | } |
| 13706 | |
| 13707 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 13708 | return ::llvm::StringLiteral("arith.truncf" ); |
| 13709 | } |
| 13710 | |
| 13711 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 13712 | return {index, 1}; |
| 13713 | } |
| 13714 | |
| 13715 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 13716 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 13717 | return getOperation()->getOperands().slice(n: start, m: length); |
| 13718 | } |
| 13719 | |
| 13720 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 13721 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 13722 | } |
| 13723 | |
| 13724 | ::mlir::OpOperand &getInMutable() { |
| 13725 | auto range = getODSOperandIndexAndLength(index: 0); |
| 13726 | return getOperation()->getOpOperand(idx: range.first); |
| 13727 | } |
| 13728 | |
| 13729 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 13730 | return {index, 1}; |
| 13731 | } |
| 13732 | |
| 13733 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 13734 | auto valueRange = getODSResultIndexAndLength(index); |
| 13735 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 13736 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 13737 | } |
| 13738 | |
| 13739 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 13740 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 13741 | } |
| 13742 | |
| 13743 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 13744 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 13745 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 13746 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 13747 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 13748 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 13749 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 13750 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 13751 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 13752 | ::mlir::arith::RoundingModeAttr getRoundingmodeAttr() { |
| 13753 | return ::llvm::dyn_cast_or_null<::mlir::arith::RoundingModeAttr>(Val&: getProperties().roundingmode); |
| 13754 | } |
| 13755 | |
| 13756 | ::std::optional<::mlir::arith::RoundingMode> getRoundingmode(); |
| 13757 | ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { |
| 13758 | return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(Val&: getProperties().fastmath); |
| 13759 | } |
| 13760 | |
| 13761 | ::std::optional<::mlir::arith::FastMathFlags> getFastmath(); |
| 13762 | void setRoundingmodeAttr(::mlir::arith::RoundingModeAttr attr) { |
| 13763 | getProperties().roundingmode = attr; |
| 13764 | } |
| 13765 | |
| 13766 | void setRoundingmode(::std::optional<::mlir::arith::RoundingMode> attrValue); |
| 13767 | void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { |
| 13768 | getProperties().fastmath = attr; |
| 13769 | } |
| 13770 | |
| 13771 | void setFastmath(::std::optional<::mlir::arith::FastMathFlags> attrValue); |
| 13772 | ::mlir::Attribute removeRoundingmodeAttr() { |
| 13773 | auto attr = getProperties().roundingmode; |
| 13774 | getProperties().roundingmode = {}; |
| 13775 | return attr; |
| 13776 | } |
| 13777 | |
| 13778 | ::mlir::Attribute removeFastmathAttr() { |
| 13779 | auto attr = getProperties().fastmath; |
| 13780 | getProperties().fastmath = {}; |
| 13781 | return attr; |
| 13782 | } |
| 13783 | |
| 13784 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type out, Value in); |
| 13785 | static TruncFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, Type out, Value in); |
| 13786 | static TruncFOp create(::mlir::ImplicitLocOpBuilder &builder, Type out, Value in); |
| 13787 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 13788 | static TruncFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 13789 | static TruncFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 13790 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 13791 | static TruncFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 13792 | static TruncFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::arith::RoundingModeAttr roundingmode, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); |
| 13793 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13794 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13795 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13796 | static TruncFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13797 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 13798 | static TruncFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 13799 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13800 | static TruncFOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13801 | static TruncFOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 13802 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 13803 | ::llvm::LogicalResult verifyInvariants(); |
| 13804 | ::llvm::LogicalResult verify(); |
| 13805 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 13806 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 13807 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 13808 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 13809 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 13810 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 13811 | private: |
| 13812 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 13813 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 13814 | } |
| 13815 | |
| 13816 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 13817 | assert(index < 2 && "invalid attribute index" ); |
| 13818 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 13819 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 13820 | "dependent dialect loading?" ); |
| 13821 | return name.getAttributeNames()[index]; |
| 13822 | } |
| 13823 | |
| 13824 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 13825 | public: |
| 13826 | }; |
| 13827 | |
| 13828 | } // namespace mlir::arith |
| 13829 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::TruncFOp) |
| 13830 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::TruncFOpGenericAdaptorBase::Properties) |
| 13831 | |
| 13832 | namespace mlir::arith { |
| 13833 | |
| 13834 | |
| 13835 | //===----------------------------------------------------------------------===// |
| 13836 | // ::mlir::arith::TruncIOp declarations |
| 13837 | //===----------------------------------------------------------------------===// |
| 13838 | |
| 13839 | namespace detail { |
| 13840 | |
| 13841 | class TruncIOpGenericAdaptorBase { |
| 13842 | public: |
| 13843 | struct Properties { |
| 13844 | using overflowFlagsTy = ::mlir::arith::IntegerOverflowFlagsAttr; |
| 13845 | overflowFlagsTy overflowFlags; |
| 13846 | |
| 13847 | auto getOverflowFlags() const { |
| 13848 | auto &propStorage = this->overflowFlags; |
| 13849 | return ::llvm::dyn_cast_or_null<::mlir::arith::IntegerOverflowFlagsAttr>(Val: propStorage); |
| 13850 | } |
| 13851 | void setOverflowFlags(const ::mlir::arith::IntegerOverflowFlagsAttr &propValue) { |
| 13852 | this->overflowFlags = propValue; |
| 13853 | } |
| 13854 | bool operator==(const Properties &rhs) const { |
| 13855 | return |
| 13856 | rhs.overflowFlags == this->overflowFlags && |
| 13857 | true; |
| 13858 | } |
| 13859 | bool operator!=(const Properties &rhs) const { |
| 13860 | return !(*this == rhs); |
| 13861 | } |
| 13862 | }; |
| 13863 | protected: |
| 13864 | ::mlir::DictionaryAttr odsAttrs; |
| 13865 | ::std::optional<::mlir::OperationName> odsOpName; |
| 13866 | Properties properties; |
| 13867 | ::mlir::RegionRange odsRegions; |
| 13868 | public: |
| 13869 | TruncIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 13870 | odsOpName.emplace(args: "arith.trunci" , args: odsAttrs.getContext()); |
| 13871 | } |
| 13872 | |
| 13873 | TruncIOpGenericAdaptorBase(TruncIOp op); |
| 13874 | |
| 13875 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 13876 | return {index, 1}; |
| 13877 | } |
| 13878 | |
| 13879 | const Properties &getProperties() { |
| 13880 | return properties; |
| 13881 | } |
| 13882 | |
| 13883 | ::mlir::DictionaryAttr getAttributes() { |
| 13884 | return odsAttrs; |
| 13885 | } |
| 13886 | |
| 13887 | ::mlir::arith::IntegerOverflowFlagsAttr getOverflowFlagsAttr(); |
| 13888 | ::mlir::arith::IntegerOverflowFlags getOverflowFlags(); |
| 13889 | }; |
| 13890 | |
| 13891 | } // namespace detail |
| 13892 | template <typename RangeT> |
| 13893 | class TruncIOpGenericAdaptor : public detail::TruncIOpGenericAdaptorBase { |
| 13894 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 13895 | using Base = detail::TruncIOpGenericAdaptorBase; |
| 13896 | static constexpr int odsIndex_in = 0; |
| 13897 | public: |
| 13898 | TruncIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 13899 | |
| 13900 | TruncIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : TruncIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 13901 | |
| 13902 | TruncIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : TruncIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 13903 | |
| 13904 | TruncIOpGenericAdaptor(RangeT values, const TruncIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 13905 | |
| 13906 | template <typename LateInst = TruncIOp, typename = std::enable_if_t<std::is_same_v<LateInst, TruncIOp>>> |
| 13907 | TruncIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 13908 | |
| 13909 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 13910 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 13911 | } |
| 13912 | |
| 13913 | RangeT getODSOperands(unsigned index) { |
| 13914 | auto valueRange = getODSOperandIndexAndLength(index); |
| 13915 | return {std::next(odsOperands.begin(), valueRange.first), |
| 13916 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 13917 | } |
| 13918 | |
| 13919 | ValueT getIn() { |
| 13920 | return (*getODSOperands(index: 0).begin()); |
| 13921 | } |
| 13922 | |
| 13923 | RangeT getOperands() { |
| 13924 | return odsOperands; |
| 13925 | } |
| 13926 | |
| 13927 | private: |
| 13928 | RangeT odsOperands; |
| 13929 | }; |
| 13930 | class TruncIOpAdaptor : public TruncIOpGenericAdaptor<::mlir::ValueRange> { |
| 13931 | public: |
| 13932 | using TruncIOpGenericAdaptor::TruncIOpGenericAdaptor; |
| 13933 | TruncIOpAdaptor(TruncIOp op); |
| 13934 | |
| 13935 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 13936 | }; |
| 13937 | class TruncIOp : public ::mlir::Op<TruncIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::CastOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 13938 | public: |
| 13939 | using Op::Op; |
| 13940 | using Op::print; |
| 13941 | using Adaptor = TruncIOpAdaptor; |
| 13942 | template <typename RangeT> |
| 13943 | using GenericAdaptor = TruncIOpGenericAdaptor<RangeT>; |
| 13944 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 13945 | static constexpr int odsIndex_in = 0; |
| 13946 | static constexpr int odsIndex_out = 0; |
| 13947 | using Properties = FoldAdaptor::Properties; |
| 13948 | using ::mlir::InferIntRangeInterface::Trait<TruncIOp>::inferResultRangesFromOptional; |
| 13949 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<TruncIOp>::getOverflowAttr; |
| 13950 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<TruncIOp>::hasNoUnsignedWrap; |
| 13951 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<TruncIOp>::hasNoSignedWrap; |
| 13952 | using ::mlir::arith::ArithIntegerOverflowFlagsInterface::Trait<TruncIOp>::getIntegerOverflowAttrName; |
| 13953 | using ::mlir::VectorUnrollOpInterface::Trait<TruncIOp>::getIterationShapeToUnroll; |
| 13954 | using ::mlir::VectorUnrollOpInterface::Trait<TruncIOp>::getDefaultUnrollTargetShape; |
| 13955 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 13956 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("overflowFlags" )}; |
| 13957 | return ::llvm::ArrayRef(attrNames); |
| 13958 | } |
| 13959 | |
| 13960 | ::mlir::StringAttr getOverflowFlagsAttrName() { |
| 13961 | return getAttributeNameForIndex(index: 0); |
| 13962 | } |
| 13963 | |
| 13964 | static ::mlir::StringAttr getOverflowFlagsAttrName(::mlir::OperationName name) { |
| 13965 | return getAttributeNameForIndex(name, index: 0); |
| 13966 | } |
| 13967 | |
| 13968 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 13969 | return ::llvm::StringLiteral("arith.trunci" ); |
| 13970 | } |
| 13971 | |
| 13972 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 13973 | return {index, 1}; |
| 13974 | } |
| 13975 | |
| 13976 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 13977 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 13978 | return getOperation()->getOperands().slice(n: start, m: length); |
| 13979 | } |
| 13980 | |
| 13981 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 13982 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 13983 | } |
| 13984 | |
| 13985 | ::mlir::OpOperand &getInMutable() { |
| 13986 | auto range = getODSOperandIndexAndLength(index: 0); |
| 13987 | return getOperation()->getOpOperand(idx: range.first); |
| 13988 | } |
| 13989 | |
| 13990 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 13991 | return {index, 1}; |
| 13992 | } |
| 13993 | |
| 13994 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 13995 | auto valueRange = getODSResultIndexAndLength(index); |
| 13996 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 13997 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 13998 | } |
| 13999 | |
| 14000 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 14001 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 14002 | } |
| 14003 | |
| 14004 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 14005 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 14006 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 14007 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 14008 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 14009 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 14010 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 14011 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 14012 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 14013 | ::mlir::arith::IntegerOverflowFlagsAttr getOverflowFlagsAttr() { |
| 14014 | return ::llvm::dyn_cast_or_null<::mlir::arith::IntegerOverflowFlagsAttr>(Val&: getProperties().overflowFlags); |
| 14015 | } |
| 14016 | |
| 14017 | ::mlir::arith::IntegerOverflowFlags getOverflowFlags(); |
| 14018 | void setOverflowFlagsAttr(::mlir::arith::IntegerOverflowFlagsAttr attr) { |
| 14019 | getProperties().overflowFlags = attr; |
| 14020 | } |
| 14021 | |
| 14022 | void setOverflowFlags(::mlir::arith::IntegerOverflowFlags attrValue); |
| 14023 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 14024 | static TruncIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 14025 | static TruncIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 14026 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 14027 | static TruncIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 14028 | static TruncIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::arith::IntegerOverflowFlagsAttr overflowFlags); |
| 14029 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 14030 | static TruncIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 14031 | static TruncIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 14032 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 14033 | static TruncIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 14034 | static TruncIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::arith::IntegerOverflowFlags overflowFlags = ::mlir::arith::IntegerOverflowFlags::none); |
| 14035 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 14036 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14037 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 14038 | static TruncIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14039 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 14040 | static TruncIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14041 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14042 | static TruncIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14043 | static TruncIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14044 | static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); |
| 14045 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 14046 | ::llvm::LogicalResult verifyInvariants(); |
| 14047 | ::llvm::LogicalResult verify(); |
| 14048 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 14049 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 14050 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 14051 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 14052 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 14053 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 14054 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 14055 | private: |
| 14056 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 14057 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 14058 | } |
| 14059 | |
| 14060 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 14061 | assert(index < 1 && "invalid attribute index" ); |
| 14062 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 14063 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 14064 | "dependent dialect loading?" ); |
| 14065 | return name.getAttributeNames()[index]; |
| 14066 | } |
| 14067 | |
| 14068 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 14069 | public: |
| 14070 | }; |
| 14071 | |
| 14072 | } // namespace mlir::arith |
| 14073 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::TruncIOp) |
| 14074 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::TruncIOpGenericAdaptorBase::Properties) |
| 14075 | |
| 14076 | namespace mlir::arith { |
| 14077 | |
| 14078 | |
| 14079 | //===----------------------------------------------------------------------===// |
| 14080 | // ::mlir::arith::UIToFPOp declarations |
| 14081 | //===----------------------------------------------------------------------===// |
| 14082 | |
| 14083 | namespace detail { |
| 14084 | |
| 14085 | class UIToFPOpGenericAdaptorBase { |
| 14086 | public: |
| 14087 | struct Properties { |
| 14088 | using nonNegTy = ::mlir::UnitAttr; |
| 14089 | nonNegTy nonNeg; |
| 14090 | |
| 14091 | auto getNonNeg() const { |
| 14092 | auto &propStorage = this->nonNeg; |
| 14093 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val: propStorage); |
| 14094 | } |
| 14095 | void setNonNeg(const ::mlir::UnitAttr &propValue) { |
| 14096 | this->nonNeg = propValue; |
| 14097 | } |
| 14098 | bool operator==(const Properties &rhs) const { |
| 14099 | return |
| 14100 | rhs.nonNeg == this->nonNeg && |
| 14101 | true; |
| 14102 | } |
| 14103 | bool operator!=(const Properties &rhs) const { |
| 14104 | return !(*this == rhs); |
| 14105 | } |
| 14106 | }; |
| 14107 | protected: |
| 14108 | ::mlir::DictionaryAttr odsAttrs; |
| 14109 | ::std::optional<::mlir::OperationName> odsOpName; |
| 14110 | Properties properties; |
| 14111 | ::mlir::RegionRange odsRegions; |
| 14112 | public: |
| 14113 | UIToFPOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 14114 | odsOpName.emplace(args: "arith.uitofp" , args: odsAttrs.getContext()); |
| 14115 | } |
| 14116 | |
| 14117 | UIToFPOpGenericAdaptorBase(UIToFPOp op); |
| 14118 | |
| 14119 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 14120 | return {index, 1}; |
| 14121 | } |
| 14122 | |
| 14123 | const Properties &getProperties() { |
| 14124 | return properties; |
| 14125 | } |
| 14126 | |
| 14127 | ::mlir::DictionaryAttr getAttributes() { |
| 14128 | return odsAttrs; |
| 14129 | } |
| 14130 | |
| 14131 | ::mlir::UnitAttr getNonNegAttr(); |
| 14132 | bool getNonNeg(); |
| 14133 | }; |
| 14134 | |
| 14135 | } // namespace detail |
| 14136 | template <typename RangeT> |
| 14137 | class UIToFPOpGenericAdaptor : public detail::UIToFPOpGenericAdaptorBase { |
| 14138 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 14139 | using Base = detail::UIToFPOpGenericAdaptorBase; |
| 14140 | static constexpr int odsIndex_in = 0; |
| 14141 | public: |
| 14142 | UIToFPOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 14143 | |
| 14144 | UIToFPOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : UIToFPOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 14145 | |
| 14146 | UIToFPOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : UIToFPOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 14147 | |
| 14148 | UIToFPOpGenericAdaptor(RangeT values, const UIToFPOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 14149 | |
| 14150 | template <typename LateInst = UIToFPOp, typename = std::enable_if_t<std::is_same_v<LateInst, UIToFPOp>>> |
| 14151 | UIToFPOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 14152 | |
| 14153 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 14154 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 14155 | } |
| 14156 | |
| 14157 | RangeT getODSOperands(unsigned index) { |
| 14158 | auto valueRange = getODSOperandIndexAndLength(index); |
| 14159 | return {std::next(odsOperands.begin(), valueRange.first), |
| 14160 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 14161 | } |
| 14162 | |
| 14163 | ValueT getIn() { |
| 14164 | return (*getODSOperands(index: 0).begin()); |
| 14165 | } |
| 14166 | |
| 14167 | RangeT getOperands() { |
| 14168 | return odsOperands; |
| 14169 | } |
| 14170 | |
| 14171 | private: |
| 14172 | RangeT odsOperands; |
| 14173 | }; |
| 14174 | class UIToFPOpAdaptor : public UIToFPOpGenericAdaptor<::mlir::ValueRange> { |
| 14175 | public: |
| 14176 | using UIToFPOpGenericAdaptor::UIToFPOpGenericAdaptor; |
| 14177 | UIToFPOpAdaptor(UIToFPOp op); |
| 14178 | |
| 14179 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 14180 | }; |
| 14181 | class UIToFPOp : public ::mlir::Op<UIToFPOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::arith::ArithNonNegFlagInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::CastOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable> { |
| 14182 | public: |
| 14183 | using Op::Op; |
| 14184 | using Op::print; |
| 14185 | using Adaptor = UIToFPOpAdaptor; |
| 14186 | template <typename RangeT> |
| 14187 | using GenericAdaptor = UIToFPOpGenericAdaptor<RangeT>; |
| 14188 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 14189 | static constexpr int odsIndex_in = 0; |
| 14190 | static constexpr int odsIndex_out = 0; |
| 14191 | using Properties = FoldAdaptor::Properties; |
| 14192 | using ::mlir::arith::ArithNonNegFlagInterface::Trait<UIToFPOp>::getNonNeg; |
| 14193 | using ::mlir::arith::ArithNonNegFlagInterface::Trait<UIToFPOp>::setNonNeg; |
| 14194 | using ::mlir::arith::ArithNonNegFlagInterface::Trait<UIToFPOp>::getNonNegFlagAttrName; |
| 14195 | using ::mlir::VectorUnrollOpInterface::Trait<UIToFPOp>::getIterationShapeToUnroll; |
| 14196 | using ::mlir::VectorUnrollOpInterface::Trait<UIToFPOp>::getDefaultUnrollTargetShape; |
| 14197 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 14198 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("nonNeg" )}; |
| 14199 | return ::llvm::ArrayRef(attrNames); |
| 14200 | } |
| 14201 | |
| 14202 | ::mlir::StringAttr getNonNegAttrName() { |
| 14203 | return getAttributeNameForIndex(index: 0); |
| 14204 | } |
| 14205 | |
| 14206 | static ::mlir::StringAttr getNonNegAttrName(::mlir::OperationName name) { |
| 14207 | return getAttributeNameForIndex(name, index: 0); |
| 14208 | } |
| 14209 | |
| 14210 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 14211 | return ::llvm::StringLiteral("arith.uitofp" ); |
| 14212 | } |
| 14213 | |
| 14214 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 14215 | return {index, 1}; |
| 14216 | } |
| 14217 | |
| 14218 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 14219 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 14220 | return getOperation()->getOperands().slice(n: start, m: length); |
| 14221 | } |
| 14222 | |
| 14223 | ::mlir::TypedValue<::mlir::Type> getIn() { |
| 14224 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 14225 | } |
| 14226 | |
| 14227 | ::mlir::OpOperand &getInMutable() { |
| 14228 | auto range = getODSOperandIndexAndLength(index: 0); |
| 14229 | return getOperation()->getOpOperand(idx: range.first); |
| 14230 | } |
| 14231 | |
| 14232 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 14233 | return {index, 1}; |
| 14234 | } |
| 14235 | |
| 14236 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 14237 | auto valueRange = getODSResultIndexAndLength(index); |
| 14238 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 14239 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 14240 | } |
| 14241 | |
| 14242 | ::mlir::TypedValue<::mlir::Type> getOut() { |
| 14243 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 14244 | } |
| 14245 | |
| 14246 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 14247 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 14248 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 14249 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 14250 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 14251 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 14252 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 14253 | static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 14254 | void writeProperties(::mlir::DialectBytecodeWriter &writer); |
| 14255 | ::mlir::UnitAttr getNonNegAttr() { |
| 14256 | return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(Val&: getProperties().nonNeg); |
| 14257 | } |
| 14258 | |
| 14259 | bool getNonNeg(); |
| 14260 | void setNonNegAttr(::mlir::UnitAttr attr) { |
| 14261 | getProperties().nonNeg = attr; |
| 14262 | } |
| 14263 | |
| 14264 | void setNonNeg(bool attrValue); |
| 14265 | ::mlir::Attribute removeNonNegAttr() { |
| 14266 | auto attr = getProperties().nonNeg; |
| 14267 | getProperties().nonNeg = {}; |
| 14268 | return attr; |
| 14269 | } |
| 14270 | |
| 14271 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 14272 | static UIToFPOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 14273 | static UIToFPOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 14274 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 14275 | static UIToFPOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 14276 | static UIToFPOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/::mlir::UnitAttr nonNeg); |
| 14277 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type out, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 14278 | static UIToFPOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type out, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 14279 | static UIToFPOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type out, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 14280 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 14281 | static UIToFPOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 14282 | static UIToFPOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, /*optional*/bool nonNeg = false); |
| 14283 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 14284 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14285 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 14286 | static UIToFPOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14287 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 14288 | static UIToFPOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14289 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14290 | static UIToFPOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14291 | static UIToFPOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14292 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 14293 | ::llvm::LogicalResult verifyInvariants(); |
| 14294 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 14295 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 14296 | static bool areCastCompatible(::mlir::TypeRange inputs, ::mlir::TypeRange outputs); |
| 14297 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 14298 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 14299 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 14300 | private: |
| 14301 | ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { |
| 14302 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 14303 | } |
| 14304 | |
| 14305 | static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { |
| 14306 | assert(index < 1 && "invalid attribute index" ); |
| 14307 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 14308 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 14309 | "dependent dialect loading?" ); |
| 14310 | return name.getAttributeNames()[index]; |
| 14311 | } |
| 14312 | |
| 14313 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 14314 | public: |
| 14315 | }; |
| 14316 | |
| 14317 | } // namespace mlir::arith |
| 14318 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::UIToFPOp) |
| 14319 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::detail::UIToFPOpGenericAdaptorBase::Properties) |
| 14320 | |
| 14321 | namespace mlir::arith { |
| 14322 | |
| 14323 | |
| 14324 | //===----------------------------------------------------------------------===// |
| 14325 | // ::mlir::arith::XOrIOp declarations |
| 14326 | //===----------------------------------------------------------------------===// |
| 14327 | |
| 14328 | namespace detail { |
| 14329 | |
| 14330 | class XOrIOpGenericAdaptorBase { |
| 14331 | public: |
| 14332 | using Properties = ::mlir::EmptyProperties; |
| 14333 | protected: |
| 14334 | ::mlir::DictionaryAttr odsAttrs; |
| 14335 | ::std::optional<::mlir::OperationName> odsOpName; |
| 14336 | Properties properties; |
| 14337 | ::mlir::RegionRange odsRegions; |
| 14338 | public: |
| 14339 | XOrIOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 14340 | odsOpName.emplace(args: "arith.xori" , args: odsAttrs.getContext()); |
| 14341 | } |
| 14342 | |
| 14343 | XOrIOpGenericAdaptorBase(XOrIOp op); |
| 14344 | |
| 14345 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 14346 | return {index, 1}; |
| 14347 | } |
| 14348 | |
| 14349 | const Properties &getProperties() { |
| 14350 | return properties; |
| 14351 | } |
| 14352 | |
| 14353 | ::mlir::DictionaryAttr getAttributes() { |
| 14354 | return odsAttrs; |
| 14355 | } |
| 14356 | |
| 14357 | }; |
| 14358 | |
| 14359 | } // namespace detail |
| 14360 | template <typename RangeT> |
| 14361 | class XOrIOpGenericAdaptor : public detail::XOrIOpGenericAdaptorBase { |
| 14362 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 14363 | using Base = detail::XOrIOpGenericAdaptorBase; |
| 14364 | static constexpr int odsIndex_lhs = 0; |
| 14365 | static constexpr int odsIndex_rhs = 1; |
| 14366 | public: |
| 14367 | XOrIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 14368 | |
| 14369 | XOrIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : XOrIOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 14370 | |
| 14371 | XOrIOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : XOrIOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 14372 | |
| 14373 | XOrIOpGenericAdaptor(RangeT values, const XOrIOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 14374 | |
| 14375 | template <typename LateInst = XOrIOp, typename = std::enable_if_t<std::is_same_v<LateInst, XOrIOp>>> |
| 14376 | XOrIOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 14377 | |
| 14378 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 14379 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 14380 | } |
| 14381 | |
| 14382 | RangeT getODSOperands(unsigned index) { |
| 14383 | auto valueRange = getODSOperandIndexAndLength(index); |
| 14384 | return {std::next(odsOperands.begin(), valueRange.first), |
| 14385 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 14386 | } |
| 14387 | |
| 14388 | ValueT getLhs() { |
| 14389 | return (*getODSOperands(index: 0).begin()); |
| 14390 | } |
| 14391 | |
| 14392 | ValueT getRhs() { |
| 14393 | return (*getODSOperands(index: 1).begin()); |
| 14394 | } |
| 14395 | |
| 14396 | RangeT getOperands() { |
| 14397 | return odsOperands; |
| 14398 | } |
| 14399 | |
| 14400 | private: |
| 14401 | RangeT odsOperands; |
| 14402 | }; |
| 14403 | class XOrIOpAdaptor : public XOrIOpGenericAdaptor<::mlir::ValueRange> { |
| 14404 | public: |
| 14405 | using XOrIOpGenericAdaptor::XOrIOpGenericAdaptor; |
| 14406 | XOrIOpAdaptor(XOrIOp op); |
| 14407 | |
| 14408 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 14409 | }; |
| 14410 | class XOrIOp : public ::mlir::Op<XOrIOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::OpTrait::IsCommutative, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 14411 | public: |
| 14412 | using Op::Op; |
| 14413 | using Op::print; |
| 14414 | using Adaptor = XOrIOpAdaptor; |
| 14415 | template <typename RangeT> |
| 14416 | using GenericAdaptor = XOrIOpGenericAdaptor<RangeT>; |
| 14417 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 14418 | static constexpr int odsIndex_lhs = 0; |
| 14419 | static constexpr int odsIndex_rhs = 1; |
| 14420 | static constexpr int odsIndex_result = 0; |
| 14421 | using Properties = FoldAdaptor::Properties; |
| 14422 | using ::mlir::InferIntRangeInterface::Trait<XOrIOp>::inferResultRangesFromOptional; |
| 14423 | using ::mlir::VectorUnrollOpInterface::Trait<XOrIOp>::getIterationShapeToUnroll; |
| 14424 | using ::mlir::VectorUnrollOpInterface::Trait<XOrIOp>::getDefaultUnrollTargetShape; |
| 14425 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 14426 | return {}; |
| 14427 | } |
| 14428 | |
| 14429 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 14430 | return ::llvm::StringLiteral("arith.xori" ); |
| 14431 | } |
| 14432 | |
| 14433 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 14434 | return {index, 1}; |
| 14435 | } |
| 14436 | |
| 14437 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 14438 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 14439 | return getOperation()->getOperands().slice(n: start, m: length); |
| 14440 | } |
| 14441 | |
| 14442 | ::mlir::TypedValue<::mlir::Type> getLhs() { |
| 14443 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 14444 | } |
| 14445 | |
| 14446 | ::mlir::TypedValue<::mlir::Type> getRhs() { |
| 14447 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 14448 | } |
| 14449 | |
| 14450 | ::mlir::OpOperand &getLhsMutable() { |
| 14451 | auto range = getODSOperandIndexAndLength(index: 0); |
| 14452 | return getOperation()->getOpOperand(idx: range.first); |
| 14453 | } |
| 14454 | |
| 14455 | ::mlir::OpOperand &getRhsMutable() { |
| 14456 | auto range = getODSOperandIndexAndLength(index: 1); |
| 14457 | return getOperation()->getOpOperand(idx: range.first); |
| 14458 | } |
| 14459 | |
| 14460 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 14461 | return {index, 1}; |
| 14462 | } |
| 14463 | |
| 14464 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 14465 | auto valueRange = getODSResultIndexAndLength(index); |
| 14466 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 14467 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 14468 | } |
| 14469 | |
| 14470 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 14471 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 14472 | } |
| 14473 | |
| 14474 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 14475 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 14476 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 14477 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 14478 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 14479 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 14480 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 14481 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 14482 | static XOrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 14483 | static XOrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); |
| 14484 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); |
| 14485 | static XOrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); |
| 14486 | static XOrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); |
| 14487 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 14488 | static XOrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 14489 | static XOrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); |
| 14490 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14491 | static XOrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14492 | static XOrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14493 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14494 | static XOrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14495 | static XOrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14496 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14497 | static XOrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14498 | static XOrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14499 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14500 | static XOrIOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14501 | static XOrIOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14502 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 14503 | ::llvm::LogicalResult verifyInvariants(); |
| 14504 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 14505 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 14506 | 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); |
| 14507 | void inferResultRanges(::llvm::ArrayRef<::mlir::ConstantIntRanges> argRanges, ::mlir::SetIntRangeFn setResultRanges); |
| 14508 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 14509 | LLVM_ATTRIBUTE_MINSIZE void print(::mlir::OpAsmPrinter &_odsPrinter); |
| 14510 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 14511 | public: |
| 14512 | }; |
| 14513 | |
| 14514 | } // namespace mlir::arith |
| 14515 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::XOrIOp) |
| 14516 | |
| 14517 | namespace mlir::arith { |
| 14518 | |
| 14519 | |
| 14520 | //===----------------------------------------------------------------------===// |
| 14521 | // ::mlir::arith::SelectOp declarations |
| 14522 | //===----------------------------------------------------------------------===// |
| 14523 | |
| 14524 | namespace detail { |
| 14525 | |
| 14526 | class SelectOpGenericAdaptorBase { |
| 14527 | public: |
| 14528 | using Properties = ::mlir::EmptyProperties; |
| 14529 | protected: |
| 14530 | ::mlir::DictionaryAttr odsAttrs; |
| 14531 | ::std::optional<::mlir::OperationName> odsOpName; |
| 14532 | Properties properties; |
| 14533 | ::mlir::RegionRange odsRegions; |
| 14534 | public: |
| 14535 | SelectOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 14536 | odsOpName.emplace(args: "arith.select" , args: odsAttrs.getContext()); |
| 14537 | } |
| 14538 | |
| 14539 | SelectOpGenericAdaptorBase(SelectOp op); |
| 14540 | |
| 14541 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 14542 | return {index, 1}; |
| 14543 | } |
| 14544 | |
| 14545 | const Properties &getProperties() { |
| 14546 | return properties; |
| 14547 | } |
| 14548 | |
| 14549 | ::mlir::DictionaryAttr getAttributes() { |
| 14550 | return odsAttrs; |
| 14551 | } |
| 14552 | |
| 14553 | }; |
| 14554 | |
| 14555 | } // namespace detail |
| 14556 | template <typename RangeT> |
| 14557 | class SelectOpGenericAdaptor : public detail::SelectOpGenericAdaptorBase { |
| 14558 | using ValueT = ::llvm::detail::ValueOfRange<RangeT>; |
| 14559 | using Base = detail::SelectOpGenericAdaptorBase; |
| 14560 | static constexpr int odsIndex_condition = 0; |
| 14561 | static constexpr int odsIndex_true_value = 1; |
| 14562 | static constexpr int odsIndex_false_value = 2; |
| 14563 | public: |
| 14564 | SelectOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 14565 | |
| 14566 | SelectOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : SelectOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 14567 | |
| 14568 | SelectOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : SelectOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 14569 | |
| 14570 | SelectOpGenericAdaptor(RangeT values, const SelectOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 14571 | |
| 14572 | template <typename LateInst = SelectOp, typename = std::enable_if_t<std::is_same_v<LateInst, SelectOp>>> |
| 14573 | SelectOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 14574 | |
| 14575 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 14576 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 14577 | } |
| 14578 | |
| 14579 | RangeT getODSOperands(unsigned index) { |
| 14580 | auto valueRange = getODSOperandIndexAndLength(index); |
| 14581 | return {std::next(odsOperands.begin(), valueRange.first), |
| 14582 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 14583 | } |
| 14584 | |
| 14585 | ValueT getCondition() { |
| 14586 | return (*getODSOperands(index: 0).begin()); |
| 14587 | } |
| 14588 | |
| 14589 | ValueT getTrueValue() { |
| 14590 | return (*getODSOperands(index: 1).begin()); |
| 14591 | } |
| 14592 | |
| 14593 | ValueT getFalseValue() { |
| 14594 | return (*getODSOperands(index: 2).begin()); |
| 14595 | } |
| 14596 | |
| 14597 | RangeT getOperands() { |
| 14598 | return odsOperands; |
| 14599 | } |
| 14600 | |
| 14601 | private: |
| 14602 | RangeT odsOperands; |
| 14603 | }; |
| 14604 | class SelectOpAdaptor : public SelectOpGenericAdaptor<::mlir::ValueRange> { |
| 14605 | public: |
| 14606 | using SelectOpGenericAdaptor::SelectOpGenericAdaptor; |
| 14607 | SelectOpAdaptor(SelectOp op); |
| 14608 | |
| 14609 | ::llvm::LogicalResult verify(::mlir::Location loc); |
| 14610 | }; |
| 14611 | class SelectOp : public ::mlir::Op<SelectOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<3>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::InferIntDivisibilityOpInterface::Trait, ::mlir::InferIntRangeInterface::Trait, ::mlir::SelectLikeOpInterface::Trait, ::mlir::VectorUnrollOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::Scalarizable, ::mlir::OpTrait::Vectorizable, ::mlir::OpTrait::Tensorizable, ::mlir::InferTypeOpInterface::Trait> { |
| 14612 | public: |
| 14613 | using Op::Op; |
| 14614 | using Op::print; |
| 14615 | using Adaptor = SelectOpAdaptor; |
| 14616 | template <typename RangeT> |
| 14617 | using GenericAdaptor = SelectOpGenericAdaptor<RangeT>; |
| 14618 | using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 14619 | static constexpr int odsIndex_condition = 0; |
| 14620 | static constexpr int odsIndex_true_value = 1; |
| 14621 | static constexpr int odsIndex_false_value = 2; |
| 14622 | static constexpr int odsIndex_result = 0; |
| 14623 | using Properties = FoldAdaptor::Properties; |
| 14624 | using ::mlir::InferIntRangeInterface::Trait<SelectOp>::inferResultRanges; |
| 14625 | using ::mlir::VectorUnrollOpInterface::Trait<SelectOp>::getIterationShapeToUnroll; |
| 14626 | using ::mlir::VectorUnrollOpInterface::Trait<SelectOp>::getDefaultUnrollTargetShape; |
| 14627 | static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { |
| 14628 | return {}; |
| 14629 | } |
| 14630 | |
| 14631 | static constexpr ::llvm::StringLiteral getOperationName() { |
| 14632 | return ::llvm::StringLiteral("arith.select" ); |
| 14633 | } |
| 14634 | |
| 14635 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 14636 | return {index, 1}; |
| 14637 | } |
| 14638 | |
| 14639 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 14640 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 14641 | return getOperation()->getOperands().slice(n: start, m: length); |
| 14642 | } |
| 14643 | |
| 14644 | ::mlir::TypedValue<::mlir::Type> getCondition() { |
| 14645 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 14646 | } |
| 14647 | |
| 14648 | ::mlir::TypedValue<::mlir::Type> getTrueValue() { |
| 14649 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 1).begin()); |
| 14650 | } |
| 14651 | |
| 14652 | ::mlir::TypedValue<::mlir::Type> getFalseValue() { |
| 14653 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 2).begin()); |
| 14654 | } |
| 14655 | |
| 14656 | ::mlir::OpOperand &getConditionMutable() { |
| 14657 | auto range = getODSOperandIndexAndLength(index: 0); |
| 14658 | return getOperation()->getOpOperand(idx: range.first); |
| 14659 | } |
| 14660 | |
| 14661 | ::mlir::OpOperand &getTrueValueMutable() { |
| 14662 | auto range = getODSOperandIndexAndLength(index: 1); |
| 14663 | return getOperation()->getOpOperand(idx: range.first); |
| 14664 | } |
| 14665 | |
| 14666 | ::mlir::OpOperand &getFalseValueMutable() { |
| 14667 | auto range = getODSOperandIndexAndLength(index: 2); |
| 14668 | return getOperation()->getOpOperand(idx: range.first); |
| 14669 | } |
| 14670 | |
| 14671 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 14672 | return {index, 1}; |
| 14673 | } |
| 14674 | |
| 14675 | ::mlir::Operation::result_range getODSResults(unsigned index) { |
| 14676 | auto valueRange = getODSResultIndexAndLength(index); |
| 14677 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 14678 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 14679 | } |
| 14680 | |
| 14681 | ::mlir::TypedValue<::mlir::Type> getResult() { |
| 14682 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSResults(index: 0).begin()); |
| 14683 | } |
| 14684 | |
| 14685 | static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 14686 | static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); |
| 14687 | static llvm::hash_code computePropertiesHash(const Properties &prop); |
| 14688 | static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 14689 | static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 14690 | static void walkInherentAttrs(::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 14691 | static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 14692 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value condition, ::mlir::Value true_value, ::mlir::Value false_value); |
| 14693 | static SelectOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value condition, ::mlir::Value true_value, ::mlir::Value false_value); |
| 14694 | static SelectOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value condition, ::mlir::Value true_value, ::mlir::Value false_value); |
| 14695 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value condition, ::mlir::Value true_value, ::mlir::Value false_value); |
| 14696 | static SelectOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value condition, ::mlir::Value true_value, ::mlir::Value false_value); |
| 14697 | static SelectOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value condition, ::mlir::Value true_value, ::mlir::Value false_value); |
| 14698 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value condition, ::mlir::Value true_value, ::mlir::Value false_value); |
| 14699 | static SelectOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value condition, ::mlir::Value true_value, ::mlir::Value false_value); |
| 14700 | static SelectOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value condition, ::mlir::Value true_value, ::mlir::Value false_value); |
| 14701 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14702 | static SelectOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14703 | static SelectOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14704 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14705 | static SelectOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14706 | static SelectOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 14707 | static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14708 | static SelectOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14709 | static SelectOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14710 | static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14711 | static SelectOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14712 | static SelectOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 14713 | static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 14714 | void print(::mlir::OpAsmPrinter &p); |
| 14715 | ::llvm::LogicalResult verifyInvariantsImpl(); |
| 14716 | ::llvm::LogicalResult verifyInvariants(); |
| 14717 | ::llvm::LogicalResult verify(); |
| 14718 | static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); |
| 14719 | ::mlir::OpFoldResult fold(FoldAdaptor adaptor); |
| 14720 | 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); |
| 14721 | void inferResultDivisibility(::llvm::ArrayRef<::mlir::IntegerDivisibility> argDivs, ::mlir::SetIntDivisibilityFn setResultDivs); |
| 14722 | void inferResultRangesFromOptional(::llvm::ArrayRef<::mlir::IntegerValueRange> argRanges, ::mlir::SetIntLatticeFn setResultRanges); |
| 14723 | static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 14724 | void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); |
| 14725 | public: |
| 14726 | }; |
| 14727 | |
| 14728 | } // namespace mlir::arith |
| 14729 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::arith::SelectOp) |
| 14730 | |
| 14731 | |
| 14732 | #endif // GET_OP_CLASSES |
| 14733 | |
| 14734 | |