[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Nov 29 22:29:24 PST 2004
Changes in directory llvm/lib/Target/PowerPC:
PPC32ISelSimple.cpp updated: 1.113 -> 1.114
---
Log message:
Fix test/Regression/CodeGen/PowerPC/2004-11-30-shift-crash.ll
---
Diffs of the changes: (+6 -1)
Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.113 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.114
--- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.113 Fri Nov 26 22:45:11 2004
+++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Tue Nov 30 00:29:10 2004
@@ -2766,7 +2766,12 @@
// than for a variable shift by using the rlwimi instruction.
if (ConstantUInt *CUI = dyn_cast<ConstantUInt>(ShiftAmount)) {
unsigned Amount = CUI->getValue();
- if (Amount < 32) {
+ if (Amount == 0) {
+ BuildMI(*MBB, IP, PPC::OR, 2, DestReg).addReg(SrcReg).addReg(SrcReg);
+ BuildMI(*MBB, IP, PPC::OR, 2, DestReg+1)
+ .addReg(SrcReg+1).addReg(SrcReg+1);
+
+ } else if (Amount < 32) {
unsigned TempReg = makeAnotherReg(ResultTy);
if (isLeftShift) {
BuildMI(*MBB, IP, PPC::RLWINM, 4, TempReg).addReg(SrcReg)
More information about the llvm-commits
mailing list