File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ // ===- RegAllocSegmentTree.h - RA segtree scaffold --------------*- C++ -*-===//
2+ //
3+ // This file declares createRegAllocSegmentTree() factory (scaffold only).
4+ //
5+ // ===----------------------------------------------------------------------===//
6+
7+ #ifndef LLVM_CODEGEN_REGALLOCSEGMENTTREE_H
8+ #define LLVM_CODEGEN_REGALLOCSEGMENTTREE_H
9+
10+ namespace llvm {
11+ class FunctionPass ;
12+
13+ // Factory (for -regalloc=segtre). For now it delegates to Greedy (NFC).
14+ FunctionPass *createRegAllocSegmentTree ();
15+ } // end namespace llvm
16+
17+ #endif
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
113113 initializeRABasicPass (Registry);
114114 initializeRAGreedyLegacyPass (Registry);
115115 initializeRegAllocFastPass (Registry);
116+ // initializeRegAllocSegmentTreePass(Registry); // Add this line
116117 initializeRegUsageInfoCollectorLegacyPass (Registry);
117118 initializeRegUsageInfoPropagationLegacyPass (Registry);
118119 initializeRegisterCoalescerLegacyPass (Registry);
Original file line number Diff line number Diff line change 1+ // ===- RegAllocSegmentTree.cpp - RA segtree scaffold ----------------------===//
2+ //
3+ // Scaffold only: register -regalloc=segmenttree that delegates to Greedy (NFC).
4+ //
5+ // ===----------------------------------------------------------------------===//
6+
7+ #include " llvm/CodeGen/RegAllocSegmentTree.h"
8+ #include " llvm/CodeGen/RegAllocRegistry.h"
9+
10+ using namespace llvm ;
11+
12+ // 工廠:目前直接委派回 Greedy(零行為變更)
13+ FunctionPass *llvm::createRegAllocSegmentTree () {
14+ extern FunctionPass *createGreedyRegisterAllocator ();
15+ return createGreedyRegisterAllocator ();
16+ }
17+
18+ // 把選項掛進 -regalloc= 名單(名稱、描述、工廠)
19+ static RegisterRegAlloc
20+ RAReg (" segmenttree" , " Segment Tree Register Allocator (scaffold)" ,
21+ createRegAllocSegmentTree);
You can’t perform that action at this time.
0 commit comments