[SelectionDAG] Codesize: don't expand SHIFT to SHIFT_PARTS
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Thu, 31 Jan 2019 08:07:30 +0000 (08:07 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Thu, 31 Jan 2019 08:07:30 +0000 (08:07 +0000)
commitf7cc34cae890fdd711173fcb633cd262ee343764
treeb5b705cfcf8aebd0e49feaadeadfb0e35370343a
parenta4938433720b54683f5b5da4ae4d1882c5a99766
[SelectionDAG] Codesize: don't expand SHIFT to SHIFT_PARTS

And instead just generate a libcall. My motivating example on ARM was a simple:

  shl i64 %A, %B

for which the code bloat is quite significant. For other targets that also
accept __int128/i128 such as AArch64 and X86, it is also beneficial for these
cases to generate a libcall when optimising for minsize. On these 64-bit targets,
the 64-bits shifts are of course unaffected because the SHIFT/SHIFT_PARTS
lowering operation action is not set to custom/expand.

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

llvm-svn: 352736
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.h
llvm/lib/Target/ARM/ARMISelLowering.h
llvm/lib/Target/X86/X86ISelLowering.h
llvm/test/CodeGen/AArch64/shift_minsize.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/shift_minsize.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/shift_minsize.ll [new file with mode: 0644]