Precompiled headers are already skipped when building ConstantFolding.cpp with MSVC, they cause problems with Clang too so disable it there the same way.
195 lines
4.8 KiB
CMake
195 lines
4.8 KiB
CMake
if (DEFINED LLVM_HAVE_TF_AOT OR LLVM_HAVE_TFLITE)
|
|
include(TensorFlowCompile)
|
|
set(LLVM_INLINER_MODEL_PATH_DEFAULT "models/inliner-Oz")
|
|
|
|
set(LLVM_INLINER_MODEL_CURRENT_URL "<UNSPECIFIED>" CACHE STRING "URL to download the LLVM inliner model")
|
|
|
|
if (DEFINED LLVM_HAVE_TF_AOT)
|
|
tf_find_and_compile(
|
|
${LLVM_INLINER_MODEL_PATH}
|
|
${LLVM_INLINER_MODEL_CURRENT_URL}
|
|
${LLVM_INLINER_MODEL_PATH_DEFAULT}
|
|
"models/gen-inline-oz-test-model.py"
|
|
serve
|
|
action
|
|
InlinerSizeModel
|
|
llvm::InlinerSizeModel
|
|
)
|
|
endif()
|
|
|
|
if (LLVM_HAVE_TFLITE)
|
|
list(APPEND MLLinkDeps
|
|
tensorflow-lite::tensorflow-lite)
|
|
endif()
|
|
endif()
|
|
|
|
# The implementation of ConstantFolding.cpp relies on the use of math functions
|
|
# from the host. In particular, it relies on the detection of floating point
|
|
# exceptions originating from such math functions to prevent invalid cases
|
|
# from being constant folded. Therefore, we must ensure that fp exceptions are
|
|
# handled correctly.
|
|
if (MSVC)
|
|
set_source_files_properties(ConstantFolding.cpp PROPERTIES COMPILE_OPTIONS "/fp:except")
|
|
# Prevent warning about mismatching compile flags.
|
|
set_source_files_properties(ConstantFolding.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
|
set_source_files_properties(ConstantFolding.cpp PROPERTIES COMPILE_OPTIONS "-ftrapping-math")
|
|
# Clang's -ftrapping-math may conflict with precompiled headers too, #183643.
|
|
set_source_files_properties(ConstantFolding.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
|
endif()
|
|
|
|
add_llvm_component_library(LLVMAnalysis
|
|
AliasAnalysis.cpp
|
|
AliasAnalysisEvaluator.cpp
|
|
AliasSetTracker.cpp
|
|
Analysis.cpp
|
|
AssumeBundleQueries.cpp
|
|
AssumptionCache.cpp
|
|
BasicAliasAnalysis.cpp
|
|
BlockFrequencyInfo.cpp
|
|
BlockFrequencyInfoImpl.cpp
|
|
BranchProbabilityInfo.cpp
|
|
CFG.cpp
|
|
CFGPrinter.cpp
|
|
CFGSCCPrinter.cpp
|
|
CGSCCPassManager.cpp
|
|
CallGraph.cpp
|
|
CallGraphSCCPass.cpp
|
|
CallPrinter.cpp
|
|
CaptureTracking.cpp
|
|
CmpInstAnalysis.cpp
|
|
CostModel.cpp
|
|
CodeMetrics.cpp
|
|
ConstantFolding.cpp
|
|
CtxProfAnalysis.cpp
|
|
CycleAnalysis.cpp
|
|
DDG.cpp
|
|
DDGPrinter.cpp
|
|
ConstraintSystem.cpp
|
|
Delinearization.cpp
|
|
DemandedBits.cpp
|
|
DependenceAnalysis.cpp
|
|
DependenceGraphBuilder.cpp
|
|
DevelopmentModeInlineAdvisor.cpp
|
|
DomConditionCache.cpp
|
|
DomPrinter.cpp
|
|
DomTreeUpdater.cpp
|
|
DominanceFrontier.cpp
|
|
DXILResource.cpp
|
|
DXILMetadataAnalysis.cpp
|
|
EphemeralValuesCache.cpp
|
|
FloatingPointPredicateUtils.cpp
|
|
FunctionPropertiesAnalysis.cpp
|
|
GlobalsModRef.cpp
|
|
GuardUtils.cpp
|
|
HashRecognize.cpp
|
|
HeatUtils.cpp
|
|
IR2Vec.cpp
|
|
IRSimilarityIdentifier.cpp
|
|
IVDescriptors.cpp
|
|
IVUsers.cpp
|
|
ImportedFunctionsInliningStatistics.cpp
|
|
IndirectCallPromotionAnalysis.cpp
|
|
InlineCost.cpp
|
|
InlineAdvisor.cpp
|
|
InlineOrder.cpp
|
|
InstCount.cpp
|
|
InstructionPrecedenceTracking.cpp
|
|
InstructionSimplify.cpp
|
|
InteractiveModelRunner.cpp
|
|
KernelInfo.cpp
|
|
LastRunTrackingAnalysis.cpp
|
|
LazyBranchProbabilityInfo.cpp
|
|
LazyBlockFrequencyInfo.cpp
|
|
LazyCallGraph.cpp
|
|
LazyValueInfo.cpp
|
|
Lint.cpp
|
|
Loads.cpp
|
|
Local.cpp
|
|
LoopAccessAnalysis.cpp
|
|
LoopAnalysisManager.cpp
|
|
LoopCacheAnalysis.cpp
|
|
LoopNestAnalysis.cpp
|
|
LoopUnrollAnalyzer.cpp
|
|
LoopInfo.cpp
|
|
LoopPass.cpp
|
|
MLInlineAdvisor.cpp
|
|
MemDerefPrinter.cpp
|
|
MemoryBuiltins.cpp
|
|
MemoryDependenceAnalysis.cpp
|
|
MemoryLocation.cpp
|
|
MemoryProfileInfo.cpp
|
|
MemorySSA.cpp
|
|
MemorySSAUpdater.cpp
|
|
ModelUnderTrainingRunner.cpp
|
|
ModuleDebugInfoPrinter.cpp
|
|
ModuleSummaryAnalysis.cpp
|
|
MustExecute.cpp
|
|
NoInferenceModelRunner.cpp
|
|
ObjCARCAliasAnalysis.cpp
|
|
ObjCARCAnalysisUtils.cpp
|
|
ObjCARCInstKind.cpp
|
|
OptimizationRemarkEmitter.cpp
|
|
OverflowInstAnalysis.cpp
|
|
PHITransAddr.cpp
|
|
PhiValues.cpp
|
|
PostDominators.cpp
|
|
ProfileSummaryInfo.cpp
|
|
PtrUseVisitor.cpp
|
|
RegionInfo.cpp
|
|
RegionPass.cpp
|
|
RegionPrinter.cpp
|
|
ReplayInlineAdvisor.cpp
|
|
RuntimeLibcallInfo.cpp
|
|
ScalarEvolution.cpp
|
|
ScalarEvolutionAliasAnalysis.cpp
|
|
ScalarEvolutionDivision.cpp
|
|
ScalarEvolutionNormalization.cpp
|
|
StaticDataProfileInfo.cpp
|
|
StackLifetime.cpp
|
|
StackSafetyAnalysis.cpp
|
|
StructuralHash.cpp
|
|
SyntheticCountsUtils.cpp
|
|
TFLiteUtils.cpp
|
|
TargetLibraryInfo.cpp
|
|
TargetTransformInfo.cpp
|
|
TensorSpec.cpp
|
|
Trace.cpp
|
|
TrainingLogger.cpp
|
|
TypeBasedAliasAnalysis.cpp
|
|
TypeMetadataUtils.cpp
|
|
UniformityAnalysis.cpp
|
|
ScopedNoAliasAA.cpp
|
|
ValueLattice.cpp
|
|
ValueLatticeUtils.cpp
|
|
ValueTracking.cpp
|
|
VectorUtils.cpp
|
|
${GeneratedMLSources}
|
|
|
|
ADDITIONAL_HEADER_DIRS
|
|
${LLVM_MAIN_INCLUDE_DIR}/llvm/Analysis
|
|
|
|
DEPENDS
|
|
analysis_gen
|
|
intrinsics_gen
|
|
${MLDeps}
|
|
|
|
LINK_LIBS
|
|
${MLLinkDeps}
|
|
|
|
LINK_COMPONENTS
|
|
BinaryFormat
|
|
Core
|
|
FrontendHLSL
|
|
Object
|
|
ProfileData
|
|
Support
|
|
TargetParser
|
|
)
|
|
|
|
include(CheckCXXSymbolExists)
|
|
check_cxx_symbol_exists(logf128 math.h HAS_LOGF128)
|
|
if(HAS_LOGF128)
|
|
target_compile_definitions(LLVMAnalysis PRIVATE HAS_LOGF128)
|
|
endif()
|