diff options
author | Sanjay Patel <spatel@rotateright.com> | 2015-11-09 21:16:49 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2015-11-09 21:16:49 +0000 |
commit | 32538d68117772c93c059a35523ea974397a8c56 (patch) | |
tree | 8866ae4fbcd4832e29a1544ef0674a6b15d156f3 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | |
parent | 65bc2b12233248f086461bea4d57bd2920c624c8 (diff) | |
download | llvm-32538d68117772c93c059a35523ea974397a8c56.zip llvm-32538d68117772c93c059a35523ea974397a8c56.tar.gz llvm-32538d68117772c93c059a35523ea974397a8c56.tar.bz2 |
[x86] try harder to match bitwise 'or' into an LEA
The motivation for this patch starts with the epic fail example in PR18007:
https://llvm.org/bugs/show_bug.cgi?id=18007
...unfortunately, this patch makes no difference for that case, but it solves some
simpler cases. We'll get there some day. :)
The current 'or' matching code was using computeKnownBits() via
isBaseWithConstantOffset() -> MaskedValueIsZero(), but that's an unnecessarily limited use.
We can do more by copying the logic in ValueTracking's haveNoCommonBitsSet(), so we can
treat the 'or' as if it was an 'add'.
There's a TODO comment here because we should lift the bit-checking logic into a helper
function, so it's not duplicated in DAGCombiner.
An example of the better LEA matching:
leal (%rdi,%rdi), %eax
andl $1, %esi
orl %esi, %eax
Becomes:
andl $1, %esi
leal (%rsi,%rdi,2), %eax
Differential Revision: http://reviews.llvm.org/D13956
llvm-svn: 252515
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
0 files changed, 0 insertions, 0 deletions