]> granicus.if.org Git - llvm/commit
[X86] Add test cases to show missed opportunities to use a sign extended 8 or 32...
authorCraig Topper <craig.topper@intel.com>
Sat, 6 Apr 2019 18:00:45 +0000 (18:00 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 6 Apr 2019 18:00:45 +0000 (18:00 +0000)
commit37f40046fb899dba4771299905e071d178b3d23b
tree0730e98a1c3c34920ec1dcd022ef2ac1eacf9f96
parentaf98c632ded8b55023f4f8560521509c7e6e8a98
[X86] Add test cases to show missed opportunities to use a sign extended 8 or 32 bit immediate AND when reversing SHL+AND to form an LEA.

When we shift the AND mask over we should shift in sign bits instead of zero bits. The scale in the LEA will shift these bits out so it doesn't matter whether we mask the bits off or not. Using sign bits will potentially allow a sign extended immediate to be used.

Also add some other test cases for cases that are currently optimal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357845 91177308-0d34-0410-b5e6-96231b3b80d8
test/CodeGen/X86/fold-and-shift-x86_64.ll [new file with mode: 0644]
test/CodeGen/X86/fold-and-shift.ll