Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow MIR pass UnreachableProp when coverage is enabled #116938

Closed
wants to merge 3 commits into from

Commits on Oct 20, 2023

  1. coverage: Force -Copt-level=2 in the unreachable-code test

    This test is mainly for detecting problems triggered by MIR optimizations, but
    the run-coverage tests don't enable optimization by default.
    
    (The coverage-map copy has also been updated, to keep the two tests in sync.)
    Zalathar committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    e3b83df View commit details
    Browse the repository at this point in the history
  2. coverage: Repair instrumented functions that have lost all their coun…

    …ters
    
    If a function has been instrumented for coverage, but MIR optimizations
    subsequently remove all of its counter-increment statements, then we won't emit
    LLVM counter-increment intrinsics. LLVM will think the function is not
    instrumented, and it will disappear from coverage mappings and coverage
    reports.
    
    This new MIR pass detects when that has happened, and re-inserts a dummy
    counter-increment statement so that LLVM knows to treat the function as
    instrumented.
    Zalathar committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    e6b2828 View commit details
    Browse the repository at this point in the history
  3. Allow MIR pass UnreachableProp when coverage is enabled

    Now that coverage has a dedicated MIR pass to detect and repair instrumented
    functions that have lost all their counters, it should be OK to permit this
    pass in coverage builds.
    Zalathar committed Oct 20, 2023
    Configuration menu
    Copy the full SHA
    2a95ee6 View commit details
    Browse the repository at this point in the history