[llvm] e9ac99b - [RISCV] Simplfy creation of IndexVT in lowerMaskedGather/lowerMaskedScatter. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu May 26 13:13:41 PDT 2022
Author: Craig Topper
Date: 2022-05-26T13:13:32-07:00
New Revision: e9ac99b6090c125091b61240c75dcc403d569472
URL: https://github.com/llvm/llvm-project/commit/e9ac99b6090c125091b61240c75dcc403d569472
DIFF: https://github.com/llvm/llvm-project/commit/e9ac99b6090c125091b61240c75dcc403d569472.diff
LOG: [RISCV] Simplfy creation of IndexVT in lowerMaskedGather/lowerMaskedScatter. NFC
The scalar element width is not a factor in how ContainerVT is
determined. We don't need to check the relative size of VT and
IndexVT.
Added:
Modified:
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index d9829298c4ac..defbfce203f2 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -6385,17 +6385,9 @@ SDValue RISCVTargetLowering::lowerMaskedGather(SDValue Op,
MVT ContainerVT = VT;
if (VT.isFixedLengthVector()) {
- // We need to use the larger of the result and index type to determine the
- // scalable type to use so we don't increase LMUL for any operand/result.
- if (VT.bitsGE(IndexVT)) {
- ContainerVT = getContainerForFixedLengthVector(VT);
- IndexVT = MVT::getVectorVT(IndexVT.getVectorElementType(),
- ContainerVT.getVectorElementCount());
- } else {
- IndexVT = getContainerForFixedLengthVector(IndexVT);
- ContainerVT = MVT::getVectorVT(ContainerVT.getVectorElementType(),
- IndexVT.getVectorElementCount());
- }
+ ContainerVT = getContainerForFixedLengthVector(VT);
+ IndexVT = MVT::getVectorVT(IndexVT.getVectorElementType(),
+ ContainerVT.getVectorElementCount());
Index = convertToScalableVector(IndexVT, Index, DAG, Subtarget);
@@ -6495,17 +6487,9 @@ SDValue RISCVTargetLowering::lowerMaskedScatter(SDValue Op,
MVT ContainerVT = VT;
if (VT.isFixedLengthVector()) {
- // We need to use the larger of the value and index type to determine the
- // scalable type to use so we don't increase LMUL for any operand/result.
- if (VT.bitsGE(IndexVT)) {
- ContainerVT = getContainerForFixedLengthVector(VT);
- IndexVT = MVT::getVectorVT(IndexVT.getVectorElementType(),
- ContainerVT.getVectorElementCount());
- } else {
- IndexVT = getContainerForFixedLengthVector(IndexVT);
- ContainerVT = MVT::getVectorVT(VT.getVectorElementType(),
- IndexVT.getVectorElementCount());
- }
+ ContainerVT = getContainerForFixedLengthVector(VT);
+ IndexVT = MVT::getVectorVT(IndexVT.getVectorElementType(),
+ ContainerVT.getVectorElementCount());
Index = convertToScalableVector(IndexVT, Index, DAG, Subtarget);
Val = convertToScalableVector(ContainerVT, Val, DAG, Subtarget);
More information about the llvm-commits
mailing list