|
42 | 42 | using namespace llvm;
|
43 | 43 |
|
44 | 44 | #define DEBUG_TYPE "ml-regalloc"
|
45 |
| -#ifdef LLVM_HAVE_TF_AOT_REGALLOCEVICTMODEL |
46 |
| -#define LLVM_HAVE_TF_AOT |
47 |
| -#endif |
| 45 | + |
48 | 46 | // Generated header in release (AOT) mode
|
49 |
| -#if defined LLVM_HAVE_TF_AOT |
| 47 | +#if defined(LLVM_HAVE_TF_AOT_REGALLOCEVICTMODEL) |
50 | 48 | #include "RegallocEvictModel.h"
|
51 | 49 | #endif
|
52 | 50 |
|
@@ -104,7 +102,6 @@ INITIALIZE_PASS(RegAllocScoring, "regallocscoringpass",
|
104 | 102 | // ===================================
|
105 | 103 | // Common ML Advisor declarations
|
106 | 104 | // ===================================
|
107 |
| -#if defined(LLVM_HAVE_TF_AOT) || defined(LLVM_HAVE_TF_API) |
108 | 105 | namespace {
|
109 | 106 | // This is the maximum number of interfererring ranges. That's the number of
|
110 | 107 | // distinct AllocationOrder values, which comes from MCRegisterClass::RegsSize.
|
@@ -193,7 +190,9 @@ static const std::vector<int64_t> PerLiveRangeShape{1, NumberOfInterferences};
|
193 | 190 | // of the output tensor.
|
194 | 191 | // The contract with the model is that the output will be guaranteed to be to a
|
195 | 192 | // mask == 1 position.
|
196 |
| -const char *const DecisionName = "index_to_evict"; |
| 193 | +// Using a macro here to avoid 'not used' warnings (and keep cond compilation to |
| 194 | +// a minimum) |
| 195 | +#define DecisionName "index_to_evict" |
197 | 196 |
|
198 | 197 | // Named features index.
|
199 | 198 | enum FeatureIDs {
|
@@ -296,13 +295,12 @@ class MLEvictAdvisor : public RegAllocEvictionAdvisor {
|
296 | 295 | // ===================================
|
297 | 296 | // Release (AOT) - specifics
|
298 | 297 | // ===================================
|
299 |
| -#ifdef LLVM_HAVE_TF_AOT |
| 298 | +#if defined(LLVM_HAVE_TF_AOT_REGALLOCEVICTMODEL) |
300 | 299 | const std::array<std::string, FeatureIDs::FeatureCount> FeatureNames{
|
301 | 300 | #define _GETNAME(_, NAME, __, ___) #NAME,
|
302 | 301 | RA_EVICT_FEATURES_LIST(_GETNAME)
|
303 | 302 | #undef _GETNAME
|
304 | 303 | };
|
305 |
| - |
306 | 304 | class ReleaseModeEvictionAdvisorAnalysis final
|
307 | 305 | : public RegAllocEvictionAdvisorAnalysis {
|
308 | 306 | public:
|
@@ -331,7 +329,7 @@ class ReleaseModeEvictionAdvisorAnalysis final
|
331 | 329 | }
|
332 | 330 | std::unique_ptr<ReleaseModeModelRunner<RegallocEvictModel>> Runner;
|
333 | 331 | };
|
334 |
| -#endif // LLVM_HAVE_TF_AOT |
| 332 | +#endif |
335 | 333 |
|
336 | 334 | // ===================================
|
337 | 335 | // Development mode-specifics
|
@@ -852,13 +850,11 @@ bool RegAllocScoring::runOnMachineFunction(MachineFunction &MF) {
|
852 | 850 | }
|
853 | 851 | #endif // #ifdef LLVM_HAVE_TF_API
|
854 | 852 |
|
855 |
| -// Release mode specific implementations |
856 |
| -#if defined LLVM_HAVE_TF_AOT |
| 853 | +#if defined(LLVM_HAVE_TF_AOT_REGALLOCEVICTMODEL) |
857 | 854 | RegAllocEvictionAdvisorAnalysis *llvm::createReleaseModeAdvisor() {
|
858 | 855 | return new ReleaseModeEvictionAdvisorAnalysis();
|
859 | 856 | }
|
860 |
| -#endif // defined(LLVM_HAVE_TF_AOT) |
861 |
| -#endif // defined(LLVM_HAVE_TF_AOT) || defined(LLVM_HAVE_TF_API) |
| 857 | +#endif |
862 | 858 |
|
863 | 859 | // In all cases except development mode, we don't need scoring.
|
864 | 860 | #if !defined(LLVM_HAVE_TF_API)
|
|
0 commit comments