[llvm] r263911 - [X86][SSE] Tidyup setTargetShuffleZeroElements to match computeZeroableShuffleElements
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 20 10:43:07 PDT 2016
Author: rksimon
Date: Sun Mar 20 12:43:07 2016
New Revision: 263911
URL: http://llvm.org/viewvc/llvm-project?rev=263911&view=rev
Log:
[X86][SSE] Tidyup setTargetShuffleZeroElements to match computeZeroableShuffleElements
Based on feedback for D14261
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=263911&r1=263910&r2=263911&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sun Mar 20 12:43:07 2016
@@ -5214,7 +5214,7 @@ static bool setTargetShuffleZeroElements
while (V2.getOpcode() == ISD::BITCAST)
V2 = V2->getOperand(0);
- for (int i = 0, Size = Mask.size(); i != Size; ++i) {
+ for (int i = 0, Size = Mask.size(); i < Size; ++i) {
int M = Mask[i];
// Already decoded as SM_SentinelZero / SM_SentinelUndef.
@@ -5239,7 +5239,7 @@ static bool setTargetShuffleZeroElements
// element must be UNDEF/ZERO.
// TODO: Is it worth testing the individual bits of a constant?
if ((Size % V.getNumOperands()) == 0) {
- unsigned Scale = Size / V->getNumOperands();
+ int Scale = Size / V->getNumOperands();
SDValue Op = V.getOperand(M / Scale);
if (Op.isUndef())
Mask[i] = SM_SentinelUndef;
@@ -5251,10 +5251,10 @@ static bool setTargetShuffleZeroElements
// If the BUILD_VECTOR has more elements then all the (smaller) source
// elements must be all UNDEF or all ZERO.
if ((V.getNumOperands() % Size) == 0) {
- unsigned Scale = V->getNumOperands() / Size;
+ int Scale = V->getNumOperands() / Size;
bool AllUndef = true;
bool AllZero = true;
- for (unsigned j = 0; j != Scale; ++j) {
+ for (int j = 0; j < Scale; ++j) {
SDValue Op = V.getOperand((M * Scale) + j);
AllUndef &= Op.isUndef();
AllZero &= X86::isZeroNode(Op);
More information about the llvm-commits
mailing list