[llvm] [LegalizeTypes][RISCV] Use SPLAT_VECTOR_PARTS to legalize splat BUILD_VECTOR (PR #107290)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 14:56:39 PDT 2024


================
@@ -376,6 +376,15 @@ SDValue DAGTypeLegalizer::ExpandOp_BUILD_VECTOR(SDNode *N) {
   assert(OldVT == VecVT.getVectorElementType() &&
          "BUILD_VECTOR operand type doesn't match vector element type!");
 
+  if (VecVT.isInteger() && TLI.isOperationLegal(ISD::SPLAT_VECTOR, VecVT) &&
----------------
preames wrote:

Why do we need the SPLAT_VECTOR legality?  Isn't SPLAT_VECTOR_PARTS enough?

https://github.com/llvm/llvm-project/pull/107290


More information about the llvm-commits mailing list