[RISCV] Use static arrays+ArrayRef instead of SmallVector to select P extension vector VTs. NFC (#175390)
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index 9a72e8a..b23bffb 100644 --- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -526,16 +526,18 @@ setTargetDAGCombine(ISD::TRUNCATE); setTruncStoreAction(MVT::v2i32, MVT::v2i16, Expand); setTruncStoreAction(MVT::v4i16, MVT::v4i8, Expand); - SmallVector<MVT, 2> VTs; + static const MVT RV32VTs[] = {MVT::v2i16, MVT::v4i8}; + static const MVT RV64VTs[] = {MVT::v2i32, MVT::v4i16, MVT::v8i8}; + ArrayRef<MVT> VTs; if (Subtarget.is64Bit()) { - VTs.append({MVT::v2i32, MVT::v4i16, MVT::v8i8}); + VTs = RV64VTs; setTruncStoreAction(MVT::v2i64, MVT::v2i32, Expand); setTruncStoreAction(MVT::v4i32, MVT::v4i16, Expand); setTruncStoreAction(MVT::v8i16, MVT::v8i8, Expand); setTruncStoreAction(MVT::v2i32, MVT::v2i16, Expand); setTruncStoreAction(MVT::v4i16, MVT::v4i8, Expand); } else { - VTs.append({MVT::v2i16, MVT::v4i8}); + VTs = RV32VTs; setOperationAction(ISD::BUILD_VECTOR, MVT::v4i8, Custom); } setOperationAction(ISD::UADDSAT, VTs, Legal);