Skip to content

Commit d3eef09

Browse files
authored
Integrate llvm-project at 07a8ebed56cfa223d1587903e4de0d5788b5f777 (#19334)
Still carrying a revert for 1004865f1ca41a9581da8747f34b29862d3ebc3d and a cherry pick for llvm/llvm-project#116650. Removed `FieldParser`s for optional enums that get autogenerated as of llvm/llvm-project#117719.
1 parent 7f99587 commit d3eef09

File tree

4 files changed

+1
-185
lines changed

4 files changed

+1
-185
lines changed

compiler/src/iree/compiler/Dialect/HAL/IR/HALTypes.h

-85
Original file line numberDiff line numberDiff line change
@@ -190,91 +190,6 @@ struct StaticRange {
190190

191191
} // namespace mlir::iree_compiler::IREE::HAL
192192

193-
// It's unfortunate this is required.
194-
namespace mlir {
195-
196-
template <>
197-
struct FieldParser<
198-
std::optional<mlir::iree_compiler::IREE::HAL::CollectiveReductionOp>> {
199-
static FailureOr<mlir::iree_compiler::IREE::HAL::CollectiveReductionOp>
200-
parse(AsmParser &parser) {
201-
std::string value;
202-
if (parser.parseKeywordOrString(&value))
203-
return failure();
204-
auto result = mlir::iree_compiler::IREE::HAL::symbolizeEnum<
205-
mlir::iree_compiler::IREE::HAL::CollectiveReductionOp>(value);
206-
if (!result.has_value())
207-
return failure();
208-
return result.value();
209-
}
210-
};
211-
static inline AsmPrinter &
212-
operator<<(AsmPrinter &printer,
213-
std::optional<mlir::iree_compiler::IREE::HAL::CollectiveReductionOp>
214-
param) {
215-
printer << (param.has_value()
216-
? mlir::iree_compiler::IREE::HAL::stringifyEnum(param.value())
217-
: StringRef{""});
218-
return printer;
219-
}
220-
221-
template <>
222-
struct FieldParser<
223-
std::optional<mlir::iree_compiler::IREE::HAL::PipelineLayoutFlags>> {
224-
static FailureOr<mlir::iree_compiler::IREE::HAL::PipelineLayoutFlags>
225-
parse(AsmParser &parser) {
226-
std::string value;
227-
if (parser.parseKeywordOrString(&value))
228-
return failure();
229-
auto result = mlir::iree_compiler::IREE::HAL::symbolizeEnum<
230-
mlir::iree_compiler::IREE::HAL::PipelineLayoutFlags>(value);
231-
if (!result.has_value())
232-
return failure();
233-
return result.value();
234-
}
235-
};
236-
static inline AsmPrinter &operator<<(
237-
AsmPrinter &printer,
238-
std::optional<mlir::iree_compiler::IREE::HAL::PipelineLayoutFlags> param) {
239-
printer << (param.has_value()
240-
? mlir::iree_compiler::IREE::HAL::stringifyEnum(param.value())
241-
: StringRef{""});
242-
return printer;
243-
}
244-
245-
template <>
246-
struct FieldParser<
247-
std::optional<mlir::iree_compiler::IREE::HAL::DescriptorFlags>> {
248-
static FailureOr<mlir::iree_compiler::IREE::HAL::DescriptorFlags>
249-
parse(AsmParser &parser) {
250-
std::string value;
251-
if (parser.parseKeywordOrString(&value))
252-
return failure();
253-
auto result = mlir::iree_compiler::IREE::HAL::symbolizeEnum<
254-
mlir::iree_compiler::IREE::HAL::DescriptorFlags>(value);
255-
if (!result.has_value())
256-
return failure();
257-
return result.value();
258-
}
259-
};
260-
static inline AsmPrinter &operator<<(
261-
AsmPrinter &printer,
262-
std::optional<mlir::iree_compiler::IREE::HAL::DescriptorFlags> param) {
263-
printer << (param.has_value()
264-
? mlir::iree_compiler::IREE::HAL::stringifyEnum(param.value())
265-
: StringRef{""});
266-
return printer;
267-
}
268-
269-
static inline AsmPrinter &
270-
operator<<(AsmPrinter &printer,
271-
mlir::iree_compiler::IREE::HAL::DescriptorType param) {
272-
printer << mlir::iree_compiler::IREE::HAL::stringifyEnum(param);
273-
return printer;
274-
}
275-
276-
} // namespace mlir
277-
278193
// clang-format off: must be included after all LLVM/MLIR headers.
279194
#define GET_ATTRDEF_CLASSES
280195
#include "iree/compiler/Dialect/HAL/IR/HALAttrs.h.inc" // IWYU pragma: keep

compiler/src/iree/compiler/Dialect/Stream/IR/StreamTypes.h

-31
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,6 @@
2727
#include "iree/compiler/Dialect/Stream/IR/StreamEnums.h.inc" // IWYU pragma: export
2828
// clang-format on
2929

30-
// It's unfortunate this is required.
31-
namespace mlir {
32-
33-
template <>
34-
struct FieldParser<
35-
std::optional<mlir::iree_compiler::IREE::Stream::CollectiveReductionOp>> {
36-
static FailureOr<mlir::iree_compiler::IREE::Stream::CollectiveReductionOp>
37-
parse(AsmParser &parser) {
38-
std::string value;
39-
if (parser.parseKeywordOrString(&value))
40-
return failure();
41-
auto result = mlir::iree_compiler::IREE::Stream::symbolizeEnum<
42-
mlir::iree_compiler::IREE::Stream::CollectiveReductionOp>(value);
43-
if (!result.has_value())
44-
return failure();
45-
return result.value();
46-
}
47-
};
48-
static inline AsmPrinter &operator<<(
49-
AsmPrinter &printer,
50-
std::optional<mlir::iree_compiler::IREE::Stream::CollectiveReductionOp>
51-
param) {
52-
printer << (param.has_value()
53-
? mlir::iree_compiler::IREE::Stream::stringifyEnum(
54-
param.value())
55-
: StringRef{""});
56-
return printer;
57-
}
58-
59-
} // namespace mlir
60-
6130
namespace mlir::iree_compiler::IREE::Stream {
6231
class AffinityAttr;
6332
} // namespace mlir::iree_compiler::IREE::Stream

llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/Input/InputDialect.h

-68
Original file line numberDiff line numberDiff line change
@@ -40,72 +40,4 @@ std::optional<int32_t> getEncodingTypeValue(Attribute attr);
4040

4141
} // namespace mlir::iree_compiler::IREE::Input
4242

