aesthetic changes, no functionality change. Evan, it's not clear

what 'Available' is, please add a comment near it and rename it
if appropriate.

llvm-svn: 44703
This commit is contained in:
Chris Lattner 2007-12-08 07:22:58 +00:00
parent 2b07d8c5a0
commit ff87f05e43
1 changed files with 40 additions and 38 deletions

View File

@ -562,7 +562,7 @@ void X86DAGToDAGISel::EmitFunctionEntryCode(Function &Fn, MachineFunction &MF) {
/// MatchAddress - Add the specified node to the specified addressing mode, /// MatchAddress - Add the specified node to the specified addressing mode,
/// returning true if it cannot be done. This just pattern matches for the /// returning true if it cannot be done. This just pattern matches for the
/// addressing mode /// addressing mode.
bool X86DAGToDAGISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM, bool X86DAGToDAGISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM,
bool isRoot, unsigned Depth) { bool isRoot, unsigned Depth) {
// Limit recursion. // Limit recursion.
@ -653,7 +653,9 @@ bool X86DAGToDAGISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM,
break; break;
case ISD::SHL: case ISD::SHL:
if (!Available && AM.IndexReg.Val == 0 && AM.Scale == 1) if (Available || AM.IndexReg.Val != 0 || AM.Scale != 1)
break;
if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N.Val->getOperand(1))) { if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N.Val->getOperand(1))) {
unsigned Val = CN->getValue(); unsigned Val = CN->getValue();
if (Val == 1 || Val == 2 || Val == 3) { if (Val == 1 || Val == 2 || Val == 3) {
@ -678,8 +680,8 @@ bool X86DAGToDAGISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM,
} }
return false; return false;
} }
}
break; break;
}
case ISD::SMUL_LOHI: case ISD::SMUL_LOHI:
case ISD::UMUL_LOHI: case ISD::UMUL_LOHI:
@ -738,7 +740,8 @@ bool X86DAGToDAGISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM,
case ISD::OR: case ISD::OR:
// Handle "X | C" as "X + C" iff X is known to have C bits clear. // Handle "X | C" as "X + C" iff X is known to have C bits clear.
if (!Available) { if (Available) break;
if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N.getOperand(1))) { if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
X86ISelAddressMode Backup = AM; X86ISelAddressMode Backup = AM;
// Start with the LHS as an addr mode. // Start with the LHS as an addr mode.
@ -754,7 +757,6 @@ bool X86DAGToDAGISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM,
} }
AM = Backup; AM = Backup;
} }
}
break; break;
} }