mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
Add a pre-regalloc tail duplication pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90567 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -74,6 +74,9 @@ EnableFastISelOption("fast-isel", cl::Hidden,
|
||||
static cl::opt<bool> EnableSplitGEPGVN("split-gep-gvn", cl::Hidden,
|
||||
cl::desc("Split GEPs and run no-load GVN"));
|
||||
|
||||
static cl::opt<bool> PreAllocTailDup("pre-regalloc-taildup", cl::Hidden,
|
||||
cl::desc("Pre-register allocation tail duplication"));
|
||||
|
||||
LLVMTargetMachine::LLVMTargetMachine(const Target &T,
|
||||
const std::string &TargetTriple)
|
||||
: TargetMachine(T) {
|
||||
@@ -302,6 +305,13 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
|
||||
/* allowDoubleDefs= */ true);
|
||||
}
|
||||
|
||||
// Pre-ra tail duplication.
|
||||
if (OptLevel != CodeGenOpt::None &&
|
||||
!DisableTailDuplicate && PreAllocTailDup) {
|
||||
PM.add(createTailDuplicatePass(true));
|
||||
printAndVerify(PM, "After Pre-RegAlloc TailDuplicate");
|
||||
}
|
||||
|
||||
// Run pre-ra passes.
|
||||
if (addPreRegAlloc(PM, OptLevel))
|
||||
printAndVerify(PM, "After PreRegAlloc passes",
|
||||
@@ -348,7 +358,7 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
|
||||
|
||||
// Tail duplication.
|
||||
if (OptLevel != CodeGenOpt::None && !DisableTailDuplicate) {
|
||||
PM.add(createTailDuplicatePass());
|
||||
PM.add(createTailDuplicatePass(false));
|
||||
printAndVerify(PM, "After TailDuplicate");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user