Pool-allocation for MachineInstrs, MachineBasicBlocks, and

MachineMemOperands. The pools are owned by MachineFunctions.

This drastically reduces the number of calls to malloc/free made
during the "Emit" phase of scheduling, as well as later phases
in CodeGen. Combined with other changes, this speeds up the
"instruction selection" phase of CodeGen by 10% in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53212 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2008-07-07 23:14:23 +00:00
parent 0e5f1306b0
commit 8e5f2c6f65
37 changed files with 625 additions and 516 deletions

View File

@@ -22,9 +22,10 @@ namespace llvm {
MachineBasicBlock* SplitCriticalMachineEdge(MachineBasicBlock* src,
MachineBasicBlock* dst) {
MachineFunction &MF = *src->getParent();
const BasicBlock* srcBB = src->getBasicBlock();
MachineBasicBlock* crit_mbb = new MachineBasicBlock(srcBB);
MachineBasicBlock* crit_mbb = MF.CreateMachineBasicBlock(srcBB);
// modify the llvm control flow graph
src->removeSuccessor(dst);
@@ -32,11 +33,10 @@ MachineBasicBlock* SplitCriticalMachineEdge(MachineBasicBlock* src,
crit_mbb->addSuccessor(dst);
// insert the new block into the machine function.
src->getParent()->getBasicBlockList().insert(src->getParent()->end(),
crit_mbb);
MF.push_back(crit_mbb);
// insert a unconditional branch linking the new block to dst
const TargetMachine& TM = src->getParent()->getTarget();
const TargetMachine& TM = MF.getTarget();
const TargetInstrInfo* TII = TM.getInstrInfo();
std::vector<MachineOperand> emptyConditions;
TII->InsertBranch(*crit_mbb, dst, (MachineBasicBlock*)0,