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

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 16:09:11 PDT 2017


MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.

The change LGTM. The testcase is really long and will probably break easily if someone changes dependency breaking heuristics, so anything you can do to make it less complicated is apreciated!



================
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,
----------------
This is not just an attempt, isn't it?


================
Comment at: lib/CodeGen/AntiDepBreaker.h:71-73
+    for (auto DVI = DbgValues.crbegin(), DVE = DbgValues.crend();
+         DVI != DVE; ++DVI) {
+      MachineInstr *PrevMI = DVI->second;
----------------
You could use:
```
for (std::pair<MachineInstr *, MachineInstr *> P : make_range(DbgValues.crbegin(), DbgValues.crend)) { ... }
```


================
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
+
----------------
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


https://reviews.llvm.org/D31755





More information about the llvm-commits mailing list