From e74ed0d53b5c12eb9cb463698df8e81c8a99549d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 30 Nov 2004 06:36:11 +0000 Subject: [PATCH] Fix test/Regression/CodeGen/PowerPC/2004-11-29-ShrCrash.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18374 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPC32ISelSimple.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Target/PowerPC/PPC32ISelSimple.cpp b/lib/Target/PowerPC/PPC32ISelSimple.cpp index 33512c1e393..7b9a312a114 100644 --- a/lib/Target/PowerPC/PPC32ISelSimple.cpp +++ b/lib/Target/PowerPC/PPC32ISelSimple.cpp @@ -2910,7 +2910,9 @@ void PPC32ISel::emitShiftOperation(MachineBasicBlock *MBB, return; unsigned SrcReg = getReg (Op, MBB, IP); - if (isLeftShift) { + if (Amount == 0) { + BuildMI(*MBB, IP, PPC::OR, 2, DestReg).addReg(SrcReg).addReg(SrcReg); + } else if (isLeftShift) { BuildMI(*MBB, IP, PPC::RLWINM, 4, DestReg).addReg(SrcReg) .addImm(Amount).addImm(0).addImm(31-Amount); } else {