Updates LLVM usage to match
[c89447b65984](https://github.com/llvm/llvm-project/commit/c89447b65984)

PiperOrigin-RevId: 338560059
Change-Id: I6f965ac224308a0d09e11465ca00b2e3734a5663
This commit is contained in:
Benjamin Kramer 2020-10-22 15:22:20 -07:00 committed by TensorFlower Gardener
parent 2cc30c6d44
commit 7abbeeb184
9 changed files with 20 additions and 13 deletions

View File

@ -27,7 +27,6 @@ namespace mlir {
class LLVMTypeConverter;
class LowerToLLVMOptions;
class OwningRewritePatternList;
class BufferAssignmentPlacer;
// Populates a collection of rewrite patterns to realize element-wise operations
// on ranked tensors where possible.

View File

@ -1,4 +1,4 @@
// RUN: mlir-hlo-opt -hlo-legalize-to-lhlo=results-escape-function=true -buffer-placement %s -o - | FileCheck %s
// RUN: mlir-hlo-opt -hlo-legalize-to-lhlo=results-escape-function=true -buffer-hoisting -buffer-deallocation %s -o - | FileCheck %s
// CHECK-LABEL: func @func_op_unranked_arg_result
func @func_op_unranked_arg_result(%arg0: tensor<*xf32>) -> tensor<*xf32> {

View File

@ -1,5 +1,5 @@
// RUN: mlir-hlo-opt -hlo-legalize-to-lhlo -buffer-placement -split-input-file %s -o - | FILECHECK_OPTS="" FileCheck --check-prefixes=PRE,BOTH %s
// RUN: mlir-hlo-opt -hlo-legalize-to-lhlo=results-escape-function=true -buffer-placement -split-input-file %s -o - | FILECHECK_OPTS="" FileCheck --check-prefixes=ESC,BOTH %s
// RUN: mlir-hlo-opt -hlo-legalize-to-lhlo -buffer-hoisting -buffer-deallocation -split-input-file %s -o - | FILECHECK_OPTS="" FileCheck --check-prefixes=PRE,BOTH %s
// RUN: mlir-hlo-opt -hlo-legalize-to-lhlo=results-escape-function=true -buffer-hoisting -buffer-deallocation -split-input-file %s -o - | FILECHECK_OPTS="" FileCheck --check-prefixes=ESC,BOTH %s
// BOTH-LABEL: func @attrs
func @attrs_copy(%operand: memref<2x2xf32>, %result: memref<2x2xf32>) {

View File

@ -83,7 +83,8 @@ Status LowerTFtoGPU(mlir::ModuleOp module, bool gpu_binary_only,
pm.addPass(mlir::mhlo::createLegalizeToLhloPass(
/*results_escape_functions=*/true));
// Moving `AllocOp`s and inserting missing `DeallocOp`s
pm.addPass(::mlir::createBufferPlacementPass());
pm.addPass(::mlir::createBufferHoistingPass());
pm.addPass(::mlir::createBufferDeallocationPass());
pm.addNestedPass<mlir::FuncOp>(mlir::createCopyRemovalPass());
pm.addPass(mlir::kernel_gen::transforms::CreateShapeToDescriptorsPass());
} else {

View File

@ -20,7 +20,6 @@ limitations under the License.
namespace mlir {
class BufferAssignmentPlacer;
class BufferizeTypeConverter;
class LLVMTypeConverter;
class MLIRContext;

View File

@ -116,15 +116,14 @@ SimpleOrcJIT::SimpleOrcJIT(
<< " features: " << target_machine_->getTargetFeatureString().str();
// Materialize unknown symbols from the runtime symbol table.
class RuntimeSymbolGenerator
: public llvm::orc::JITDylib::DefinitionGenerator {
class RuntimeSymbolGenerator : public llvm::orc::DefinitionGenerator {
SimpleOrcJIT& jit_;
public:
explicit RuntimeSymbolGenerator(SimpleOrcJIT& jit) : jit_(jit) {}
llvm::Error tryToGenerate(
llvm::orc::LookupKind, llvm::orc::JITDylib& jit_dylib,
llvm::orc::JITDylibLookupFlags,
llvm::orc::LookupState&, llvm::orc::LookupKind,
llvm::orc::JITDylib& jit_dylib, llvm::orc::JITDylibLookupFlags,
const llvm::orc::SymbolLookupSet& names) override {
llvm::orc::SymbolMap new_defs;
@ -151,6 +150,12 @@ SimpleOrcJIT::SimpleOrcJIT(
}
}
SimpleOrcJIT::~SimpleOrcJIT() {
if (auto err = execution_session_->endSession()) {
execution_session_->reportError(std::move(err));
}
}
llvm::Expected<std::unique_ptr<SimpleOrcJIT>> SimpleOrcJIT::Create(
const llvm::TargetOptions& target_options,
llvm::CodeGenOpt::Level opt_level, bool optimize_for_size,

View File

@ -71,6 +71,8 @@ class SimpleOrcJIT : public llvm::JITEventListener {
LLVMCompiler::ModuleHook post_optimization_hook,
std::function<void(const llvm::object::ObjectFile&)> post_codegen_hook);
~SimpleOrcJIT() override;
const llvm::DataLayout& data_layout() const { return data_layout_; }
const llvm::Triple& target_triple() const {

View File

@ -70,7 +70,8 @@ Status LowerLHLOToGPU(mlir::ModuleOp module, LowerLHLOToGPUOptions options) {
// Legalize from HLO to LHLO.
pm.addPass(::mlir::mhlo::createLegalizeToLhloPass());
// Moving `AllocOp`s and inserting missing `DeallocOp`s
pm.addPass(::mlir::createBufferPlacementPass());
pm.addPass(::mlir::createBufferHoistingPass());
pm.addPass(::mlir::createBufferDeallocationPass());
// Next, we can strip the outer fusion operation.
pm.addPass(createFusionOpRemoverPass());
// Remove unnecessary LHLO copies.

View File

@ -680,8 +680,8 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
)
# Check out LLVM and MLIR from llvm-project.
LLVM_COMMIT = "6154c4115cd4b78d0171892aac21e340e72e32bd"
LLVM_SHA256 = "40a0d77e45b4877ab3463074fbdb717a61c2848df4db0331e9b55a23a31cbb17"
LLVM_COMMIT = "c89447b65984c97145f63be21e42cfa98da60dd2"
LLVM_SHA256 = "b35dd27eace459897c07faa333b0cb9ddc0ef260b20582dd04b6910d548a7e08"
LLVM_URLS = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),
"https://github.com/llvm/llvm-project/archive/{commit}.tar.gz".format(commit = LLVM_COMMIT),