Skip to content

Commit 3b19cd7

Browse files
authored
[RISCV] Slightly simplify RVVArgDispatcher::constructArgInfos. NFC (llvm#87308)
Use a single insert for the non-mask case instead of a push_back followed by an insert that may contain 0 registers.
1 parent a27d886 commit 3b19cd7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21115,12 +21115,10 @@ void RVVArgDispatcher::constructArgInfos(ArrayRef<Type *> TypeList) {
2111521115
RegisterVT.getVectorElementType() == MVT::i1) {
2111621116
RVVArgInfos.push_back({1, RegisterVT, true});
2111721117
FirstVMaskAssigned = true;
21118-
} else {
21119-
RVVArgInfos.push_back({1, RegisterVT, false});
21118+
--NumRegs;
2112021119
}
2112121120

21122-
RVVArgInfos.insert(RVVArgInfos.end(), --NumRegs,
21123-
{1, RegisterVT, false});
21121+
RVVArgInfos.insert(RVVArgInfos.end(), NumRegs, {1, RegisterVT, false});
2112421122
}
2112521123
}
2112621124
}

0 commit comments

Comments
 (0)