mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-24 08:33:39 +00:00
Forgot to propagate debug loc info here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63371 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3311a1f8f0
commit
73e16b2869
@ -1306,7 +1306,7 @@ SDValue DAGCombiner::visitMUL(SDNode *N) {
|
|||||||
// single-use add), we should put the negate there.
|
// single-use add), we should put the negate there.
|
||||||
return DAG.getNode(ISD::SUB, N->getDebugLoc(), VT,
|
return DAG.getNode(ISD::SUB, N->getDebugLoc(), VT,
|
||||||
DAG.getConstant(0, VT),
|
DAG.getConstant(0, VT),
|
||||||
DAG.getNode(ISD::SHL, VT, N0,
|
DAG.getNode(ISD::SHL, N->getDebugLoc(), VT, N0,
|
||||||
DAG.getConstant(Log2_64(-N1C->getSExtValue()),
|
DAG.getConstant(Log2_64(-N1C->getSExtValue()),
|
||||||
TLI.getShiftAmountTy())));
|
TLI.getShiftAmountTy())));
|
||||||
// (mul (shl X, c1), c2) -> (mul X, c2 << c1)
|
// (mul (shl X, c1), c2) -> (mul X, c2 << c1)
|
||||||
@ -1332,6 +1332,7 @@ SDValue DAGCombiner::visitMUL(SDNode *N) {
|
|||||||
N1.getNode()->hasOneUse()) {
|
N1.getNode()->hasOneUse()) {
|
||||||
Sh = N1; Y = N0;
|
Sh = N1; Y = N0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Sh.getNode()) {
|
if (Sh.getNode()) {
|
||||||
SDValue Mul = DAG.getNode(ISD::MUL, N->getDebugLoc(), VT,
|
SDValue Mul = DAG.getNode(ISD::MUL, N->getDebugLoc(), VT,
|
||||||
Sh.getOperand(0), Y);
|
Sh.getOperand(0), Y);
|
||||||
@ -1339,6 +1340,7 @@ SDValue DAGCombiner::visitMUL(SDNode *N) {
|
|||||||
Mul, Sh.getOperand(1));
|
Mul, Sh.getOperand(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fold (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2)
|
// fold (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2)
|
||||||
if (N1C && N0.getOpcode() == ISD::ADD && N0.getNode()->hasOneUse() &&
|
if (N1C && N0.getOpcode() == ISD::ADD && N0.getNode()->hasOneUse() &&
|
||||||
isa<ConstantSDNode>(N0.getOperand(1)))
|
isa<ConstantSDNode>(N0.getOperand(1)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user