43-
//===----------------------------------------------------------------------===//
44-
// Specialize templates in mlir namespace to support enum attributes
45-
//===----------------------------------------------------------------------===//
46-
47-
namespace mlir {
48-
49-
template <>
50-
struct FieldParser<
51-
std::optional<mlir::iree_compiler::IREE::Input::PipelineLayoutFlags>> {
52-
static FailureOr<mlir::iree_compiler::IREE::Input::PipelineLayoutFlags>
53-
parse(AsmParser &parser) {
54-
std::string value;
55-
if (parser.parseKeywordOrString(&value))
56-
return failure();
57-
auto result = mlir::iree_compiler::IREE::Input::symbolizeEnum<
58-
mlir::iree_compiler::IREE::Input::PipelineLayoutFlags>(value);
59-
if (!result.has_value())
60-
return failure();
61-
return result.value();
62-
}
63-
};
64-
65-
static inline AsmPrinter &
66-
operator<<(AsmPrinter &printer,
67-
std::optional<mlir::iree_compiler::IREE::Input::PipelineLayoutFlags>
68-
param) {
69-
printer << (param.has_value()
70-
? mlir::iree_compiler::IREE::Input::stringifyEnum(
71-
param.value())
72-
: StringRef{""});
73-
return printer;
74-
}
75-
76-
template <>
77-
struct FieldParser<
78-
std::optional<mlir::iree_compiler::IREE::Input::DescriptorFlags>> {
79-
static FailureOr<mlir::iree_compiler::IREE::Input::DescriptorFlags>
80-
parse(AsmParser &parser) {
81-
std::string value;
82-
if (parser.parseKeywordOrString(&value))
83-
return failure();
84-
auto result = mlir::iree_compiler::IREE::Input::symbolizeEnum<
85-
mlir::iree_compiler::IREE::Input::DescriptorFlags>(value);
86-
if (!result.has_value())
87-
return failure();
88-
return result.value();
89-
}
90-
};
91-
92-
static inline AsmPrinter &operator<<(
93-
AsmPrinter &printer,
94-
std::optional<mlir::iree_compiler::IREE::Input::DescriptorFlags> param) {
95-
printer << (param.has_value()
96-
? mlir::iree_compiler::IREE::Input::stringifyEnum(
97-
param.value())
98-
: StringRef{""});
99-
return printer;
100-
}
101-
102-
static inline AsmPrinter &
103-
operator<<(AsmPrinter &printer,
104-
mlir::iree_compiler::IREE::Input::DescriptorType param) {
105-
printer << mlir::iree_compiler::IREE::Input::stringifyEnum(param);
106-
return printer;
107-
}
108-
109-
} // namespace mlir
110-
11143
#endif // IREE_DIALECTS_DIALECT_INPUT_DIALECT_H

third_party/llvm-project

Submodule llvm-project updated 624 files

0 commit comments

Comments
 (0)