Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions llvm/include/llvm/CodeGen/RegAllocSegmentTree.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//===- RegAllocSegmentTree.h - RA segtree scaffold --------------*- C++ -*-===//
//
// This file declares createRegAllocSegmentTree() factory (scaffold only).
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_REGALLOCSEGMENTTREE_H
#define LLVM_CODEGEN_REGALLOCSEGMENTTREE_H

namespace llvm {
class FunctionPass;

// Factory (for -regalloc=segtre). For now it delegates to Greedy (NFC).
FunctionPass *createRegAllocSegmentTree();
} // end namespace llvm

#endif
1 change: 1 addition & 0 deletions llvm/lib/CodeGen/CodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
initializeRABasicPass(Registry);
initializeRAGreedyLegacyPass(Registry);
initializeRegAllocFastPass(Registry);
// initializeRegAllocSegmentTreePass(Registry); // Add this line
initializeRegUsageInfoCollectorLegacyPass(Registry);
initializeRegUsageInfoPropagationLegacyPass(Registry);
initializeRegisterCoalescerLegacyPass(Registry);
Expand Down
21 changes: 21 additions & 0 deletions llvm/lib/CodeGen/RegAllocSegmentTree.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//===- RegAllocSegmentTree.cpp - RA segtree scaffold ----------------------===//
//
// Scaffold only: register -regalloc=segmenttree that delegates to Greedy (NFC).
//
//===----------------------------------------------------------------------===//

#include "llvm/CodeGen/RegAllocSegmentTree.h"
#include "llvm/CodeGen/RegAllocRegistry.h"

using namespace llvm;

// 工廠:目前直接委派回 Greedy(零行為變更)
FunctionPass *llvm::createRegAllocSegmentTree() {
extern FunctionPass *createGreedyRegisterAllocator();
return createGreedyRegisterAllocator();
}

// 把選項掛進 -regalloc= 名單(名稱、描述、工廠)
static RegisterRegAlloc
RAReg("segmenttree", "Segment Tree Register Allocator (scaffold)",
createRegAllocSegmentTree);
Loading