diff options
author | Bill Wendling <isanbard@gmail.com> | 2007-12-07 21:42:31 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2007-12-07 21:42:31 +0000 |
commit | fb706bc52bd61c4c426ff3d7a9cb2b16560b5c5a (patch) | |
tree | 94361610d7beb2c0af3c309651a56d5b48d0e8be /llvm/lib/CodeGen/LLVMTargetMachine.cpp | |
parent | b41d838d28a64369f8a804bfd2bc0899115e60cc (diff) | |
download | bcm5719-llvm-fb706bc52bd61c4c426ff3d7a9cb2b16560b5c5a.tar.gz bcm5719-llvm-fb706bc52bd61c4c426ff3d7a9cb2b16560b5c5a.zip |
Initial commit of the machine code LICM pass. It successfully hoists this:
_foo:
li r2, 0
LBB1_1: ; bb
li r5, 0
stw r5, 0(r3)
addi r2, r2, 1
addi r3, r3, 4
cmplw cr0, r2, r4
bne cr0, LBB1_1 ; bb
LBB1_2: ; return
blr
to:
_foo:
li r2, 0
li r5, 0
LBB1_1: ; bb
stw r5, 0(r3)
addi r2, r2, 1
addi r3, r3, 4
cmplw cr0, r2, r4
bne cr0, LBB1_1 ; bb
LBB1_2: ; return
blr
ZOMG!! :-)
Moar to come...
llvm-svn: 44687
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LLVMTargetMachine.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp index 526c5255fe3..7776d67b2ad 100644 --- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp +++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp @@ -66,7 +66,9 @@ LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM, // Print the instruction selected machine code... if (PrintMachineCode) PM.add(createMachineFunctionPrinterPass(cerr)); - + + PM.add(createMachineLICMPass()); + // Perform register allocation to convert to a concrete x86 representation PM.add(createRegisterAllocator()); @@ -92,7 +94,7 @@ LLVMTargetMachine::addPassesToEmitFile(FunctionPassManager &PM, // Branch folding must be run after regalloc and prolog/epilog insertion. if (!Fast) PM.add(createBranchFoldingPass(getEnableTailMergeDefault())); - + // Fold redundant debug labels. PM.add(createDebugLabelFoldingPass()); @@ -175,7 +177,9 @@ bool LLVMTargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM, // Print the instruction selected machine code... if (PrintMachineCode) PM.add(createMachineFunctionPrinterPass(cerr)); - + + PM.add(createMachineLICMPass()); + // Perform register allocation to convert to a concrete x86 representation PM.add(createRegisterAllocator()); @@ -204,7 +208,7 @@ bool LLVMTargetMachine::addPassesToEmitMachineCode(FunctionPassManager &PM, // Branch folding must be run after regalloc and prolog/epilog insertion. if (!Fast) PM.add(createBranchFoldingPass(getEnableTailMergeDefault())); - + if (addPreEmitPass(PM, Fast) && PrintMachineCode) PM.add(createMachineFunctionPrinterPass(cerr)); |