Temporarily revert this patch, which probably breaks with the

tblgen patch reverted.

llvm-svn: 25971
This commit is contained in:
Chris Lattner 2006-02-04 09:24:16 +00:00
parent 586b06281c
commit 22b4edfb42
1 changed files with 13 additions and 7 deletions

View File

@ -369,11 +369,17 @@ bool X86DAGToDAGISel::SelectAddr(SDOperand N, SDOperand &Base, SDOperand &Scale,
return false; return false;
if (AM.BaseType == X86ISelAddressMode::RegBase) { if (AM.BaseType == X86ISelAddressMode::RegBase) {
if (!AM.Base.Reg.Val) if (AM.Base.Reg.Val) {
if (AM.Base.Reg.getOpcode() != ISD::Register)
AM.Base.Reg = Select(AM.Base.Reg);
} else {
AM.Base.Reg = CurDAG->getRegister(0, MVT::i32); AM.Base.Reg = CurDAG->getRegister(0, MVT::i32);
}
} }
if (!AM.IndexReg.Val) if (AM.IndexReg.Val)
AM.IndexReg = Select(AM.IndexReg);
else
AM.IndexReg = CurDAG->getRegister(0, MVT::i32); AM.IndexReg = CurDAG->getRegister(0, MVT::i32);
getAddressOperands(AM, Base, Scale, Index, Disp); getAddressOperands(AM, Base, Scale, Index, Disp);
@ -435,6 +441,11 @@ bool X86DAGToDAGISel::SelectLEAAddr(SDOperand N, SDOperand &Base,
return false; return false;
} }
if (SelectBase)
AM.Base.Reg = Select(AM.Base.Reg);
if (SelectIndex)
AM.IndexReg = Select(AM.IndexReg);
getAddressOperands(AM, Base, Scale, Index, Disp); getAddressOperands(AM, Base, Scale, Index, Disp);
return true; return true;
} }
@ -450,11 +461,6 @@ SDOperand X86DAGToDAGISel::Select(SDOperand N) {
if (Opcode >= ISD::BUILTIN_OP_END && Opcode < X86ISD::FIRST_NUMBER) if (Opcode >= ISD::BUILTIN_OP_END && Opcode < X86ISD::FIRST_NUMBER)
return N; // Already selected. return N; // Already selected.
// These are probably emitted by SelectAddr().
if (Opcode == ISD::TargetConstant || Opcode == ISD::TargetConstantPool ||
Opcode == ISD::TargetFrameIndex || Opcode == ISD::TargetGlobalAddress)
return N;
std::map<SDOperand, SDOperand>::iterator CGMI = CodeGenMap.find(N); std::map<SDOperand, SDOperand>::iterator CGMI = CodeGenMap.find(N);
if (CGMI != CodeGenMap.end()) return CGMI->second; if (CGMI != CodeGenMap.end()) return CGMI->second;