This is an archive of the discontinued LLVM Phabricator instance.

TensorFlowCompile: Add object file to list of sources rather than LINK_LIBS
ClosedPublic

Authored by MatzeB on May 31 2022, 5:20 PM.

Details

Summary

Put object file with precompiled model into list of source files instead of LINK_LIBS.

Without this I would randomly get compilation failures which I believe stem from a bad ordering of RegallocEvictModel.o and libtf_xla_runtime.a:

/usr/bin/clang++ ... lib/libtf_xla_runtime.a  lib/CodeGen/RegallocEvictModel.o ...
...
lib/CodeGen/RegallocEvictModel.o:__compute_module:function _xla_home_matthiasb_dev_llvm_tfbuild_lib_CodeGen_RegallocEvictModel_llvm_RegallocEvictModel: error: undefined reference to '__xla_cpu_runtime_EigenSingleThreadedMatMulF32'
... other similar errors here ...

specifying the object file in the source file list ensures that it will come before any static libraries.

Diff Detail

Event Timeline

MatzeB created this revision.May 31 2022, 5:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2022, 5:20 PM
MatzeB requested review of this revision.May 31 2022, 5:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2022, 5:20 PM
MatzeB edited the summary of this revision. (Show Details)May 31 2022, 5:21 PM
mtrofin accepted this revision.May 31 2022, 5:48 PM

lgtm, thanks!

This revision is now accepted and ready to land.May 31 2022, 5:48 PM
This revision was landed with ongoing or failed builds.Jun 1 2022, 9:05 AM
This revision was automatically updated to reflect the committed changes.