/* Whether Timers signpost passes in Xcode Instruments */
#cmakedefine01 LLVM_SUPPORT_XCODE_SIGNPOSTS
+/* Define if LLVM was built with a dependency to the tensorflow compiler */
+#cmakedefine LLVM_HAVE_TF_AOT
+
#endif
-set(CommonMLSources MLInlineAdvisor.cpp)
-set(ReleaseModeMLSources ReleaseModeModelRunner.cpp)
-set(DevelopmentModeMLSources
- DevelopmentModeInlineAdvisor.cpp
- TFUtils.cpp
- )
-
if (DEFINED LLVM_HAVE_TF_AOT OR DEFINED LLVM_HAVE_TF_API)
- set(MLPolicySources ${CommonMLSources})
if (DEFINED LLVM_HAVE_TF_AOT)
include(TensorFlowCompile)
tfcompile(models/inliner serve action InlinerSizeModel llvm::InlinerSizeModel)
- list(APPEND ReleaseModeMLSources
+ list(APPEND GeneratedMLSources
$<TARGET_OBJECTS:tf_xla_runtime_objects>
${GENERATED_OBJS}
)
- LIST(APPEND MLPolicySources ${ReleaseModeMLSources})
- else()
- LIST(APPEND LLVM_OPTIONAL_SOURCES ${ReleaseModeMLSources})
endif()
if (DEFINED LLVM_HAVE_TF_API)
- LIST(APPEND MLPolicySources ${DevelopmentModeMLSources})
LIST(APPEND MLLinkDeps ${tensorflow_c_api})
- else()
- LIST(APPEND LLVM_OPTIONAL_SOURCES ${DevelopmentModeMLSources})
endif()
-else()
- LIST(APPEND LLVM_OPTIONAL_SOURCES
- ${CommonMLSources}
- ${DevelopmentModeMLSources}
- ${ReleaseModeMLSources}
- )
endif()
-
add_llvm_component_library(LLVMAnalysis
AliasAnalysis.cpp
DemandedBits.cpp
DependenceAnalysis.cpp
DependenceGraphBuilder.cpp
+ DevelopmentModeInlineAdvisor.cpp
DivergenceAnalysis.cpp
DomPrinter.cpp
DomTreeUpdater.cpp
LoopUnrollAnalyzer.cpp
LoopInfo.cpp
LoopPass.cpp
+ MLInlineAdvisor.cpp
MemDepPrinter.cpp
MemDerefPrinter.cpp
MemoryBuiltins.cpp
RegionInfo.cpp
RegionPass.cpp
RegionPrinter.cpp
+ ReleaseModeModelRunner.cpp
ScalarEvolution.cpp
ScalarEvolutionAliasAnalysis.cpp
ScalarEvolutionDivision.cpp
StackSafetyAnalysis.cpp
SyncDependenceAnalysis.cpp
SyntheticCountsUtils.cpp
+ TFUtils.cpp
TargetLibraryInfo.cpp
TargetTransformInfo.cpp
Trace.cpp
ValueTracking.cpp
VectorUtils.cpp
VFABIDemangling.cpp
- ${MLPolicySources}
+ ${GeneratedMLSources}
ADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm/Analysis
// loading of a model from a command line option.
//
//===----------------------------------------------------------------------===//
+#include "llvm/Config/config.h"
+#if defined(LLVM_HAVE_TF_API)
+
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/InlineSizeEstimatorAnalysis.h"
#include "llvm/Analysis/MLInlineAdvisor.h"
}
return std::make_unique<DevelopmentModeMLInlineAdvisor>(
M, MAM, std::move(Runner), GetDefaultAdvice, IsDoingInference);
-}
\ No newline at end of file
+}
+#endif // defined(LLVM_HAVE_TF_API)
// 'release' mode) or a runtime-loaded model (the 'development' case).
//
//===----------------------------------------------------------------------===//
+#include "llvm/Config/config.h"
+#if defined(LLVM_HAVE_TF_AOT) || defined(LLVM_HAVE_TF_API)
+
#include <limits>
#include <unordered_map>
#include <unordered_set>
reportContextForRemark(R);
return R;
});
-}
\ No newline at end of file
+}
+#endif // defined(LLVM_HAVE_TF_AOT) || defined(LLVM_HAVE_TF_API)
// Only inference is supported.
//
//===----------------------------------------------------------------------===//
+#include "llvm/Config/config.h"
+#if defined(LLVM_HAVE_TF_AOT)
#include "llvm/Analysis/InlineModelFeatureMaps.h"
#include "llvm/Analysis/MLInlineAdvisor.h"
auto AOTRunner = std::make_unique<ReleaseModeModelRunner>(M.getContext());
return std::make_unique<MLInlineAdvisor>(M, MAM, std::move(AOTRunner));
}
+#endif // defined(LLVM_HAVE_TF_AOT)
// This file implements utilities for interfacing with tensorflow C APIs.
//
//===----------------------------------------------------------------------===//
+#include "llvm/Config/config.h"
+#if defined(LLVM_HAVE_TF_API)
#include "llvm/Analysis/Utils/TFUtils.h"
#include "llvm/ADT/Twine.h"
TFModelEvaluator::EvaluationResult::~EvaluationResult() {}
TFModelEvaluator::~TFModelEvaluator() {}
+#endif // defined(LLVM_HAVE_TF_API)
"RETSIGTYPE=void",
"LLVM_GISEL_COV_ENABLED=",
"LLVM_GISEL_COV_PREFIX=",
+ "LLVM_HAVE_TF_AOT=",
"LLVM_WITH_Z3=",
# FIXME: Set to 1 on mac once the 10.14 SDK is in common use.
"DemandedBits.cpp",
"DependenceAnalysis.cpp",
"DependenceGraphBuilder.cpp",
+ "DevelopmentModeInlineAdvisor.cpp",
"DivergenceAnalysis.cpp",
"DomPrinter.cpp",
"DomTreeUpdater.cpp",
"LoopNestAnalysis.cpp",
"LoopPass.cpp",
"LoopUnrollAnalyzer.cpp",
+ "MLInlineAdvisor.cpp",
"MemDepPrinter.cpp",
"MemDerefPrinter.cpp",
"MemoryBuiltins.cpp",
"RegionInfo.cpp",
"RegionPass.cpp",
"RegionPrinter.cpp",
+ "ReleaseModeModelRunner.cpp",
"ScalarEvolution.cpp",
"ScalarEvolutionAliasAnalysis.cpp",
"ScalarEvolutionDivision.cpp",
"StackSafetyAnalysis.cpp",
"SyncDependenceAnalysis.cpp",
"SyntheticCountsUtils.cpp",
+ "TFUtils.cpp",
"TargetLibraryInfo.cpp",
"TargetTransformInfo.cpp",
"Trace.cpp",
"VectorUtils.cpp",
]
}
-
-static_library("TensorFlow") {
- sources = [
- "DevelopmentModeInlineAdvisor.cpp",
- "TFUtils.cpp",
- ]
-}