[llvm] r273643 - [X86] Combine two nearby calls to isSingleInputShuffleVector. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 23 20:06:11 PDT 2016
Author: ctopper
Date: Thu Jun 23 22:06:11 2016
New Revision: 273643
URL: http://llvm.org/viewvc/llvm-project?rev=273643&view=rev
Log:
[X86] Combine two nearby calls to isSingleInputShuffleVector. NFC
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=273643&r1=273642&r2=273643&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Jun 23 22:06:11 2016
@@ -9951,10 +9951,8 @@ static SDValue lowerV8I16VectorShuffle(c
///
/// \returns N above, or the number of times even elements must be dropped if
/// there is such a number. Otherwise returns zero.
-static int canLowerByDroppingEvenElements(ArrayRef<int> Mask) {
- // Figure out whether we're looping over two inputs or just one.
- bool IsSingleInput = isSingleInputShuffleMask(Mask);
-
+static int canLowerByDroppingEvenElements(ArrayRef<int> Mask,
+ bool IsSingleInput) {
// The modulus for the shuffle vector entries is based on whether this is
// a single input or not.
int ShuffleModulus = Mask.size() * (IsSingleInput ? 1 : 2);
@@ -10204,11 +10202,11 @@ static SDValue lowerV16I8VectorShuffle(c
// We special case these as they can be particularly efficiently handled with
// the PACKUSB instruction on x86 and they show up in common patterns of
// rearranging bytes to truncate wide elements.
- if (int NumEvenDrops = canLowerByDroppingEvenElements(Mask)) {
+ bool IsSingleInput = isSingleInputShuffleMask(Mask);
+ if (int NumEvenDrops = canLowerByDroppingEvenElements(Mask, IsSingleInput)) {
// NumEvenDrops is the power of two stride of the elements. Another way of
// thinking about it is that we need to drop the even elements this many
// times to get the original input.
- bool IsSingleInput = isSingleInputShuffleMask(Mask);
// First we need to zero all the dropped bytes.
assert(NumEvenDrops <= 3 &&
More information about the llvm-commits
mailing list