191 lines · plain
1if (DEFINED LLVM_HAVE_TF_AOT OR LLVM_HAVE_TFLITE)2 include(TensorFlowCompile)3 set(LLVM_INLINER_MODEL_PATH_DEFAULT "models/inliner-Oz")4 5 set(LLVM_INLINER_MODEL_CURRENT_URL "<UNSPECIFIED>" CACHE STRING "URL to download the LLVM inliner model")6 7 if (DEFINED LLVM_HAVE_TF_AOT)8 tf_find_and_compile(9 ${LLVM_INLINER_MODEL_PATH}10 ${LLVM_INLINER_MODEL_CURRENT_URL}11 ${LLVM_INLINER_MODEL_PATH_DEFAULT}12 "models/gen-inline-oz-test-model.py"13 serve14 action15 InlinerSizeModel16 llvm::InlinerSizeModel17 )18 endif()19 20 if (LLVM_HAVE_TFLITE)21 list(APPEND MLLinkDeps22 tensorflow-lite::tensorflow-lite)23 endif()24endif()25 26# The implementation of ConstantFolding.cpp relies on the use of math functions27# from the host. In particular, it relies on the detection of floating point28# exceptions originating from such math functions to prevent invalid cases29# from being constant folded. Therefore, we must ensure that fp exceptions are30# handled correctly.31if (MSVC)32 set_source_files_properties(ConstantFolding.cpp PROPERTIES COMPILE_OPTIONS "/fp:except")33elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")34 set_source_files_properties(ConstantFolding.cpp PROPERTIES COMPILE_OPTIONS "-ftrapping-math")35endif()36 37add_llvm_component_library(LLVMAnalysis38 AliasAnalysis.cpp39 AliasAnalysisEvaluator.cpp40 AliasSetTracker.cpp41 Analysis.cpp42 AssumeBundleQueries.cpp43 AssumptionCache.cpp44 BasicAliasAnalysis.cpp45 BlockFrequencyInfo.cpp46 BlockFrequencyInfoImpl.cpp47 BranchProbabilityInfo.cpp48 CFG.cpp49 CFGPrinter.cpp50 CFGSCCPrinter.cpp51 CGSCCPassManager.cpp52 CallGraph.cpp53 CallGraphSCCPass.cpp54 CallPrinter.cpp55 CaptureTracking.cpp56 CmpInstAnalysis.cpp57 CostModel.cpp58 CodeMetrics.cpp59 ConstantFolding.cpp60 CtxProfAnalysis.cpp61 CycleAnalysis.cpp62 DDG.cpp63 DDGPrinter.cpp64 ConstraintSystem.cpp65 Delinearization.cpp66 DemandedBits.cpp67 DependenceAnalysis.cpp68 DependenceGraphBuilder.cpp69 DevelopmentModeInlineAdvisor.cpp70 DomConditionCache.cpp71 DomPrinter.cpp72 DomTreeUpdater.cpp73 DominanceFrontier.cpp74 DXILResource.cpp75 DXILMetadataAnalysis.cpp76 EphemeralValuesCache.cpp77 FloatingPointPredicateUtils.cpp78 FunctionPropertiesAnalysis.cpp79 GlobalsModRef.cpp80 GuardUtils.cpp81 HashRecognize.cpp82 HeatUtils.cpp83 IR2Vec.cpp84 IRSimilarityIdentifier.cpp85 IVDescriptors.cpp86 IVUsers.cpp87 ImportedFunctionsInliningStatistics.cpp88 IndirectCallPromotionAnalysis.cpp89 InlineCost.cpp90 InlineAdvisor.cpp91 InlineOrder.cpp92 InstCount.cpp93 InstructionPrecedenceTracking.cpp94 InstructionSimplify.cpp95 InteractiveModelRunner.cpp96 KernelInfo.cpp97 LastRunTrackingAnalysis.cpp98 LazyBranchProbabilityInfo.cpp99 LazyBlockFrequencyInfo.cpp100 LazyCallGraph.cpp101 LazyValueInfo.cpp102 Lint.cpp103 Loads.cpp104 Local.cpp105 LoopAccessAnalysis.cpp106 LoopAnalysisManager.cpp107 LoopCacheAnalysis.cpp108 LoopNestAnalysis.cpp109 LoopUnrollAnalyzer.cpp110 LoopInfo.cpp111 LoopPass.cpp112 MLInlineAdvisor.cpp113 MemDerefPrinter.cpp114 MemoryBuiltins.cpp115 MemoryDependenceAnalysis.cpp116 MemoryLocation.cpp117 MemoryProfileInfo.cpp118 MemorySSA.cpp119 MemorySSAUpdater.cpp120 ModelUnderTrainingRunner.cpp121 ModuleDebugInfoPrinter.cpp122 ModuleSummaryAnalysis.cpp123 MustExecute.cpp124 NoInferenceModelRunner.cpp125 ObjCARCAliasAnalysis.cpp126 ObjCARCAnalysisUtils.cpp127 ObjCARCInstKind.cpp128 OptimizationRemarkEmitter.cpp129 OverflowInstAnalysis.cpp130 PHITransAddr.cpp131 PhiValues.cpp132 PostDominators.cpp133 ProfileSummaryInfo.cpp134 PtrUseVisitor.cpp135 RegionInfo.cpp136 RegionPass.cpp137 RegionPrinter.cpp138 ReplayInlineAdvisor.cpp139 RuntimeLibcallInfo.cpp140 ScalarEvolution.cpp141 ScalarEvolutionAliasAnalysis.cpp142 ScalarEvolutionDivision.cpp143 ScalarEvolutionNormalization.cpp144 StaticDataProfileInfo.cpp145 StackLifetime.cpp146 StackSafetyAnalysis.cpp147 StructuralHash.cpp148 SyntheticCountsUtils.cpp149 TFLiteUtils.cpp150 TargetLibraryInfo.cpp151 TargetTransformInfo.cpp152 TensorSpec.cpp153 Trace.cpp154 TrainingLogger.cpp155 TypeBasedAliasAnalysis.cpp156 TypeMetadataUtils.cpp157 UniformityAnalysis.cpp158 ScopedNoAliasAA.cpp159 ValueLattice.cpp160 ValueLatticeUtils.cpp161 ValueTracking.cpp162 VectorUtils.cpp163 ${GeneratedMLSources}164 165 ADDITIONAL_HEADER_DIRS166 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Analysis167 168 DEPENDS169 analysis_gen170 intrinsics_gen171 ${MLDeps}172 173 LINK_LIBS174 ${MLLinkDeps}175 176 LINK_COMPONENTS177 BinaryFormat178 Core179 FrontendHLSL180 Object181 ProfileData182 Support183 TargetParser184 )185 186include(CheckCXXSymbolExists)187check_cxx_symbol_exists(logf128 math.h HAS_LOGF128)188if(HAS_LOGF128)189 target_compile_definitions(LLVMAnalysis PRIVATE HAS_LOGF128)190endif()191