| 1 | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
| 2 | |* *| |
| 3 | |* Enum Utility Declarations *| |
| 4 | |* *| |
| 5 | |* Automatically generated file, do not edit! *| |
| 6 | |* From: LLVMOps.td *| |
| 7 | |* *| |
| 8 | \*===----------------------------------------------------------------------===*/ |
| 9 | |
| 10 | #include "llvm/ADT/DenseMapInfo.h" |
| 11 | #include "llvm/ADT/StringRef.h" |
| 12 | #include "llvm/ADT/bit.h" |
| 13 | #include "llvm/Support/raw_ostream.h" |
| 14 | #include "mlir/IR/BuiltinAttributes.h" |
| 15 | #include "mlir/Support/LLVM.h" |
| 16 | |
| 17 | |
| 18 | namespace mlir { |
| 19 | class AsmParser; |
| 20 | |
| 21 | template <typename T, typename> |
| 22 | struct FieldParser; |
| 23 | } // namespace mlir |
| 24 | namespace mlir::LLVM { |
| 25 | |
| 26 | // ATT (0) or Intel (1) asm dialect |
| 27 | enum class AsmDialect : uint64_t { |
| 28 | AD_ATT = 0, |
| 29 | AD_Intel = 1, |
| 30 | }; |
| 31 | |
| 32 | ::std::optional<AsmDialect> symbolizeAsmDialect(uint64_t); |
| 33 | ::llvm::StringRef stringifyAsmDialect(AsmDialect); |
| 34 | ::std::optional<AsmDialect> symbolizeAsmDialect(::llvm::StringRef); |
| 35 | inline constexpr unsigned getMaxEnumValForAsmDialect() { |
| 36 | return 1; |
| 37 | } |
| 38 | |
| 39 | |
| 40 | inline ::llvm::StringRef stringifyEnum(AsmDialect enumValue) { |
| 41 | return stringifyAsmDialect(enumValue); |
| 42 | } |
| 43 | |
| 44 | template <typename EnumType> |
| 45 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 46 | |
| 47 | template <> |
| 48 | inline ::std::optional<AsmDialect> symbolizeEnum<AsmDialect>(::llvm::StringRef str) { |
| 49 | return symbolizeAsmDialect(str); |
| 50 | } |
| 51 | |
| 52 | class AsmDialectAttr : public ::mlir::IntegerAttr { |
| 53 | public: |
| 54 | using ValueType = AsmDialect; |
| 55 | using ::mlir::IntegerAttr::IntegerAttr; |
| 56 | static bool classof(::mlir::Attribute attr); |
| 57 | static AsmDialectAttr get(::mlir::MLIRContext *context, AsmDialect val); |
| 58 | AsmDialect getValue() const; |
| 59 | }; |
| 60 | |
| 61 | } // namespace mlir::LLVM |
| 62 | |
| 63 | namespace mlir { |
| 64 | template<> |
| 65 | struct FieldParser<::mlir::LLVM::AsmDialect, ::mlir::LLVM::AsmDialect> { |
| 66 | static FailureOr<::mlir::LLVM::AsmDialect> parse(AsmParser &parser); |
| 67 | }; |
| 68 | |
| 69 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 70 | /// used as: |
| 71 | /// |
| 72 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 73 | template<> |
| 74 | struct FieldParser<std::optional<::mlir::LLVM::AsmDialect>, std::optional<::mlir::LLVM::AsmDialect>> { |
| 75 | static constexpr bool isKeyValueCompositional = false; |
| 76 | |
| 77 | static FailureOr<std::optional<::mlir::LLVM::AsmDialect>> parse(AsmParser &parser); |
| 78 | }; |
| 79 | } // namespace mlir |
| 80 | |
| 81 | namespace llvm { |
| 82 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::AsmDialect value) { |
| 83 | auto valueStr = stringifyEnum(enumValue: value); |
| 84 | return p << valueStr; |
| 85 | } |
| 86 | } // namespace llvm |
| 87 | |
| 88 | namespace llvm { |
| 89 | template<> struct DenseMapInfo<::mlir::LLVM::AsmDialect> { |
| 90 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 91 | |
| 92 | static unsigned getHashValue(const ::mlir::LLVM::AsmDialect &val) { |
| 93 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 94 | } |
| 95 | |
| 96 | static bool isEqual(const ::mlir::LLVM::AsmDialect &lhs, const ::mlir::LLVM::AsmDialect &rhs) { |
| 97 | return lhs == rhs; |
| 98 | } |
| 99 | }; |
| 100 | } |
| 101 | |
| 102 | namespace mlir::LLVM { |
| 103 | |
| 104 | // llvm.atomicrmw binary operations |
| 105 | enum class AtomicBinOp : uint64_t { |
| 106 | xchg = 0, |
| 107 | add = 1, |
| 108 | sub = 2, |
| 109 | _and = 3, |
| 110 | nand = 4, |
| 111 | _or = 5, |
| 112 | _xor = 6, |
| 113 | max = 7, |
| 114 | min = 8, |
| 115 | umax = 9, |
| 116 | umin = 10, |
| 117 | fadd = 11, |
| 118 | fsub = 12, |
| 119 | fmax = 13, |
| 120 | fmin = 14, |
| 121 | uinc_wrap = 15, |
| 122 | udec_wrap = 16, |
| 123 | usub_cond = 17, |
| 124 | usub_sat = 18, |
| 125 | fmaximum = 19, |
| 126 | fminimum = 20, |
| 127 | fmaximumnum = 21, |
| 128 | fminimumnum = 22, |
| 129 | }; |
| 130 | |
| 131 | ::std::optional<AtomicBinOp> symbolizeAtomicBinOp(uint64_t); |
| 132 | ::llvm::StringRef stringifyAtomicBinOp(AtomicBinOp); |
| 133 | ::std::optional<AtomicBinOp> symbolizeAtomicBinOp(::llvm::StringRef); |
| 134 | inline constexpr unsigned getMaxEnumValForAtomicBinOp() { |
| 135 | return 22; |
| 136 | } |
| 137 | |
| 138 | |
| 139 | inline ::llvm::StringRef stringifyEnum(AtomicBinOp enumValue) { |
| 140 | return stringifyAtomicBinOp(enumValue); |
| 141 | } |
| 142 | |
| 143 | template <typename EnumType> |
| 144 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 145 | |
| 146 | template <> |
| 147 | inline ::std::optional<AtomicBinOp> symbolizeEnum<AtomicBinOp>(::llvm::StringRef str) { |
| 148 | return symbolizeAtomicBinOp(str); |
| 149 | } |
| 150 | |
| 151 | class AtomicBinOpAttr : public ::mlir::IntegerAttr { |
| 152 | public: |
| 153 | using ValueType = AtomicBinOp; |
| 154 | using ::mlir::IntegerAttr::IntegerAttr; |
| 155 | static bool classof(::mlir::Attribute attr); |
| 156 | static AtomicBinOpAttr get(::mlir::MLIRContext *context, AtomicBinOp val); |
| 157 | AtomicBinOp getValue() const; |
| 158 | }; |
| 159 | |
| 160 | } // namespace mlir::LLVM |
| 161 | |
| 162 | namespace mlir { |
| 163 | template<> |
| 164 | struct FieldParser<::mlir::LLVM::AtomicBinOp, ::mlir::LLVM::AtomicBinOp> { |
| 165 | static FailureOr<::mlir::LLVM::AtomicBinOp> parse(AsmParser &parser); |
| 166 | }; |
| 167 | |
| 168 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 169 | /// used as: |
| 170 | /// |
| 171 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 172 | template<> |
| 173 | struct FieldParser<std::optional<::mlir::LLVM::AtomicBinOp>, std::optional<::mlir::LLVM::AtomicBinOp>> { |
| 174 | static constexpr bool isKeyValueCompositional = false; |
| 175 | |
| 176 | static FailureOr<std::optional<::mlir::LLVM::AtomicBinOp>> parse(AsmParser &parser); |
| 177 | }; |
| 178 | } // namespace mlir |
| 179 | |
| 180 | namespace llvm { |
| 181 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::AtomicBinOp value) { |
| 182 | auto valueStr = stringifyEnum(enumValue: value); |
| 183 | return p << valueStr; |
| 184 | } |
| 185 | } // namespace llvm |
| 186 | |
| 187 | namespace llvm { |
| 188 | template<> struct DenseMapInfo<::mlir::LLVM::AtomicBinOp> { |
| 189 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 190 | |
| 191 | static unsigned getHashValue(const ::mlir::LLVM::AtomicBinOp &val) { |
| 192 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 193 | } |
| 194 | |
| 195 | static bool isEqual(const ::mlir::LLVM::AtomicBinOp &lhs, const ::mlir::LLVM::AtomicBinOp &rhs) { |
| 196 | return lhs == rhs; |
| 197 | } |
| 198 | }; |
| 199 | } |
| 200 | |
| 201 | namespace mlir::LLVM { |
| 202 | |
| 203 | // Atomic ordering for LLVM's memory model |
| 204 | enum class AtomicOrdering : uint64_t { |
| 205 | not_atomic = 0, |
| 206 | unordered = 1, |
| 207 | monotonic = 2, |
| 208 | acquire = 4, |
| 209 | release = 5, |
| 210 | acq_rel = 6, |
| 211 | seq_cst = 7, |
| 212 | }; |
| 213 | |
| 214 | ::std::optional<AtomicOrdering> symbolizeAtomicOrdering(uint64_t); |
| 215 | ::llvm::StringRef stringifyAtomicOrdering(AtomicOrdering); |
| 216 | ::std::optional<AtomicOrdering> symbolizeAtomicOrdering(::llvm::StringRef); |
| 217 | inline constexpr unsigned getMaxEnumValForAtomicOrdering() { |
| 218 | return 7; |
| 219 | } |
| 220 | |
| 221 | |
| 222 | inline ::llvm::StringRef stringifyEnum(AtomicOrdering enumValue) { |
| 223 | return stringifyAtomicOrdering(enumValue); |
| 224 | } |
| 225 | |
| 226 | template <typename EnumType> |
| 227 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 228 | |
| 229 | template <> |
| 230 | inline ::std::optional<AtomicOrdering> symbolizeEnum<AtomicOrdering>(::llvm::StringRef str) { |
| 231 | return symbolizeAtomicOrdering(str); |
| 232 | } |
| 233 | |
| 234 | class AtomicOrderingAttr : public ::mlir::IntegerAttr { |
| 235 | public: |
| 236 | using ValueType = AtomicOrdering; |
| 237 | using ::mlir::IntegerAttr::IntegerAttr; |
| 238 | static bool classof(::mlir::Attribute attr); |
| 239 | static AtomicOrderingAttr get(::mlir::MLIRContext *context, AtomicOrdering val); |
| 240 | AtomicOrdering getValue() const; |
| 241 | }; |
| 242 | |
| 243 | } // namespace mlir::LLVM |
| 244 | |
| 245 | namespace mlir { |
| 246 | template<> |
| 247 | struct FieldParser<::mlir::LLVM::AtomicOrdering, ::mlir::LLVM::AtomicOrdering> { |
| 248 | static FailureOr<::mlir::LLVM::AtomicOrdering> parse(AsmParser &parser); |
| 249 | }; |
| 250 | |
| 251 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 252 | /// used as: |
| 253 | /// |
| 254 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 255 | template<> |
| 256 | struct FieldParser<std::optional<::mlir::LLVM::AtomicOrdering>, std::optional<::mlir::LLVM::AtomicOrdering>> { |
| 257 | static constexpr bool isKeyValueCompositional = false; |
| 258 | |
| 259 | static FailureOr<std::optional<::mlir::LLVM::AtomicOrdering>> parse(AsmParser &parser); |
| 260 | }; |
| 261 | } // namespace mlir |
| 262 | |
| 263 | namespace llvm { |
| 264 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::AtomicOrdering value) { |
| 265 | auto valueStr = stringifyEnum(enumValue: value); |
| 266 | return p << valueStr; |
| 267 | } |
| 268 | } // namespace llvm |
| 269 | |
| 270 | namespace llvm { |
| 271 | template<> struct DenseMapInfo<::mlir::LLVM::AtomicOrdering> { |
| 272 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 273 | |
| 274 | static unsigned getHashValue(const ::mlir::LLVM::AtomicOrdering &val) { |
| 275 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 276 | } |
| 277 | |
| 278 | static bool isEqual(const ::mlir::LLVM::AtomicOrdering &lhs, const ::mlir::LLVM::AtomicOrdering &rhs) { |
| 279 | return lhs == rhs; |
| 280 | } |
| 281 | }; |
| 282 | } |
| 283 | |
| 284 | namespace mlir::LLVM::cconv { |
| 285 | |
| 286 | // Calling Conventions |
| 287 | enum class CConv : uint64_t { |
| 288 | C = 0, |
| 289 | Fast = 8, |
| 290 | Cold = 9, |
| 291 | GHC = 10, |
| 292 | HiPE = 11, |
| 293 | AnyReg = 13, |
| 294 | PreserveMost = 14, |
| 295 | PreserveAll = 15, |
| 296 | Swift = 16, |
| 297 | CXX_FAST_TLS = 17, |
| 298 | Tail = 18, |
| 299 | CFGuard_Check = 19, |
| 300 | SwiftTail = 20, |
| 301 | PreserveNone = 21, |
| 302 | X86_StdCall = 64, |
| 303 | X86_FastCall = 65, |
| 304 | ARM_APCS = 66, |
| 305 | ARM_AAPCS = 67, |
| 306 | ARM_AAPCS_VFP = 68, |
| 307 | MSP430_INTR = 69, |
| 308 | X86_ThisCall = 70, |
| 309 | PTX_Kernel = 71, |
| 310 | PTX_Device = 72, |
| 311 | SPIR_FUNC = 75, |
| 312 | SPIR_KERNEL = 76, |
| 313 | Intel_OCL_BI = 77, |
| 314 | X86_64_SysV = 78, |
| 315 | Win64 = 79, |
| 316 | X86_VectorCall = 80, |
| 317 | DUMMY_HHVM = 81, |
| 318 | DUMMY_HHVM_C = 82, |
| 319 | X86_INTR = 83, |
| 320 | AVR_INTR = 84, |
| 321 | AVR_BUILTIN = 86, |
| 322 | AMDGPU_VS = 87, |
| 323 | AMDGPU_GS = 88, |
| 324 | AMDGPU_CS = 90, |
| 325 | AMDGPU_KERNEL = 91, |
| 326 | X86_RegCall = 92, |
| 327 | AMDGPU_HS = 93, |
| 328 | MSP430_BUILTIN = 94, |
| 329 | AMDGPU_LS = 95, |
| 330 | AMDGPU_ES = 96, |
| 331 | AArch64_VectorCall = 97, |
| 332 | AArch64_SVE_VectorCall = 98, |
| 333 | WASM_EmscriptenInvoke = 99, |
| 334 | AMDGPU_Gfx = 100, |
| 335 | M68k_INTR = 101, |
| 336 | }; |
| 337 | |
| 338 | ::std::optional<CConv> symbolizeCConv(uint64_t); |
| 339 | ::llvm::StringRef stringifyCConv(CConv); |
| 340 | ::std::optional<CConv> symbolizeCConv(::llvm::StringRef); |
| 341 | inline constexpr unsigned getMaxEnumValForCConv() { |
| 342 | return 101; |
| 343 | } |
| 344 | |
| 345 | |
| 346 | inline ::llvm::StringRef stringifyEnum(CConv enumValue) { |
| 347 | return stringifyCConv(enumValue); |
| 348 | } |
| 349 | |
| 350 | template <typename EnumType> |
| 351 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 352 | |
| 353 | template <> |
| 354 | inline ::std::optional<CConv> symbolizeEnum<CConv>(::llvm::StringRef str) { |
| 355 | return symbolizeCConv(str); |
| 356 | } |
| 357 | |
| 358 | class CConvAttr : public ::mlir::IntegerAttr { |
| 359 | public: |
| 360 | using ValueType = CConv; |
| 361 | using ::mlir::IntegerAttr::IntegerAttr; |
| 362 | static bool classof(::mlir::Attribute attr); |
| 363 | static CConvAttr get(::mlir::MLIRContext *context, CConv val); |
| 364 | CConv getValue() const; |
| 365 | }; |
| 366 | |
| 367 | } // namespace mlir::LLVM::cconv |
| 368 | |
| 369 | namespace mlir { |
| 370 | template<> |
| 371 | struct FieldParser<::mlir::LLVM::cconv::CConv, ::mlir::LLVM::cconv::CConv> { |
| 372 | static FailureOr<::mlir::LLVM::cconv::CConv> parse(AsmParser &parser); |
| 373 | }; |
| 374 | |
| 375 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 376 | /// used as: |
| 377 | /// |
| 378 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 379 | template<> |
| 380 | struct FieldParser<std::optional<::mlir::LLVM::cconv::CConv>, std::optional<::mlir::LLVM::cconv::CConv>> { |
| 381 | static constexpr bool isKeyValueCompositional = false; |
| 382 | |
| 383 | static FailureOr<std::optional<::mlir::LLVM::cconv::CConv>> parse(AsmParser &parser); |
| 384 | }; |
| 385 | } // namespace mlir |
| 386 | |
| 387 | namespace llvm { |
| 388 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::cconv::CConv value) { |
| 389 | auto valueStr = stringifyEnum(enumValue: value); |
| 390 | return p << valueStr; |
| 391 | } |
| 392 | } // namespace llvm |
| 393 | |
| 394 | namespace llvm { |
| 395 | template<> struct DenseMapInfo<::mlir::LLVM::cconv::CConv> { |
| 396 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 397 | |
| 398 | static unsigned getHashValue(const ::mlir::LLVM::cconv::CConv &val) { |
| 399 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 400 | } |
| 401 | |
| 402 | static bool isEqual(const ::mlir::LLVM::cconv::CConv &lhs, const ::mlir::LLVM::cconv::CConv &rhs) { |
| 403 | return lhs == rhs; |
| 404 | } |
| 405 | }; |
| 406 | } |
| 407 | |
| 408 | namespace mlir::LLVM::comdat { |
| 409 | |
| 410 | // LLVM Comdat Types |
| 411 | enum class Comdat : uint64_t { |
| 412 | Any = 0, |
| 413 | ExactMatch = 1, |
| 414 | Largest = 2, |
| 415 | NoDeduplicate = 3, |
| 416 | SameSize = 4, |
| 417 | }; |
| 418 | |
| 419 | ::std::optional<Comdat> symbolizeComdat(uint64_t); |
| 420 | ::llvm::StringRef stringifyComdat(Comdat); |
| 421 | ::std::optional<Comdat> symbolizeComdat(::llvm::StringRef); |
| 422 | inline constexpr unsigned getMaxEnumValForComdat() { |
| 423 | return 4; |
| 424 | } |
| 425 | |
| 426 | |
| 427 | inline ::llvm::StringRef stringifyEnum(Comdat enumValue) { |
| 428 | return stringifyComdat(enumValue); |
| 429 | } |
| 430 | |
| 431 | template <typename EnumType> |
| 432 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 433 | |
| 434 | template <> |
| 435 | inline ::std::optional<Comdat> symbolizeEnum<Comdat>(::llvm::StringRef str) { |
| 436 | return symbolizeComdat(str); |
| 437 | } |
| 438 | |
| 439 | class ComdatAttr : public ::mlir::IntegerAttr { |
| 440 | public: |
| 441 | using ValueType = Comdat; |
| 442 | using ::mlir::IntegerAttr::IntegerAttr; |
| 443 | static bool classof(::mlir::Attribute attr); |
| 444 | static ComdatAttr get(::mlir::MLIRContext *context, Comdat val); |
| 445 | Comdat getValue() const; |
| 446 | }; |
| 447 | |
| 448 | } // namespace mlir::LLVM::comdat |
| 449 | |
| 450 | namespace mlir { |
| 451 | template<> |
| 452 | struct FieldParser<::mlir::LLVM::comdat::Comdat, ::mlir::LLVM::comdat::Comdat> { |
| 453 | static FailureOr<::mlir::LLVM::comdat::Comdat> parse(AsmParser &parser); |
| 454 | }; |
| 455 | |
| 456 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 457 | /// used as: |
| 458 | /// |
| 459 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 460 | template<> |
| 461 | struct FieldParser<std::optional<::mlir::LLVM::comdat::Comdat>, std::optional<::mlir::LLVM::comdat::Comdat>> { |
| 462 | static constexpr bool isKeyValueCompositional = false; |
| 463 | |
| 464 | static FailureOr<std::optional<::mlir::LLVM::comdat::Comdat>> parse(AsmParser &parser); |
| 465 | }; |
| 466 | } // namespace mlir |
| 467 | |
| 468 | namespace llvm { |
| 469 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::comdat::Comdat value) { |
| 470 | auto valueStr = stringifyEnum(enumValue: value); |
| 471 | return p << valueStr; |
| 472 | } |
| 473 | } // namespace llvm |
| 474 | |
| 475 | namespace llvm { |
| 476 | template<> struct DenseMapInfo<::mlir::LLVM::comdat::Comdat> { |
| 477 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 478 | |
| 479 | static unsigned getHashValue(const ::mlir::LLVM::comdat::Comdat &val) { |
| 480 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 481 | } |
| 482 | |
| 483 | static bool isEqual(const ::mlir::LLVM::comdat::Comdat &lhs, const ::mlir::LLVM::comdat::Comdat &rhs) { |
| 484 | return lhs == rhs; |
| 485 | } |
| 486 | }; |
| 487 | } |
| 488 | |
| 489 | namespace mlir::LLVM { |
| 490 | |
| 491 | // LLVM DI flags |
| 492 | enum class DIFlags : uint32_t { |
| 493 | Zero = 0, |
| 494 | Bit0 = 1, |
| 495 | Bit1 = 2, |
| 496 | Private = 1, |
| 497 | Protected = 2, |
| 498 | Public = 3, |
| 499 | FwdDecl = 4, |
| 500 | AppleBlock = 8, |
| 501 | ReservedBit4 = 16, |
| 502 | Virtual = 32, |
| 503 | Artificial = 64, |
| 504 | Explicit = 128, |
| 505 | Prototyped = 256, |
| 506 | ObjcClassComplete = 512, |
| 507 | ObjectPointer = 1024, |
| 508 | Vector = 2048, |
| 509 | StaticMember = 4096, |
| 510 | LValueReference = 8192, |
| 511 | RValueReference = 16384, |
| 512 | ExportSymbols = 32768, |
| 513 | SingleInheritance = 65536, |
| 514 | MultipleInheritance = 65536, |
| 515 | VirtualInheritance = 65536, |
| 516 | IntroducedVirtual = 262144, |
| 517 | BitField = 524288, |
| 518 | NoReturn = 1048576, |
| 519 | TypePassByValue = 4194304, |
| 520 | TypePassByReference = 8388608, |
| 521 | EnumClass = 16777216, |
| 522 | Thunk = 33554432, |
| 523 | NonTrivial = 67108864, |
| 524 | BigEndian = 134217728, |
| 525 | LittleEndian = 268435456, |
| 526 | AllCallsDescribed = 536870912, |
| 527 | }; |
| 528 | |
| 529 | ::std::optional<DIFlags> symbolizeDIFlags(uint32_t); |
| 530 | std::string stringifyDIFlags(DIFlags); |
| 531 | ::std::optional<DIFlags> symbolizeDIFlags(::llvm::StringRef); |
| 532 | |
| 533 | inline constexpr DIFlags operator|(DIFlags a, DIFlags b) { |
| 534 | return static_cast<DIFlags>(static_cast<uint32_t>(a) | static_cast<uint32_t>(b)); |
| 535 | } |
| 536 | inline constexpr DIFlags operator&(DIFlags a, DIFlags b) { |
| 537 | return static_cast<DIFlags>(static_cast<uint32_t>(a) & static_cast<uint32_t>(b)); |
| 538 | } |
| 539 | inline constexpr DIFlags operator^(DIFlags a, DIFlags b) { |
| 540 | return static_cast<DIFlags>(static_cast<uint32_t>(a) ^ static_cast<uint32_t>(b)); |
| 541 | } |
| 542 | inline constexpr DIFlags &operator|=(DIFlags &a, DIFlags b) { |
| 543 | return a = a | b; |
| 544 | } |
| 545 | inline constexpr DIFlags &operator&=(DIFlags &a, DIFlags b) { |
| 546 | return a = a & b; |
| 547 | } |
| 548 | inline constexpr DIFlags &operator^=(DIFlags &a, DIFlags b) { |
| 549 | return a = a ^ b; |
| 550 | } |
| 551 | inline constexpr DIFlags operator~(DIFlags bits) { |
| 552 | // Ensure only bits that can be present in the enum are set |
| 553 | return static_cast<DIFlags>(~static_cast<uint32_t>(bits) & static_cast<uint32_t>(1071513599u)); |
| 554 | } |
| 555 | inline constexpr bool bitEnumContainsAll(DIFlags bits, DIFlags bit) { |
| 556 | return (bits & bit) == bit; |
| 557 | } |
| 558 | inline constexpr bool bitEnumContainsAny(DIFlags bits, DIFlags bit) { |
| 559 | return (static_cast<uint32_t>(bits) & static_cast<uint32_t>(bit)) != 0; |
| 560 | } |
| 561 | inline constexpr DIFlags bitEnumClear(DIFlags bits, DIFlags bit) { |
| 562 | return bits & ~bit; |
| 563 | } |
| 564 | inline constexpr DIFlags bitEnumSet(DIFlags bits, DIFlags bit, /*optional*/bool value=true) { |
| 565 | return value ? (bits | bit) : bitEnumClear(bits, bit); |
| 566 | } |
| 567 | |
| 568 | inline std::string stringifyEnum(DIFlags enumValue) { |
| 569 | return stringifyDIFlags(enumValue); |
| 570 | } |
| 571 | |
| 572 | template <typename EnumType> |
| 573 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 574 | |
| 575 | template <> |
| 576 | inline ::std::optional<DIFlags> symbolizeEnum<DIFlags>(::llvm::StringRef str) { |
| 577 | return symbolizeDIFlags(str); |
| 578 | } |
| 579 | |
| 580 | class DIFlagsAttr : public ::mlir::IntegerAttr { |
| 581 | public: |
| 582 | using ValueType = DIFlags; |
| 583 | using ::mlir::IntegerAttr::IntegerAttr; |
| 584 | static bool classof(::mlir::Attribute attr); |
| 585 | static DIFlagsAttr get(::mlir::MLIRContext *context, DIFlags val); |
| 586 | DIFlags getValue() const; |
| 587 | }; |
| 588 | |
| 589 | } // namespace mlir::LLVM |
| 590 | |
| 591 | namespace mlir { |
| 592 | template<> |
| 593 | struct FieldParser<::mlir::LLVM::DIFlags, ::mlir::LLVM::DIFlags> { |
| 594 | static FailureOr<::mlir::LLVM::DIFlags> parse(AsmParser &parser); |
| 595 | }; |
| 596 | |
| 597 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 598 | /// used as: |
| 599 | /// |
| 600 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 601 | template<> |
| 602 | struct FieldParser<std::optional<::mlir::LLVM::DIFlags>, std::optional<::mlir::LLVM::DIFlags>> { |
| 603 | static constexpr bool isKeyValueCompositional = false; |
| 604 | |
| 605 | static FailureOr<std::optional<::mlir::LLVM::DIFlags>> parse(AsmParser &parser); |
| 606 | }; |
| 607 | } // namespace mlir |
| 608 | |
| 609 | namespace llvm { |
| 610 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::DIFlags value) { |
| 611 | auto valueStr = stringifyEnum(enumValue: value); |
| 612 | switch (value) { |
| 613 | case ::mlir::LLVM::DIFlags::Public: |
| 614 | return p << valueStr; |
| 615 | default: |
| 616 | break; |
| 617 | } |
| 618 | auto underlyingValue = static_cast<std::make_unsigned_t<::mlir::LLVM::DIFlags>>(value); |
| 619 | if (underlyingValue && !llvm::has_single_bit(Value: underlyingValue)) |
| 620 | return p << '"' << valueStr << '"'; |
| 621 | return p << valueStr; |
| 622 | } |
| 623 | } // namespace llvm |
| 624 | |
| 625 | namespace llvm { |
| 626 | template<> struct DenseMapInfo<::mlir::LLVM::DIFlags> { |
| 627 | using StorageInfo = ::llvm::DenseMapInfo<uint32_t>; |
| 628 | |
| 629 | static unsigned getHashValue(const ::mlir::LLVM::DIFlags &val) { |
| 630 | return StorageInfo::getHashValue(Val: static_cast<uint32_t>(val)); |
| 631 | } |
| 632 | |
| 633 | static bool isEqual(const ::mlir::LLVM::DIFlags &lhs, const ::mlir::LLVM::DIFlags &rhs) { |
| 634 | return lhs == rhs; |
| 635 | } |
| 636 | }; |
| 637 | } |
| 638 | |
| 639 | namespace mlir::LLVM { |
| 640 | |
| 641 | // LLVM DISubprogram flags |
| 642 | enum class DISubprogramFlags : uint32_t { |
| 643 | Virtual = 1, |
| 644 | PureVirtual = 2, |
| 645 | LocalToUnit = 4, |
| 646 | Definition = 8, |
| 647 | Optimized = 16, |
| 648 | Pure = 32, |
| 649 | Elemental = 64, |
| 650 | Recursive = 128, |
| 651 | MainSubprogram = 256, |
| 652 | Deleted = 512, |
| 653 | ObjCDirect = 2048, |
| 654 | }; |
| 655 | |
| 656 | ::std::optional<DISubprogramFlags> symbolizeDISubprogramFlags(uint32_t); |
| 657 | std::string stringifyDISubprogramFlags(DISubprogramFlags); |
| 658 | ::std::optional<DISubprogramFlags> symbolizeDISubprogramFlags(::llvm::StringRef); |
| 659 | |
| 660 | inline constexpr DISubprogramFlags operator|(DISubprogramFlags a, DISubprogramFlags b) { |
| 661 | return static_cast<DISubprogramFlags>(static_cast<uint32_t>(a) | static_cast<uint32_t>(b)); |
| 662 | } |
| 663 | inline constexpr DISubprogramFlags operator&(DISubprogramFlags a, DISubprogramFlags b) { |
| 664 | return static_cast<DISubprogramFlags>(static_cast<uint32_t>(a) & static_cast<uint32_t>(b)); |
| 665 | } |
| 666 | inline constexpr DISubprogramFlags operator^(DISubprogramFlags a, DISubprogramFlags b) { |
| 667 | return static_cast<DISubprogramFlags>(static_cast<uint32_t>(a) ^ static_cast<uint32_t>(b)); |
| 668 | } |
| 669 | inline constexpr DISubprogramFlags &operator|=(DISubprogramFlags &a, DISubprogramFlags b) { |
| 670 | return a = a | b; |
| 671 | } |
| 672 | inline constexpr DISubprogramFlags &operator&=(DISubprogramFlags &a, DISubprogramFlags b) { |
| 673 | return a = a & b; |
| 674 | } |
| 675 | inline constexpr DISubprogramFlags &operator^=(DISubprogramFlags &a, DISubprogramFlags b) { |
| 676 | return a = a ^ b; |
| 677 | } |
| 678 | inline constexpr DISubprogramFlags operator~(DISubprogramFlags bits) { |
| 679 | // Ensure only bits that can be present in the enum are set |
| 680 | return static_cast<DISubprogramFlags>(~static_cast<uint32_t>(bits) & static_cast<uint32_t>(3071u)); |
| 681 | } |
| 682 | inline constexpr bool bitEnumContainsAll(DISubprogramFlags bits, DISubprogramFlags bit) { |
| 683 | return (bits & bit) == bit; |
| 684 | } |
| 685 | inline constexpr bool bitEnumContainsAny(DISubprogramFlags bits, DISubprogramFlags bit) { |
| 686 | return (static_cast<uint32_t>(bits) & static_cast<uint32_t>(bit)) != 0; |
| 687 | } |
| 688 | inline constexpr DISubprogramFlags bitEnumClear(DISubprogramFlags bits, DISubprogramFlags bit) { |
| 689 | return bits & ~bit; |
| 690 | } |
| 691 | inline constexpr DISubprogramFlags bitEnumSet(DISubprogramFlags bits, DISubprogramFlags bit, /*optional*/bool value=true) { |
| 692 | return value ? (bits | bit) : bitEnumClear(bits, bit); |
| 693 | } |
| 694 | |
| 695 | inline std::string stringifyEnum(DISubprogramFlags enumValue) { |
| 696 | return stringifyDISubprogramFlags(enumValue); |
| 697 | } |
| 698 | |
| 699 | template <typename EnumType> |
| 700 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 701 | |
| 702 | template <> |
| 703 | inline ::std::optional<DISubprogramFlags> symbolizeEnum<DISubprogramFlags>(::llvm::StringRef str) { |
| 704 | return symbolizeDISubprogramFlags(str); |
| 705 | } |
| 706 | |
| 707 | class DISubprogramFlagsAttr : public ::mlir::IntegerAttr { |
| 708 | public: |
| 709 | using ValueType = DISubprogramFlags; |
| 710 | using ::mlir::IntegerAttr::IntegerAttr; |
| 711 | static bool classof(::mlir::Attribute attr); |
| 712 | static DISubprogramFlagsAttr get(::mlir::MLIRContext *context, DISubprogramFlags val); |
| 713 | DISubprogramFlags getValue() const; |
| 714 | }; |
| 715 | |
| 716 | } // namespace mlir::LLVM |
| 717 | |
| 718 | namespace mlir { |
| 719 | template<> |
| 720 | struct FieldParser<::mlir::LLVM::DISubprogramFlags, ::mlir::LLVM::DISubprogramFlags> { |
| 721 | static FailureOr<::mlir::LLVM::DISubprogramFlags> parse(AsmParser &parser); |
| 722 | }; |
| 723 | |
| 724 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 725 | /// used as: |
| 726 | /// |
| 727 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 728 | template<> |
| 729 | struct FieldParser<std::optional<::mlir::LLVM::DISubprogramFlags>, std::optional<::mlir::LLVM::DISubprogramFlags>> { |
| 730 | static constexpr bool isKeyValueCompositional = false; |
| 731 | |
| 732 | static FailureOr<std::optional<::mlir::LLVM::DISubprogramFlags>> parse(AsmParser &parser); |
| 733 | }; |
| 734 | } // namespace mlir |
| 735 | |
| 736 | namespace llvm { |
| 737 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::DISubprogramFlags value) { |
| 738 | auto valueStr = stringifyEnum(enumValue: value); |
| 739 | auto underlyingValue = static_cast<std::make_unsigned_t<::mlir::LLVM::DISubprogramFlags>>(value); |
| 740 | if (underlyingValue && !llvm::has_single_bit(Value: underlyingValue)) |
| 741 | return p << '"' << valueStr << '"'; |
| 742 | return p << valueStr; |
| 743 | } |
| 744 | } // namespace llvm |
| 745 | |
| 746 | namespace llvm { |
| 747 | template<> struct DenseMapInfo<::mlir::LLVM::DISubprogramFlags> { |
| 748 | using StorageInfo = ::llvm::DenseMapInfo<uint32_t>; |
| 749 | |
| 750 | static unsigned getHashValue(const ::mlir::LLVM::DISubprogramFlags &val) { |
| 751 | return StorageInfo::getHashValue(Val: static_cast<uint32_t>(val)); |
| 752 | } |
| 753 | |
| 754 | static bool isEqual(const ::mlir::LLVM::DISubprogramFlags &lhs, const ::mlir::LLVM::DISubprogramFlags &rhs) { |
| 755 | return lhs == rhs; |
| 756 | } |
| 757 | }; |
| 758 | } |
| 759 | |
| 760 | namespace mlir::LLVM { |
| 761 | |
| 762 | // LLVM Denormal Mode Kinds |
| 763 | enum class DenormalModeKind : uint64_t { |
| 764 | IEEE = 0, |
| 765 | PreserveSign = 1, |
| 766 | PositiveZero = 2, |
| 767 | Dynamic = 3, |
| 768 | Invalid, |
| 769 | }; |
| 770 | |
| 771 | ::llvm::StringRef stringifyDenormalModeKind(DenormalModeKind); |
| 772 | ::std::optional<DenormalModeKind> symbolizeDenormalModeKind(::llvm::StringRef); |
| 773 | |
| 774 | inline ::llvm::StringRef stringifyEnum(DenormalModeKind enumValue) { |
| 775 | return stringifyDenormalModeKind(enumValue); |
| 776 | } |
| 777 | |
| 778 | template <typename EnumType> |
| 779 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 780 | |
| 781 | template <> |
| 782 | inline ::std::optional<DenormalModeKind> symbolizeEnum<DenormalModeKind>(::llvm::StringRef str) { |
| 783 | return symbolizeDenormalModeKind(str); |
| 784 | } |
| 785 | |
| 786 | class DenormalModeKindAttr : public ::mlir::IntegerAttr { |
| 787 | public: |
| 788 | using ValueType = DenormalModeKind; |
| 789 | using ::mlir::IntegerAttr::IntegerAttr; |
| 790 | static bool classof(::mlir::Attribute attr); |
| 791 | static DenormalModeKindAttr get(::mlir::MLIRContext *context, DenormalModeKind val); |
| 792 | DenormalModeKind getValue() const; |
| 793 | }; |
| 794 | |
| 795 | } // namespace mlir::LLVM |
| 796 | |
| 797 | namespace mlir { |
| 798 | template<> |
| 799 | struct FieldParser<::mlir::LLVM::DenormalModeKind, ::mlir::LLVM::DenormalModeKind> { |
| 800 | static FailureOr<::mlir::LLVM::DenormalModeKind> parse(AsmParser &parser); |
| 801 | }; |
| 802 | |
| 803 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 804 | /// used as: |
| 805 | /// |
| 806 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 807 | template<> |
| 808 | struct FieldParser<std::optional<::mlir::LLVM::DenormalModeKind>, std::optional<::mlir::LLVM::DenormalModeKind>> { |
| 809 | static constexpr bool isKeyValueCompositional = false; |
| 810 | |
| 811 | static FailureOr<std::optional<::mlir::LLVM::DenormalModeKind>> parse(AsmParser &parser); |
| 812 | }; |
| 813 | } // namespace mlir |
| 814 | |
| 815 | namespace llvm { |
| 816 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::DenormalModeKind value) { |
| 817 | auto valueStr = stringifyEnum(enumValue: value); |
| 818 | return p << valueStr; |
| 819 | } |
| 820 | } // namespace llvm |
| 821 | |
| 822 | namespace llvm { |
| 823 | template<> struct DenseMapInfo<::mlir::LLVM::DenormalModeKind> { |
| 824 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 825 | |
| 826 | static unsigned getHashValue(const ::mlir::LLVM::DenormalModeKind &val) { |
| 827 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 828 | } |
| 829 | |
| 830 | static bool isEqual(const ::mlir::LLVM::DenormalModeKind &lhs, const ::mlir::LLVM::DenormalModeKind &rhs) { |
| 831 | return lhs == rhs; |
| 832 | } |
| 833 | }; |
| 834 | } |
| 835 | |
| 836 | namespace mlir::LLVM { |
| 837 | |
| 838 | // llvm.fcmp comparison predicate |
| 839 | enum class FCmpPredicate : uint64_t { |
| 840 | _false = 0, |
| 841 | oeq = 1, |
| 842 | ogt = 2, |
| 843 | oge = 3, |
| 844 | olt = 4, |
| 845 | ole = 5, |
| 846 | one = 6, |
| 847 | ord = 7, |
| 848 | ueq = 8, |
| 849 | ugt = 9, |
| 850 | uge = 10, |
| 851 | ult = 11, |
| 852 | ule = 12, |
| 853 | une = 13, |
| 854 | uno = 14, |
| 855 | _true = 15, |
| 856 | }; |
| 857 | |
| 858 | ::std::optional<FCmpPredicate> symbolizeFCmpPredicate(uint64_t); |
| 859 | ::llvm::StringRef stringifyFCmpPredicate(FCmpPredicate); |
| 860 | ::std::optional<FCmpPredicate> symbolizeFCmpPredicate(::llvm::StringRef); |
| 861 | inline constexpr unsigned getMaxEnumValForFCmpPredicate() { |
| 862 | return 15; |
| 863 | } |
| 864 | |
| 865 | |
| 866 | inline ::llvm::StringRef stringifyEnum(FCmpPredicate enumValue) { |
| 867 | return stringifyFCmpPredicate(enumValue); |
| 868 | } |
| 869 | |
| 870 | template <typename EnumType> |
| 871 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 872 | |
| 873 | template <> |
| 874 | inline ::std::optional<FCmpPredicate> symbolizeEnum<FCmpPredicate>(::llvm::StringRef str) { |
| 875 | return symbolizeFCmpPredicate(str); |
| 876 | } |
| 877 | |
| 878 | class FCmpPredicateAttr : public ::mlir::IntegerAttr { |
| 879 | public: |
| 880 | using ValueType = FCmpPredicate; |
| 881 | using ::mlir::IntegerAttr::IntegerAttr; |
| 882 | static bool classof(::mlir::Attribute attr); |
| 883 | static FCmpPredicateAttr get(::mlir::MLIRContext *context, FCmpPredicate val); |
| 884 | FCmpPredicate getValue() const; |
| 885 | }; |
| 886 | |
| 887 | } // namespace mlir::LLVM |
| 888 | |
| 889 | namespace mlir { |
| 890 | template<> |
| 891 | struct FieldParser<::mlir::LLVM::FCmpPredicate, ::mlir::LLVM::FCmpPredicate> { |
| 892 | static FailureOr<::mlir::LLVM::FCmpPredicate> parse(AsmParser &parser); |
| 893 | }; |
| 894 | |
| 895 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 896 | /// used as: |
| 897 | /// |
| 898 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 899 | template<> |
| 900 | struct FieldParser<std::optional<::mlir::LLVM::FCmpPredicate>, std::optional<::mlir::LLVM::FCmpPredicate>> { |
| 901 | static constexpr bool isKeyValueCompositional = false; |
| 902 | |
| 903 | static FailureOr<std::optional<::mlir::LLVM::FCmpPredicate>> parse(AsmParser &parser); |
| 904 | }; |
| 905 | } // namespace mlir |
| 906 | |
| 907 | namespace llvm { |
| 908 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::FCmpPredicate value) { |
| 909 | auto valueStr = stringifyEnum(enumValue: value); |
| 910 | return p << valueStr; |
| 911 | } |
| 912 | } // namespace llvm |
| 913 | |
| 914 | namespace llvm { |
| 915 | template<> struct DenseMapInfo<::mlir::LLVM::FCmpPredicate> { |
| 916 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 917 | |
| 918 | static unsigned getHashValue(const ::mlir::LLVM::FCmpPredicate &val) { |
| 919 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 920 | } |
| 921 | |
| 922 | static bool isEqual(const ::mlir::LLVM::FCmpPredicate &lhs, const ::mlir::LLVM::FCmpPredicate &rhs) { |
| 923 | return lhs == rhs; |
| 924 | } |
| 925 | }; |
| 926 | } |
| 927 | |
| 928 | namespace mlir::LLVM { |
| 929 | |
| 930 | // LLVM Exception Behavior |
| 931 | enum class FPExceptionBehavior : uint64_t { |
| 932 | Ignore = 0, |
| 933 | MayTrap = 1, |
| 934 | Strict = 2, |
| 935 | }; |
| 936 | |
| 937 | ::std::optional<FPExceptionBehavior> symbolizeFPExceptionBehavior(uint64_t); |
| 938 | ::llvm::StringRef stringifyFPExceptionBehavior(FPExceptionBehavior); |
| 939 | ::std::optional<FPExceptionBehavior> symbolizeFPExceptionBehavior(::llvm::StringRef); |
| 940 | inline constexpr unsigned getMaxEnumValForFPExceptionBehavior() { |
| 941 | return 2; |
| 942 | } |
| 943 | |
| 944 | |
| 945 | inline ::llvm::StringRef stringifyEnum(FPExceptionBehavior enumValue) { |
| 946 | return stringifyFPExceptionBehavior(enumValue); |
| 947 | } |
| 948 | |
| 949 | template <typename EnumType> |
| 950 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 951 | |
| 952 | template <> |
| 953 | inline ::std::optional<FPExceptionBehavior> symbolizeEnum<FPExceptionBehavior>(::llvm::StringRef str) { |
| 954 | return symbolizeFPExceptionBehavior(str); |
| 955 | } |
| 956 | |
| 957 | class FPExceptionBehaviorAttr : public ::mlir::IntegerAttr { |
| 958 | public: |
| 959 | using ValueType = FPExceptionBehavior; |
| 960 | using ::mlir::IntegerAttr::IntegerAttr; |
| 961 | static bool classof(::mlir::Attribute attr); |
| 962 | static FPExceptionBehaviorAttr get(::mlir::MLIRContext *context, FPExceptionBehavior val); |
| 963 | FPExceptionBehavior getValue() const; |
| 964 | }; |
| 965 | |
| 966 | } // namespace mlir::LLVM |
| 967 | |
| 968 | namespace mlir { |
| 969 | template<> |
| 970 | struct FieldParser<::mlir::LLVM::FPExceptionBehavior, ::mlir::LLVM::FPExceptionBehavior> { |
| 971 | static FailureOr<::mlir::LLVM::FPExceptionBehavior> parse(AsmParser &parser); |
| 972 | }; |
| 973 | |
| 974 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 975 | /// used as: |
| 976 | /// |
| 977 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 978 | template<> |
| 979 | struct FieldParser<std::optional<::mlir::LLVM::FPExceptionBehavior>, std::optional<::mlir::LLVM::FPExceptionBehavior>> { |
| 980 | static constexpr bool isKeyValueCompositional = false; |
| 981 | |
| 982 | static FailureOr<std::optional<::mlir::LLVM::FPExceptionBehavior>> parse(AsmParser &parser); |
| 983 | }; |
| 984 | } // namespace mlir |
| 985 | |
| 986 | namespace llvm { |
| 987 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::FPExceptionBehavior value) { |
| 988 | auto valueStr = stringifyEnum(enumValue: value); |
| 989 | return p << valueStr; |
| 990 | } |
| 991 | } // namespace llvm |
| 992 | |
| 993 | namespace llvm { |
| 994 | template<> struct DenseMapInfo<::mlir::LLVM::FPExceptionBehavior> { |
| 995 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 996 | |
| 997 | static unsigned getHashValue(const ::mlir::LLVM::FPExceptionBehavior &val) { |
| 998 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 999 | } |
| 1000 | |
| 1001 | static bool isEqual(const ::mlir::LLVM::FPExceptionBehavior &lhs, const ::mlir::LLVM::FPExceptionBehavior &rhs) { |
| 1002 | return lhs == rhs; |
| 1003 | } |
| 1004 | }; |
| 1005 | } |
| 1006 | |
| 1007 | namespace mlir::LLVM { |
| 1008 | |
| 1009 | // LLVM fastmath flags |
| 1010 | enum class FastmathFlags : uint32_t { |
| 1011 | none = 0, |
| 1012 | nnan = 1, |
| 1013 | ninf = 2, |
| 1014 | nsz = 4, |
| 1015 | arcp = 8, |
| 1016 | contract = 16, |
| 1017 | afn = 32, |
| 1018 | reassoc = 64, |
| 1019 | fast = 127, |
| 1020 | }; |
| 1021 | |
| 1022 | ::std::optional<FastmathFlags> symbolizeFastmathFlags(uint32_t); |
| 1023 | std::string stringifyFastmathFlags(FastmathFlags); |
| 1024 | ::std::optional<FastmathFlags> symbolizeFastmathFlags(::llvm::StringRef); |
| 1025 | |
| 1026 | inline constexpr FastmathFlags operator|(FastmathFlags a, FastmathFlags b) { |
| 1027 | return static_cast<FastmathFlags>(static_cast<uint32_t>(a) | static_cast<uint32_t>(b)); |
| 1028 | } |
| 1029 | inline constexpr FastmathFlags operator&(FastmathFlags a, FastmathFlags b) { |
| 1030 | return static_cast<FastmathFlags>(static_cast<uint32_t>(a) & static_cast<uint32_t>(b)); |
| 1031 | } |
| 1032 | inline constexpr FastmathFlags operator^(FastmathFlags a, FastmathFlags b) { |
| 1033 | return static_cast<FastmathFlags>(static_cast<uint32_t>(a) ^ static_cast<uint32_t>(b)); |
| 1034 | } |
| 1035 | inline constexpr FastmathFlags &operator|=(FastmathFlags &a, FastmathFlags b) { |
| 1036 | return a = a | b; |
| 1037 | } |
| 1038 | inline constexpr FastmathFlags &operator&=(FastmathFlags &a, FastmathFlags b) { |
| 1039 | return a = a & b; |
| 1040 | } |
| 1041 | inline constexpr FastmathFlags &operator^=(FastmathFlags &a, FastmathFlags b) { |
| 1042 | return a = a ^ b; |
| 1043 | } |
| 1044 | inline constexpr FastmathFlags operator~(FastmathFlags bits) { |
| 1045 | // Ensure only bits that can be present in the enum are set |
| 1046 | return static_cast<FastmathFlags>(~static_cast<uint32_t>(bits) & static_cast<uint32_t>(127u)); |
| 1047 | } |
| 1048 | inline constexpr bool bitEnumContainsAll(FastmathFlags bits, FastmathFlags bit) { |
| 1049 | return (bits & bit) == bit; |
| 1050 | } |
| 1051 | inline constexpr bool bitEnumContainsAny(FastmathFlags bits, FastmathFlags bit) { |
| 1052 | return (static_cast<uint32_t>(bits) & static_cast<uint32_t>(bit)) != 0; |
| 1053 | } |
| 1054 | inline constexpr FastmathFlags bitEnumClear(FastmathFlags bits, FastmathFlags bit) { |
| 1055 | return bits & ~bit; |
| 1056 | } |
| 1057 | inline constexpr FastmathFlags bitEnumSet(FastmathFlags bits, FastmathFlags bit, /*optional*/bool value=true) { |
| 1058 | return value ? (bits | bit) : bitEnumClear(bits, bit); |
| 1059 | } |
| 1060 | |
| 1061 | inline std::string stringifyEnum(FastmathFlags enumValue) { |
| 1062 | return stringifyFastmathFlags(enumValue); |
| 1063 | } |
| 1064 | |
| 1065 | template <typename EnumType> |
| 1066 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 1067 | |
| 1068 | template <> |
| 1069 | inline ::std::optional<FastmathFlags> symbolizeEnum<FastmathFlags>(::llvm::StringRef str) { |
| 1070 | return symbolizeFastmathFlags(str); |
| 1071 | } |
| 1072 | |
| 1073 | } // namespace mlir::LLVM |
| 1074 | |
| 1075 | namespace mlir { |
| 1076 | template<> |
| 1077 | struct FieldParser<::mlir::LLVM::FastmathFlags, ::mlir::LLVM::FastmathFlags> { |
| 1078 | static FailureOr<::mlir::LLVM::FastmathFlags> parse(AsmParser &parser); |
| 1079 | }; |
| 1080 | |
| 1081 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 1082 | /// used as: |
| 1083 | /// |
| 1084 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 1085 | template<> |
| 1086 | struct FieldParser<std::optional<::mlir::LLVM::FastmathFlags>, std::optional<::mlir::LLVM::FastmathFlags>> { |
| 1087 | static constexpr bool isKeyValueCompositional = false; |
| 1088 | |
| 1089 | static FailureOr<std::optional<::mlir::LLVM::FastmathFlags>> parse(AsmParser &parser); |
| 1090 | }; |
| 1091 | } // namespace mlir |
| 1092 | |
| 1093 | namespace llvm { |
| 1094 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::FastmathFlags value) { |
| 1095 | auto valueStr = stringifyEnum(enumValue: value); |
| 1096 | switch (value) { |
| 1097 | case ::mlir::LLVM::FastmathFlags::fast: |
| 1098 | return p << valueStr; |
| 1099 | default: |
| 1100 | break; |
| 1101 | } |
| 1102 | auto underlyingValue = static_cast<std::make_unsigned_t<::mlir::LLVM::FastmathFlags>>(value); |
| 1103 | if (underlyingValue && !llvm::has_single_bit(Value: underlyingValue)) |
| 1104 | return p << '"' << valueStr << '"'; |
| 1105 | return p << valueStr; |
| 1106 | } |
| 1107 | } // namespace llvm |
| 1108 | |
| 1109 | namespace llvm { |
| 1110 | template<> struct DenseMapInfo<::mlir::LLVM::FastmathFlags> { |
| 1111 | using StorageInfo = ::llvm::DenseMapInfo<uint32_t>; |
| 1112 | |
| 1113 | static unsigned getHashValue(const ::mlir::LLVM::FastmathFlags &val) { |
| 1114 | return StorageInfo::getHashValue(Val: static_cast<uint32_t>(val)); |
| 1115 | } |
| 1116 | |
| 1117 | static bool isEqual(const ::mlir::LLVM::FastmathFlags &lhs, const ::mlir::LLVM::FastmathFlags &rhs) { |
| 1118 | return lhs == rhs; |
| 1119 | } |
| 1120 | }; |
| 1121 | } |
| 1122 | |
| 1123 | namespace mlir::LLVM::framePointerKind { |
| 1124 | |
| 1125 | // LLVM FramePointerKind |
| 1126 | enum class FramePointerKind : uint64_t { |
| 1127 | None = 0, |
| 1128 | NonLeaf = 1, |
| 1129 | All = 2, |
| 1130 | Reserved = 3, |
| 1131 | NonLeafNoReserve = 4, |
| 1132 | }; |
| 1133 | |
| 1134 | ::std::optional<FramePointerKind> symbolizeFramePointerKind(uint64_t); |
| 1135 | ::llvm::StringRef stringifyFramePointerKind(FramePointerKind); |
| 1136 | ::std::optional<FramePointerKind> symbolizeFramePointerKind(::llvm::StringRef); |
| 1137 | inline constexpr unsigned getMaxEnumValForFramePointerKind() { |
| 1138 | return 4; |
| 1139 | } |
| 1140 | |
| 1141 | |
| 1142 | inline ::llvm::StringRef stringifyEnum(FramePointerKind enumValue) { |
| 1143 | return stringifyFramePointerKind(enumValue); |
| 1144 | } |
| 1145 | |
| 1146 | template <typename EnumType> |
| 1147 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 1148 | |
| 1149 | template <> |
| 1150 | inline ::std::optional<FramePointerKind> symbolizeEnum<FramePointerKind>(::llvm::StringRef str) { |
| 1151 | return symbolizeFramePointerKind(str); |
| 1152 | } |
| 1153 | |
| 1154 | class FramePointerKindAttr : public ::mlir::IntegerAttr { |
| 1155 | public: |
| 1156 | using ValueType = FramePointerKind; |
| 1157 | using ::mlir::IntegerAttr::IntegerAttr; |
| 1158 | static bool classof(::mlir::Attribute attr); |
| 1159 | static FramePointerKindAttr get(::mlir::MLIRContext *context, FramePointerKind val); |
| 1160 | FramePointerKind getValue() const; |
| 1161 | }; |
| 1162 | |
| 1163 | } // namespace mlir::LLVM::framePointerKind |
| 1164 | |
| 1165 | namespace mlir { |
| 1166 | template<> |
| 1167 | struct FieldParser<::mlir::LLVM::framePointerKind::FramePointerKind, ::mlir::LLVM::framePointerKind::FramePointerKind> { |
| 1168 | static FailureOr<::mlir::LLVM::framePointerKind::FramePointerKind> parse(AsmParser &parser); |
| 1169 | }; |
| 1170 | |
| 1171 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 1172 | /// used as: |
| 1173 | /// |
| 1174 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 1175 | template<> |
| 1176 | struct FieldParser<std::optional<::mlir::LLVM::framePointerKind::FramePointerKind>, std::optional<::mlir::LLVM::framePointerKind::FramePointerKind>> { |
| 1177 | static constexpr bool isKeyValueCompositional = false; |
| 1178 | |
| 1179 | static FailureOr<std::optional<::mlir::LLVM::framePointerKind::FramePointerKind>> parse(AsmParser &parser); |
| 1180 | }; |
| 1181 | } // namespace mlir |
| 1182 | |
| 1183 | namespace llvm { |
| 1184 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::framePointerKind::FramePointerKind value) { |
| 1185 | auto valueStr = stringifyEnum(enumValue: value); |
| 1186 | switch (value) { |
| 1187 | case ::mlir::LLVM::framePointerKind::FramePointerKind::None: |
| 1188 | case ::mlir::LLVM::framePointerKind::FramePointerKind::All: |
| 1189 | case ::mlir::LLVM::framePointerKind::FramePointerKind::Reserved: |
| 1190 | break; |
| 1191 | default: |
| 1192 | return p << '"' << valueStr << '"'; |
| 1193 | } |
| 1194 | return p << valueStr; |
| 1195 | } |
| 1196 | } // namespace llvm |
| 1197 | |
| 1198 | namespace llvm { |
| 1199 | template<> struct DenseMapInfo<::mlir::LLVM::framePointerKind::FramePointerKind> { |
| 1200 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 1201 | |
| 1202 | static unsigned getHashValue(const ::mlir::LLVM::framePointerKind::FramePointerKind &val) { |
| 1203 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 1204 | } |
| 1205 | |
| 1206 | static bool isEqual(const ::mlir::LLVM::framePointerKind::FramePointerKind &lhs, const ::mlir::LLVM::framePointerKind::FramePointerKind &rhs) { |
| 1207 | return lhs == rhs; |
| 1208 | } |
| 1209 | }; |
| 1210 | } |
| 1211 | |
| 1212 | namespace mlir::LLVM { |
| 1213 | |
| 1214 | // ::mlir::LLVM::GEPNoWrapFlags |
| 1215 | enum class GEPNoWrapFlags : uint32_t { |
| 1216 | none = 0, |
| 1217 | inboundsFlag = 1, |
| 1218 | nusw = 2, |
| 1219 | nuw = 4, |
| 1220 | inbounds = 3, |
| 1221 | }; |
| 1222 | |
| 1223 | ::std::optional<GEPNoWrapFlags> symbolizeGEPNoWrapFlags(uint32_t); |
| 1224 | std::string stringifyGEPNoWrapFlags(GEPNoWrapFlags); |
| 1225 | ::std::optional<GEPNoWrapFlags> symbolizeGEPNoWrapFlags(::llvm::StringRef); |
| 1226 | |
| 1227 | inline constexpr GEPNoWrapFlags operator|(GEPNoWrapFlags a, GEPNoWrapFlags b) { |
| 1228 | return static_cast<GEPNoWrapFlags>(static_cast<uint32_t>(a) | static_cast<uint32_t>(b)); |
| 1229 | } |
| 1230 | inline constexpr GEPNoWrapFlags operator&(GEPNoWrapFlags a, GEPNoWrapFlags b) { |
| 1231 | return static_cast<GEPNoWrapFlags>(static_cast<uint32_t>(a) & static_cast<uint32_t>(b)); |
| 1232 | } |
| 1233 | inline constexpr GEPNoWrapFlags operator^(GEPNoWrapFlags a, GEPNoWrapFlags b) { |
| 1234 | return static_cast<GEPNoWrapFlags>(static_cast<uint32_t>(a) ^ static_cast<uint32_t>(b)); |
| 1235 | } |
| 1236 | inline constexpr GEPNoWrapFlags &operator|=(GEPNoWrapFlags &a, GEPNoWrapFlags b) { |
| 1237 | return a = a | b; |
| 1238 | } |
| 1239 | inline constexpr GEPNoWrapFlags &operator&=(GEPNoWrapFlags &a, GEPNoWrapFlags b) { |
| 1240 | return a = a & b; |
| 1241 | } |
| 1242 | inline constexpr GEPNoWrapFlags &operator^=(GEPNoWrapFlags &a, GEPNoWrapFlags b) { |
| 1243 | return a = a ^ b; |
| 1244 | } |
| 1245 | inline constexpr GEPNoWrapFlags operator~(GEPNoWrapFlags bits) { |
| 1246 | // Ensure only bits that can be present in the enum are set |
| 1247 | return static_cast<GEPNoWrapFlags>(~static_cast<uint32_t>(bits) & static_cast<uint32_t>(7u)); |
| 1248 | } |
| 1249 | inline constexpr bool bitEnumContainsAll(GEPNoWrapFlags bits, GEPNoWrapFlags bit) { |
| 1250 | return (bits & bit) == bit; |
| 1251 | } |
| 1252 | inline constexpr bool bitEnumContainsAny(GEPNoWrapFlags bits, GEPNoWrapFlags bit) { |
| 1253 | return (static_cast<uint32_t>(bits) & static_cast<uint32_t>(bit)) != 0; |
| 1254 | } |
| 1255 | inline constexpr GEPNoWrapFlags bitEnumClear(GEPNoWrapFlags bits, GEPNoWrapFlags bit) { |
| 1256 | return bits & ~bit; |
| 1257 | } |
| 1258 | inline constexpr GEPNoWrapFlags bitEnumSet(GEPNoWrapFlags bits, GEPNoWrapFlags bit, /*optional*/bool value=true) { |
| 1259 | return value ? (bits | bit) : bitEnumClear(bits, bit); |
| 1260 | } |
| 1261 | |
| 1262 | inline std::string stringifyEnum(GEPNoWrapFlags enumValue) { |
| 1263 | return stringifyGEPNoWrapFlags(enumValue); |
| 1264 | } |
| 1265 | |
| 1266 | template <typename EnumType> |
| 1267 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 1268 | |
| 1269 | template <> |
| 1270 | inline ::std::optional<GEPNoWrapFlags> symbolizeEnum<GEPNoWrapFlags>(::llvm::StringRef str) { |
| 1271 | return symbolizeGEPNoWrapFlags(str); |
| 1272 | } |
| 1273 | |
| 1274 | } // namespace mlir::LLVM |
| 1275 | |
| 1276 | namespace mlir { |
| 1277 | template<> |
| 1278 | struct FieldParser<::mlir::LLVM::GEPNoWrapFlags, ::mlir::LLVM::GEPNoWrapFlags> { |
| 1279 | static constexpr bool isKeyValueCompositional = true; |
| 1280 | |
| 1281 | static FailureOr<::mlir::LLVM::GEPNoWrapFlags> parse(AsmParser &parser); |
| 1282 | }; |
| 1283 | |
| 1284 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 1285 | /// used as: |
| 1286 | /// |
| 1287 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 1288 | template<> |
| 1289 | struct FieldParser<std::optional<::mlir::LLVM::GEPNoWrapFlags>, std::optional<::mlir::LLVM::GEPNoWrapFlags>> { |
| 1290 | static constexpr bool isKeyValueCompositional = false; |
| 1291 | |
| 1292 | static FailureOr<std::optional<::mlir::LLVM::GEPNoWrapFlags>> parse(AsmParser &parser); |
| 1293 | }; |
| 1294 | } // namespace mlir |
| 1295 | |
| 1296 | namespace llvm { |
| 1297 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::GEPNoWrapFlags value) { |
| 1298 | auto valueStr = stringifyEnum(enumValue: value); |
| 1299 | return p << valueStr; |
| 1300 | } |
| 1301 | } // namespace llvm |
| 1302 | |
| 1303 | namespace llvm { |
| 1304 | template<> struct DenseMapInfo<::mlir::LLVM::GEPNoWrapFlags> { |
| 1305 | using StorageInfo = ::llvm::DenseMapInfo<uint32_t>; |
| 1306 | |
| 1307 | static unsigned getHashValue(const ::mlir::LLVM::GEPNoWrapFlags &val) { |
| 1308 | return StorageInfo::getHashValue(Val: static_cast<uint32_t>(val)); |
| 1309 | } |
| 1310 | |
| 1311 | static bool isEqual(const ::mlir::LLVM::GEPNoWrapFlags &lhs, const ::mlir::LLVM::GEPNoWrapFlags &rhs) { |
| 1312 | return lhs == rhs; |
| 1313 | } |
| 1314 | }; |
| 1315 | } |
| 1316 | |
| 1317 | namespace mlir::LLVM { |
| 1318 | |
| 1319 | // llvm.icmp comparison predicate |
| 1320 | enum class ICmpPredicate : uint64_t { |
| 1321 | eq = 0, |
| 1322 | ne = 1, |
| 1323 | slt = 2, |
| 1324 | sle = 3, |
| 1325 | sgt = 4, |
| 1326 | sge = 5, |
| 1327 | ult = 6, |
| 1328 | ule = 7, |
| 1329 | ugt = 8, |
| 1330 | uge = 9, |
| 1331 | }; |
| 1332 | |
| 1333 | ::std::optional<ICmpPredicate> symbolizeICmpPredicate(uint64_t); |
| 1334 | ::llvm::StringRef stringifyICmpPredicate(ICmpPredicate); |
| 1335 | ::std::optional<ICmpPredicate> symbolizeICmpPredicate(::llvm::StringRef); |
| 1336 | inline constexpr unsigned getMaxEnumValForICmpPredicate() { |
| 1337 | return 9; |
| 1338 | } |
| 1339 | |
| 1340 | |
| 1341 | inline ::llvm::StringRef stringifyEnum(ICmpPredicate enumValue) { |
| 1342 | return stringifyICmpPredicate(enumValue); |
| 1343 | } |
| 1344 | |
| 1345 | template <typename EnumType> |
| 1346 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 1347 | |
| 1348 | template <> |
| 1349 | inline ::std::optional<ICmpPredicate> symbolizeEnum<ICmpPredicate>(::llvm::StringRef str) { |
| 1350 | return symbolizeICmpPredicate(str); |
| 1351 | } |
| 1352 | |
| 1353 | class ICmpPredicateAttr : public ::mlir::IntegerAttr { |
| 1354 | public: |
| 1355 | using ValueType = ICmpPredicate; |
| 1356 | using ::mlir::IntegerAttr::IntegerAttr; |
| 1357 | static bool classof(::mlir::Attribute attr); |
| 1358 | static ICmpPredicateAttr get(::mlir::MLIRContext *context, ICmpPredicate val); |
| 1359 | ICmpPredicate getValue() const; |
| 1360 | }; |
| 1361 | |
| 1362 | } // namespace mlir::LLVM |
| 1363 | |
| 1364 | namespace mlir { |
| 1365 | template<> |
| 1366 | struct FieldParser<::mlir::LLVM::ICmpPredicate, ::mlir::LLVM::ICmpPredicate> { |
| 1367 | static FailureOr<::mlir::LLVM::ICmpPredicate> parse(AsmParser &parser); |
| 1368 | }; |
| 1369 | |
| 1370 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 1371 | /// used as: |
| 1372 | /// |
| 1373 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 1374 | template<> |
| 1375 | struct FieldParser<std::optional<::mlir::LLVM::ICmpPredicate>, std::optional<::mlir::LLVM::ICmpPredicate>> { |
| 1376 | static constexpr bool isKeyValueCompositional = false; |
| 1377 | |
| 1378 | static FailureOr<std::optional<::mlir::LLVM::ICmpPredicate>> parse(AsmParser &parser); |
| 1379 | }; |
| 1380 | } // namespace mlir |
| 1381 | |
| 1382 | namespace llvm { |
| 1383 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::ICmpPredicate value) { |
| 1384 | auto valueStr = stringifyEnum(enumValue: value); |
| 1385 | return p << valueStr; |
| 1386 | } |
| 1387 | } // namespace llvm |
| 1388 | |
| 1389 | namespace llvm { |
| 1390 | template<> struct DenseMapInfo<::mlir::LLVM::ICmpPredicate> { |
| 1391 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 1392 | |
| 1393 | static unsigned getHashValue(const ::mlir::LLVM::ICmpPredicate &val) { |
| 1394 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 1395 | } |
| 1396 | |
| 1397 | static bool isEqual(const ::mlir::LLVM::ICmpPredicate &lhs, const ::mlir::LLVM::ICmpPredicate &rhs) { |
| 1398 | return lhs == rhs; |
| 1399 | } |
| 1400 | }; |
| 1401 | } |
| 1402 | |
| 1403 | namespace mlir::LLVM { |
| 1404 | |
| 1405 | // LLVM integer overflow flags |
| 1406 | enum class IntegerOverflowFlags : uint32_t { |
| 1407 | none = 0, |
| 1408 | nsw = 1, |
| 1409 | nuw = 2, |
| 1410 | }; |
| 1411 | |
| 1412 | ::std::optional<IntegerOverflowFlags> symbolizeIntegerOverflowFlags(uint32_t); |
| 1413 | std::string stringifyIntegerOverflowFlags(IntegerOverflowFlags); |
| 1414 | ::std::optional<IntegerOverflowFlags> symbolizeIntegerOverflowFlags(::llvm::StringRef); |
| 1415 | |
| 1416 | inline constexpr IntegerOverflowFlags operator|(IntegerOverflowFlags a, IntegerOverflowFlags b) { |
| 1417 | return static_cast<IntegerOverflowFlags>(static_cast<uint32_t>(a) | static_cast<uint32_t>(b)); |
| 1418 | } |
| 1419 | inline constexpr IntegerOverflowFlags operator&(IntegerOverflowFlags a, IntegerOverflowFlags b) { |
| 1420 | return static_cast<IntegerOverflowFlags>(static_cast<uint32_t>(a) & static_cast<uint32_t>(b)); |
| 1421 | } |
| 1422 | inline constexpr IntegerOverflowFlags operator^(IntegerOverflowFlags a, IntegerOverflowFlags b) { |
| 1423 | return static_cast<IntegerOverflowFlags>(static_cast<uint32_t>(a) ^ static_cast<uint32_t>(b)); |
| 1424 | } |
| 1425 | inline constexpr IntegerOverflowFlags &operator|=(IntegerOverflowFlags &a, IntegerOverflowFlags b) { |
| 1426 | return a = a | b; |
| 1427 | } |
| 1428 | inline constexpr IntegerOverflowFlags &operator&=(IntegerOverflowFlags &a, IntegerOverflowFlags b) { |
| 1429 | return a = a & b; |
| 1430 | } |
| 1431 | inline constexpr IntegerOverflowFlags &operator^=(IntegerOverflowFlags &a, IntegerOverflowFlags b) { |
| 1432 | return a = a ^ b; |
| 1433 | } |
| 1434 | inline constexpr IntegerOverflowFlags operator~(IntegerOverflowFlags bits) { |
| 1435 | // Ensure only bits that can be present in the enum are set |
| 1436 | return static_cast<IntegerOverflowFlags>(~static_cast<uint32_t>(bits) & static_cast<uint32_t>(3u)); |
| 1437 | } |
| 1438 | inline constexpr bool bitEnumContainsAll(IntegerOverflowFlags bits, IntegerOverflowFlags bit) { |
| 1439 | return (bits & bit) == bit; |
| 1440 | } |
| 1441 | inline constexpr bool bitEnumContainsAny(IntegerOverflowFlags bits, IntegerOverflowFlags bit) { |
| 1442 | return (static_cast<uint32_t>(bits) & static_cast<uint32_t>(bit)) != 0; |
| 1443 | } |
| 1444 | inline constexpr IntegerOverflowFlags bitEnumClear(IntegerOverflowFlags bits, IntegerOverflowFlags bit) { |
| 1445 | return bits & ~bit; |
| 1446 | } |
| 1447 | inline constexpr IntegerOverflowFlags bitEnumSet(IntegerOverflowFlags bits, IntegerOverflowFlags bit, /*optional*/bool value=true) { |
| 1448 | return value ? (bits | bit) : bitEnumClear(bits, bit); |
| 1449 | } |
| 1450 | |
| 1451 | inline std::string stringifyEnum(IntegerOverflowFlags enumValue) { |
| 1452 | return stringifyIntegerOverflowFlags(enumValue); |
| 1453 | } |
| 1454 | |
| 1455 | template <typename EnumType> |
| 1456 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 1457 | |
| 1458 | template <> |
| 1459 | inline ::std::optional<IntegerOverflowFlags> symbolizeEnum<IntegerOverflowFlags>(::llvm::StringRef str) { |
| 1460 | return symbolizeIntegerOverflowFlags(str); |
| 1461 | } |
| 1462 | |
| 1463 | } // namespace mlir::LLVM |
| 1464 | |
| 1465 | namespace mlir { |
| 1466 | template<> |
| 1467 | struct FieldParser<::mlir::LLVM::IntegerOverflowFlags, ::mlir::LLVM::IntegerOverflowFlags> { |
| 1468 | static constexpr bool isKeyValueCompositional = false; |
| 1469 | |
| 1470 | static FailureOr<::mlir::LLVM::IntegerOverflowFlags> parse(AsmParser &parser); |
| 1471 | }; |
| 1472 | |
| 1473 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 1474 | /// used as: |
| 1475 | /// |
| 1476 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 1477 | template<> |
| 1478 | struct FieldParser<std::optional<::mlir::LLVM::IntegerOverflowFlags>, std::optional<::mlir::LLVM::IntegerOverflowFlags>> { |
| 1479 | static constexpr bool isKeyValueCompositional = false; |
| 1480 | |
| 1481 | static FailureOr<std::optional<::mlir::LLVM::IntegerOverflowFlags>> parse(AsmParser &parser); |
| 1482 | }; |
| 1483 | } // namespace mlir |
| 1484 | |
| 1485 | namespace llvm { |
| 1486 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::IntegerOverflowFlags value) { |
| 1487 | auto valueStr = stringifyEnum(enumValue: value); |
| 1488 | return p << valueStr; |
| 1489 | } |
| 1490 | } // namespace llvm |
| 1491 | |
| 1492 | namespace llvm { |
| 1493 | template<> struct DenseMapInfo<::mlir::LLVM::IntegerOverflowFlags> { |
| 1494 | using StorageInfo = ::llvm::DenseMapInfo<uint32_t>; |
| 1495 | |
| 1496 | static unsigned getHashValue(const ::mlir::LLVM::IntegerOverflowFlags &val) { |
| 1497 | return StorageInfo::getHashValue(Val: static_cast<uint32_t>(val)); |
| 1498 | } |
| 1499 | |
| 1500 | static bool isEqual(const ::mlir::LLVM::IntegerOverflowFlags &lhs, const ::mlir::LLVM::IntegerOverflowFlags &rhs) { |
| 1501 | return lhs == rhs; |
| 1502 | } |
| 1503 | }; |
| 1504 | } |
| 1505 | |
| 1506 | namespace mlir::LLVM { |
| 1507 | |
| 1508 | // LLVM debug emission kind |
| 1509 | enum class DIEmissionKind : uint64_t { |
| 1510 | None = 0, |
| 1511 | Full = 1, |
| 1512 | LineTablesOnly = 2, |
| 1513 | DebugDirectivesOnly = 3, |
| 1514 | }; |
| 1515 | |
| 1516 | ::std::optional<DIEmissionKind> symbolizeDIEmissionKind(uint64_t); |
| 1517 | ::llvm::StringRef stringifyDIEmissionKind(DIEmissionKind); |
| 1518 | ::std::optional<DIEmissionKind> symbolizeDIEmissionKind(::llvm::StringRef); |
| 1519 | inline constexpr unsigned getMaxEnumValForDIEmissionKind() { |
| 1520 | return 3; |
| 1521 | } |
| 1522 | |
| 1523 | |
| 1524 | inline ::llvm::StringRef stringifyEnum(DIEmissionKind enumValue) { |
| 1525 | return stringifyDIEmissionKind(enumValue); |
| 1526 | } |
| 1527 | |
| 1528 | template <typename EnumType> |
| 1529 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 1530 | |
| 1531 | template <> |
| 1532 | inline ::std::optional<DIEmissionKind> symbolizeEnum<DIEmissionKind>(::llvm::StringRef str) { |
| 1533 | return symbolizeDIEmissionKind(str); |
| 1534 | } |
| 1535 | |
| 1536 | class DIEmissionKindAttr : public ::mlir::IntegerAttr { |
| 1537 | public: |
| 1538 | using ValueType = DIEmissionKind; |
| 1539 | using ::mlir::IntegerAttr::IntegerAttr; |
| 1540 | static bool classof(::mlir::Attribute attr); |
| 1541 | static DIEmissionKindAttr get(::mlir::MLIRContext *context, DIEmissionKind val); |
| 1542 | DIEmissionKind getValue() const; |
| 1543 | }; |
| 1544 | |
| 1545 | } // namespace mlir::LLVM |
| 1546 | |
| 1547 | namespace mlir { |
| 1548 | template<> |
| 1549 | struct FieldParser<::mlir::LLVM::DIEmissionKind, ::mlir::LLVM::DIEmissionKind> { |
| 1550 | static FailureOr<::mlir::LLVM::DIEmissionKind> parse(AsmParser &parser); |
| 1551 | }; |
| 1552 | |
| 1553 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 1554 | /// used as: |
| 1555 | /// |
| 1556 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 1557 | template<> |
| 1558 | struct FieldParser<std::optional<::mlir::LLVM::DIEmissionKind>, std::optional<::mlir::LLVM::DIEmissionKind>> { |
| 1559 | static constexpr bool isKeyValueCompositional = false; |
| 1560 | |
| 1561 | static FailureOr<std::optional<::mlir::LLVM::DIEmissionKind>> parse(AsmParser &parser); |
| 1562 | }; |
| 1563 | } // namespace mlir |
| 1564 | |
| 1565 | namespace llvm { |
| 1566 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::DIEmissionKind value) { |
| 1567 | auto valueStr = stringifyEnum(enumValue: value); |
| 1568 | return p << valueStr; |
| 1569 | } |
| 1570 | } // namespace llvm |
| 1571 | |
| 1572 | namespace llvm { |
| 1573 | template<> struct DenseMapInfo<::mlir::LLVM::DIEmissionKind> { |
| 1574 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 1575 | |
| 1576 | static unsigned getHashValue(const ::mlir::LLVM::DIEmissionKind &val) { |
| 1577 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 1578 | } |
| 1579 | |
| 1580 | static bool isEqual(const ::mlir::LLVM::DIEmissionKind &lhs, const ::mlir::LLVM::DIEmissionKind &rhs) { |
| 1581 | return lhs == rhs; |
| 1582 | } |
| 1583 | }; |
| 1584 | } |
| 1585 | |
| 1586 | namespace mlir::LLVM { |
| 1587 | |
| 1588 | // LLVM debug name table kind |
| 1589 | enum class DINameTableKind : uint64_t { |
| 1590 | Default = 0, |
| 1591 | GNU = 1, |
| 1592 | None = 2, |
| 1593 | Apple = 3, |
| 1594 | }; |
| 1595 | |
| 1596 | ::std::optional<DINameTableKind> symbolizeDINameTableKind(uint64_t); |
| 1597 | ::llvm::StringRef stringifyDINameTableKind(DINameTableKind); |
| 1598 | ::std::optional<DINameTableKind> symbolizeDINameTableKind(::llvm::StringRef); |
| 1599 | inline constexpr unsigned getMaxEnumValForDINameTableKind() { |
| 1600 | return 3; |
| 1601 | } |
| 1602 | |
| 1603 | |
| 1604 | inline ::llvm::StringRef stringifyEnum(DINameTableKind enumValue) { |
| 1605 | return stringifyDINameTableKind(enumValue); |
| 1606 | } |
| 1607 | |
| 1608 | template <typename EnumType> |
| 1609 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 1610 | |
| 1611 | template <> |
| 1612 | inline ::std::optional<DINameTableKind> symbolizeEnum<DINameTableKind>(::llvm::StringRef str) { |
| 1613 | return symbolizeDINameTableKind(str); |
| 1614 | } |
| 1615 | |
| 1616 | class DINameTableKindAttr : public ::mlir::IntegerAttr { |
| 1617 | public: |
| 1618 | using ValueType = DINameTableKind; |
| 1619 | using ::mlir::IntegerAttr::IntegerAttr; |
| 1620 | static bool classof(::mlir::Attribute attr); |
| 1621 | static DINameTableKindAttr get(::mlir::MLIRContext *context, DINameTableKind val); |
| 1622 | DINameTableKind getValue() const; |
| 1623 | }; |
| 1624 | |
| 1625 | } // namespace mlir::LLVM |
| 1626 | |
| 1627 | namespace mlir { |
| 1628 | template<> |
| 1629 | struct FieldParser<::mlir::LLVM::DINameTableKind, ::mlir::LLVM::DINameTableKind> { |
| 1630 | static FailureOr<::mlir::LLVM::DINameTableKind> parse(AsmParser &parser); |
| 1631 | }; |
| 1632 | |
| 1633 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 1634 | /// used as: |
| 1635 | /// |
| 1636 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 1637 | template<> |
| 1638 | struct FieldParser<std::optional<::mlir::LLVM::DINameTableKind>, std::optional<::mlir::LLVM::DINameTableKind>> { |
| 1639 | static constexpr bool isKeyValueCompositional = false; |
| 1640 | |
| 1641 | static FailureOr<std::optional<::mlir::LLVM::DINameTableKind>> parse(AsmParser &parser); |
| 1642 | }; |
| 1643 | } // namespace mlir |
| 1644 | |
| 1645 | namespace llvm { |
| 1646 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::DINameTableKind value) { |
| 1647 | auto valueStr = stringifyEnum(enumValue: value); |
| 1648 | return p << valueStr; |
| 1649 | } |
| 1650 | } // namespace llvm |
| 1651 | |
| 1652 | namespace llvm { |
| 1653 | template<> struct DenseMapInfo<::mlir::LLVM::DINameTableKind> { |
| 1654 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 1655 | |
| 1656 | static unsigned getHashValue(const ::mlir::LLVM::DINameTableKind &val) { |
| 1657 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 1658 | } |
| 1659 | |
| 1660 | static bool isEqual(const ::mlir::LLVM::DINameTableKind &lhs, const ::mlir::LLVM::DINameTableKind &rhs) { |
| 1661 | return lhs == rhs; |
| 1662 | } |
| 1663 | }; |
| 1664 | } |
| 1665 | |
| 1666 | namespace mlir::LLVM { |
| 1667 | |
| 1668 | // LLVM ProfileSummary format kinds |
| 1669 | enum class ProfileSummaryFormatKind : uint64_t { |
| 1670 | SampleProfile = 0, |
| 1671 | InstrProf = 1, |
| 1672 | CSInstrProf = 2, |
| 1673 | }; |
| 1674 | |
| 1675 | ::std::optional<ProfileSummaryFormatKind> symbolizeProfileSummaryFormatKind(uint64_t); |
| 1676 | ::llvm::StringRef stringifyProfileSummaryFormatKind(ProfileSummaryFormatKind); |
| 1677 | ::std::optional<ProfileSummaryFormatKind> symbolizeProfileSummaryFormatKind(::llvm::StringRef); |
| 1678 | inline constexpr unsigned getMaxEnumValForProfileSummaryFormatKind() { |
| 1679 | return 2; |
| 1680 | } |
| 1681 | |
| 1682 | |
| 1683 | inline ::llvm::StringRef stringifyEnum(ProfileSummaryFormatKind enumValue) { |
| 1684 | return stringifyProfileSummaryFormatKind(enumValue); |
| 1685 | } |
| 1686 | |
| 1687 | template <typename EnumType> |
| 1688 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 1689 | |
| 1690 | template <> |
| 1691 | inline ::std::optional<ProfileSummaryFormatKind> symbolizeEnum<ProfileSummaryFormatKind>(::llvm::StringRef str) { |
| 1692 | return symbolizeProfileSummaryFormatKind(str); |
| 1693 | } |
| 1694 | |
| 1695 | class ProfileSummaryFormatKindAttr : public ::mlir::IntegerAttr { |
| 1696 | public: |
| 1697 | using ValueType = ProfileSummaryFormatKind; |
| 1698 | using ::mlir::IntegerAttr::IntegerAttr; |
| 1699 | static bool classof(::mlir::Attribute attr); |
| 1700 | static ProfileSummaryFormatKindAttr get(::mlir::MLIRContext *context, ProfileSummaryFormatKind val); |
| 1701 | ProfileSummaryFormatKind getValue() const; |
| 1702 | }; |
| 1703 | |
| 1704 | } // namespace mlir::LLVM |
| 1705 | |
| 1706 | namespace mlir { |
| 1707 | template<> |
| 1708 | struct FieldParser<::mlir::LLVM::ProfileSummaryFormatKind, ::mlir::LLVM::ProfileSummaryFormatKind> { |
| 1709 | static FailureOr<::mlir::LLVM::ProfileSummaryFormatKind> parse(AsmParser &parser); |
| 1710 | }; |
| 1711 | |
| 1712 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 1713 | /// used as: |
| 1714 | /// |
| 1715 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 1716 | template<> |
| 1717 | struct FieldParser<std::optional<::mlir::LLVM::ProfileSummaryFormatKind>, std::optional<::mlir::LLVM::ProfileSummaryFormatKind>> { |
| 1718 | static constexpr bool isKeyValueCompositional = false; |
| 1719 | |
| 1720 | static FailureOr<std::optional<::mlir::LLVM::ProfileSummaryFormatKind>> parse(AsmParser &parser); |
| 1721 | }; |
| 1722 | } // namespace mlir |
| 1723 | |
| 1724 | namespace llvm { |
| 1725 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::ProfileSummaryFormatKind value) { |
| 1726 | auto valueStr = stringifyEnum(enumValue: value); |
| 1727 | return p << valueStr; |
| 1728 | } |
| 1729 | } // namespace llvm |
| 1730 | |
| 1731 | namespace llvm { |
| 1732 | template<> struct DenseMapInfo<::mlir::LLVM::ProfileSummaryFormatKind> { |
| 1733 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 1734 | |
| 1735 | static unsigned getHashValue(const ::mlir::LLVM::ProfileSummaryFormatKind &val) { |
| 1736 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 1737 | } |
| 1738 | |
| 1739 | static bool isEqual(const ::mlir::LLVM::ProfileSummaryFormatKind &lhs, const ::mlir::LLVM::ProfileSummaryFormatKind &rhs) { |
| 1740 | return lhs == rhs; |
| 1741 | } |
| 1742 | }; |
| 1743 | } |
| 1744 | |
| 1745 | namespace mlir::LLVM { |
| 1746 | |
| 1747 | // TLS Mode |
| 1748 | enum class ThreadLocalMode : uint64_t { |
| 1749 | NotThreadLocal = 0, |
| 1750 | GeneralDynamic = 1, |
| 1751 | LocalDynamic = 2, |
| 1752 | InitialExec = 3, |
| 1753 | LocalExec = 4, |
| 1754 | }; |
| 1755 | |
| 1756 | ::std::optional<ThreadLocalMode> symbolizeThreadLocalMode(uint64_t); |
| 1757 | ::llvm::StringRef stringifyThreadLocalMode(ThreadLocalMode); |
| 1758 | ::std::optional<ThreadLocalMode> symbolizeThreadLocalMode(::llvm::StringRef); |
| 1759 | inline constexpr unsigned getMaxEnumValForThreadLocalMode() { |
| 1760 | return 4; |
| 1761 | } |
| 1762 | |
| 1763 | |
| 1764 | inline ::llvm::StringRef stringifyEnum(ThreadLocalMode enumValue) { |
| 1765 | return stringifyThreadLocalMode(enumValue); |
| 1766 | } |
| 1767 | |
| 1768 | template <typename EnumType> |
| 1769 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 1770 | |
| 1771 | template <> |
| 1772 | inline ::std::optional<ThreadLocalMode> symbolizeEnum<ThreadLocalMode>(::llvm::StringRef str) { |
| 1773 | return symbolizeThreadLocalMode(str); |
| 1774 | } |
| 1775 | |
| 1776 | class ThreadLocalModeAttr : public ::mlir::IntegerAttr { |
| 1777 | public: |
| 1778 | using ValueType = ThreadLocalMode; |
| 1779 | using ::mlir::IntegerAttr::IntegerAttr; |
| 1780 | static bool classof(::mlir::Attribute attr); |
| 1781 | static ThreadLocalModeAttr get(::mlir::MLIRContext *context, ThreadLocalMode val); |
| 1782 | ThreadLocalMode getValue() const; |
| 1783 | }; |
| 1784 | |
| 1785 | } // namespace mlir::LLVM |
| 1786 | |
| 1787 | namespace mlir { |
| 1788 | template<> |
| 1789 | struct FieldParser<::mlir::LLVM::ThreadLocalMode, ::mlir::LLVM::ThreadLocalMode> { |
| 1790 | static FailureOr<::mlir::LLVM::ThreadLocalMode> parse(AsmParser &parser); |
| 1791 | }; |
| 1792 | |
| 1793 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 1794 | /// used as: |
| 1795 | /// |
| 1796 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 1797 | template<> |
| 1798 | struct FieldParser<std::optional<::mlir::LLVM::ThreadLocalMode>, std::optional<::mlir::LLVM::ThreadLocalMode>> { |
| 1799 | static constexpr bool isKeyValueCompositional = false; |
| 1800 | |
| 1801 | static FailureOr<std::optional<::mlir::LLVM::ThreadLocalMode>> parse(AsmParser &parser); |
| 1802 | }; |
| 1803 | } // namespace mlir |
| 1804 | |
| 1805 | namespace llvm { |
| 1806 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::ThreadLocalMode value) { |
| 1807 | auto valueStr = stringifyEnum(enumValue: value); |
| 1808 | switch (value) { |
| 1809 | case ::mlir::LLVM::ThreadLocalMode::GeneralDynamic: |
| 1810 | case ::mlir::LLVM::ThreadLocalMode::LocalDynamic: |
| 1811 | case ::mlir::LLVM::ThreadLocalMode::InitialExec: |
| 1812 | case ::mlir::LLVM::ThreadLocalMode::LocalExec: |
| 1813 | break; |
| 1814 | default: |
| 1815 | return p << '"' << valueStr << '"'; |
| 1816 | } |
| 1817 | return p << valueStr; |
| 1818 | } |
| 1819 | } // namespace llvm |
| 1820 | |
| 1821 | namespace llvm { |
| 1822 | template<> struct DenseMapInfo<::mlir::LLVM::ThreadLocalMode> { |
| 1823 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 1824 | |
| 1825 | static unsigned getHashValue(const ::mlir::LLVM::ThreadLocalMode &val) { |
| 1826 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 1827 | } |
| 1828 | |
| 1829 | static bool isEqual(const ::mlir::LLVM::ThreadLocalMode &lhs, const ::mlir::LLVM::ThreadLocalMode &rhs) { |
| 1830 | return lhs == rhs; |
| 1831 | } |
| 1832 | }; |
| 1833 | } |
| 1834 | |
| 1835 | namespace mlir::LLVM::linkage { |
| 1836 | |
| 1837 | // LLVM linkage types |
| 1838 | enum class Linkage : uint64_t { |
| 1839 | External = 0, |
| 1840 | AvailableExternally = 1, |
| 1841 | Linkonce = 2, |
| 1842 | LinkonceODR = 3, |
| 1843 | Weak = 4, |
| 1844 | WeakODR = 5, |
| 1845 | Appending = 6, |
| 1846 | Internal = 7, |
| 1847 | Private = 8, |
| 1848 | ExternWeak = 9, |
| 1849 | Common = 10, |
| 1850 | }; |
| 1851 | |
| 1852 | ::std::optional<Linkage> symbolizeLinkage(uint64_t); |
| 1853 | ::llvm::StringRef stringifyLinkage(Linkage); |
| 1854 | ::std::optional<Linkage> symbolizeLinkage(::llvm::StringRef); |
| 1855 | inline constexpr unsigned getMaxEnumValForLinkage() { |
| 1856 | return 10; |
| 1857 | } |
| 1858 | |
| 1859 | |
| 1860 | inline ::llvm::StringRef stringifyEnum(Linkage enumValue) { |
| 1861 | return stringifyLinkage(enumValue); |
| 1862 | } |
| 1863 | |
| 1864 | template <typename EnumType> |
| 1865 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 1866 | |
| 1867 | template <> |
| 1868 | inline ::std::optional<Linkage> symbolizeEnum<Linkage>(::llvm::StringRef str) { |
| 1869 | return symbolizeLinkage(str); |
| 1870 | } |
| 1871 | |
| 1872 | class LinkageAttr : public ::mlir::IntegerAttr { |
| 1873 | public: |
| 1874 | using ValueType = Linkage; |
| 1875 | using ::mlir::IntegerAttr::IntegerAttr; |
| 1876 | static bool classof(::mlir::Attribute attr); |
| 1877 | static LinkageAttr get(::mlir::MLIRContext *context, Linkage val); |
| 1878 | Linkage getValue() const; |
| 1879 | }; |
| 1880 | |
| 1881 | } // namespace mlir::LLVM::linkage |
| 1882 | |
| 1883 | namespace mlir { |
| 1884 | template<> |
| 1885 | struct FieldParser<::mlir::LLVM::linkage::Linkage, ::mlir::LLVM::linkage::Linkage> { |
| 1886 | static FailureOr<::mlir::LLVM::linkage::Linkage> parse(AsmParser &parser); |
| 1887 | }; |
| 1888 | |
| 1889 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 1890 | /// used as: |
| 1891 | /// |
| 1892 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 1893 | template<> |
| 1894 | struct FieldParser<std::optional<::mlir::LLVM::linkage::Linkage>, std::optional<::mlir::LLVM::linkage::Linkage>> { |
| 1895 | static constexpr bool isKeyValueCompositional = false; |
| 1896 | |
| 1897 | static FailureOr<std::optional<::mlir::LLVM::linkage::Linkage>> parse(AsmParser &parser); |
| 1898 | }; |
| 1899 | } // namespace mlir |
| 1900 | |
| 1901 | namespace llvm { |
| 1902 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::linkage::Linkage value) { |
| 1903 | auto valueStr = stringifyEnum(enumValue: value); |
| 1904 | return p << valueStr; |
| 1905 | } |
| 1906 | } // namespace llvm |
| 1907 | |
| 1908 | namespace llvm { |
| 1909 | template<> struct DenseMapInfo<::mlir::LLVM::linkage::Linkage> { |
| 1910 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 1911 | |
| 1912 | static unsigned getHashValue(const ::mlir::LLVM::linkage::Linkage &val) { |
| 1913 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 1914 | } |
| 1915 | |
| 1916 | static bool isEqual(const ::mlir::LLVM::linkage::Linkage &lhs, const ::mlir::LLVM::linkage::Linkage &rhs) { |
| 1917 | return lhs == rhs; |
| 1918 | } |
| 1919 | }; |
| 1920 | } |
| 1921 | |
| 1922 | namespace mlir::LLVM { |
| 1923 | |
| 1924 | // LLVM Module Flag Behavior |
| 1925 | enum class ModFlagBehavior : uint64_t { |
| 1926 | Error = 1, |
| 1927 | Warning = 2, |
| 1928 | Require = 3, |
| 1929 | Override = 4, |
| 1930 | Append = 5, |
| 1931 | AppendUnique = 6, |
| 1932 | Max = 7, |
| 1933 | Min = 8, |
| 1934 | }; |
| 1935 | |
| 1936 | ::std::optional<ModFlagBehavior> symbolizeModFlagBehavior(uint64_t); |
| 1937 | ::llvm::StringRef stringifyModFlagBehavior(ModFlagBehavior); |
| 1938 | ::std::optional<ModFlagBehavior> symbolizeModFlagBehavior(::llvm::StringRef); |
| 1939 | inline constexpr unsigned getMaxEnumValForModFlagBehavior() { |
| 1940 | return 8; |
| 1941 | } |
| 1942 | |
| 1943 | |
| 1944 | inline ::llvm::StringRef stringifyEnum(ModFlagBehavior enumValue) { |
| 1945 | return stringifyModFlagBehavior(enumValue); |
| 1946 | } |
| 1947 | |
| 1948 | template <typename EnumType> |
| 1949 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 1950 | |
| 1951 | template <> |
| 1952 | inline ::std::optional<ModFlagBehavior> symbolizeEnum<ModFlagBehavior>(::llvm::StringRef str) { |
| 1953 | return symbolizeModFlagBehavior(str); |
| 1954 | } |
| 1955 | |
| 1956 | class ModFlagBehaviorAttr : public ::mlir::IntegerAttr { |
| 1957 | public: |
| 1958 | using ValueType = ModFlagBehavior; |
| 1959 | using ::mlir::IntegerAttr::IntegerAttr; |
| 1960 | static bool classof(::mlir::Attribute attr); |
| 1961 | static ModFlagBehaviorAttr get(::mlir::MLIRContext *context, ModFlagBehavior val); |
| 1962 | ModFlagBehavior getValue() const; |
| 1963 | }; |
| 1964 | |
| 1965 | } // namespace mlir::LLVM |
| 1966 | |
| 1967 | namespace mlir { |
| 1968 | template<> |
| 1969 | struct FieldParser<::mlir::LLVM::ModFlagBehavior, ::mlir::LLVM::ModFlagBehavior> { |
| 1970 | static FailureOr<::mlir::LLVM::ModFlagBehavior> parse(AsmParser &parser); |
| 1971 | }; |
| 1972 | |
| 1973 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 1974 | /// used as: |
| 1975 | /// |
| 1976 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 1977 | template<> |
| 1978 | struct FieldParser<std::optional<::mlir::LLVM::ModFlagBehavior>, std::optional<::mlir::LLVM::ModFlagBehavior>> { |
| 1979 | static constexpr bool isKeyValueCompositional = false; |
| 1980 | |
| 1981 | static FailureOr<std::optional<::mlir::LLVM::ModFlagBehavior>> parse(AsmParser &parser); |
| 1982 | }; |
| 1983 | } // namespace mlir |
| 1984 | |
| 1985 | namespace llvm { |
| 1986 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::ModFlagBehavior value) { |
| 1987 | auto valueStr = stringifyEnum(enumValue: value); |
| 1988 | return p << valueStr; |
| 1989 | } |
| 1990 | } // namespace llvm |
| 1991 | |
| 1992 | namespace llvm { |
| 1993 | template<> struct DenseMapInfo<::mlir::LLVM::ModFlagBehavior> { |
| 1994 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 1995 | |
| 1996 | static unsigned getHashValue(const ::mlir::LLVM::ModFlagBehavior &val) { |
| 1997 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 1998 | } |
| 1999 | |
| 2000 | static bool isEqual(const ::mlir::LLVM::ModFlagBehavior &lhs, const ::mlir::LLVM::ModFlagBehavior &rhs) { |
| 2001 | return lhs == rhs; |
| 2002 | } |
| 2003 | }; |
| 2004 | } |
| 2005 | |
| 2006 | namespace mlir::LLVM { |
| 2007 | |
| 2008 | // LLVM ModRefInfo |
| 2009 | enum class ModRefInfo : uint64_t { |
| 2010 | NoModRef = 0, |
| 2011 | Ref = 1, |
| 2012 | Mod = 2, |
| 2013 | ModRef = 3, |
| 2014 | }; |
| 2015 | |
| 2016 | ::std::optional<ModRefInfo> symbolizeModRefInfo(uint64_t); |
| 2017 | ::llvm::StringRef stringifyModRefInfo(ModRefInfo); |
| 2018 | ::std::optional<ModRefInfo> symbolizeModRefInfo(::llvm::StringRef); |
| 2019 | inline constexpr unsigned getMaxEnumValForModRefInfo() { |
| 2020 | return 3; |
| 2021 | } |
| 2022 | |
| 2023 | |
| 2024 | inline ::llvm::StringRef stringifyEnum(ModRefInfo enumValue) { |
| 2025 | return stringifyModRefInfo(enumValue); |
| 2026 | } |
| 2027 | |
| 2028 | template <typename EnumType> |
| 2029 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 2030 | |
| 2031 | template <> |
| 2032 | inline ::std::optional<ModRefInfo> symbolizeEnum<ModRefInfo>(::llvm::StringRef str) { |
| 2033 | return symbolizeModRefInfo(str); |
| 2034 | } |
| 2035 | |
| 2036 | class ModRefInfoAttr : public ::mlir::IntegerAttr { |
| 2037 | public: |
| 2038 | using ValueType = ModRefInfo; |
| 2039 | using ::mlir::IntegerAttr::IntegerAttr; |
| 2040 | static bool classof(::mlir::Attribute attr); |
| 2041 | static ModRefInfoAttr get(::mlir::MLIRContext *context, ModRefInfo val); |
| 2042 | ModRefInfo getValue() const; |
| 2043 | }; |
| 2044 | |
| 2045 | } // namespace mlir::LLVM |
| 2046 | |
| 2047 | namespace mlir { |
| 2048 | template<> |
| 2049 | struct FieldParser<::mlir::LLVM::ModRefInfo, ::mlir::LLVM::ModRefInfo> { |
| 2050 | static FailureOr<::mlir::LLVM::ModRefInfo> parse(AsmParser &parser); |
| 2051 | }; |
| 2052 | |
| 2053 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 2054 | /// used as: |
| 2055 | /// |
| 2056 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 2057 | template<> |
| 2058 | struct FieldParser<std::optional<::mlir::LLVM::ModRefInfo>, std::optional<::mlir::LLVM::ModRefInfo>> { |
| 2059 | static constexpr bool isKeyValueCompositional = false; |
| 2060 | |
| 2061 | static FailureOr<std::optional<::mlir::LLVM::ModRefInfo>> parse(AsmParser &parser); |
| 2062 | }; |
| 2063 | } // namespace mlir |
| 2064 | |
| 2065 | namespace llvm { |
| 2066 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::ModRefInfo value) { |
| 2067 | auto valueStr = stringifyEnum(enumValue: value); |
| 2068 | return p << valueStr; |
| 2069 | } |
| 2070 | } // namespace llvm |
| 2071 | |
| 2072 | namespace llvm { |
| 2073 | template<> struct DenseMapInfo<::mlir::LLVM::ModRefInfo> { |
| 2074 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 2075 | |
| 2076 | static unsigned getHashValue(const ::mlir::LLVM::ModRefInfo &val) { |
| 2077 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 2078 | } |
| 2079 | |
| 2080 | static bool isEqual(const ::mlir::LLVM::ModRefInfo &lhs, const ::mlir::LLVM::ModRefInfo &rhs) { |
| 2081 | return lhs == rhs; |
| 2082 | } |
| 2083 | }; |
| 2084 | } |
| 2085 | |
| 2086 | namespace mlir::LLVM { |
| 2087 | |
| 2088 | // LLVM Rounding Mode |
| 2089 | enum class RoundingMode : uint64_t { |
| 2090 | TowardZero = 0, |
| 2091 | NearestTiesToEven = 1, |
| 2092 | TowardPositive = 2, |
| 2093 | TowardNegative = 3, |
| 2094 | NearestTiesToAway = 4, |
| 2095 | Dynamic = 7, |
| 2096 | Invalid, |
| 2097 | }; |
| 2098 | |
| 2099 | ::llvm::StringRef stringifyRoundingMode(RoundingMode); |
| 2100 | ::std::optional<RoundingMode> symbolizeRoundingMode(::llvm::StringRef); |
| 2101 | |
| 2102 | inline ::llvm::StringRef stringifyEnum(RoundingMode enumValue) { |
| 2103 | return stringifyRoundingMode(enumValue); |
| 2104 | } |
| 2105 | |
| 2106 | template <typename EnumType> |
| 2107 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 2108 | |
| 2109 | template <> |
| 2110 | inline ::std::optional<RoundingMode> symbolizeEnum<RoundingMode>(::llvm::StringRef str) { |
| 2111 | return symbolizeRoundingMode(str); |
| 2112 | } |
| 2113 | |
| 2114 | class RoundingModeAttr : public ::mlir::IntegerAttr { |
| 2115 | public: |
| 2116 | using ValueType = RoundingMode; |
| 2117 | using ::mlir::IntegerAttr::IntegerAttr; |
| 2118 | static bool classof(::mlir::Attribute attr); |
| 2119 | static RoundingModeAttr get(::mlir::MLIRContext *context, RoundingMode val); |
| 2120 | RoundingMode getValue() const; |
| 2121 | }; |
| 2122 | |
| 2123 | } // namespace mlir::LLVM |
| 2124 | |
| 2125 | namespace mlir { |
| 2126 | template<> |
| 2127 | struct FieldParser<::mlir::LLVM::RoundingMode, ::mlir::LLVM::RoundingMode> { |
| 2128 | static FailureOr<::mlir::LLVM::RoundingMode> parse(AsmParser &parser); |
| 2129 | }; |
| 2130 | |
| 2131 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 2132 | /// used as: |
| 2133 | /// |
| 2134 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 2135 | template<> |
| 2136 | struct FieldParser<std::optional<::mlir::LLVM::RoundingMode>, std::optional<::mlir::LLVM::RoundingMode>> { |
| 2137 | static constexpr bool isKeyValueCompositional = false; |
| 2138 | |
| 2139 | static FailureOr<std::optional<::mlir::LLVM::RoundingMode>> parse(AsmParser &parser); |
| 2140 | }; |
| 2141 | } // namespace mlir |
| 2142 | |
| 2143 | namespace llvm { |
| 2144 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::RoundingMode value) { |
| 2145 | auto valueStr = stringifyEnum(enumValue: value); |
| 2146 | return p << valueStr; |
| 2147 | } |
| 2148 | } // namespace llvm |
| 2149 | |
| 2150 | namespace llvm { |
| 2151 | template<> struct DenseMapInfo<::mlir::LLVM::RoundingMode> { |
| 2152 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 2153 | |
| 2154 | static unsigned getHashValue(const ::mlir::LLVM::RoundingMode &val) { |
| 2155 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 2156 | } |
| 2157 | |
| 2158 | static bool isEqual(const ::mlir::LLVM::RoundingMode &lhs, const ::mlir::LLVM::RoundingMode &rhs) { |
| 2159 | return lhs == rhs; |
| 2160 | } |
| 2161 | }; |
| 2162 | } |
| 2163 | |
| 2164 | namespace mlir::LLVM::tailcallkind { |
| 2165 | |
| 2166 | // Tail Call Kind |
| 2167 | enum class TailCallKind : uint64_t { |
| 2168 | None = 0, |
| 2169 | NoTail = 3, |
| 2170 | MustTail = 2, |
| 2171 | Tail = 1, |
| 2172 | }; |
| 2173 | |
| 2174 | ::std::optional<TailCallKind> symbolizeTailCallKind(uint64_t); |
| 2175 | ::llvm::StringRef stringifyTailCallKind(TailCallKind); |
| 2176 | ::std::optional<TailCallKind> symbolizeTailCallKind(::llvm::StringRef); |
| 2177 | inline constexpr unsigned getMaxEnumValForTailCallKind() { |
| 2178 | return 3; |
| 2179 | } |
| 2180 | |
| 2181 | |
| 2182 | inline ::llvm::StringRef stringifyEnum(TailCallKind enumValue) { |
| 2183 | return stringifyTailCallKind(enumValue); |
| 2184 | } |
| 2185 | |
| 2186 | template <typename EnumType> |
| 2187 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 2188 | |
| 2189 | template <> |
| 2190 | inline ::std::optional<TailCallKind> symbolizeEnum<TailCallKind>(::llvm::StringRef str) { |
| 2191 | return symbolizeTailCallKind(str); |
| 2192 | } |
| 2193 | |
| 2194 | class TailCallKindAttr : public ::mlir::IntegerAttr { |
| 2195 | public: |
| 2196 | using ValueType = TailCallKind; |
| 2197 | using ::mlir::IntegerAttr::IntegerAttr; |
| 2198 | static bool classof(::mlir::Attribute attr); |
| 2199 | static TailCallKindAttr get(::mlir::MLIRContext *context, TailCallKind val); |
| 2200 | TailCallKind getValue() const; |
| 2201 | }; |
| 2202 | |
| 2203 | } // namespace mlir::LLVM::tailcallkind |
| 2204 | |
| 2205 | namespace mlir { |
| 2206 | template<> |
| 2207 | struct FieldParser<::mlir::LLVM::tailcallkind::TailCallKind, ::mlir::LLVM::tailcallkind::TailCallKind> { |
| 2208 | static FailureOr<::mlir::LLVM::tailcallkind::TailCallKind> parse(AsmParser &parser); |
| 2209 | }; |
| 2210 | |
| 2211 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 2212 | /// used as: |
| 2213 | /// |
| 2214 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 2215 | template<> |
| 2216 | struct FieldParser<std::optional<::mlir::LLVM::tailcallkind::TailCallKind>, std::optional<::mlir::LLVM::tailcallkind::TailCallKind>> { |
| 2217 | static constexpr bool isKeyValueCompositional = false; |
| 2218 | |
| 2219 | static FailureOr<std::optional<::mlir::LLVM::tailcallkind::TailCallKind>> parse(AsmParser &parser); |
| 2220 | }; |
| 2221 | } // namespace mlir |
| 2222 | |
| 2223 | namespace llvm { |
| 2224 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::tailcallkind::TailCallKind value) { |
| 2225 | auto valueStr = stringifyEnum(enumValue: value); |
| 2226 | return p << valueStr; |
| 2227 | } |
| 2228 | } // namespace llvm |
| 2229 | |
| 2230 | namespace llvm { |
| 2231 | template<> struct DenseMapInfo<::mlir::LLVM::tailcallkind::TailCallKind> { |
| 2232 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 2233 | |
| 2234 | static unsigned getHashValue(const ::mlir::LLVM::tailcallkind::TailCallKind &val) { |
| 2235 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 2236 | } |
| 2237 | |
| 2238 | static bool isEqual(const ::mlir::LLVM::tailcallkind::TailCallKind &lhs, const ::mlir::LLVM::tailcallkind::TailCallKind &rhs) { |
| 2239 | return lhs == rhs; |
| 2240 | } |
| 2241 | }; |
| 2242 | } |
| 2243 | |
| 2244 | namespace mlir::LLVM::uwtable { |
| 2245 | |
| 2246 | // LLVM Unwind Behavior |
| 2247 | enum class UWTableKind : uint64_t { |
| 2248 | None = 0, |
| 2249 | Sync = 1, |
| 2250 | Async = 2, |
| 2251 | }; |
| 2252 | |
| 2253 | ::std::optional<UWTableKind> symbolizeUWTableKind(uint64_t); |
| 2254 | ::llvm::StringRef stringifyUWTableKind(UWTableKind); |
| 2255 | ::std::optional<UWTableKind> symbolizeUWTableKind(::llvm::StringRef); |
| 2256 | inline constexpr unsigned getMaxEnumValForUWTableKind() { |
| 2257 | return 2; |
| 2258 | } |
| 2259 | |
| 2260 | |
| 2261 | inline ::llvm::StringRef stringifyEnum(UWTableKind enumValue) { |
| 2262 | return stringifyUWTableKind(enumValue); |
| 2263 | } |
| 2264 | |
| 2265 | template <typename EnumType> |
| 2266 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 2267 | |
| 2268 | template <> |
| 2269 | inline ::std::optional<UWTableKind> symbolizeEnum<UWTableKind>(::llvm::StringRef str) { |
| 2270 | return symbolizeUWTableKind(str); |
| 2271 | } |
| 2272 | |
| 2273 | class UWTableKindAttr : public ::mlir::IntegerAttr { |
| 2274 | public: |
| 2275 | using ValueType = UWTableKind; |
| 2276 | using ::mlir::IntegerAttr::IntegerAttr; |
| 2277 | static bool classof(::mlir::Attribute attr); |
| 2278 | static UWTableKindAttr get(::mlir::MLIRContext *context, UWTableKind val); |
| 2279 | UWTableKind getValue() const; |
| 2280 | }; |
| 2281 | |
| 2282 | } // namespace mlir::LLVM::uwtable |
| 2283 | |
| 2284 | namespace mlir { |
| 2285 | template<> |
| 2286 | struct FieldParser<::mlir::LLVM::uwtable::UWTableKind, ::mlir::LLVM::uwtable::UWTableKind> { |
| 2287 | static FailureOr<::mlir::LLVM::uwtable::UWTableKind> parse(AsmParser &parser); |
| 2288 | }; |
| 2289 | |
| 2290 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 2291 | /// used as: |
| 2292 | /// |
| 2293 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 2294 | template<> |
| 2295 | struct FieldParser<std::optional<::mlir::LLVM::uwtable::UWTableKind>, std::optional<::mlir::LLVM::uwtable::UWTableKind>> { |
| 2296 | static constexpr bool isKeyValueCompositional = false; |
| 2297 | |
| 2298 | static FailureOr<std::optional<::mlir::LLVM::uwtable::UWTableKind>> parse(AsmParser &parser); |
| 2299 | }; |
| 2300 | } // namespace mlir |
| 2301 | |
| 2302 | namespace llvm { |
| 2303 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::uwtable::UWTableKind value) { |
| 2304 | auto valueStr = stringifyEnum(enumValue: value); |
| 2305 | return p << valueStr; |
| 2306 | } |
| 2307 | } // namespace llvm |
| 2308 | |
| 2309 | namespace llvm { |
| 2310 | template<> struct DenseMapInfo<::mlir::LLVM::uwtable::UWTableKind> { |
| 2311 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 2312 | |
| 2313 | static unsigned getHashValue(const ::mlir::LLVM::uwtable::UWTableKind &val) { |
| 2314 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 2315 | } |
| 2316 | |
| 2317 | static bool isEqual(const ::mlir::LLVM::uwtable::UWTableKind &lhs, const ::mlir::LLVM::uwtable::UWTableKind &rhs) { |
| 2318 | return lhs == rhs; |
| 2319 | } |
| 2320 | }; |
| 2321 | } |
| 2322 | |
| 2323 | namespace mlir::LLVM { |
| 2324 | |
| 2325 | // LLVM GlobalValue UnnamedAddr |
| 2326 | enum class UnnamedAddr : uint64_t { |
| 2327 | None = 0, |
| 2328 | Local = 1, |
| 2329 | Global = 2, |
| 2330 | }; |
| 2331 | |
| 2332 | ::std::optional<UnnamedAddr> symbolizeUnnamedAddr(uint64_t); |
| 2333 | ::llvm::StringRef stringifyUnnamedAddr(UnnamedAddr); |
| 2334 | ::std::optional<UnnamedAddr> symbolizeUnnamedAddr(::llvm::StringRef); |
| 2335 | inline constexpr unsigned getMaxEnumValForUnnamedAddr() { |
| 2336 | return 2; |
| 2337 | } |
| 2338 | |
| 2339 | |
| 2340 | inline ::llvm::StringRef stringifyEnum(UnnamedAddr enumValue) { |
| 2341 | return stringifyUnnamedAddr(enumValue); |
| 2342 | } |
| 2343 | |
| 2344 | template <typename EnumType> |
| 2345 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 2346 | |
| 2347 | template <> |
| 2348 | inline ::std::optional<UnnamedAddr> symbolizeEnum<UnnamedAddr>(::llvm::StringRef str) { |
| 2349 | return symbolizeUnnamedAddr(str); |
| 2350 | } |
| 2351 | |
| 2352 | class UnnamedAddrAttr : public ::mlir::IntegerAttr { |
| 2353 | public: |
| 2354 | using ValueType = UnnamedAddr; |
| 2355 | using ::mlir::IntegerAttr::IntegerAttr; |
| 2356 | static bool classof(::mlir::Attribute attr); |
| 2357 | static UnnamedAddrAttr get(::mlir::MLIRContext *context, UnnamedAddr val); |
| 2358 | UnnamedAddr getValue() const; |
| 2359 | }; |
| 2360 | |
| 2361 | } // namespace mlir::LLVM |
| 2362 | |
| 2363 | namespace mlir { |
| 2364 | template<> |
| 2365 | struct FieldParser<::mlir::LLVM::UnnamedAddr, ::mlir::LLVM::UnnamedAddr> { |
| 2366 | static FailureOr<::mlir::LLVM::UnnamedAddr> parse(AsmParser &parser); |
| 2367 | }; |
| 2368 | |
| 2369 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 2370 | /// used as: |
| 2371 | /// |
| 2372 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 2373 | template<> |
| 2374 | struct FieldParser<std::optional<::mlir::LLVM::UnnamedAddr>, std::optional<::mlir::LLVM::UnnamedAddr>> { |
| 2375 | static constexpr bool isKeyValueCompositional = false; |
| 2376 | |
| 2377 | static FailureOr<std::optional<::mlir::LLVM::UnnamedAddr>> parse(AsmParser &parser); |
| 2378 | }; |
| 2379 | } // namespace mlir |
| 2380 | |
| 2381 | namespace llvm { |
| 2382 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::UnnamedAddr value) { |
| 2383 | auto valueStr = stringifyEnum(enumValue: value); |
| 2384 | switch (value) { |
| 2385 | case ::mlir::LLVM::UnnamedAddr::Local: |
| 2386 | case ::mlir::LLVM::UnnamedAddr::Global: |
| 2387 | break; |
| 2388 | default: |
| 2389 | return p << '"' << valueStr << '"'; |
| 2390 | } |
| 2391 | return p << valueStr; |
| 2392 | } |
| 2393 | } // namespace llvm |
| 2394 | |
| 2395 | namespace llvm { |
| 2396 | template<> struct DenseMapInfo<::mlir::LLVM::UnnamedAddr> { |
| 2397 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 2398 | |
| 2399 | static unsigned getHashValue(const ::mlir::LLVM::UnnamedAddr &val) { |
| 2400 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 2401 | } |
| 2402 | |
| 2403 | static bool isEqual(const ::mlir::LLVM::UnnamedAddr &lhs, const ::mlir::LLVM::UnnamedAddr &rhs) { |
| 2404 | return lhs == rhs; |
| 2405 | } |
| 2406 | }; |
| 2407 | } |
| 2408 | |
| 2409 | namespace mlir::LLVM { |
| 2410 | |
| 2411 | // LLVM GlobalValue Visibility |
| 2412 | enum class Visibility : uint64_t { |
| 2413 | Default = 0, |
| 2414 | Hidden = 1, |
| 2415 | Protected = 2, |
| 2416 | }; |
| 2417 | |
| 2418 | ::std::optional<Visibility> symbolizeVisibility(uint64_t); |
| 2419 | ::llvm::StringRef stringifyVisibility(Visibility); |
| 2420 | ::std::optional<Visibility> symbolizeVisibility(::llvm::StringRef); |
| 2421 | inline constexpr unsigned getMaxEnumValForVisibility() { |
| 2422 | return 2; |
| 2423 | } |
| 2424 | |
| 2425 | |
| 2426 | inline ::llvm::StringRef stringifyEnum(Visibility enumValue) { |
| 2427 | return stringifyVisibility(enumValue); |
| 2428 | } |
| 2429 | |
| 2430 | template <typename EnumType> |
| 2431 | ::std::optional<EnumType> symbolizeEnum(::llvm::StringRef); |
| 2432 | |
| 2433 | template <> |
| 2434 | inline ::std::optional<Visibility> symbolizeEnum<Visibility>(::llvm::StringRef str) { |
| 2435 | return symbolizeVisibility(str); |
| 2436 | } |
| 2437 | |
| 2438 | class VisibilityAttr : public ::mlir::IntegerAttr { |
| 2439 | public: |
| 2440 | using ValueType = Visibility; |
| 2441 | using ::mlir::IntegerAttr::IntegerAttr; |
| 2442 | static bool classof(::mlir::Attribute attr); |
| 2443 | static VisibilityAttr get(::mlir::MLIRContext *context, Visibility val); |
| 2444 | Visibility getValue() const; |
| 2445 | }; |
| 2446 | |
| 2447 | } // namespace mlir::LLVM |
| 2448 | |
| 2449 | namespace mlir { |
| 2450 | template<> |
| 2451 | struct FieldParser<::mlir::LLVM::Visibility, ::mlir::LLVM::Visibility> { |
| 2452 | static FailureOr<::mlir::LLVM::Visibility> parse(AsmParser &parser); |
| 2453 | }; |
| 2454 | |
| 2455 | /// Support for std::optional, useful in attribute/type definition where the enum is |
| 2456 | /// used as: |
| 2457 | /// |
| 2458 | /// let parameters = (ins OptionalParameter<"std::optional<TheEnumName>">:$value); |
| 2459 | template<> |
| 2460 | struct FieldParser<std::optional<::mlir::LLVM::Visibility>, std::optional<::mlir::LLVM::Visibility>> { |
| 2461 | static constexpr bool isKeyValueCompositional = false; |
| 2462 | |
| 2463 | static FailureOr<std::optional<::mlir::LLVM::Visibility>> parse(AsmParser &parser); |
| 2464 | }; |
| 2465 | } // namespace mlir |
| 2466 | |
| 2467 | namespace llvm { |
| 2468 | inline ::llvm::raw_ostream &operator<<(::llvm::raw_ostream &p, ::mlir::LLVM::Visibility value) { |
| 2469 | auto valueStr = stringifyEnum(enumValue: value); |
| 2470 | switch (value) { |
| 2471 | case ::mlir::LLVM::Visibility::Hidden: |
| 2472 | case ::mlir::LLVM::Visibility::Protected: |
| 2473 | break; |
| 2474 | default: |
| 2475 | return p << '"' << valueStr << '"'; |
| 2476 | } |
| 2477 | return p << valueStr; |
| 2478 | } |
| 2479 | } // namespace llvm |
| 2480 | |
| 2481 | namespace llvm { |
| 2482 | template<> struct DenseMapInfo<::mlir::LLVM::Visibility> { |
| 2483 | using StorageInfo = ::llvm::DenseMapInfo<uint64_t>; |
| 2484 | |
| 2485 | static unsigned getHashValue(const ::mlir::LLVM::Visibility &val) { |
| 2486 | return StorageInfo::getHashValue(Val: static_cast<uint64_t>(val)); |
| 2487 | } |
| 2488 | |
| 2489 | static bool isEqual(const ::mlir::LLVM::Visibility &lhs, const ::mlir::LLVM::Visibility &rhs) { |
| 2490 | return lhs == rhs; |
| 2491 | } |
| 2492 | }; |
| 2493 | } |
| 2494 | |
| 2495 | |