aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-11-27 23:37:22 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-11-27 23:37:22 +0000
commit20350c4025259b6a85089936bcdea17b84fd1f23 (patch)
tree017059993f024c77c6eb5c30c26f47e10d7d749e /llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
parent5230e9175aca9bc1c09c2065708ee86d3533593a (diff)
downloadllvm-20350c4025259b6a85089936bcdea17b84fd1f23.zip
llvm-20350c4025259b6a85089936bcdea17b84fd1f23.tar.gz
llvm-20350c4025259b6a85089936bcdea17b84fd1f23.tar.bz2
Change MachineInstr ctor's to take a TargetInstrDescriptor reference instead
of opcode and number of operands. llvm-svn: 31947
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCBranchSelector.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCBranchSelector.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp b/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
index f3d3124..edd28579 100644
--- a/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
+++ b/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
@@ -73,6 +73,7 @@ static unsigned getNumBytesForInstruction(MachineInstr *MI) {
bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {
+ const TargetInstrInfo *TII = Fn.getTarget().getInstrInfo();
// Give the blocks of the function a dense, in-order, numbering.
Fn.RenumberBlocks();
BlockSizes.resize(Fn.getNumBlockIDs());
@@ -165,11 +166,11 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {
MachineInstr *OldBranch = I;
// Jump over the uncond branch inst (i.e. $PC+8) on opposite condition.
- BuildMI(MBB, I, PPC::BCC, 3)
+ BuildMI(MBB, I, TII->get(PPC::BCC))
.addImm(PPC::InvertPredicate(Pred)).addReg(CRReg).addImm(2);
// Uncond branch to the real destination.
- I = BuildMI(MBB, I, PPC::B, 1).addMBB(Dest);
+ I = BuildMI(MBB, I, TII->get(PPC::B)).addMBB(Dest);
// Remove the old branch from the function.
OldBranch->eraseFromParent();