Skip to content

Compile hangs endlessly in LLVM in await-heavy code when ThinLTO is enabled #66036

Closed
@tmandry

Description

Some code went from compiling in <10 seconds to (hours) in between commits 10f12fe..b3a0350 (unfortunately I don't have a smaller range right now).

The regression only happens when ThinLTO is enabled. Full LTO doesn't have the slowdown.

Here's the source code which is causing the regression. The function has about 20 .await points, which I suspect might be related. It doesn't seem to have anything to do with inlining the awaited function (I replaced it with a panic and linking was still slow).

Here's the LLVM IR for the fast and slow cases (built with the above commits of rustc, respectively): llvm-ir.zip
EDIT: See below for a reproducer

cc @petrhosek

Activity

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

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.ICEBreaker-LLVMBugs identified for the LLVM ICE-breaker group

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions