Skip to content

-C inline-threshold has no effect with new LLVM pass manager #89742

Closed
@MSxDOS

Description

@MSxDOS

The compiler produces identical binaries whatever value is set.

In this example:

const LEN: usize = 20;

pub fn test(vals1: &[usize; LEN], vals2: &[usize; LEN]) -> bool {
    test_inner(vals1) || test_inner(vals2)
}

fn test_inner(vals: &[usize; LEN]) -> bool {
    vals.iter().any(|v| v % 2 == 0)
}

test_inner is not inlined when compiled with -C opt-level=3 -C inline-threshold=9000 unless the new pass manager is manually disabled via -Z new-llvm-pass-manager=no.

https://rust.godbolt.org/z/TKGoz3h6n

Related: #61088

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.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions