[PATCH] D41226: [LiveDebugValues] recognize spilled register that is killed in instruction after the spill

Wolfgang Pieb via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 12:00:21 PST 2018


wolfgangp accepted this revision.
wolfgangp added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/CodeGen/LiveDebugValues.cpp:429
 
-  // In a spill instruction generated by the InlineSpiller the spilled register
-  // has its kill flag set. Return false if we don't find such a register.
-  Reg = 0;
+  auto getRegIfKilled = [&](const MachineOperand MO, unsigned &Reg) {
+    if (!MO.isReg() || !MO.isUse()) {
----------------
wolfgangp wrote:
> I would prefer if the name of the lambda would reflect that we are returning a boolean quantity, i.e. whether the operand is a killed register or not. The register itself is returned as a side-effect, so something like 'isKilledReg()' instead of 'getKilledReg()' would sound a bit more consistent to me.
I'd still prefer to call the lambda 'isKilledReg()' but I leave it up to you.


https://reviews.llvm.org/D41226





More information about the llvm-commits mailing list