[llvm] Use `std::move` to avoid copy (PR #113054)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 19 10:22:57 PDT 2024
https://github.com/abhishek-kaushik22 updated https://github.com/llvm/llvm-project/pull/113054
>From 76050379ac9d7d485bedf2661bd10a900379f582 Mon Sep 17 00:00:00 2001
From: abhishek-kaushik22 <abhishek.kaushik at intel.com>
Date: Sat, 19 Oct 2024 22:43:52 +0530
Subject: [PATCH 1/2] Use `std::move` to avoid redundant copy
---
llvm/utils/TableGen/DecoderEmitter.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index 4d2320b31ea94a..55af5fdc3d6a37 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -2059,7 +2059,7 @@ populateInstruction(const CodeGenTarget &Target, const Record &EncodingDef,
MyName = Op.Name;
TiedNames[MyName] = TiedName;
- TiedNames[TiedName] = MyName;
+ TiedNames[TiedName] = std::move(MyName);
}
}
}
>From 014565eb49b5855e3da164040f976b4fbf342521 Mon Sep 17 00:00:00 2001
From: abhishek-kaushik22 <abhishek.kaushik at intel.com>
Date: Sat, 19 Oct 2024 22:52:50 +0530
Subject: [PATCH 2/2] Use `std::move` to avoid copy
---
llvm/utils/TableGen/DecoderEmitter.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index 55af5fdc3d6a37..a9e05bcaeff68c 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -1893,7 +1893,7 @@ OperandInfo getOpInfo(const Record *TypeRecord) {
bool HasCompleteDecoder =
HasCompleteDecoderBit ? HasCompleteDecoderBit->getValue() : true;
- return OperandInfo(Decoder, HasCompleteDecoder);
+ return OperandInfo(std::move(Decoder), HasCompleteDecoder);
}
static void parseVarLenInstOperand(const Record &Def,
More information about the llvm-commits
mailing list