[TargetLowering] In BuildSDIV, add the MULHS/SMUL_LOHI to the Created vector.

BuildUDIV was already correct.

llvm-svn: 338304
This commit is contained in:
Craig Topper 2018-07-30 21:04:38 +00:00
parent a568a27dfa
commit 42d312bb83
1 changed files with 3 additions and 0 deletions

View File

@ -3494,6 +3494,9 @@ SDValue TargetLowering::BuildSDIV(SDNode *N, const APInt &Divisor,
DAG.getConstant(magics.m, dl, VT)).getNode(), 1);
else
return SDValue(); // No mulhs or equvialent
Created.push_back(Q.getNode());
// If d > 0 and m < 0, add the numerator
if (Divisor.isStrictlyPositive() && magics.m.isNegative()) {
Q = DAG.getNode(ISD::ADD, dl, VT, Q, N->getOperand(0));