Skip to content

Commit

Permalink
[XLA] Add HLO alias analysis.
Browse files Browse the repository at this point in the history
Add HloAliasAnalysis which identifies aliasing of buffers in the HLO graph. This analysis is module-scoped and will eventually replace the computation-scoped TuplePointsToAnalysis. Currently the analysis is unused, but later CLs will incrementally replace TuplePointsToAnalysis with HloAliasAnalysis (or potentially HloDataflowAnalysis).

This CL also includes a small change to HloDataflowAnalysis. When ssa_form is true, only while instructions (which update inplace) define phi values. Previously, subcomputations called from multiple kCall instructions would also define phi values. Effectively this is an inconsequential change because we always flatten the callgraph eliminating multiple callsites for the same subcomputation.

PiperOrigin-RevId: 158537805
  • Loading branch information
meheffernan authored and tensorflower-gardener committed Jun 9, 2017
1 parent 7b22e96 commit c60899a
Show file tree
Hide file tree
Showing 7 changed files with 1,548 additions and 60 deletions.
43 changes: 43 additions & 0 deletions tensorflow/compiler/xla/service/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,49 @@ cc_test(
],
)

cc_library(
name = "hlo_alias_analysis",
srcs = [
"hlo_alias_analysis.cc",
],
hdrs = [
"hlo_alias_analysis.h",
],
deps = [
":call_graph",
":hlo",
":hlo_dataflow_analysis",
":logical_buffer",
"//tensorflow/compiler/xla:shape_tree",
"//tensorflow/compiler/xla:shape_util",
"//tensorflow/compiler/xla:statusor",
"//tensorflow/compiler/xla:types",
"//tensorflow/compiler/xla:util",
"//tensorflow/compiler/xla:xla_data_proto",
"//tensorflow/core:lib",
],
)

cc_test(
name = "hlo_alias_analysis_test",
srcs = ["hlo_alias_analysis_test.cc"],
deps = [
":hlo",
":hlo_alias_analysis",
":hlo_matchers",
":instruction_fusion",
"//tensorflow/compiler/xla:literal_util",
"//tensorflow/compiler/xla:shape_util",
"//tensorflow/compiler/xla:test",
"//tensorflow/compiler/xla:test_helpers",
"//tensorflow/compiler/xla:xla_data_proto",
"//tensorflow/compiler/xla/tests:hlo_test_base",
"//tensorflow/core:lib",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
],
)

cc_library(
name = "tuple_points_to_analysis",
srcs = [
Expand Down
Loading

0 comments on commit c60899a

Please sign in to comment.