Skip to content

When the new LLVM Pass Manager is enabled, -Z verify-llvm-ir=yes is ignored if -C no-prepopulate-passes is also given #95874

Closed
@luqmana

Description

@luqmana

While investigating the issue fixed in #95864 I came across some surprising behaviour. In trying to figure out whether rustc was generating invalid IR or it was some subsequent LLVM pass, I realized that -Z verify-llvm-ir was essentially ignored with -C no-prepopulate-passes in the new LLVM Pass Manager. This lead me to (incorrectly) assume that the IR rustc generated was valid when it got to LLVM.

It looks like a subtle change in behaviour due to the way the new Pass Manager is constructed in LLVMRustOptimizeWithNewPassManager.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions