[llvm] 61595c4 - [RISCV] Simplify some code in vector fp<->int handling. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 16 12:57:12 PDT 2022


Author: Craig Topper
Date: 2022-09-16T12:56:42-07:00
New Revision: 61595c45af6a0e2e123946b1e18b38682c79fab3

URL: https://github.com/llvm/llvm-project/commit/61595c45af6a0e2e123946b1e18b38682c79fab3
DIFF: https://github.com/llvm/llvm-project/commit/61595c45af6a0e2e123946b1e18b38682c79fab3.diff

LOG: [RISCV] Simplify some code in vector fp<->int handling. NFC

We changed the way container types are selected since this code
was written. We no longer need to use the largest type.

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 1d5cd3ecd8ea..171c1b12434e 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -3581,16 +3581,10 @@ SDValue RISCVTargetLowering::LowerOperation(SDValue Op,
       break;
     }
 
-    MVT ContainerVT, SrcContainerVT;
-    // Derive the reference container type from the larger vector type.
-    if (SrcEltSize > EltSize) {
-      SrcContainerVT = getContainerForFixedLengthVector(SrcVT);
-      ContainerVT =
-          SrcContainerVT.changeVectorElementType(VT.getVectorElementType());
-    } else {
-      ContainerVT = getContainerForFixedLengthVector(VT);
-      SrcContainerVT = ContainerVT.changeVectorElementType(SrcEltVT);
-    }
+    MVT ContainerVT = getContainerForFixedLengthVector(VT);
+    MVT SrcContainerVT = getContainerForFixedLengthVector(SrcVT);
+    assert(ContainerVT.getVectorElementCount() == SrcContainerVT.getVectorElementCount() &&
+           "Expected same element count");
 
     SDValue Mask, VL;
     std::tie(Mask, VL) = getDefaultVLOps(VT, ContainerVT, DL, DAG, Subtarget);


        


More information about the llvm-commits mailing list