https://github.com/wangpc-pp updated https://github.com/llvm/llvm-project/pull/114971
>From 3fd27bd1405a8b2c068786a200d610b9cacb65ef Mon Sep 17 00:00:00 2001 From: Wang Pengcheng <wangpengcheng...@bytedance.com> Date: Tue, 5 Nov 2024 20:38:44 +0800 Subject: [PATCH] Set max bytes Created using spr 1.3.6-beta.1 --- llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp index c65feb9755633..a1c5f76bae009 100644 --- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp +++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp @@ -2508,7 +2508,10 @@ RISCVTTIImpl::enableMemCmpExpansion(bool OptSize, bool IsZeroCmp) const { Options.LoadSizes = {4, 2, 1}; if (IsZeroCmp && ST->hasVInstructions()) { unsigned VLenB = ST->getRealMinVLen() / 8; - for (unsigned Size = ST->getXLen() / 8 + 1; + // The minimum size should be the maximum bytes between `VLen * LMUL_MF8` + // and `XLen + 8`. + unsigned MinSize = std::max(VLenB / 8, ST->getXLen() / 8 + 1); + for (unsigned Size = MinSize; Size <= VLenB * ST->getMaxLMULForFixedLengthVectors(); Size++) Options.LoadSizes.insert(Options.LoadSizes.begin(), Size); } _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits