diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-11-13 21:56:15 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-11-13 21:56:15 +0000 |
commit | 1222287543a5b5917f8c31aa8c88d740f70222d9 (patch) | |
tree | 6adb9002432415f75761c4e5caf45dca25290995 /lib/CodeGen/PHIElimination.h | |
parent | ce727d0da006ca59bbd8c9ddc86e2fa71217d293 (diff) | |
download | llvm-1222287543a5b5917f8c31aa8c88d740f70222d9.tar.gz llvm-1222287543a5b5917f8c31aa8c88d740f70222d9.tar.bz2 llvm-1222287543a5b5917f8c31aa8c88d740f70222d9.tar.xz |
Fix PHIElimination optimization that uses MBB->getBasicBlock.
The BasicBlock associated with a MachineBasicBlock does not necessarily
correspond to the code in the MBB.
Don't insert a new IR BasicBlock when splitting critical edges. We are not
supposed to modify the IR during codegen, and we should be able to do just
fine with a NULL BB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88707 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PHIElimination.h')
-rw-r--r-- | lib/CodeGen/PHIElimination.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/PHIElimination.h b/lib/CodeGen/PHIElimination.h index edc2d36670..94716eef6c 100644 --- a/lib/CodeGen/PHIElimination.h +++ b/lib/CodeGen/PHIElimination.h @@ -110,11 +110,12 @@ namespace llvm { MachineBasicBlock *SplitCriticalEdge(MachineBasicBlock *A, MachineBasicBlock *B); - // FindCopyInsertPoint - Find a safe place in MBB to insert a copy from - // SrcReg. This needs to be after any def or uses of SrcReg, but before - // any subsequent point where control flow might jump out of the basic - // block. + /// FindCopyInsertPoint - Find a safe place in MBB to insert a copy from + /// SrcReg when following the CFG edge to SuccMBB. This needs to be after + /// any def of SrcReg, but before any subsequent point where control flow + /// might jump out of the basic block. MachineBasicBlock::iterator FindCopyInsertPoint(MachineBasicBlock &MBB, + MachineBasicBlock &SuccMBB, unsigned SrcReg); // SkipPHIsAndLabels - Copies need to be inserted after phi nodes and |