Skip to content

Commit 880ef00

Browse files
bangtianliukeshavvinayak01
authored andcommitted
Bump to llvm/llvm-project@5f53182 Carry revert commit iree-org/llvm-project@1aedd94 to llvm/llvm-project@1fdbe69. This PR also fixes MSVC build failures. --------- Signed-off-by: Bangtian Liu <[email protected]> Signed-off-by: keshavvinayak01 <[email protected]>
1 parent 412ce73 commit 880ef00

File tree

4 files changed

+15
-25
lines changed

4 files changed

+15
-25
lines changed

compiler/bindings/python/IREECompilerDialectsModule.cpp

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "mlir/Bindings/Python/Nanobind.h"
1515
#include "mlir/Bindings/Python/NanobindAdaptors.h"
1616
#include "mlir/CAPI/IR.h"
17-
#include "mlir/IR/BuiltinAttributes.h"
1817

1918
static const char *kCodegenModuleImportPath =
2019
MAKE_MLIR_PYTHON_QUALNAME("dialects.iree_codegen");
@@ -62,18 +61,6 @@ ireeCodegenGetTunerRootOpsBinding(MlirModule module) {
6261
return ops;
6362
}
6463

65-
static std::vector<int64_t> getIntArrayAttrValues(MlirAttribute attr) {
66-
mlir::Attribute Attr = unwrap(attr);
67-
auto arrayAttr = mlir::dyn_cast_or_null<mlir::ArrayAttr>(Attr);
68-
if (!arrayAttr)
69-
return {};
70-
std::vector<int64_t> values;
71-
values.reserve(arrayAttr.size());
72-
for (mlir::Attribute val : arrayAttr)
73-
values.push_back(mlir::cast<mlir::IntegerAttr>(val).getInt());
74-
return values;
75-
}
76-
7764
NB_MODULE(_ireeCompilerDialects, m) {
7865
m.doc() = "iree-compiler dialects python extension";
7966

@@ -373,16 +360,19 @@ NB_MODULE(_ireeCompilerDialects, m) {
373360
return std::vector<py::object>{};
374361
}
375362

376-
auto arrayAttr = mlir::cast<mlir::ArrayAttr>(unwrap(rawArrayAttr));
377363
static py::object virtualEnum =
378364
py::module_::import_(kGpuModuleImportPath)
379365
.attr("VirtualMMAIntrinsic");
380366

381367
std::vector<py::object> result;
382-
for (mlir::Attribute attr : arrayAttr) {
383-
auto intAttr = mlir::cast<mlir::IntegerAttr>(attr);
384-
result.push_back(
385-
virtualEnum(static_cast<uint32_t>(intAttr.getInt())));
368+
size_t n = mlirArrayAttrGetNumElements(rawArrayAttr);
369+
result.reserve(n);
370+
for (size_t i = 0; i < n; ++i) {
371+
MlirAttribute elem = mlirArrayAttrGetElement(rawArrayAttr, i);
372+
if (!mlirAttributeIsAInteger(elem))
373+
continue;
374+
int64_t val = mlirIntegerAttrGetValueInt(elem);
375+
result.push_back(virtualEnum(static_cast<uint32_t>(val)));
386376
}
387377

388378
return result;

compiler/src/iree/compiler/Codegen/Common/FoldTensorExtractOp.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ include "mlir/IR/PatternBase.td"
1717
def : Pat<(Tensor_ExtractOp(Bufferization_ToTensorOp $value, $restrict,
1818
$writable),
1919
$indices),
20-
(LoadOp $value, $indices, ConstBoolAttrFalse)>;
20+
(LoadOp $value, $indices, ConstBoolAttrFalse, (NativeCodeCall<"::mlir::Attribute()">))>;
2121

2222
#endif // IREE_COMPILER_CODEGEN_COMMON_FOLDTENSOREXTRACTOP

compiler/src/iree/compiler/DispatchCreation/Passes.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,10 @@ void registerDispatchCreationPipelines() {
388388
llvm::cl::init(false),
389389
};
390390

391-
TransformOptions toTransformOptions() const {
392-
DispatchCreationOptions options;
393-
options.enableAggressiveFusion = aggressiveFusion;
394-
return TransformOptions{.options = options};
391+
std::unique_ptr<TransformOptions> toTransformOptions() const {
392+
auto options = std::make_unique<TransformOptions>();
393+
options->options.enableAggressiveFusion = aggressiveFusion;
394+
return options;
395395
}
396396
};
397397

@@ -402,7 +402,7 @@ void registerDispatchCreationPipelines() {
402402
[](OpPassManager &passManager,
403403
const DispatchCreationPipelineOptions &options) {
404404
buildDispatchCreationPassPipeline(passManager,
405-
options.toTransformOptions());
405+
*(options.toTransformOptions()));
406406
});
407407

408408
PassPipelineRegistration<TransformOptions>

third_party/llvm-project

Submodule llvm-project updated 1069 files

0 commit comments

Comments
 (0)