From: Craig Topper Date: Sat, 14 Jan 2017 04:29:15 +0000 (+0000) Subject: [X86] Simplify the code that calculates a scaled blend mask. We don't need a second... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e76954dbb0cc5b443ae9cb006435a328b18d63d;p=llvm [X86] Simplify the code that calculates a scaled blend mask. We don't need a second loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291996 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index a91e47424b2..989039f3ee4 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -8368,8 +8368,7 @@ static SDValue lowerVectorShuffleAsBlend(const SDLoc &DL, MVT VT, SDValue V1, uint64_t ScaledMask = 0; for (int i = 0; i != Size; ++i) if (BlendMask & (1ull << i)) - for (int j = 0; j != Scale; ++j) - ScaledMask |= 1ull << (i * Scale + j); + ScaledMask |= ((1ull << Scale) - 1) << (i * Scale); return ScaledMask; };