aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachinePipeliner.cpp
diff options
context:
space:
mode:
authorJie Fu <jiefu@tencent.com>2024-01-22 16:17:18 +0800
committerJie Fu <jiefu@tencent.com>2024-01-22 16:17:18 +0800
commit9f290509421b874ecf8082fa8f754850fb121655 (patch)
tree2920d501ab4a9cee40bf48e7952113bced38af10 /llvm/lib/CodeGen/MachinePipeliner.cpp
parenta54463a4c6c32810b064e02b39e2c8f0de974006 (diff)
downloadllvm-9f290509421b874ecf8082fa8f754850fb121655.zip
llvm-9f290509421b874ecf8082fa8f754850fb121655.tar.gz
llvm-9f290509421b874ecf8082fa8f754850fb121655.tar.bz2
[CodeGen][MachinePipeliner] Fix -Wpessimizing-move in MachinePipeliner.cpp (NFC)
/Users/jiefu/llvm-project/llvm/lib/CodeGen/MachinePipeliner.cpp:1044:19: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move] 1044 | CycleInstrs = std::move(Schedule.reorderInstructions(SSD, CycleInstrs)); | ^ /Users/jiefu/llvm-project/llvm/lib/CodeGen/MachinePipeliner.cpp:1044:19: note: remove std::move call here 1044 | CycleInstrs = std::move(Schedule.reorderInstructions(SSD, CycleInstrs)); | ^~~~~~~~~~ ~ /Users/jiefu/llvm-project/llvm/lib/CodeGen/MachinePipeliner.cpp:1395:21: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move] 1395 | auto LastUses = std::move(computeLastUses(OrderedInsts, Stages)); | ^ /Users/jiefu/llvm-project/llvm/lib/CodeGen/MachinePipeliner.cpp:1395:21: note: remove std::move call here 1395 | auto LastUses = std::move(computeLastUses(OrderedInsts, Stages)); | ^~~~~~~~~~ ~ /Users/jiefu/llvm-project/llvm/lib/CodeGen/MachinePipeliner.cpp:1502:9: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move] 1502 | std::move(computeMaxSetPressure(OrderedInsts, Stages, MaxStage + 1)); | ^ /Users/jiefu/llvm-project/llvm/lib/CodeGen/MachinePipeliner.cpp:1502:9: note: remove std::move call here 1502 | std::move(computeMaxSetPressure(OrderedInsts, Stages, MaxStage + 1)); | ^~~~~~~~~~ ~ /Users/jiefu/llvm-project/llvm/lib/CodeGen/MachinePipeliner.cpp:3381:19: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move] 3381 | cycleInstrs = std::move(reorderInstructions(SSD, cycleInstrs)); | ^ /Users/jiefu/llvm-project/llvm/lib/CodeGen/MachinePipeliner.cpp:3381:19: note: remove std::move call here 3381 | cycleInstrs = std::move(reorderInstructions(SSD, cycleInstrs)); | ^~~~~~~~~~ ~ 4 errors generated.
Diffstat (limited to 'llvm/lib/CodeGen/MachinePipeliner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachinePipeliner.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp
index 5c9f0f1..2d2d0bf 100644
--- a/llvm/lib/CodeGen/MachinePipeliner.cpp
+++ b/llvm/lib/CodeGen/MachinePipeliner.cpp
@@ -1041,7 +1041,7 @@ static void computeScheduledInsts(const SwingSchedulerDAG *SSD,
for (int Cycle = Schedule.getFirstCycle(); Cycle <= Schedule.getFinalCycle();
++Cycle) {
std::deque<SUnit *> &CycleInstrs = Instrs[Cycle];
- CycleInstrs = std::move(Schedule.reorderInstructions(SSD, CycleInstrs));
+ CycleInstrs = Schedule.reorderInstructions(SSD, CycleInstrs);
for (SUnit *SU : CycleInstrs) {
MachineInstr *MI = SU->getInstr();
OrderedInsts.push_back(MI);
@@ -1392,7 +1392,7 @@ private:
auto CurSetPressure = InitSetPressure;
auto MaxSetPressure = InitSetPressure;
- auto LastUses = std::move(computeLastUses(OrderedInsts, Stages));
+ auto LastUses = computeLastUses(OrderedInsts, Stages);
LLVM_DEBUG({
dbgs() << "Ordered instructions:\n";
@@ -1499,7 +1499,7 @@ public:
Instr2StageTy Stages;
computeScheduledInsts(SSD, Schedule, OrderedInsts, Stages);
const auto MaxSetPressure =
- std::move(computeMaxSetPressure(OrderedInsts, Stages, MaxStage + 1));
+ computeMaxSetPressure(OrderedInsts, Stages, MaxStage + 1);
LLVM_DEBUG({
dbgs() << "Dump MaxSetPressure:\n";
@@ -3378,7 +3378,7 @@ void SMSchedule::finalizeSchedule(SwingSchedulerDAG *SSD) {
// generated code.
for (int Cycle = getFirstCycle(), E = getFinalCycle(); Cycle <= E; ++Cycle) {
std::deque<SUnit *> &cycleInstrs = ScheduledInstrs[Cycle];
- cycleInstrs = std::move(reorderInstructions(SSD, cycleInstrs));
+ cycleInstrs = reorderInstructions(SSD, cycleInstrs);
SSD->fixupRegisterOverlaps(cycleInstrs);
}