[llvm] r274988 - [X86][SSE] Use scaleShuffleMask helper. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 9 14:12:03 PDT 2016


Author: rksimon
Date: Sat Jul  9 16:12:03 2016
New Revision: 274988

URL: http://llvm.org/viewvc/llvm-project?rev=274988&view=rev
Log:
[X86][SSE] Use scaleShuffleMask helper. NFCI.

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=274988&r1=274987&r2=274988&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sat Jul  9 16:12:03 2016
@@ -24879,17 +24879,8 @@ static bool matchPermuteVectorShuffle(MV
 
   // Narrow the repeated mask for 32-bit element permutes.
   SmallVector<int, 4> WordMask = RepeatedMask;
-  if (MaskScalarSizeInBits == 64) {
-    WordMask.clear();
-    for (int M : RepeatedMask) {
-      if (M == SM_SentinelUndef) {
-        WordMask.append(2, SM_SentinelUndef);
-        continue;
-      }
-      WordMask.push_back((M * 2) + 0);
-      WordMask.push_back((M * 2) + 1);
-    }
-  }
+  if (MaskScalarSizeInBits == 64)
+    scaleShuffleMask(2, RepeatedMask, WordMask);
 
   Shuffle = (FloatDomain ? X86ISD::VPERMILPI : X86ISD::PSHUFD);
   ShuffleVT = (FloatDomain ? MVT::f32 : MVT::i32);




More information about the llvm-commits mailing list