[PATCH] D31755: [DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler.

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 02:56:49 PDT 2017


andrewng added a comment.

In https://reviews.llvm.org/D31755#731245, @aprantl wrote:

> Rather than scanning forward for DBG_VALUEs, is there a more systematic way to find them? E.g., by iterating over USEs? If not, doing it this way is probably fine.


I'm not sure as I'm still new to LLVM, but because these are physical registers, I don't think the USEs would work. But I agree that the current method doesn't seem so robust.



================
Comment at: lib/CodeGen/AntiDepBreaker.h:64-65
+
+  /// Attempt to update all DBG_VALUE instructions that may be affected by the
+  /// dependency breaker's update of ParentMI to use NewReg.
+  void UpdateDbgValues(const DbgValueVector &DbgValues, MachineInstr *ParentMI,
----------------
MatzeB wrote:
> This is not just an attempt, isn't it?
Yes, I will drop the "Attempt", as it's not really needed. I think I phrased it that way because the call to UpdateDbgValue may not actually do anything.


================
Comment at: lib/CodeGen/AntiDepBreaker.h:71-73
+    for (auto DVI = DbgValues.crbegin(), DVE = DbgValues.crend();
+         DVI != DVE; ++DVI) {
+      MachineInstr *PrevMI = DVI->second;
----------------
MatzeB wrote:
> You could use:
> ```
> for (std::pair<MachineInstr *, MachineInstr *> P : make_range(DbgValues.crbegin(), DbgValues.crend)) { ... }
> ```
OK, that makes sense as ranged for loops seems to be the way to go.


================
Comment at: test/CodeGen/X86/post-ra-sched-with-debug.mir:1
+# RUN: llc -mtriple=x86_64-unknown-unknown -run-pass=post-RA-sched -o - %s | FileCheck %s
+
----------------
MatzeB wrote:
> aprantl wrote:
> > I'm sure this testcase can be reduced further with some manual inlining.
> > The only variables being CHECKed are i and j.
> Please take a look at the "Simplifying MIR Files" documentation I wrote a few days ago:
> http://llvm.org/docs/MIRLangRef.html#simplifying-mir-files
I will try to manually inline to see if it can be further reduced. I will also see if the MIR can be further simplified.


https://reviews.llvm.org/D31755





More information about the llvm-commits mailing list