1515#include " RegAllocGreedy.h"
1616#include " llvm/Analysis/MLModelRunner.h"
1717#include " llvm/Analysis/TensorSpec.h"
18- #if defined(LLVM_HAVE_TF_AOT_REGALLOCEVICTMODEL) || defined(LLVM_HAVE_TF_API )
18+ #if defined(LLVM_HAVE_TF_AOT_REGALLOCEVICTMODEL) || defined(LLVM_HAVE_TFLITE )
1919#include " llvm/Analysis/ModelUnderTrainingRunner.h"
2020#include " llvm/Analysis/NoInferenceModelRunner.h"
2121#include " llvm/Analysis/Utils/TrainingLogger.h"
@@ -53,7 +53,7 @@ using CompiledModelType = NoopSavedModelImpl;
5353#endif
5454
5555// Options that only make sense in development mode
56- #ifdef LLVM_HAVE_TF_API
56+ #ifdef LLVM_HAVE_TFLITE
5757#include " RegAllocScore.h"
5858#include " llvm/Analysis/Utils/TFUtils.h"
5959
@@ -72,7 +72,7 @@ static cl::opt<bool> EnableDevelopmentFeatures(
7272
7373#else
7474static const bool EnableDevelopmentFeatures = false ;
75- #endif // #ifdef LLVM_HAVE_TF_API
75+ #endif // #ifdef LLVM_HAVE_TFLITE
7676
7777extern cl::opt<unsigned > EvictInterferenceCutoff;
7878
@@ -191,7 +191,7 @@ static const std::vector<int64_t> PerLiveRangeShape{1, NumberOfInterferences};
191191 " lowest stage of an interval in this LR" ) \
192192 M (float , progress, {1 }, " ratio of current queue size to initial size" )
193193
194- #ifdef LLVM_HAVE_TF_API
194+ #ifdef LLVM_HAVE_TFLITE
195195#define RA_EVICT_FIRST_DEVELOPMENT_FEATURE (M ) \
196196 M (int64_t , instructions, InstructionsShape, \
197197 " Opcodes of the instructions covered by the eviction problem" )
@@ -219,11 +219,11 @@ enum FeatureIDs {
219219#define _FEATURE_IDX_SIMPLE (_, name, __, ___ ) name
220220#define _FEATURE_IDX (A, B, C, D ) _FEATURE_IDX_SIMPLE(A, B, C, D),
221221 RA_EVICT_FEATURES_LIST (_FEATURE_IDX) FeatureCount,
222- #ifdef LLVM_HAVE_TF_API
222+ #ifdef LLVM_HAVE_TFLITE
223223 RA_EVICT_FIRST_DEVELOPMENT_FEATURE (_FEATURE_IDX_SIMPLE) = FeatureCount,
224224#else
225225 RA_EVICT_FIRST_DEVELOPMENT_FEATURE (_FEATURE_IDX)
226- #endif // #ifdef LLVM_HAVE_TF_API
226+ #endif // #ifdef LLVM_HAVE_TFLITE
227227 RA_EVICT_REST_DEVELOPMENT_FEATURES (_FEATURE_IDX) FeaturesWithDevelopmentCount
228228#undef _FEATURE_IDX
229229#undef _FEATURE_IDX_SIMPLE
@@ -397,7 +397,7 @@ class ReleaseModeEvictionAdvisorAnalysis final
397397// ===================================
398398//
399399// Features we log
400- #ifdef LLVM_HAVE_TF_API
400+ #ifdef LLVM_HAVE_TFLITE
401401static const TensorSpec Output =
402402 TensorSpec::createSpec<int64_t >(DecisionName, {1 });
403403static const TensorSpec Reward = TensorSpec::createSpec<float >(" reward" , {1 });
@@ -539,7 +539,7 @@ class DevelopmentModeEvictionAdvisorAnalysis final
539539 StringMap<std::unique_ptr<Logger>> LogMap;
540540};
541541
542- #endif // #ifdef LLVM_HAVE_TF_API
542+ #endif // #ifdef LLVM_HAVE_TFLITE
543543} // namespace
544544
545545float MLEvictAdvisor::getInitialQueueSize (const MachineFunction &MF) {
@@ -718,7 +718,7 @@ MCRegister MLEvictAdvisor::tryFindEvictionCandidate(
718718 /* NrUrgent*/ 0.0 , LRPosInfo);
719719 assert (InitialQSize > 0.0 && " We couldn't have gotten here if we had "
720720 " nothing to allocate initially." );
721- #ifdef LLVM_HAVE_TF_API
721+ #ifdef LLVM_HAVE_TFLITE
722722 if (EnableDevelopmentFeatures) {
723723 extractInstructionFeatures (
724724 LRPosInfo, Runner,
@@ -745,7 +745,7 @@ MCRegister MLEvictAdvisor::tryFindEvictionCandidate(
745745 FeatureIDs::mbb_frequencies, FeatureIDs::mbb_mapping,
746746 LIS->getSlotIndexes ()->getLastIndex ());
747747 }
748- #endif // #ifdef LLVM_HAVE_TF_API
748+ #endif // #ifdef LLVM_HAVE_TFLITE
749749 // Normalize the features.
750750 for (auto &V : Largest)
751751 V = V ? V : 1.0 ;
@@ -1062,7 +1062,7 @@ void extractMBBFrequency(const SlotIndex CurrentIndex,
10621062}
10631063
10641064// Development mode-specific implementations
1065- #ifdef LLVM_HAVE_TF_API
1065+ #ifdef LLVM_HAVE_TFLITE
10661066
10671067RegAllocEvictionAdvisorAnalysis *llvm::createDevelopmentModeAdvisor () {
10681068 return new DevelopmentModeEvictionAdvisorAnalysis ();
@@ -1128,13 +1128,13 @@ bool RegAllocScoring::runOnMachineFunction(MachineFunction &MF) {
11281128 GetReward);
11291129 return false ;
11301130}
1131- #endif // #ifdef LLVM_HAVE_TF_API
1131+ #endif // #ifdef LLVM_HAVE_TFLITE
11321132
11331133RegAllocEvictionAdvisorAnalysis *llvm::createReleaseModeAdvisor () {
11341134 return new ReleaseModeEvictionAdvisorAnalysis ();
11351135}
11361136
11371137// In all cases except development mode, we don't need scoring.
1138- #if !defined(LLVM_HAVE_TF_API )
1138+ #if !defined(LLVM_HAVE_TFLITE )
11391139bool RegAllocScoring::runOnMachineFunction (MachineFunction &) { return false ; }
11401140#endif
0 commit comments