[clang] 6d323e7 - [RISCV] Use SmallVector::append to replace some for loops in intrinsic creation. NFC
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 27 09:57:20 PST 2022
Author: Craig Topper
Date: 2022-12-27T09:57:05-08:00
New Revision: 6d323e7e51c6a58b44b6b1a982bbda7edfd962fb
URL: https://github.com/llvm/llvm-project/commit/6d323e7e51c6a58b44b6b1a982bbda7edfd962fb
DIFF: https://github.com/llvm/llvm-project/commit/6d323e7e51c6a58b44b6b1a982bbda7edfd962fb.diff
LOG: [RISCV] Use SmallVector::append to replace some for loops in intrinsic creation. NFC
Reviewed By: eopXD
Differential Revision: https://reviews.llvm.org/D140678
Added:
Modified:
clang/include/clang/Basic/riscv_vector.td
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/riscv_vector.td b/clang/include/clang/Basic/riscv_vector.td
index 2669df028d93..9c05d893dde2 100644
--- a/clang/include/clang/Basic/riscv_vector.td
+++ b/clang/include/clang/Basic/riscv_vector.td
@@ -853,8 +853,7 @@ multiclass RVVUnitStridedSegLoad<string op> {
Operands.push_back(Ops[NF]);
Operands.push_back(Ops[NF + 2]);
} else {
- for (unsigned I = 0; I < NF; ++I)
- Operands.push_back(Ops[NF + I + 1]);
+ Operands.append(Ops.begin() + NF + 1, Ops.begin() + 2 * NF + 1);
Operands.push_back(Ops[2 * NF + 1]);
Operands.push_back(Ops[NF]);
Operands.push_back(Ops[2 * NF + 2]);
@@ -870,10 +869,7 @@ multiclass RVVUnitStridedSegLoad<string op> {
Operands.push_back(Ops[NF]);
Operands.push_back(Ops[NF + 1]);
} else {
- for (unsigned I = 0; I < NF; ++I)
- Operands.push_back(Ops[NF + I]);
- Operands.push_back(Ops[2 * NF]);
- Operands.push_back(Ops[2 * NF + 1]);
+ Operands.append(Ops.begin() + NF, Ops.begin() + 2 * NF + 2);
}
}
llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes);
@@ -931,8 +927,7 @@ multiclass RVVUnitStridedSegLoadFF<string op> {
Operands.push_back(Ops[NF + 3]);
NewVL = Ops[NF + 2];
} else {
- for (unsigned I = 0; I < NF; ++I)
- Operands.push_back(Ops[NF + I + 1]);
+ Operands.append(Ops.begin() + NF + 1, Ops.begin() + 2 * NF + 1);
Operands.push_back(Ops[2 * NF + 1]);
Operands.push_back(Ops[NF]);
Operands.push_back(Ops[2 * NF + 3]);
@@ -950,8 +945,7 @@ multiclass RVVUnitStridedSegLoadFF<string op> {
Operands.push_back(Ops[NF + 2]);
NewVL = Ops[NF + 1];
} else {
- for (unsigned I = 0; I < NF; ++I)
- Operands.push_back(Ops[NF + I]);
+ Operands.append(Ops.begin() + NF, Ops.begin() + 2 * NF);
Operands.push_back(Ops[2 * NF]);
Operands.push_back(Ops[2 * NF + 2]);
NewVL = Ops[2 * NF + 1];
@@ -1012,8 +1006,7 @@ multiclass RVVStridedSegLoad<string op> {
Operands.push_back(Ops[NF]);
Operands.push_back(Ops[NF + 3]);
} else {
- for (unsigned I = 0; I < NF; ++I)
- Operands.push_back(Ops[NF + I + 1]);
+ Operands.append(Ops.begin() + NF + 1, Ops.begin() + 2 * NF + 1);
Operands.push_back(Ops[2 * NF + 1]);
Operands.push_back(Ops[2 * NF + 2]);
Operands.push_back(Ops[NF]);
@@ -1031,8 +1024,7 @@ multiclass RVVStridedSegLoad<string op> {
Operands.push_back(Ops[NF + 1]);
Operands.push_back(Ops[NF + 2]);
} else {
- for (unsigned I = 0; I < NF; ++I)
- Operands.push_back(Ops[NF + I]);
+ Operands.append(Ops.begin() + NF, Ops.begin() + 2 * NF);
Operands.push_back(Ops[2 * NF]);
Operands.push_back(Ops[2 * NF + 1]);
Operands.push_back(Ops[2 * NF + 2]);
@@ -1087,8 +1079,7 @@ multiclass RVVIndexedSegLoad<string op> {
Operands.push_back(Ops[NF + 3]);
IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()};
} else {
- for (unsigned I = 0; I < NF; ++I)
- Operands.push_back(Ops[NF + I + 1]);
+ Operands.append(Ops.begin() + NF + 1, Ops.begin() + 2 * NF + 1);
Operands.push_back(Ops[2 * NF + 1]);
Operands.push_back(Ops[2 * NF + 2]);
Operands.push_back(Ops[NF]);
@@ -1108,8 +1099,7 @@ multiclass RVVIndexedSegLoad<string op> {
Operands.push_back(Ops[NF + 2]);
IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()};
} else {
- for (unsigned I = 0; I < NF; ++I)
- Operands.push_back(Ops[NF + I]);
+ Operands.append(Ops.begin() + NF, Ops.begin() + 2 * NF);
Operands.push_back(Ops[2 * NF]);
Operands.push_back(Ops[2 * NF + 1]);
Operands.push_back(Ops[2 * NF + 2]);
More information about the cfe-commits
mailing list