]> granicus.if.org Git - llvm/commit
[X86] Disable shouldFoldConstantShiftPairToMask for scalar shifts on AMD targets...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 14 May 2019 15:21:28 +0000 (15:21 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 14 May 2019 15:21:28 +0000 (15:21 +0000)
commitff9323a7c6b5e5f2361cc8c84658a57f3c20281a
tree3db8ab253521f7e4c6f7a28f5fe10e4ef62bc542
parentb930e37a0d2f77076bc513162ab7575fb49bea44
[X86] Disable shouldFoldConstantShiftPairToMask for scalar shifts on AMD targets (PR40758)

D61068 handled vector shifts, this patch does the same for scalars where there are similar number of pipes for shifts as bit ops - this is true almost entirely for AMD targets where the scalar ALUs are well balanced.

This combine avoids AND immediate mask which usually means we reduce encoding size.

Some tests show use of (slow, scaled) LEA instead of SHL in some cases, but thats due to particular shift immediates - shift+mask generate these just as easily.

Differential Revision: https://reviews.llvm.org/D61830

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360684 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86.td
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86Subtarget.h
test/CodeGen/X86/shift-mask.ll