aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_alias_analysis.cc
diff options
context:
space:
mode:
authorGravatar Mark Heffernan <meheff@google.com>2017-08-09 15:01:40 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-08-09 15:04:53 -0700
commit56633fe0cecba03929738df0a0788216f57cf8e9 (patch)
tree7c0be8c004e12172e4e33f98eb1307a395454247 /tensorflow/compiler/xla/service/hlo_alias_analysis.cc
parent83accbb3745b4019c21f59c3e6f9ab92250261ba (diff)
Make HloDataFlowAnalysis updatable after transforming the HLO graph.
Updating is possible if operands/uses or computation roots change in the graph. Updating is not possible if instructions are deleted or if new instructions are added. Specific changes: * Add verification methods for asserting invariants and checking the analysis after updating. * Always add phi values at while instructions. Previously these were added only if the phi had different inputs. The advantage of using phi's unconditionally is that the set of values is fixed for a module. Updates due to changing operands/uses in the graph do not create new values. * Store values in a vector rather than a map. With unconditional phi values, the number of HloValues is fixed so the values can be held in a vector with stable references to elements. PiperOrigin-RevId: 164778750
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_alias_analysis.cc')
-rw-r--r--tensorflow/compiler/xla/service/hlo_alias_analysis.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_alias_analysis.cc b/tensorflow/compiler/xla/service/hlo_alias_analysis.cc
index 0c03d72752..ad2c1ba773 100644
--- a/tensorflow/compiler/xla/service/hlo_alias_analysis.cc
+++ b/tensorflow/compiler/xla/service/hlo_alias_analysis.cc
@@ -44,10 +44,10 @@ void HloAliasAnalysis::InitializeBufferSets() {
std::unordered_map<HloValue::Id, const HloBuffer*> value_to_buffer;
// Initially define a buffer for every HloValue in the module.
- for (const HloValue* value : dataflow_analysis_->values()) {
+ for (const HloValue& value : dataflow_analysis_->values()) {
HloBuffer* buffer = NewHloBuffer();
- buffer->AddValue(*value);
- value_to_buffer[value->id()] = buffer;
+ buffer->AddValue(value);
+ value_to_buffer[value.id()] = buffer;
}
// Construct the Instruction buffer set to contain the HloBuffers for each