[llvm] r291996 - [X86] Simplify the code that calculates a scaled blend mask. We don't need a second loop.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 13 20:29:15 PST 2017
Author: ctopper
Date: Fri Jan 13 22:29:15 2017
New Revision: 291996
URL: http://llvm.org/viewvc/llvm-project?rev=291996&view=rev
Log:
[X86] Simplify the code that calculates a scaled blend mask. We don't need a second loop.
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=291996&r1=291995&r2=291996&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Jan 13 22:29:15 2017
@@ -8368,8 +8368,7 @@ static SDValue lowerVectorShuffleAsBlend
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;
};
More information about the llvm-commits
mailing list