Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

[meta] Make llvm passes debug info invariant #36701

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR37728
Status NEW
Importance P enhancement
Reported by Vedant Kumar (vsk@apple.com)
Reported on 2018-06-07 00:52:58 -0700
Last modified on 2021-11-17 19:47:20 -0800
Version unspecified
Hardware PC All
CC bjorn.a.pettersson@ericsson.com, chris.dawson@sony.com, david.stenberg@ericsson.com, david.tellenbach@arm.com, dblaikie@gmail.com, ditaliano@apple.com, friss@apple.com, greg.bedwell@sony.com, jeremy.morse.llvm@gmail.com, jryans@gmail.com, llvm-bugs@lists.llvm.org, matthew.davis@sony.com, paul_robinson@playstation.sony.com, russell_gallop@sn.scee.net, warren_ristow@playstation.sony.com, yechunliangcn@163.com, yuanfang.chen@sony.com
Fixed by commit(s)
Attachments check_cfc.sh (3897 bytes, application/x-shellscript)
test_err.log (25406 bytes, text/x-log)
Blocks
Blocked by PR37240, PR37715, PR37727, PR40969, PR41111, PR43859, PR44422, PR44880, PR49691, PR49700, PR51110, PR51181, PR51195, PR51196, PR51569, PR51570, PR52538, PR52539, PR52540, PR37306, PR37713, PR37714, PR37726, PR42138, PR43291, PR43758, PR43964, PR49446, PR49982, PR50580
See also

This is a meta bug for tracking work related to making llvm passes debug info invariant. That means that the output of llvm passes should be the same, modulo debug info metadata & intrinsics, regardless of whether the input IR contains debug info. The motivation for this is that enabling debug info should not degrade optimizations.

There are at least two different approaches for detecting debug invariance bugs:

  1. Compile a C program with/without -g, and check that the resulting text sections are identical.

  2. Compile some LLVM IR using opt, with/without -debugify-each enabled, and check that the stripped output is identical. The -debugify-each mode applies/removes synthetic debug info to a Module before/after each pass in opt's pipeline.

The second approach might be a bit more flexible, seeing as it's possible to generate LLVM IR from a C program, and to then run a custom pipeline over the IR using opt.

In addition to finding debug invariance bugs, we should think about setting up infrastructure to detect regressions, and about adding utilities to the codebase which might make it easier to write debug info invariant passes.

Quuxplusone commented 6 years ago
(In reply to Vedant Kumar from comment #0)
> 1. Compile a C program with/without -g, and check that the resulting text
> sections are identical.
>

For this approach we have:
https://llvm.org/devmtg/2015-04/slides/Verifying_code_gen_dash_g_final.pdf

We have this pipeline setup for some our Sony internal test-suites and it's
generally very effective FWIW.  We've not had the spare bandwidth to fix all of
the existing bugs unfortunately, but we do tend to report/fix regressions as we
spot them.  Hopefully we'll be able to find some spare bandwidth to help with
this effort :)
Quuxplusone commented 6 years ago
Added a couple older bugs to the list.  Post-RA Scheduler will likely be
pretty unpleasant, but it clearly has an effect and showed up fairly
often in our dash-g-no-change pipeline.
Quuxplusone commented 4 years ago

Attached check_cfc.sh (3897 bytes, application/x-shellscript): check_cfc test script

Quuxplusone commented 4 years ago

Attached test_err.log (25406 bytes, text/x-log): check_cfc test result

Quuxplusone commented 4 years ago

_Bug 43757 has been marked as a duplicate of this bug._