mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-21 03:28:31 +00:00
Try both ways to fold an add together. This allows us to generate this code
imul %EAX, %EAX, 400 add %ECX, %EAX add %ESI, DWORD PTR [%ECX + 4*%EDX] inc %EDX cmp %EDX, 100 instead of this: imul %EAX, %EAX, 400 add %ECX, %EAX mov %EAX, %EDX shl %EAX, 2 add %ECX, %EAX add %ESI, DWORD PTR [%ECX] inc %EDX cmp %EDX, 100 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19513 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3bfbf4ea99
commit
9bbd992eb1
@ -527,6 +527,10 @@ bool ISel::SelectAddress(SDOperand N, X86AddressMode &AM) {
|
||||
!SelectAddress(N.Val->getOperand(1), AM))
|
||||
return false;
|
||||
AM = Backup;
|
||||
if (!SelectAddress(N.Val->getOperand(1), AM) &&
|
||||
!SelectAddress(N.Val->getOperand(0), AM))
|
||||
return false;
|
||||
AM = Backup;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user