[PATCH] D56401: [WebAssembly] Fix updating/moving DBG_VALUEs in RegStackify

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 9 18:43:15 PST 2019


aheejin added inline comments.


================
Comment at: lib/Target/WebAssembly/WebAssemblyRegStackify.cpp:43
 
+class AdjacentDebugValues {
+  MachineInstr *Def;
----------------
It's still not in the anonymous namespace I think..?
Also, not sure about the name `AdjacentDebugValues`.. which sounds like there are also non-adjacent DBG_VALUE instructions.


================
Comment at: lib/Target/WebAssembly/WebAssemblyRegStackify.cpp:68
+  void clone(MachineInstr *Insert, unsigned NewReg,
+             const WebAssemblyInstrInfo *TII) {
+    MachineBasicBlock *MBB = Insert->getParent();
----------------
I don't think we need to pass `TII` here.. It looks like you can call `MachineFunction::CloneMachineInstrBundle` to clone an instruction, which `WebAssemblyInstrInfo::duplicate` is calling anyway?


================
Comment at: lib/Target/WebAssembly/WebAssemblyRegStackify.cpp:78
+        }
+      }
+      LLVM_DEBUG(dbgs() << " - - Cloned DBG_VALUE: "; Clone.dump());
----------------
Do we need to loop through all operands just to set the 0th operand? Why don't we just do `getOperand(0).setReg(NewReg)`?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56401/new/

https://reviews.llvm.org/D56401





More information about the llvm-commits mailing list