Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 3c265bf

Browse files
authored
Integrate LLVM at llvm/llvm-project@8e5f3d0 (#119)
Updates LLVM usage to match llvm/llvm-project@8e5f3d0. Further updates the MLIR-HLO submodule to tensorflow/mlir-hlo@0800423.
1 parent 122d11a commit 3c265bf

9 files changed

Lines changed: 5 additions & 12 deletions

‎build_tools/llvm_version.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1d909c9a35713bef7badcbf17e7e75d6335c070b
1+
8e5f3d04f269dbe791076e775f1d1a098cbada01

‎lib/Dialect/EmitC/Conversion/MHLORegionOpsToEmitC.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ struct ConvertMhloRegionOpsToEmitCPass
195195

196196
SmallVector<Attribute, 2> args_ = indexSequence(operands.size(), ctx);
197197

198-
size_t dim = op.getResult().getType().cast<RankedTensorType>().getRank();
198+
size_t dim = op.getResult(0).getType().cast<RankedTensorType>().getRank();
199199
args_.push_back(op.window_dimensions());
200200
args_.push_back(
201201
op.window_strides().getValueOr(i64ElementsAttr(1, dim, ctx)));
@@ -209,10 +209,10 @@ struct ConvertMhloRegionOpsToEmitCPass
209209
ArrayAttr args = ArrayAttr::get(ctx, args_);
210210

211211
ArrayAttr templateArgs =
212-
ArrayAttr::get(ctx, {TypeAttr::get(op.getResult().getType())});
212+
ArrayAttr::get(ctx, {TypeAttr::get(op.getResult(0).getType())});
213213

214214
emitc::CallOp callOp = builder.create<emitc::CallOp>(
215-
op.getLoc(), op.getType(), callee, args, templateArgs, operands);
215+
op.getLoc(), op.getType(0), callee, args, templateArgs, operands);
216216
op.replaceAllUsesWith(callOp);
217217
op.erase();
218218
return success();

‎lib/Dialect/EmitC/Conversion/MHLOToEmitC.cpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ struct ConvertMhloToEmitCPass
577577
target.addLegalDialect<StandardOpsDialect>();
578578
target.addLegalOp<FuncOp>();
579579
target.addLegalOp<ModuleOp>();
580-
target.addLegalOp<ModuleTerminatorOp>();
581580

582581
// clang-format off
583582
// MHLO nullary ops

‎lib/Dialect/EmitC/Conversion/TosaToEmitC.cpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,6 @@ struct ConvertTosaToEmitCPass
666666
// target.addLegalDialect<StandardOpsDialect>();
667667
// target.addLegalOp<FuncOp>();
668668
// target.addLegalOp<ModuleOp>();
669-
// target.addLegalOp<ModuleTerminatorOp>();
670669

671670
// Data node ops
672671
target.addIllegalOp<tosa::ConstOp>();

‎lib/Target/Cpp/TranslateToCpp.cpp‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,6 @@ static LogicalResult printOperation(CppEmitter &emitter, Operation &op) {
801801
return printModule(emitter, moduleOp);
802802
if (auto returnOp = dyn_cast<ReturnOp>(op))
803803
return printReturnOp(emitter, returnOp);
804-
if (isa<ModuleTerminatorOp>(op))
805-
return success();
806804

807805
return op.emitOpError() << "unable to find printer for op";
808806
}

‎test/testCorrectGroundTruthWithHMC.mlir‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7005,5 +7005,4 @@
70057005
%299 = "mhlo.tuple"(%295, %298) {name = "tuple.2629"} : (tensor<1000x4xf32>, tensor<1000x4xi1>) -> tuple<tensor<1000x4xf32>, tensor<1000x4xi1>>
70067006
"std.return"(%299) : (tuple<tensor<1000x4xf32>, tensor<1000x4xi1>>) -> ()
70077007
}) {sym_name = "main", type = (tensor<4xf32>, tensor<f32>, tensor<f32>, tensor<4xf32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<i32>) -> tuple<tensor<1000x4xf32>, tensor<1000x4xi1>>} : () -> ()
7008-
"module_terminator"() : () -> ()
70097008
}) : () -> ()

‎test/testCorrectGroundTruthWithHMC_canon.mlir‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,5 +1333,4 @@
13331333
%88 = "mhlo.tuple"(%86, %87) {name = "tuple.2629"} : (tensor<1000x4xf32>, tensor<1000x4xi1>) -> tuple<tensor<1000x4xf32>, tensor<1000x4xi1>>
13341334
"std.return"(%88) : (tuple<tensor<1000x4xf32>, tensor<1000x4xi1>>) -> ()
13351335
}) {sym_name = "main", type = (tensor<4xf32>, tensor<f32>, tensor<f32>, tensor<4xf32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<i32>) -> tuple<tensor<1000x4xf32>, tensor<1000x4xi1>>} : () -> ()
1336-
"module_terminator"() : () -> ()
13371336
}) : () -> ()

‎test/testCorrectGroundTruthWithHMC_canon_inline.mlir‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,5 +1316,4 @@
13161316
%88 = "mhlo.tuple"(%86, %87) {name = "tuple.2629"} : (tensor<1000x4xf32>, tensor<1000x4xi1>) -> tuple<tensor<1000x4xf32>, tensor<1000x4xi1>>
13171317
"std.return"(%88) : (tuple<tensor<1000x4xf32>, tensor<1000x4xi1>>) -> ()
13181318
}) {sym_name = "main", type = (tensor<4xf32>, tensor<f32>, tensor<f32>, tensor<4xf32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<i32>) -> tuple<tensor<1000x4xf32>, tensor<1000x4xi1>>} : () -> ()
1319-
"module_terminator"() : () -> ()
13201319
}) : () -> ()

0 commit comments

Comments
 (0)