[PATCH] D11933: Extending debug ranges

Vikram TV via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 04:35:52 PDT 2015


tvvikram added inline comments.

================
Comment at: test/DebugInfo/extend-debug-range.ll:1
@@ +1,2 @@
+; RUN: llc -print-machineinstrs=dbgval-fixup %s 2>&1 | FileCheck %s
+
----------------
arphaman wrote:
> tvvikram wrote:
> > I am checking the generated machine instructions after the new pass to check for propagated debug ranges. But llc will also generate the .s file. Now, I tried using -stop-after option to llc, but it still generates the .s file.
> If you would like to test just the individual DebugValueFixup pass, you can use the new 'run-pass' option in llc. The run-pass option expects an MIR file as input. MIR files contain the serialized machine instructions. I'm still working on the documentation for this format, but you can take a look at the current docs at http://llvm.org/docs/MIRLangRef.html. 
> 
> To generate an input MIR file for this test, you can use the 'stop-after' option with llc. You can pass the current 'extend-debug-range.ll' file directly to it and llc will print the MIR into stdout. You have to specify a name of a pass that runs before the DebugValueFixup for the 'stop-after' option. I see that the DebugValueFixup pass should run after the StackMapLivenessAnalysis pass, so you can obtain the MIR input file by running the following command:
> 
>     llc -stop-after stackmap-liveness extend-debug-range.ll -o /dev/null > debug-value-fixup.mir
> 
> The generated MIR input file will be target dependent, so you will have to place the test in the appropriate target directory in test/CodeGen.
> 
> After you've generated an input MIR file, you can transform it into an actual test that tests your pass.
> You can use a RUN line similar to this:
> 
>      RUN: llc -o /dev/null -run-pass=dbgval-fixup -march=??? %s | FileCheck %s
> 
> When running this test case, llc will print the produced MIR with the machine instructions that were transformed by your pass directly to stdout.
I tried the above commands but I keep getting the following error with the second command:


```
$llc -run-pass=extend-dbg-range-loc -march=x86-64 d.mir -o /dev/null
error: d.mir:172:76: expected an implicit register operand 'implicit-def %eflags'
    dead %eax = XOR32rr undef %eax, undef %eax, implicit-def dead %eflags, implicit-def %al, debug-location !25
```

[Please note that the pass has been renamed to extend-dbg-range-loc]


http://reviews.llvm.org/D11933





More information about the llvm-commits mailing list