Fix a major regression last night that prevented us from producing [mem] op= reg

operations.

The body of the if is less indented but unmodified in this patch.

llvm-svn: 19638
This commit is contained in:
Chris Lattner 2005-01-17 17:49:14 +00:00
parent 16f64df93a
commit 9098879472
1 changed files with 108 additions and 106 deletions

View File

@ -2489,17 +2489,21 @@ void ISel::Select(SDOperand N) {
// Check to see if this is a load/op/store combination.
if (N.getOperand(1).Val->hasOneUse() &&
N.getOperand(0).getOpcode() == ISD::LOAD &&
N.getOperand(1).Val->getNumOperands() == 2 &&
!MVT::isFloatingPoint(N.getOperand(0).getValue(0).getValueType()) &&
isFoldableLoad(N.getOperand(0).getValue(0),
N.getOperand(0).getValue(1))) {
!MVT::isFloatingPoint(N.getOperand(0).getValue(0).getValueType())) {
SDOperand TheLoad = N.getOperand(0).getValue(0);
// Check to see if we are loading the same pointer that we're storing to.
if (TheLoad.getOperand(1) == N.getOperand(2)) {
// See if the stored value is a simple binary operator that uses the
// load as one of its operands.
// See if the stored value is a simple binary operator that uses the load
// as one of its operands.
SDOperand Op = N.getOperand(1);
if ((Op.getOperand(0) == TheLoad || Op.getOperand(1) == TheLoad)) {
// Check to see if we are loading the same pointer that we're storing to.
if (TheLoad.getOperand(1) == N.getOperand(2) &&
((Op.getOperand(0) == TheLoad &&
isFoldableLoad(TheLoad, Op.getOperand(1))) ||
(Op.getOperand(1) == TheLoad &&
isFoldableLoad(TheLoad, Op.getOperand(0))))) {
// Finally, check to see if this is one of the ops we can handle!
static const unsigned ADDTAB[] = {
X86::ADD8mi, X86::ADD16mi, X86::ADD32mi,
@ -2608,8 +2612,6 @@ void ISel::Select(SDOperand N) {
}
}
}
}
switch (N.getOperand(1).getValueType()) {
default: assert(0 && "Cannot store this type!");