mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
simplify control flow, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30403 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7d7bffe157
commit
a89654b1a1
@ -4723,22 +4723,28 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
|
||||
LH.getOpcode() == ISD::SRA && LH.getOperand(0) == LL &&
|
||||
LH.getOperand(1).getOpcode() == ISD::Constant &&
|
||||
cast<ConstantSDNode>(LH.getOperand(1))->getValue() == SH) {
|
||||
// FIXME: Move this to the dag combiner.
|
||||
|
||||
// Low part:
|
||||
Lo = DAG.getNode(ISD::MUL, NVT, LL, RL);
|
||||
// High part:
|
||||
Hi = DAG.getNode(ISD::MULHS, NVT, LL, RL);
|
||||
UseLibCall = false;
|
||||
break;
|
||||
} else if (HasMULHU) {
|
||||
// Low part:
|
||||
Lo = DAG.getNode(ISD::MUL, NVT, LL, RL);
|
||||
|
||||
// High part:
|
||||
Hi = DAG.getNode(ISD::MULHU, NVT, LL, RL);
|
||||
RH = DAG.getNode(ISD::MUL, NVT, LL, RH);
|
||||
LH = DAG.getNode(ISD::MUL, NVT, LH, RL);
|
||||
Hi = DAG.getNode(ISD::ADD, NVT, Hi, RH);
|
||||
Hi = DAG.getNode(ISD::ADD, NVT, Hi, LH);
|
||||
UseLibCall = false;
|
||||
break;
|
||||
}
|
||||
if (!UseLibCall)
|
||||
Lo = DAG.getNode(ISD::MUL, NVT, LL, RL);
|
||||
}
|
||||
|
||||
if (UseLibCall)
|
||||
Lo = ExpandLibCall("__muldi3" , Node, Hi);
|
||||
Lo = ExpandLibCall("__muldi3" , Node, Hi);
|
||||
break;
|
||||
}
|
||||
case ISD::SDIV: Lo = ExpandLibCall("__divdi3" , Node, Hi); break;
|
||||
|
Loading…
Reference in New Issue
Block a user