[XLA] Minor cleanups related to multi-output fusion.
authorJustin Lebar <jlebar@google.com>
Sat, 3 Feb 2018 02:57:10 +0000 (18:57 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Sat, 3 Feb 2018 03:01:12 +0000 (19:01 -0800)
commit2b932c28d60ec4f248d950cd2ef69a7eb98bb66d
treeece382a4171f598dc99f2ab5cd1b571b60c17aec
parent09d2efecf44bf313d2e03abdc1c8884cf48e23ae
[XLA] Minor cleanups related to multi-output fusion.

- Add some comments about preexisting invariants, and add some CHECKs.

- In the LoopEmitter constructor, materialize the given
  ArraySlice<IrArray> to a vector, so we don't rely on the given
  ArraySlice having any particular lifetime.

- Add the invariant that the LoopEmitter constructor which takes a
  list of IrArrays is only for multi-output fusion.  Previously it said:
  If you only pass one array, then treat it as regular fusion.  But this
  results in an LLVM type mismatch, because the given
  target_element_generator should be passing a struct with one element.

PiperOrigin-RevId: 184365310
tensorflow/compiler/xla/service/gpu/hlo_to_ir_bindings.cc
tensorflow/compiler/xla/service/gpu/ir_emitter_unnested.cc
tensorflow/compiler/xla/service/gpu/parallel_loop_emitter.h
tensorflow/compiler/xla/service/hlo_instruction.h
tensorflow/compiler/xla/service/llvm_ir/fused_ir_emitter.h
tensorflow/compiler/xla/service/llvm_ir/loop_emitter.cc
tensorflow/compiler/xla/service/llvm_ir/loop_emitter.h