Fix test/Regression/CodeGen/PowerPC/2004-11-30-shift-crash.ll

llvm-svn: 18371
This commit is contained in:
Chris Lattner 2004-11-30 06:29:10 +00:00
parent 90e62de4e9
commit 9eeb2033ff
1 changed files with 6 additions and 1 deletions

View File

@ -2766,7 +2766,12 @@ void PPC32ISel::emitShiftOperation(MachineBasicBlock *MBB,
// 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)