From 42d312bb83c06a1fdd74b3a2e027cfd529fa0460 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 30 Jul 2018 21:04:38 +0000 Subject: [PATCH] [TargetLowering] In BuildSDIV, add the MULHS/SMUL_LOHI to the Created vector. BuildUDIV was already correct. llvm-svn: 338304 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index b2537476dad8..273c2239ac73 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -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));