[PATCH] D53992: [DebugInfo] Correctly sink DBG_VALUEs in postra-machine-sink
Matt Davis via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 1 14:07:24 PDT 2018
mattd added inline comments.
================
Comment at: lib/CodeGen/MachineSink.cpp:1116
UsedRegUnits.clear();
+ SeenDbgInstrs.clear();
----------------
nit: unnecessary newline at L1116
================
Comment at: lib/CodeGen/MachineSink.cpp:1130
+ // it may not be anywhere near the register def
+ if (MI->isDebugValue()) {
+ auto &MO = MI->getOperand(0);
----------------
Can you get away with using MI->isDebugInstr ?
================
Comment at: lib/CodeGen/MachineSink.cpp:1140
+ // Record debug use of this register
+ SeenDbgInstrs.insert(std::make_pair(MO.getReg(), MI));
+ }
----------------
As an alternative to insert, you can call emplace().
SeenDbgInstrs.emplace(MO.getReg(), MI);
================
Comment at: lib/CodeGen/MachineSink.cpp:1145
+
if (MI->isDebugInstr())
continue;
----------------
This condition might not be necessary since you will always continue in the previous conditional at L1130... if you update the conditional at L1130 to be isDebugInstr.
Repository:
rL LLVM
https://reviews.llvm.org/D53992
More information about the llvm-commits
mailing list