diff options
| author | Dale Johannesen <dalej@apple.com> | 2009-02-19 19:40:21 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2009-02-19 19:40:21 +0000 |
| commit | f6a71b39b7e4ed4bd99ac3c7ef3eb2194c99d759 (patch) | |
| tree | 6942e3c17b4390044e8a12f0a874653a2434a31d /llvm/include | |
| parent | a34d7adefb60936553d71fa9c63cf868e6d14922 (diff) | |
| download | bcm5719-llvm-f6a71b39b7e4ed4bd99ac3c7ef3eb2194c99d759.tar.gz bcm5719-llvm-f6a71b39b7e4ed4bd99ac3c7ef3eb2194c99d759.zip | |
Describe tail merging's use of InsertBranch.
llvm-svn: 65062
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Target/TargetInstrInfo.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/llvm/include/llvm/Target/TargetInstrInfo.h b/llvm/include/llvm/Target/TargetInstrInfo.h index 1ea4a963320..c8e90cf8792 100644 --- a/llvm/include/llvm/Target/TargetInstrInfo.h +++ b/llvm/include/llvm/Target/TargetInstrInfo.h @@ -182,15 +182,15 @@ public: /// 2. If this block ends with only an unconditional branch, it sets TBB to be /// the destination block. /// 3. If this block ends with an conditional branch and it falls through to - /// an successor block, it sets TBB to be the branch destination block and a - /// list of operands that evaluate the condition. These + /// an successor block, it sets TBB to be the branch destination block and + /// a list of operands that evaluate the condition. These /// operands can be passed to other TargetInstrInfo methods to create new /// branches. /// 4. If this block ends with an conditional branch and an unconditional - /// block, it returns the 'true' destination in TBB, the 'false' destination - /// in FBB, and a list of operands that evaluate the condition. These - /// operands can be passed to other TargetInstrInfo methods to create new - /// branches. + /// block, it returns the 'true' destination in TBB, the 'false' + /// destination in FBB, and a list of operands that evaluate the condition. + /// These operands can be passed to other TargetInstrInfo methods to create + /// new branches. /// /// Note that RemoveBranch and InsertBranch must be implemented to support /// cases where this method returns success. @@ -219,6 +219,11 @@ public: /// returns success and when an unconditional branch (TBB is non-null, FBB is /// null, Cond is empty) needs to be inserted. It returns the number of /// instructions inserted. + /// + /// It is also invoked by tail merging to add unconditional branches in + /// cases where AnalyzeBranch doesn't apply because there was no original + /// branch to analyze. At least this much must be implemented, else tail + /// merging needs to be disabled. virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, const SmallVectorImpl<MachineOperand> &Cond) const { |

