[llvm] ea85345 - [RISCV][NFC] Use raw_svector_ostream to construct key of SubtargetMap (#72964)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 8 02:34:35 PST 2023
Author: Wang Pengcheng
Date: 2023-12-08T18:34:31+08:00
New Revision: ea85345eb69f751fdfd793016c854605f14f9dfc
URL: https://github.com/llvm/llvm-project/commit/ea85345eb69f751fdfd793016c854605f14f9dfc
DIFF: https://github.com/llvm/llvm-project/commit/ea85345eb69f751fdfd793016c854605f14f9dfc.diff
LOG: [RISCV][NFC] Use raw_svector_ostream to construct key of SubtargetMap (#72964)
To simplify some code.
Added:
Modified:
llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
index 84239db1971c2..3abdb6003659f 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
@@ -213,13 +213,8 @@ RISCVTargetMachine::getSubtargetImpl(const Function &F) const {
llvm::bit_floor((RVVBitsMax < 64 || RVVBitsMax > 65536) ? 0 : RVVBitsMax);
SmallString<512> Key;
- Key += "RVVMin";
- Key += std::to_string(RVVBitsMin);
- Key += "RVVMax";
- Key += std::to_string(RVVBitsMax);
- Key += CPU;
- Key += TuneCPU;
- Key += FS;
+ raw_svector_ostream(Key) << "RVVMin" << RVVBitsMin << "RVVMax" << RVVBitsMax
+ << CPU << TuneCPU << FS;
auto &I = SubtargetMap[Key];
if (!I) {
// This needs to be done before we create a new subtarget since any
More information about the llvm-commits
mailing list