forked from OSchip/llvm-project
Don't emit SAR X, 0 in the case of sdiv Y, 2
llvm-svn: 21986
This commit is contained in:
parent
7d387d207d
commit
79e9fa5de1
|
@ -2699,8 +2699,13 @@ unsigned ISel::SelectExpr(SDOperand N) {
|
||||||
}
|
}
|
||||||
unsigned RegSize = MVT::getSizeInBits(N.getValueType());
|
unsigned RegSize = MVT::getSizeInBits(N.getValueType());
|
||||||
Tmp1 = SelectExpr(N.getOperand(0));
|
Tmp1 = SelectExpr(N.getOperand(0));
|
||||||
unsigned TmpReg = MakeReg(N.getValueType());
|
unsigned TmpReg;
|
||||||
BuildMI(BB, SAROpc, 2, TmpReg).addReg(Tmp1).addImm(Log-1);
|
if (Log != 1) {
|
||||||
|
TmpReg = MakeReg(N.getValueType());
|
||||||
|
BuildMI(BB, SAROpc, 2, TmpReg).addReg(Tmp1).addImm(Log-1);
|
||||||
|
} else {
|
||||||
|
TmpReg = Tmp1;
|
||||||
|
}
|
||||||
unsigned TmpReg2 = MakeReg(N.getValueType());
|
unsigned TmpReg2 = MakeReg(N.getValueType());
|
||||||
BuildMI(BB, SHROpc, 2, TmpReg2).addReg(TmpReg).addImm(RegSize-Log);
|
BuildMI(BB, SHROpc, 2, TmpReg2).addReg(TmpReg).addImm(RegSize-Log);
|
||||||
unsigned TmpReg3 = MakeReg(N.getValueType());
|
unsigned TmpReg3 = MakeReg(N.getValueType());
|
||||||
|
|
Loading…
Reference in New Issue