From 1664c0f01bdabfa5b2c29bf14d9f17d708069aeb Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Tue, 29 Jul 2025 19:38:36 +0100 Subject: [PATCH 1/2] [RISCV] Fix build failure in getIntrinsicInstrCost bd66fd0 ([CostModel/RISCV] Fix costs of vector [l](lrint|lround)) introduced buildbot failures by using a temporary ArrayRef when a SmallVector should have been used. Fix this. Failure: https://lab.llvm.org/buildbot/#/builders/186/builds/11133 --- llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp index d4f372652a5e4..bb78452585c19 100644 --- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp +++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp @@ -1254,7 +1254,7 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, Type *SrcTy = ICA.getArgTypes().front(); auto SrcLT = getTypeLegalizationCost(SrcTy); if (ST->hasVInstructions() && LT.second.isVector()) { - ArrayRef Ops; + SmallVector Ops; unsigned SrcEltSz = DL.getTypeSizeInBits(SrcTy->getScalarType()); unsigned DstEltSz = DL.getTypeSizeInBits(RetTy->getScalarType()); if (LT.second.getVectorElementType() == MVT::bf16) { From b55fffafa30eed11729094ef941a849f177990a4 Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Tue, 29 Jul 2025 20:13:24 +0100 Subject: [PATCH 2/2] [RISCV] Set SmallVector size 2 --- llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp index bb78452585c19..4eef8de06b278 100644 --- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp +++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp @@ -1254,7 +1254,7 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, Type *SrcTy = ICA.getArgTypes().front(); auto SrcLT = getTypeLegalizationCost(SrcTy); if (ST->hasVInstructions() && LT.second.isVector()) { - SmallVector Ops; + SmallVector Ops; unsigned SrcEltSz = DL.getTypeSizeInBits(SrcTy->getScalarType()); unsigned DstEltSz = DL.getTypeSizeInBits(RetTy->getScalarType()); if (LT.second.getVectorElementType() == MVT::bf16) {