diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-09-14 17:23:48 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-09-14 17:23:48 +0000 |
| commit | a2b036e88b8f31c4a2169c1d5634e21c9c8eb927 (patch) | |
| tree | 42c193d75f862e2c4580fe41e0da38f3a3d5765c /llvm/lib/Target/MSP430 | |
| parent | c531c9ebf555c2c96d62e2d0e956697fe7011cc3 (diff) | |
| download | bcm5719-llvm-a2b036e88b8f31c4a2169c1d5634e21c9c8eb927.tar.gz bcm5719-llvm-a2b036e88b8f31c4a2169c1d5634e21c9c8eb927.zip | |
AArch64: Use TTI branch functions in branch relaxation
The main change is to return the code size from
InsertBranch/RemoveBranch.
Patch mostly by Tim Northover
llvm-svn: 281505
Diffstat (limited to 'llvm/lib/Target/MSP430')
| -rw-r--r-- | llvm/lib/Target/MSP430/MSP430InstrInfo.cpp | 9 | ||||
| -rw-r--r-- | llvm/lib/Target/MSP430/MSP430InstrInfo.h | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp b/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp index 4fb82ad613d..12f93fbcac5 100644 --- a/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp +++ b/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp @@ -104,7 +104,10 @@ void MSP430InstrInfo::copyPhysReg(MachineBasicBlock &MBB, .addReg(SrcReg, getKillRegState(KillSrc)); } -unsigned MSP430InstrInfo::RemoveBranch(MachineBasicBlock &MBB) const { +unsigned MSP430InstrInfo::RemoveBranch(MachineBasicBlock &MBB, + int *BytesRemoved) const { + assert(!BytesRemoved && "code size not handled"); + MachineBasicBlock::iterator I = MBB.end(); unsigned Count = 0; @@ -264,11 +267,13 @@ unsigned MSP430InstrInfo::InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond, - const DebugLoc &DL) const { + const DebugLoc &DL, + int *BytesAdded) const { // Shouldn't be a fall through. assert(TBB && "InsertBranch must not be told to insert a fallthrough"); assert((Cond.size() == 1 || Cond.size() == 0) && "MSP430 branch conditions have one component!"); + assert(!BytesAdded && "code size not handled"); if (Cond.empty()) { // Unconditional branch? diff --git a/llvm/lib/Target/MSP430/MSP430InstrInfo.h b/llvm/lib/Target/MSP430/MSP430InstrInfo.h index 1db438c8d67..80f21fd8f9a 100644 --- a/llvm/lib/Target/MSP430/MSP430InstrInfo.h +++ b/llvm/lib/Target/MSP430/MSP430InstrInfo.h @@ -79,10 +79,12 @@ public: SmallVectorImpl<MachineOperand> &Cond, bool AllowModify) const override; - unsigned RemoveBranch(MachineBasicBlock &MBB) const override; + unsigned RemoveBranch(MachineBasicBlock &MBB, + int *BytesRemoved = nullptr) const override; unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond, - const DebugLoc &DL) const override; + const DebugLoc &DL, + int *BytesAdded = nullptr) const override; }; } |

