[llvm] 936ef89 - [X86] lowerShuffleWithPERMV - use MVT::changeTypeToInteger helper. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 23 04:35:58 PDT 2020
Author: Simon Pilgrim
Date: 2020-10-23T12:35:27+01:00
New Revision: 936ef89ebe8646c483b993d8d8e50ee9509e005d
URL: https://github.com/llvm/llvm-project/commit/936ef89ebe8646c483b993d8d8e50ee9509e005d
DIFF: https://github.com/llvm/llvm-project/commit/936ef89ebe8646c483b993d8d8e50ee9509e005d.diff
LOG: [X86] lowerShuffleWithPERMV - use MVT::changeTypeToInteger helper. NFCI.
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 913073e66221..6aeb0d9d062c 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -15091,10 +15091,7 @@ static SDValue lowerShuffleWithPERMV(const SDLoc &DL, MVT VT,
ArrayRef<int> Mask, SDValue V1, SDValue V2,
const X86Subtarget &Subtarget,
SelectionDAG &DAG) {
- int NumElts = VT.getVectorNumElements();
- MVT MaskEltVT = MVT::getIntegerVT(VT.getScalarSizeInBits());
- MVT MaskVecVT = MVT::getVectorVT(MaskEltVT, NumElts);
-
+ MVT MaskVT = VT.changeTypeToInteger();
SDValue MaskNode;
MVT ShuffleVT = VT;
if (!VT.is512BitVector() && !Subtarget.hasVLX()) {
@@ -15103,15 +15100,16 @@ static SDValue lowerShuffleWithPERMV(const SDLoc &DL, MVT VT,
ShuffleVT = V1.getSimpleValueType();
// Adjust mask to correct indices for the second input.
+ int NumElts = VT.getVectorNumElements();
unsigned Scale = 512 / VT.getSizeInBits();
SmallVector<int, 32> AdjustedMask(Mask.begin(), Mask.end());
for (int &M : AdjustedMask)
if (NumElts <= M)
M += (Scale - 1) * NumElts;
- MaskNode = getConstVector(AdjustedMask, MaskVecVT, DAG, DL, true);
+ MaskNode = getConstVector(AdjustedMask, MaskVT, DAG, DL, true);
MaskNode = widenSubVector(MaskNode, false, Subtarget, DAG, DL, 512);
} else {
- MaskNode = getConstVector(Mask, MaskVecVT, DAG, DL, true);
+ MaskNode = getConstVector(Mask, MaskVT, DAG, DL, true);
}
SDValue Result;
More information about the llvm-commits
mailing list