diff options
author | Craig Topper <craig.topper@gmail.com> | 2016-06-20 04:00:53 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2016-06-20 04:00:53 +0000 |
commit | ddf5d2a4a50fd32f3233b52f74514ab5257e9d95 (patch) | |
tree | ebb5b935f0ee71c1824f6e6b16d551a59a5ad4fc | |
parent | 01ef65dd79366654c18a73260414961a88be0aaf (diff) | |
download | bcm5719-llvm-ddf5d2a4a50fd32f3233b52f74514ab5257e9d95.tar.gz bcm5719-llvm-ddf5d2a4a50fd32f3233b52f74514ab5257e9d95.zip |
[X86] Use existing ArrayRef variable instead of calling SVOp->getMask() repeatedly. Remove nearby else after return as well. NFC
llvm-svn: 273136
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index f8e05711346..46773eb6045 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -12087,7 +12087,7 @@ static SDValue lowerVectorShuffle(SDValue Op, const X86Subtarget &Subtarget, } int NumV1Elements = 0, NumUndefElements = 0, NumV2Elements = 0; - for (int M : SVOp->getMask()) + for (int M : Mask) if (M < 0) ++NumUndefElements; else if (M < NumElements) @@ -12108,28 +12108,28 @@ static SDValue lowerVectorShuffle(SDValue Op, const X86Subtarget &Subtarget, // indices for V1 is lower than the number of odd indices for V2. if (NumV1Elements == NumV2Elements) { int LowV1Elements = 0, LowV2Elements = 0; - for (int M : SVOp->getMask().slice(0, NumElements / 2)) + for (int M : Mask.slice(0, NumElements / 2)) if (M >= NumElements) ++LowV2Elements; else if (M >= 0) ++LowV1Elements; - if (LowV2Elements > LowV1Elements) { + if (LowV2Elements > LowV1Elements) return DAG.getCommutedVectorShuffle(*SVOp); - } else if (LowV2Elements == LowV1Elements) { + if (LowV2Elements == LowV1Elements) { int SumV1Indices = 0, SumV2Indices = 0; - for (int i = 0, Size = SVOp->getMask().size(); i < Size; ++i) - if (SVOp->getMask()[i] >= NumElements) + for (int i = 0, Size = Mask.size(); i < Size; ++i) + if (Mask[i] >= NumElements) SumV2Indices += i; - else if (SVOp->getMask()[i] >= 0) + else if (Mask[i] >= 0) SumV1Indices += i; - if (SumV2Indices < SumV1Indices) { + if (SumV2Indices < SumV1Indices) return DAG.getCommutedVectorShuffle(*SVOp); - } else if (SumV2Indices == SumV1Indices) { + if (SumV2Indices == SumV1Indices) { int NumV1OddIndices = 0, NumV2OddIndices = 0; - for (int i = 0, Size = SVOp->getMask().size(); i < Size; ++i) - if (SVOp->getMask()[i] >= NumElements) + for (int i = 0, Size = Mask.size(); i < Size; ++i) + if (Mask[i] >= NumElements) NumV2OddIndices += i % 2; - else if (SVOp->getMask()[i] >= 0) + else if (Mask[i] >= 0) NumV1OddIndices += i % 2; if (NumV2OddIndices < NumV1OddIndices) return DAG.getCommutedVectorShuffle(*SVOp); |