Skip to content

[meta] Make llvm passes debug info invariant #37076

Open
@vedantk

Description

@vedantk
Collaborator
Bugzilla Link 37728
Version unspecified
OS All
Depends On #36588 #37063 llvm/llvm-bugzilla-archive#37727 #40314 #40456 #43204 #43767 #44225 #49035 #49044 #50454 #50525 #50539 #50540 #50911 #50912 #51880 #51881 #51882 #36654 #37061 #37062 llvm/llvm-bugzilla-archive#37726 #41483 #42636 #43103 #43309 #48790 #49326 #49924
CC @bjope,@dstenb,@dwblaikie,@fredriss,@gregbedwell,@jmorse,@jryans,@pogo59,@rgal,@wjristow,@yuanfang-chen

Extended Description

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.

Activity

gregbedwell

gregbedwell commented on Jun 7, 2018

@gregbedwell
Collaborator
  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 :)

pogo59

pogo59 commented on Jun 7, 2018

@pogo59
Collaborator

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.

llvmbot

llvmbot commented on Oct 25, 2019

@llvmbot
Member

check_cfc test script
This is a shell script tool calling check_cfc.py to detect codegen difference with/without -g

Run as: ./check_cfc.sh 2>test_err.log

llvmbot

llvmbot commented on Oct 25, 2019

@llvmbot
Member

check_cfc test result
After run check_cfc.sh with llvm_test_suite as test code,
Codegen differences found in test_err.log

llvmbot

llvmbot commented on Oct 25, 2019

@llvmbot
Member

*** Bug llvm/llvm-bugzilla-archive#43757 has been marked as a duplicate of this bug. ***

gregbedwell

gregbedwell commented on Nov 27, 2021

@gregbedwell
Collaborator

mentioned in issue #40314

llvmbot

llvmbot commented on Nov 27, 2021

@llvmbot
Member

mentioned in issue #40456

llvmbot

llvmbot commented on Nov 27, 2021

@llvmbot
Member

mentioned in issue #41483

mikaelholmen

mikaelholmen commented on Nov 27, 2021

@mikaelholmen
Collaborator

mentioned in issue #42636

llvmbot

llvmbot commented on Nov 27, 2021

@llvmbot
Member

mentioned in issue llvm/llvm-bugzilla-archive#43757

llvmbot

llvmbot commented on Nov 27, 2021

@llvmbot
Member

mentioned in issue #43103

llvmbot

llvmbot commented on Nov 27, 2021

@llvmbot
Member

mentioned in issue #43204

bjope

bjope commented on Nov 27, 2021

@bjope
Collaborator

mentioned in issue #43309

llvmbot

llvmbot commented on Nov 27, 2021

@llvmbot
Member

mentioned in issue #43767

dstenb

dstenb commented on Nov 27, 2021

@dstenb
Mannequin

mentioned in issue #44225

53 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilladebuginfoenhancementImproving things as opposed to bug fixing, e.g. new or missing featurellvm:transformsmetaissueIssue to collect references to a group of similar or related issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @vedantk@rgal@Endilll@dwblaikie@theo-lw

        Issue actions

          [meta] Make llvm passes debug info invariant · Issue #37076 · llvm/llvm-project