[PATCH] D11933: Extending debug ranges

Alex Lorenz via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 09:54:54 PDT 2015


arphaman added a comment.

Hi, Sorry about not replying earlier last week,

I hope that you will utilize the new MIR serialization format to test the new pass. I added an inline comment that should explain how you can use the new format to create a test case for this pass.

Cheers,
Alex


================
Comment at: test/DebugInfo/extend-debug-range.ll:1
@@ +1,2 @@
+; RUN: llc -print-machineinstrs=dbgval-fixup %s 2>&1 | FileCheck %s
+
----------------
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.


http://reviews.llvm.org/D11933





More information about the llvm-commits mailing list