| 1 | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
| 2 | |* *| |
| 3 | |* Op Declarations *| |
| 4 | |* *| |
| 5 | |* Automatically generated file, do not edit! *| |
| 6 | |* From: DebugExtensionOps.td *| |
| 7 | |* *| |
| 8 | \*===----------------------------------------------------------------------===*/ |
| 9 | |
| 10 | namespace mlir::transform { |
| 11 | |
| 12 | /// Prints the parameter as a diagnostic remark |
| 13 | /// This operation emits a diagnostic remark containing the string form of the |
| 14 | /// attributes associated with the parameter provided as attribute. It takes |
| 15 | /// as optional arguments: |
| 16 | /// - an additional message text to prepend; |
| 17 | /// - a handle pointing to operations the location of which will be used to |
| 18 | /// emit the diagnostic; if multiple operations are associated, the |
| 19 | /// diagnostic is emitted for all of their respective locations. |
| 20 | /// |
| 21 | /// This operation always succeeds. |
| 22 | class EmitParamAsRemarkOp; |
| 23 | |
| 24 | } // namespace mlir::transform |
| 25 | namespace mlir::transform { |
| 26 | |
| 27 | /// Print a message as diagnostic remark attached to payload |
| 28 | /// This operation emits a diagnostic remark with the given message at the |
| 29 | /// location of each payload object associated with the argument. The argument |
| 30 | /// may be an operation or a value handle. |
| 31 | /// |
| 32 | /// This operation always succeeds. |
| 33 | class EmitRemarkAtOp; |
| 34 | |
| 35 | } // namespace mlir::transform |
| 36 | #ifdef GET_OP_CLASSES |
| 37 | #undef GET_OP_CLASSES |
| 38 | |
| 39 | #include "mlir/Bytecode/BytecodeOpInterface.h" |
| 40 | #include "mlir/IR/BuiltinAttributes.h" |
| 41 | #include "mlir/IR/OpDefinition.h" |
| 42 | #include "mlir/IR/Types.h" |
| 43 | #include "mlir/Interfaces/SideEffectInterfaces.h" |
| 44 | |
| 45 | namespace mlir::transform { |
| 46 | |
| 47 | |
| 48 | //===----------------------------------------------------------------------===// |
| 49 | // ::mlir::transform::EmitParamAsRemarkOp declarations |
| 50 | //===----------------------------------------------------------------------===// |
| 51 | |
| 52 | namespace detail { |
| 53 | |
| 54 | class { |
| 55 | public: |
| 56 | struct { |
| 57 | using = ::mlir::StringAttr; |
| 58 | messageTy ; |
| 59 | |
| 60 | auto () const { |
| 61 | auto &propStorage = this->message; |
| 62 | return ::llvm::dyn_cast_or_null<::mlir::StringAttr>(Val: propStorage); |
| 63 | } |
| 64 | void (const ::mlir::StringAttr &propValue) { |
| 65 | this->message = propValue; |
| 66 | } |
| 67 | bool (const Properties &rhs) const { |
| 68 | return |
| 69 | rhs.message == this->message && |
| 70 | true; |
| 71 | } |
| 72 | bool (const Properties &rhs) const { |
| 73 | return !(*this == rhs); |
| 74 | } |
| 75 | }; |
| 76 | protected: |
| 77 | ::mlir::DictionaryAttr ; |
| 78 | ::std::optional<::mlir::OperationName> ; |
| 79 | Properties ; |
| 80 | ::mlir::RegionRange ; |
| 81 | public: |
| 82 | (::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 83 | odsOpName.emplace(args: "transform.debug.emit_param_as_remark" , args: odsAttrs.getContext()); |
| 84 | } |
| 85 | |
| 86 | (EmitParamAsRemarkOp op); |
| 87 | |
| 88 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize); |
| 89 | const Properties &() { |
| 90 | return properties; |
| 91 | } |
| 92 | |
| 93 | ::mlir::DictionaryAttr () { |
| 94 | return odsAttrs; |
| 95 | } |
| 96 | |
| 97 | ::mlir::StringAttr () { |
| 98 | auto attr = ::llvm::dyn_cast_or_null<::mlir::StringAttr>(Val: getProperties().message); |
| 99 | return attr; |
| 100 | } |
| 101 | |
| 102 | ::std::optional< ::llvm::StringRef > (); |
| 103 | }; |
| 104 | |
| 105 | } // namespace detail |
| 106 | template <typename RangeT> |
| 107 | class : public detail::EmitParamAsRemarkOpGenericAdaptorBase { |
| 108 | using = ::llvm::detail::ValueOfRange<RangeT>; |
| 109 | using = detail::EmitParamAsRemarkOpGenericAdaptorBase; |
| 110 | static constexpr int = 0; |
| 111 | static constexpr int = 1; |
| 112 | public: |
| 113 | (RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 114 | |
| 115 | (RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : EmitParamAsRemarkOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 116 | |
| 117 | (RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : EmitParamAsRemarkOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 118 | |
| 119 | (RangeT values, const EmitParamAsRemarkOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 120 | |
| 121 | template <typename LateInst = EmitParamAsRemarkOp, typename = std::enable_if_t<std::is_same_v<LateInst, EmitParamAsRemarkOp>>> |
| 122 | (RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 123 | |
| 124 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 125 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 126 | } |
| 127 | |
| 128 | RangeT getODSOperands(unsigned index) { |
| 129 | auto valueRange = getODSOperandIndexAndLength(index); |
| 130 | return {std::next(odsOperands.begin(), valueRange.first), |
| 131 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 132 | } |
| 133 | |
| 134 | ValueT () { |
| 135 | return (*getODSOperands(index: 0).begin()); |
| 136 | } |
| 137 | |
| 138 | ValueT () { |
| 139 | auto operands = getODSOperands(index: 1); |
| 140 | return operands.empty() ? ValueT{} : (*operands.begin()); |
| 141 | } |
| 142 | |
| 143 | RangeT getOperands() { |
| 144 | return odsOperands; |
| 145 | } |
| 146 | |
| 147 | private: |
| 148 | RangeT odsOperands; |
| 149 | }; |
| 150 | class : public EmitParamAsRemarkOpGenericAdaptor<::mlir::ValueRange> { |
| 151 | public: |
| 152 | using EmitParamAsRemarkOpGenericAdaptor::EmitParamAsRemarkOpGenericAdaptor; |
| 153 | (EmitParamAsRemarkOp op); |
| 154 | |
| 155 | ::llvm::LogicalResult (::mlir::Location loc); |
| 156 | }; |
| 157 | class : public ::mlir::Op<EmitParamAsRemarkOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::AtLeastNOperands<1>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::transform::TransformOpInterface::Trait, ::mlir::transform::MatchOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::transform::NavigationTransformOpTrait> { |
| 158 | public: |
| 159 | using Op::Op; |
| 160 | using Op::print; |
| 161 | using = EmitParamAsRemarkOpAdaptor; |
| 162 | template <typename RangeT> |
| 163 | using = EmitParamAsRemarkOpGenericAdaptor<RangeT>; |
| 164 | using = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 165 | static constexpr int = 0; |
| 166 | static constexpr int = 1; |
| 167 | using = FoldAdaptor::Properties; |
| 168 | using ::mlir::transform::TransformOpInterface::Trait<EmitParamAsRemarkOp>::allowsRepeatedHandleOperands; |
| 169 | static ::llvm::ArrayRef<::llvm::StringRef> () { |
| 170 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("message" )}; |
| 171 | return ::llvm::ArrayRef(attrNames); |
| 172 | } |
| 173 | |
| 174 | ::mlir::StringAttr () { |
| 175 | return getAttributeNameForIndex(index: 0); |
| 176 | } |
| 177 | |
| 178 | static ::mlir::StringAttr (::mlir::OperationName name) { |
| 179 | return getAttributeNameForIndex(name, index: 0); |
| 180 | } |
| 181 | |
| 182 | static constexpr ::llvm::StringLiteral () { |
| 183 | return ::llvm::StringLiteral("transform.debug.emit_param_as_remark" ); |
| 184 | } |
| 185 | |
| 186 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index); |
| 187 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 188 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 189 | return getOperation()->getOperands().slice(n: start, m: length); |
| 190 | } |
| 191 | |
| 192 | ::mlir::TypedValue<::mlir::transform::TransformParamTypeInterface> () { |
| 193 | return ::llvm::cast<::mlir::TypedValue<::mlir::transform::TransformParamTypeInterface>>(Val: *getODSOperands(index: 0).begin()); |
| 194 | } |
| 195 | |
| 196 | ::mlir::TypedValue<::mlir::transform::TransformHandleTypeInterface> () { |
| 197 | auto operands = getODSOperands(index: 1); |
| 198 | return operands.empty() ? ::mlir::TypedValue<::mlir::transform::TransformHandleTypeInterface>{} : ::llvm::cast<::mlir::TypedValue<::mlir::transform::TransformHandleTypeInterface>>(Val: *operands.begin()); |
| 199 | } |
| 200 | |
| 201 | ::mlir::OpOperand &() { |
| 202 | auto range = getODSOperandIndexAndLength(index: 0); |
| 203 | return getOperation()->getOpOperand(idx: range.first); |
| 204 | } |
| 205 | |
| 206 | ::mlir::MutableOperandRange (); |
| 207 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 208 | return {index, 1}; |
| 209 | } |
| 210 | |
| 211 | ::mlir::Operation::result_range (unsigned index) { |
| 212 | auto valueRange = getODSResultIndexAndLength(index); |
| 213 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 214 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 215 | } |
| 216 | |
| 217 | static ::llvm::LogicalResult (Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 218 | static ::mlir::Attribute (::mlir::MLIRContext *ctx, const Properties &prop); |
| 219 | static llvm::hash_code (const Properties &prop); |
| 220 | static std::optional<mlir::Attribute> (::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 221 | static void (Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 222 | static void (::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 223 | static ::llvm::LogicalResult (::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 224 | static ::llvm::LogicalResult (::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 225 | void (::mlir::DialectBytecodeWriter &writer); |
| 226 | ::mlir::StringAttr () { |
| 227 | return ::llvm::dyn_cast_or_null<::mlir::StringAttr>(Val&: getProperties().message); |
| 228 | } |
| 229 | |
| 230 | ::std::optional< ::llvm::StringRef > (); |
| 231 | void (::mlir::StringAttr attr) { |
| 232 | getProperties().message = attr; |
| 233 | } |
| 234 | |
| 235 | void (::std::optional<::llvm::StringRef> attrValue); |
| 236 | ::mlir::Attribute () { |
| 237 | auto attr = getProperties().message; |
| 238 | getProperties().message = {}; |
| 239 | return attr; |
| 240 | } |
| 241 | |
| 242 | static void (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value param, /*optional*/::mlir::Value anchor, /*optional*/::mlir::StringAttr message); |
| 243 | static EmitParamAsRemarkOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value param, /*optional*/::mlir::Value anchor, /*optional*/::mlir::StringAttr message); |
| 244 | static EmitParamAsRemarkOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value param, /*optional*/::mlir::Value anchor, /*optional*/::mlir::StringAttr message); |
| 245 | static void (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value param, /*optional*/::mlir::Value anchor, /*optional*/::mlir::StringAttr message); |
| 246 | static EmitParamAsRemarkOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value param, /*optional*/::mlir::Value anchor, /*optional*/::mlir::StringAttr message); |
| 247 | static EmitParamAsRemarkOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value param, /*optional*/::mlir::Value anchor, /*optional*/::mlir::StringAttr message); |
| 248 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 249 | static void (::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 250 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 251 | static EmitParamAsRemarkOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 252 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 253 | static EmitParamAsRemarkOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 254 | static void (::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 255 | static EmitParamAsRemarkOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 256 | static EmitParamAsRemarkOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 257 | ::llvm::LogicalResult (); |
| 258 | ::llvm::LogicalResult (); |
| 259 | ::mlir::DiagnosedSilenceableFailure (::mlir::transform::TransformRewriter &rewriter, ::mlir::transform::TransformResults &transformResults, ::mlir::transform::TransformState &state); |
| 260 | static ::mlir::ParseResult (::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 261 | LLVM_ATTRIBUTE_MINSIZE void (::mlir::OpAsmPrinter &_odsPrinter); |
| 262 | private: |
| 263 | ::mlir::StringAttr (unsigned index) { |
| 264 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 265 | } |
| 266 | |
| 267 | static ::mlir::StringAttr (::mlir::OperationName name, unsigned index) { |
| 268 | assert(index < 1 && "invalid attribute index" ); |
| 269 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 270 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 271 | "dependent dialect loading?" ); |
| 272 | return name.getAttributeNames()[index]; |
| 273 | } |
| 274 | |
| 275 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 276 | public: |
| 277 | }; |
| 278 | |
| 279 | } // namespace mlir::transform |
| 280 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::transform::EmitParamAsRemarkOp) |
| 281 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::transform::detail::EmitParamAsRemarkOpGenericAdaptorBase::Properties) |
| 282 | |
| 283 | namespace mlir::transform { |
| 284 | |
| 285 | |
| 286 | //===----------------------------------------------------------------------===// |
| 287 | // ::mlir::transform::EmitRemarkAtOp declarations |
| 288 | //===----------------------------------------------------------------------===// |
| 289 | |
| 290 | namespace detail { |
| 291 | |
| 292 | class { |
| 293 | public: |
| 294 | struct { |
| 295 | using = ::mlir::StringAttr; |
| 296 | messageTy ; |
| 297 | |
| 298 | auto () const { |
| 299 | auto &propStorage = this->message; |
| 300 | return ::llvm::cast<::mlir::StringAttr>(Val: propStorage); |
| 301 | } |
| 302 | void (const ::mlir::StringAttr &propValue) { |
| 303 | this->message = propValue; |
| 304 | } |
| 305 | bool (const Properties &rhs) const { |
| 306 | return |
| 307 | rhs.message == this->message && |
| 308 | true; |
| 309 | } |
| 310 | bool (const Properties &rhs) const { |
| 311 | return !(*this == rhs); |
| 312 | } |
| 313 | }; |
| 314 | protected: |
| 315 | ::mlir::DictionaryAttr ; |
| 316 | ::std::optional<::mlir::OperationName> ; |
| 317 | Properties ; |
| 318 | ::mlir::RegionRange ; |
| 319 | public: |
| 320 | (::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) |
| 321 | odsOpName.emplace(args: "transform.debug.emit_remark_at" , args: odsAttrs.getContext()); |
| 322 | } |
| 323 | |
| 324 | (EmitRemarkAtOp op); |
| 325 | |
| 326 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { |
| 327 | return {index, 1}; |
| 328 | } |
| 329 | |
| 330 | const Properties &() { |
| 331 | return properties; |
| 332 | } |
| 333 | |
| 334 | ::mlir::DictionaryAttr () { |
| 335 | return odsAttrs; |
| 336 | } |
| 337 | |
| 338 | ::mlir::StringAttr () { |
| 339 | auto attr = ::llvm::cast<::mlir::StringAttr>(Val: getProperties().message); |
| 340 | return attr; |
| 341 | } |
| 342 | |
| 343 | ::llvm::StringRef (); |
| 344 | }; |
| 345 | |
| 346 | } // namespace detail |
| 347 | template <typename RangeT> |
| 348 | class : public detail::EmitRemarkAtOpGenericAdaptorBase { |
| 349 | using = ::llvm::detail::ValueOfRange<RangeT>; |
| 350 | using = detail::EmitRemarkAtOpGenericAdaptorBase; |
| 351 | static constexpr int = 0; |
| 352 | public: |
| 353 | (RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} |
| 354 | |
| 355 | (RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : EmitRemarkAtOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {} |
| 356 | |
| 357 | (RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : EmitRemarkAtOpGenericAdaptor(values, attrs, Properties{}, {}) {} |
| 358 | |
| 359 | (RangeT values, const EmitRemarkAtOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} |
| 360 | |
| 361 | template <typename LateInst = EmitRemarkAtOp, typename = std::enable_if_t<std::is_same_v<LateInst, EmitRemarkAtOp>>> |
| 362 | (RangeT values, LateInst op) : Base(op), odsOperands(values) {} |
| 363 | |
| 364 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 365 | return Base::getODSOperandIndexAndLength(index, odsOperandsSize: odsOperands.size()); |
| 366 | } |
| 367 | |
| 368 | RangeT getODSOperands(unsigned index) { |
| 369 | auto valueRange = getODSOperandIndexAndLength(index); |
| 370 | return {std::next(odsOperands.begin(), valueRange.first), |
| 371 | std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; |
| 372 | } |
| 373 | |
| 374 | ValueT () { |
| 375 | return (*getODSOperands(index: 0).begin()); |
| 376 | } |
| 377 | |
| 378 | RangeT getOperands() { |
| 379 | return odsOperands; |
| 380 | } |
| 381 | |
| 382 | private: |
| 383 | RangeT odsOperands; |
| 384 | }; |
| 385 | class : public EmitRemarkAtOpGenericAdaptor<::mlir::ValueRange> { |
| 386 | public: |
| 387 | using EmitRemarkAtOpGenericAdaptor::EmitRemarkAtOpGenericAdaptor; |
| 388 | (EmitRemarkAtOp op); |
| 389 | |
| 390 | ::llvm::LogicalResult (::mlir::Location loc); |
| 391 | }; |
| 392 | class : public ::mlir::Op<EmitRemarkAtOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::transform::TransformOpInterface::Trait, ::mlir::transform::MatchOpInterface::Trait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::transform::NavigationTransformOpTrait> { |
| 393 | public: |
| 394 | using Op::Op; |
| 395 | using Op::print; |
| 396 | using = EmitRemarkAtOpAdaptor; |
| 397 | template <typename RangeT> |
| 398 | using = EmitRemarkAtOpGenericAdaptor<RangeT>; |
| 399 | using = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; |
| 400 | static constexpr int = 0; |
| 401 | using = FoldAdaptor::Properties; |
| 402 | using ::mlir::transform::TransformOpInterface::Trait<EmitRemarkAtOp>::allowsRepeatedHandleOperands; |
| 403 | static ::llvm::ArrayRef<::llvm::StringRef> () { |
| 404 | static ::llvm::StringRef attrNames[] = {::llvm::StringRef("message" )}; |
| 405 | return ::llvm::ArrayRef(attrNames); |
| 406 | } |
| 407 | |
| 408 | ::mlir::StringAttr () { |
| 409 | return getAttributeNameForIndex(index: 0); |
| 410 | } |
| 411 | |
| 412 | static ::mlir::StringAttr (::mlir::OperationName name) { |
| 413 | return getAttributeNameForIndex(name, index: 0); |
| 414 | } |
| 415 | |
| 416 | static constexpr ::llvm::StringLiteral () { |
| 417 | return ::llvm::StringLiteral("transform.debug.emit_remark_at" ); |
| 418 | } |
| 419 | |
| 420 | std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) { |
| 421 | return {index, 1}; |
| 422 | } |
| 423 | |
| 424 | ::mlir::Operation::operand_range getODSOperands(unsigned index) { |
| 425 | auto [start, length] = getODSOperandIndexAndLength(index); |
| 426 | return getOperation()->getOperands().slice(n: start, m: length); |
| 427 | } |
| 428 | |
| 429 | ::mlir::TypedValue<::mlir::Type> () { |
| 430 | return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(Val: *getODSOperands(index: 0).begin()); |
| 431 | } |
| 432 | |
| 433 | ::mlir::OpOperand &() { |
| 434 | auto range = getODSOperandIndexAndLength(index: 0); |
| 435 | return getOperation()->getOpOperand(idx: range.first); |
| 436 | } |
| 437 | |
| 438 | std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) { |
| 439 | return {index, 1}; |
| 440 | } |
| 441 | |
| 442 | ::mlir::Operation::result_range (unsigned index) { |
| 443 | auto valueRange = getODSResultIndexAndLength(index); |
| 444 | return {std::next(x: getOperation()->result_begin(), n: valueRange.first), |
| 445 | std::next(x: getOperation()->result_begin(), n: valueRange.first + valueRange.second)}; |
| 446 | } |
| 447 | |
| 448 | static ::llvm::LogicalResult (Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 449 | static ::mlir::Attribute (::mlir::MLIRContext *ctx, const Properties &prop); |
| 450 | static llvm::hash_code (const Properties &prop); |
| 451 | static std::optional<mlir::Attribute> (::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); |
| 452 | static void (Properties &prop, llvm::StringRef name, mlir::Attribute value); |
| 453 | static void (::mlir::MLIRContext *ctx, Properties &prop, ::llvm::function_ref<void(::llvm::StringRef, ::mlir::Attribute &)> visitor); |
| 454 | static ::llvm::LogicalResult (::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); |
| 455 | static ::llvm::LogicalResult (::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); |
| 456 | void (::mlir::DialectBytecodeWriter &writer); |
| 457 | ::mlir::StringAttr () { |
| 458 | return ::llvm::cast<::mlir::StringAttr>(Val&: getProperties().message); |
| 459 | } |
| 460 | |
| 461 | ::llvm::StringRef (); |
| 462 | void (::mlir::StringAttr attr) { |
| 463 | getProperties().message = attr; |
| 464 | } |
| 465 | |
| 466 | void (::llvm::StringRef attrValue); |
| 467 | static void (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value at, ::mlir::StringAttr message); |
| 468 | static EmitRemarkAtOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value at, ::mlir::StringAttr message); |
| 469 | static EmitRemarkAtOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value at, ::mlir::StringAttr message); |
| 470 | static void (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value at, ::mlir::StringAttr message); |
| 471 | static EmitRemarkAtOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value at, ::mlir::StringAttr message); |
| 472 | static EmitRemarkAtOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value at, ::mlir::StringAttr message); |
| 473 | static void (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value at, ::llvm::StringRef message); |
| 474 | static EmitRemarkAtOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value at, ::llvm::StringRef message); |
| 475 | static EmitRemarkAtOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value at, ::llvm::StringRef message); |
| 476 | static void (::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value at, ::llvm::StringRef message); |
| 477 | static EmitRemarkAtOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value at, ::llvm::StringRef message); |
| 478 | static EmitRemarkAtOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value at, ::llvm::StringRef message); |
| 479 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 480 | static void (::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 481 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 482 | static EmitRemarkAtOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 483 | [[deprecated("use the overload taking Properties and discardableAttributes instead" )]] |
| 484 | static EmitRemarkAtOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); |
| 485 | static void (::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 486 | static EmitRemarkAtOp (::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 487 | static EmitRemarkAtOp (::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); |
| 488 | ::llvm::LogicalResult (); |
| 489 | ::llvm::LogicalResult (); |
| 490 | ::mlir::DiagnosedSilenceableFailure (::mlir::transform::TransformRewriter &rewriter, ::mlir::transform::TransformResults &transformResults, ::mlir::transform::TransformState &state); |
| 491 | static ::mlir::ParseResult (::mlir::OpAsmParser &parser, ::mlir::OperationState &result); |
| 492 | LLVM_ATTRIBUTE_MINSIZE void (::mlir::OpAsmPrinter &_odsPrinter); |
| 493 | private: |
| 494 | ::mlir::StringAttr (unsigned index) { |
| 495 | return getAttributeNameForIndex(name: (*this)->getName(), index); |
| 496 | } |
| 497 | |
| 498 | static ::mlir::StringAttr (::mlir::OperationName name, unsigned index) { |
| 499 | assert(index < 1 && "invalid attribute index" ); |
| 500 | assert(name.getStringRef() == getOperationName() && "invalid operation name" ); |
| 501 | assert(name.isRegistered() && "Operation isn't registered, missing a " |
| 502 | "dependent dialect loading?" ); |
| 503 | return name.getAttributeNames()[index]; |
| 504 | } |
| 505 | |
| 506 | static void buildPropertiesAndDiscardableAttributes(::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes); |
| 507 | public: |
| 508 | }; |
| 509 | |
| 510 | } // namespace mlir::transform |
| 511 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::transform::EmitRemarkAtOp) |
| 512 | MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::transform::detail::EmitRemarkAtOpGenericAdaptorBase::Properties) |
| 513 | |
| 514 | |
| 515 | #endif // GET_OP_CLASSES |
| 516 | |
| 517 | |