[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)
commitc2d9cfd9250d93ec4e1785a8eabbf40eaa245b6a
treedb93cdd04e60662d9bb4b0f212d8f55d3b6b2ffa
parent3b917019a5d6379eec026fb1fbabd4bd9e2bbead
[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

llvm-svn: 360684
llvm/lib/Target/X86/X86.td
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86Subtarget.h
llvm/test/CodeGen/X86/shift-mask.ll