[llvm] [RISCV] Slightly simplify RVVArgDispatcher::constructArgInfos. NFC (PR #87308)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 1 20:17:31 PDT 2024
https://github.com/topperc created https://github.com/llvm/llvm-project/pull/87308
Use a single insert for the non-mask case instead of a push_back followed by an insert that may contain 0 registers.
>From 1ddc80dabd71e1e81725d84b267871efce54aca0 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Mon, 1 Apr 2024 19:51:39 -0700
Subject: [PATCH] [RISCV] Slightly simplify
RVVArgDispatcher::constructArgInfos. NFC
Use a single insert for the non-mask case instead of a push_back
followed by an insert that may contain 0 registers.
---
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index f693cbd3bea51e..6424c6c27ad6f1 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -21106,12 +21106,10 @@ void RVVArgDispatcher::constructArgInfos(ArrayRef<Type *> TypeList) {
RegisterVT.getVectorElementType() == MVT::i1) {
RVVArgInfos.push_back({1, RegisterVT, true});
FirstVMaskAssigned = true;
- } else {
- RVVArgInfos.push_back({1, RegisterVT, false});
+ --NumRegs;
}
- RVVArgInfos.insert(RVVArgInfos.end(), --NumRegs,
- {1, RegisterVT, false});
+ RVVArgInfos.insert(RVVArgInfos.end(), NumRegs, {1, RegisterVT, false});
}
}
}
More information about the llvm-commits
mailing list