Re-commit the last bit of change that was backed out.

llvm-svn: 25983
This commit is contained in:
Evan Cheng 2006-02-05 05:25:07 +00:00
parent d5d3d7ad9e
commit c23d3cd6c3

View File

@ -369,17 +369,11 @@ bool X86DAGToDAGISel::SelectAddr(SDOperand N, SDOperand &Base, SDOperand &Scale,
return false;
if (AM.BaseType == X86ISelAddressMode::RegBase) {
if (AM.Base.Reg.Val) {
if (AM.Base.Reg.getOpcode() != ISD::Register)
AM.Base.Reg = Select(AM.Base.Reg);
} else {
if (!AM.Base.Reg.Val)
AM.Base.Reg = CurDAG->getRegister(0, MVT::i32);
}
}
if (AM.IndexReg.Val)
AM.IndexReg = Select(AM.IndexReg);
else
if (!AM.IndexReg.Val)
AM.IndexReg = CurDAG->getRegister(0, MVT::i32);
getAddressOperands(AM, Base, Scale, Index, Disp);
@ -441,11 +435,6 @@ bool X86DAGToDAGISel::SelectLEAAddr(SDOperand N, SDOperand &Base,
return false;
}
if (SelectBase)
AM.Base.Reg = Select(AM.Base.Reg);
if (SelectIndex)
AM.IndexReg = Select(AM.IndexReg);
getAddressOperands(AM, Base, Scale, Index, Disp);
return true;
}