[llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPCBranchSelector.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Aug 26 16:41:39 PDT 2005
Changes in directory llvm/lib/Target/PowerPC:
PowerPCBranchSelector.cpp updated: 1.13 -> 1.14
---
Log message:
Propagate cr# from COND_BRANCH to the actual branch instruction as appropriate
---
Diffs of the changes: (+3 -2)
PowerPCBranchSelector.cpp | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
Index: llvm/lib/Target/PowerPC/PowerPCBranchSelector.cpp
diff -u llvm/lib/Target/PowerPC/PowerPCBranchSelector.cpp:1.13 llvm/lib/Target/PowerPC/PowerPCBranchSelector.cpp:1.14
--- llvm/lib/Target/PowerPC/PowerPCBranchSelector.cpp:1.13 Wed Aug 24 18:08:16 2005
+++ llvm/lib/Target/PowerPC/PowerPCBranchSelector.cpp Fri Aug 26 18:41:27 2005
@@ -106,12 +106,13 @@
int Displacement = OffsetMap[trueMBB] - ByteCount;
unsigned Opcode = MBBI->getOperand(1).getImmedValue();
+ unsigned CRReg = MBBI->getOperand(0).getReg();
unsigned Inverted = PPC32InstrInfo::invertPPCBranchOpcode(Opcode);
if (Displacement >= -32768 && Displacement <= 32767) {
- BuildMI(*MBB, MBBJ, Opcode, 2).addReg(PPC::CR0).addMBB(trueMBB);
+ BuildMI(*MBB, MBBJ, Opcode, 2).addReg(CRReg).addMBB(trueMBB);
} else {
- BuildMI(*MBB, MBBJ, Inverted, 2).addReg(PPC::CR0).addSImm(8);
+ BuildMI(*MBB, MBBJ, Inverted, 2).addReg(CRReg).addSImm(8);
BuildMI(*MBB, MBBJ, PPC::B, 1).addMBB(trueMBB);
BuildMI(*MBB, MBBJ, PPC::B, 1).addMBB(falseMBB);
}
More information about the llvm-commits
mailing list