Skip to content

Commit

Permalink
Resolved conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Bosch authored and Alexander Bosch committed Jun 28, 2021
1 parent d059665 commit a4030cf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
8 changes: 5 additions & 3 deletions tensorflow/compiler/mlir/hlo/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,6 @@ cc_library(
":LmhloPassIncGen",
":MhloPassIncGen",
":broadcast_propagation",
":mlir_buffer_transforms_pass_inc_gen",
":transforms_pass_inc_gen",
":chlo_legalize_to_hlo",
":hlo_legalize_to_lhlo",
Expand Down Expand Up @@ -1413,13 +1412,16 @@ cc_library(
],
)

gentbl(
gentbl_cc_library(
name = "transforms_pass_inc_gen",
compatible_with = get_compatible_with_cloud(),
strip_include_prefix = "include",
tbl_outs = [
(
"-gen-pass-decls -name LMHLOTransforms",
[
"-gen-pass-decls",
"-name=LMHLOTransforms",
],
"include/mlir-hlo/Transforms/passes.h.inc",
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class UserangeAnalysis {
using IntervalVector = SmallVector<UseInterval, 8>;

UserangeAnalysis(Operation *op, const BufferPlacementAllocs &allocs,
const BufferAliasAnalysis &aliases);
const BufferViewFlowAnalysis &aliases);

/// Returns the index of the first operation that uses the given value.
/// Returns an empty Optional if the value has no uses.
Expand All @@ -59,7 +59,7 @@ class UserangeAnalysis {
void dump(raw_ostream &os);

private:
using ValueSetT = BufferAliasAnalysis::ValueSetT;
using ValueSetT = BufferViewFlowAnalysis::ValueSetT;
using OperationListT = Liveness::OperationListT;

/// Builds an IntervalVector corresponding to the given OperationList.
Expand Down Expand Up @@ -106,7 +106,7 @@ class UserangeAnalysis {
DenseMap<Value, OperationListT> aliasUseranges;

/// Cache the alias lists for all values to avoid recomputation.
BufferAliasAnalysis::ValueMapT aliasCache;
BufferViewFlowAnalysis::ValueMapT aliasCache;

/// The current liveness info.
Liveness liveness;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
#include "mlir-hlo/Dialect/mhlo/IR/lhlo_ops.h"
#include "mlir-hlo/Transforms/PassDetail.h"
#include "mlir-hlo/Transforms/passes.h"
#include "mlir/Analysis/BufferAliasAnalysis.h"
#include "mlir/Analysis/BufferViewFlowAnalysis.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/BufferUtils.h"

Expand All @@ -33,7 +33,7 @@ struct TestUserangePass : public TestUserangeBase<TestUserangePass> {
void runOnFunction() override {
llvm::outs() << "Testing : " << getFunction().getName() << "\n";
UserangeAnalysis(getFunction(), BufferPlacementAllocs(getFunction()),
BufferAliasAnalysis(getFunction()))
BufferViewFlowAnalysis(getFunction()))
.dump(llvm::outs());
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace {
/// information includes all operations that are within the userange.
struct UserangeInfoBuilder {
using OperationListT = Liveness::OperationListT;
using ValueSetT = BufferAliasAnalysis::ValueSetT;
using ValueSetT = BufferViewFlowAnalysis::ValueSetT;

public:
/// Constructs an Userange builder.
Expand Down Expand Up @@ -240,7 +240,7 @@ struct UserangeInfoBuilder {

UserangeAnalysis::UserangeAnalysis(Operation *op,
const BufferPlacementAllocs &allocs,
const BufferAliasAnalysis &aliases)
const BufferViewFlowAnalysis &aliases)
: liveness(op) {
// Walk over all operations and map them to an ID.
op->walk([&](Operation *operation) {
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/compiler/mlir/hlo/tests/test_userange.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ func @condBranchWithAlias(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>)
// CHECK: Value: %4 {{ *}}
// CHECK-NEXT: Userange: {(22, 22)}
// CHECK: Value: <block argument> of type 'memref<2xf32>' at index: 0
// CHECK-NEXT: Userange: {(14, 16)}
// CHECK-SAME: Userange: {(14, 16)}
// CHECK: Value: <block argument> of type 'memref<2xf32>' at index: 0
// CHECK-NEXT: Userange: {(26, 26)}
// CHECK-SAME: Userange: {(26, 26)}

0 comments on commit a4030cf

Please sign in to comment.