]> granicus.if.org Git - llvm/commit
Revert: r296141 [APInt] Add APInt::extractBits() method to extract APInt subrange
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 24 Feb 2017 18:31:04 +0000 (18:31 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 24 Feb 2017 18:31:04 +0000 (18:31 +0000)
commit0ab7c7b1f01b3b401a98cf17037f1cd70027a1e2
tree15ed381774326d154149b9b6257caec3015a31ae
parentaceef6fa371e3bf7c4b684d60d982488d6575334
Revert: r296141 [APInt] Add APInt::extractBits() method to extract APInt subrange

The current pattern for extract bits in range is typically:

Mask.lshr(BitOffset).trunc(SubSizeInBits);

Which can be particularly slow for large APInts (MaskSizeInBits > 64) as they require the allocation of memory for the temporary variable.

This is another of the compile time issues identified in PR32037 (see also D30265).

This patch adds the APInt::extractBits() helper method which avoids the temporary memory allocation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296147 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/APInt.h
lib/Support/APInt.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ShuffleDecodeConstantPool.cpp
unittests/ADT/APIntTest.cpp