forked from OSchip/llvm-project
Fix a regression in the 32-bit port from the 64-bit port landing.
We now compile CodeGen/X86/lea-2.ll into: _test: movl 4(%esp), %eax movl 8(%esp), %ecx leal -5(%ecx,%eax,4), %eax ret instead of: _test: movl 4(%esp), %eax leal (,%eax,4), %eax addl 8(%esp), %eax addl $4294967291, %eax ret llvm-svn: 30288
This commit is contained in:
parent
7789e938b6
commit
706dd3e0d4
|
@ -498,7 +498,7 @@ bool X86DAGToDAGISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM,
|
|||
// RIP relative addressing: %rip + 32-bit displacement!
|
||||
if (AM.isRIPRel) {
|
||||
if (!AM.ES && AM.JT != -1 && N.getOpcode() == ISD::Constant) {
|
||||
uint64_t Val = cast<ConstantSDNode>(N)->getValue();
|
||||
int64_t Val = cast<ConstantSDNode>(N)->getSignExtended();
|
||||
if (isInt32(AM.Disp + Val)) {
|
||||
AM.Disp += Val;
|
||||
return false;
|
||||
|
@ -513,7 +513,7 @@ bool X86DAGToDAGISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM,
|
|||
switch (N.getOpcode()) {
|
||||
default: break;
|
||||
case ISD::Constant: {
|
||||
uint64_t Val = cast<ConstantSDNode>(N)->getValue();
|
||||
int64_t Val = cast<ConstantSDNode>(N)->getSignExtended();
|
||||
if (isInt32(AM.Disp + Val)) {
|
||||
AM.Disp += Val;
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue