diff options
| author | Alexander Belyaev <pifon@google.com> | 2019-12-11 08:01:56 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-12-11 08:13:43 -0800 |
| commit | 4b0198acb523ba26b8d4384f0f61ca0b755cb0c6 (patch) | |
| tree | 3127a4c49c1385fb9dae66d2660b8e94038fe923 /mlir/test/lib/Transforms | |
| parent | 984fdde269f7f9421f9cd444a5c11d7b096b711e (diff) | |
| download | bcm5719-llvm-4b0198acb523ba26b8d4384f0f61ca0b755cb0c6.tar.gz bcm5719-llvm-4b0198acb523ba26b8d4384f0f61ca0b755cb0c6.zip | |
Roll-forward initial liveness analysis including test cases.
Fix the usage of the map size when appending to the map with [].
PiperOrigin-RevId: 284985916
Diffstat (limited to 'mlir/test/lib/Transforms')
| -rw-r--r-- | mlir/test/lib/Transforms/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | mlir/test/lib/Transforms/TestLiveness.cpp | 42 |
2 files changed, 43 insertions, 0 deletions
diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt index 2d5f37a5fc5..b6338e1d167 100644 --- a/mlir/test/lib/Transforms/CMakeLists.txt +++ b/mlir/test/lib/Transforms/CMakeLists.txt @@ -4,6 +4,7 @@ add_llvm_library(MLIRTestTransforms TestLoopFusion.cpp TestInlining.cpp TestLinalgTransforms.cpp + TestLiveness.cpp TestLoopMapping.cpp TestLoopParametricTiling.cpp TestOpaqueLoc.cpp diff --git a/mlir/test/lib/Transforms/TestLiveness.cpp b/mlir/test/lib/Transforms/TestLiveness.cpp new file mode 100644 index 00000000000..d97060247f4 --- /dev/null +++ b/mlir/test/lib/Transforms/TestLiveness.cpp @@ -0,0 +1,42 @@ +//===- TestLiveness.cpp - Test liveness construction and information +//-------===// +// +// Copyright 2019 The MLIR Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================= +// +// This file contains test passes for constructing and resolving liveness +// information. +// +//===----------------------------------------------------------------------===// + +#include "mlir/Analysis/Liveness.h" +#include "mlir/Pass/Pass.h" + +using namespace mlir; + +namespace { + +struct TestLivenessPass : public FunctionPass<TestLivenessPass> { + void runOnFunction() override { + llvm::errs() << "Testing : " << getFunction().getName() << "\n"; + getAnalysis<Liveness>().print(llvm::errs()); + } +}; + +} // end anonymous namespace + +static PassRegistration<TestLivenessPass> + pass("test-print-liveness", + "Print the contents of a constructed liveness information."); |

