1if (DEFINED LLVM_HAVE_TF_AOT OR LLVM_HAVE_TFLITE) 2 include(TensorFlowCompile) 3 set(LLVM_RAEVICT_MODEL_PATH_DEFAULT "models/regalloc-eviction") 4 5 set(LLVM_RAEVICT_MODEL_CURRENT_URL "<UNSPECIFIED>" CACHE STRING "URL to download the LLVM register allocator eviction model") 6 7 if (DEFINED LLVM_HAVE_TF_AOT) 8 tf_find_and_compile( 9 ${LLVM_RAEVICT_MODEL_PATH} 10 ${LLVM_RAEVICT_MODEL_CURRENT_URL} 11 ${LLVM_RAEVICT_MODEL_PATH_DEFAULT} 12 "../Analysis/models/gen-regalloc-eviction-test-model.py" 13 serve 14 action 15 RegAllocEvictModel 16 llvm::RegAllocEvictModel 17 ) 18 endif() 19 20 if (LLVM_HAVE_TFLITE) 21 list(APPEND MLLinkDeps ${tensorflow_c_api} ${tensorflow_fx}) 22 endif() 23endif() 24 25add_llvm_component_library(LLVMCodeGen 26 AggressiveAntiDepBreaker.cpp 27 AllocationOrder.cpp 28 Analysis.cpp 29 AssignmentTrackingAnalysis.cpp 30 AtomicExpandPass.cpp 31 BasicTargetTransformInfo.cpp 32 BranchFolding.cpp 33 BranchRelaxation.cpp 34 BreakFalseDeps.cpp 35 BasicBlockSections.cpp 36 BasicBlockPathCloning.cpp 37 BasicBlockSectionsProfileReader.cpp 38 CalcSpillWeights.cpp 39 CallBrPrepare.cpp 40 CallingConvLower.cpp 41 CFGuardLongjmp.cpp 42 CFIFixup.cpp 43 CFIInstrInserter.cpp 44 CodeGen.cpp 45 CodeGenCommonISel.cpp 46 CodeGenPrepare.cpp 47 CommandFlags.cpp 48 ComplexDeinterleavingPass.cpp 49 CriticalAntiDepBreaker.cpp 50 DeadMachineInstructionElim.cpp 51 DetectDeadLanes.cpp 52 DFAPacketizer.cpp 53 DwarfEHPrepare.cpp 54 EarlyIfConversion.cpp 55 EdgeBundles.cpp 56 EHContGuardCatchret.cpp 57 ExecutionDomainFix.cpp 58 ExpandLargeDivRem.cpp 59 ExpandLargeFpConvert.cpp 60 ExpandMemCmp.cpp 61 ExpandPostRAPseudos.cpp 62 ExpandReductions.cpp 63 ExpandVectorPredication.cpp 64 FaultMaps.cpp 65 FEntryInserter.cpp 66 FinalizeISel.cpp 67 FixupStatepointCallerSaved.cpp 68 FuncletLayout.cpp 69 MachineFunctionAnalysis.cpp 70 GCMetadata.cpp 71 GCMetadataPrinter.cpp 72 GCRootLowering.cpp 73 GlobalMerge.cpp 74 GlobalMergeFunctions.cpp 75 HardwareLoops.cpp 76 IfConversion.cpp 77 ImplicitNullChecks.cpp 78 IndirectBrExpandPass.cpp 79 InitUndef.cpp 80 InlineSpiller.cpp 81 InterferenceCache.cpp 82 InterleavedAccessPass.cpp 83 InterleavedLoadCombinePass.cpp 84 IntrinsicLowering.cpp 85 JMCInstrumenter.cpp 86 KCFI.cpp 87 LatencyPriorityQueue.cpp 88 LazyMachineBlockFrequencyInfo.cpp 89 LexicalScopes.cpp 90 LiveDebugVariables.cpp 91 LiveIntervals.cpp 92 LiveInterval.cpp 93 LiveIntervalUnion.cpp 94 LivePhysRegs.cpp 95 LiveRangeCalc.cpp 96 LiveIntervalCalc.cpp 97 LiveRangeEdit.cpp 98 LiveRangeShrink.cpp 99 LiveRegMatrix.cpp 100 LiveRegUnits.cpp 101 LiveStacks.cpp 102 LiveVariables.cpp 103 CodeGenTargetMachineImpl.cpp 104 LocalStackSlotAllocation.cpp 105 LoopTraversal.cpp 106 LowLevelTypeUtils.cpp 107 LowerEmuTLS.cpp 108 MachineBasicBlock.cpp 109 MachineBlockFrequencyInfo.cpp 110 MachineBlockPlacement.cpp 111 MachineBranchProbabilityInfo.cpp 112 MachineCFGPrinter.cpp 113 MachineCombiner.cpp 114 MachineConvergenceVerifier.cpp 115 MachineCopyPropagation.cpp 116 MachineCSE.cpp 117 MachineCheckDebugify.cpp 118 MachineCycleAnalysis.cpp 119 MachineDebugify.cpp 120 MachineDomTreeUpdater.cpp 121 MachineDominanceFrontier.cpp 122 MachineDominators.cpp 123 MachineFrameInfo.cpp 124 MachineFunction.cpp 125 MachineFunctionPass.cpp 126 MachineFunctionPrinterPass.cpp 127 MachineFunctionSplitter.cpp 128 MachineInstrBundle.cpp 129 MachineInstr.cpp 130 MachineLateInstrsCleanup.cpp 131 MachineLICM.cpp 132 MachineLoopInfo.cpp 133 MachineLoopUtils.cpp 134 MachineModuleInfo.cpp 135 MachineModuleInfoImpls.cpp 136 MachineModuleSlotTracker.cpp 137 MachineOperand.cpp 138 MachineOptimizationRemarkEmitter.cpp 139 MachineOutliner.cpp 140 MachinePassManager.cpp 141 MachinePipeliner.cpp 142 MachinePostDominators.cpp 143 MachineRegionInfo.cpp 144 MachineRegisterInfo.cpp 145 MachineScheduler.cpp 146 MachineSink.cpp 147 MachineSizeOpts.cpp 148 MachineSSAContext.cpp 149 MachineSSAUpdater.cpp 150 MachineStripDebug.cpp 151 MachineTraceMetrics.cpp 152 MachineUniformityAnalysis.cpp 153 MachineVerifier.cpp 154 MIRFSDiscriminator.cpp 155 MIRSampleProfile.cpp 156 MIRYamlMapping.cpp 157 MLRegAllocEvictAdvisor.cpp 158 MLRegAllocPriorityAdvisor.cpp 159 ModuloSchedule.cpp 160 MultiHazardRecognizer.cpp 161 PatchableFunction.cpp 162 MBFIWrapper.cpp 163 MIRPrinter.cpp 164 MIRPrintingPass.cpp 165 MacroFusion.cpp 166 NonRelocatableStringpool.cpp 167 OptimizePHIs.cpp 168 PeepholeOptimizer.cpp 169 PHIElimination.cpp 170 PHIEliminationUtils.cpp 171 PostRAHazardRecognizer.cpp 172 PostRASchedulerList.cpp 173 PreISelIntrinsicLowering.cpp 174 ProcessImplicitDefs.cpp 175 PrologEpilogInserter.cpp 176 PseudoProbeInserter.cpp 177 PseudoSourceValue.cpp 178 RDFGraph.cpp 179 RDFLiveness.cpp 180 RDFRegisters.cpp 181 ReachingDefAnalysis.cpp 182 RegAllocBase.cpp 183 RegAllocBasic.cpp 184 RegAllocEvictionAdvisor.cpp 185 RegAllocFast.cpp 186 RegAllocGreedy.cpp 187 RegAllocPBQP.cpp 188 RegAllocPriorityAdvisor.cpp 189 RegAllocScore.cpp 190 RegisterClassInfo.cpp 191 RegisterCoalescer.cpp 192 RegisterPressure.cpp 193 RegisterScavenging.cpp 194 GCEmptyBasicBlocks.cpp 195 RemoveRedundantDebugValues.cpp 196 RenameIndependentSubregs.cpp 197 MachineStableHash.cpp 198 MIRVRegNamerUtils.cpp 199 MIRNamerPass.cpp 200 MIRCanonicalizerPass.cpp 201 RegisterUsageInfo.cpp 202 RegUsageInfoCollector.cpp 203 RegUsageInfoPropagate.cpp 204 RemoveLoadsIntoFakeUses.cpp 205 ReplaceWithVeclib.cpp 206 ResetMachineFunctionPass.cpp 207 RegisterBank.cpp 208 RegisterBankInfo.cpp 209 SafeStack.cpp 210 SafeStackLayout.cpp 211 SanitizerBinaryMetadata.cpp 212 ScheduleDAG.cpp 213 ScheduleDAGInstrs.cpp 214 ScheduleDAGPrinter.cpp 215 ScoreboardHazardRecognizer.cpp 216 SelectOptimize.cpp 217 ShadowStackGCLowering.cpp 218 ShrinkWrap.cpp 219 SjLjEHPrepare.cpp 220 SlotIndexes.cpp 221 SpillPlacement.cpp 222 SplitKit.cpp 223 StackColoring.cpp 224 StackFrameLayoutAnalysisPass.cpp 225 StackMapLivenessAnalysis.cpp 226 StackMaps.cpp 227 StackProtector.cpp 228 StackSlotColoring.cpp 229 StaticDataSplitter.cpp 230 SwiftErrorValueTracking.cpp 231 SwitchLoweringUtils.cpp 232 TailDuplication.cpp 233 TailDuplicator.cpp 234 TargetFrameLoweringImpl.cpp 235 TargetInstrInfo.cpp 236 TargetLoweringBase.cpp 237 TargetLoweringObjectFileImpl.cpp 238 TargetOptionsImpl.cpp 239 TargetPassConfig.cpp 240 TargetRegisterInfo.cpp 241 TargetSchedule.cpp 242 TargetSubtargetInfo.cpp 243 TwoAddressInstructionPass.cpp 244 TypePromotion.cpp 245 UnreachableBlockElim.cpp 246 ValueTypes.cpp 247 VLIWMachineScheduler.cpp 248 VirtRegMap.cpp 249 WasmEHPrepare.cpp 250 WindowScheduler.cpp 251 WinEHPrepare.cpp 252 XRayInstrumentation.cpp 253 ${GeneratedMLSources} 254 255 LiveDebugValues/LiveDebugValues.cpp 256 LiveDebugValues/VarLocBasedImpl.cpp 257 LiveDebugValues/InstrRefBasedImpl.cpp 258 259 ADDITIONAL_HEADER_DIRS 260 ${LLVM_MAIN_INCLUDE_DIR}/llvm/CodeGen 261 ${LLVM_MAIN_INCLUDE_DIR}/llvm/CodeGen/PBQP 262 263 LINK_LIBS ${LLVM_PTHREAD_LIB} ${MLLinkDeps} 264 265 DEPENDS 266 intrinsics_gen 267 vt_gen 268 ${MLDeps} 269 270 LINK_COMPONENTS 271 Analysis 272 BitReader 273 BitWriter 274 CGData 275 CodeGenTypes 276 Core 277 MC 278 ObjCARC 279 ProfileData 280 Scalar 281 Support 282 Target 283 TargetParser 284 TransformUtils 285 ) 286 287add_subdirectory(SelectionDAG) 288add_subdirectory(AsmPrinter) 289add_subdirectory(MIRParser) 290add_subdirectory(GlobalISel) 291