[XLA:CPU] Re-use the same llvm::GlobalVariable for identical literals
authorSanjoy Das <sanjoy@google.com>
Wed, 2 May 2018 01:46:31 +0000 (18:46 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 2 May 2018 01:49:56 +0000 (18:49 -0700)
commit69b2c639f55b065a5dbf829351034441bebc8437
tree89869d4af178dba875557e4280ece30a642bf20b
parentc8ae9e86f33053484b05e405dadd2c8a98b8b41b
[XLA:CPU] Re-use the same llvm::GlobalVariable for identical literals

This isn't necessary today, but it will be after an optimization change I'm
about to make.

LLVM has a constant merging pass too, but one of the motivations here is to
avoid the LLVM compile time overhead of having many large arrays in the IR.

PiperOrigin-RevId: 195032900
14 files changed:
tensorflow/compiler/xla/layout_util.cc
tensorflow/compiler/xla/layout_util.h
tensorflow/compiler/xla/literal_util.cc
tensorflow/compiler/xla/literal_util.h
tensorflow/compiler/xla/service/cpu/cpu_compiler.cc
tensorflow/compiler/xla/service/cpu/ir_emitter.cc
tensorflow/compiler/xla/service/cpu/ir_emitter.h
tensorflow/compiler/xla/service/cpu/tests/BUILD
tensorflow/compiler/xla/service/cpu/tests/cpu_literal_caching_test.cc [new file with mode: 0644]
tensorflow/compiler/xla/shape_util.cc
tensorflow/compiler/xla/shape_util.h
tensorflow/compiler/xla/tests/llvm_irgen_test_base.cc
tensorflow/compiler/xla/xla_data.proto
tensorflow/core/lib/hash/hash.h