mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user