Skip to content

Cranelift: Support stack probes without external function call #2299

Closed
@bjorn3

Description

@bjorn3

Feature

LLVM has support for performing the stack probes directly in the function prologue instead of calling an external function. (see rust-lang/rust#77885 for using this in Rust)

Benefit

This can be faster due to being able to unroll the stack probe loop. It also avoids having to provide an external stack probe function. This makes it possible to enable stack probing in cg_clif. (https://github.com/bjorn3/rustc_codegen_cranelift/issues/661)

Implementation

This should only be implemented for the machinst backends. It should probably be added to either the gen_prologue implementation or gen_prologue caller.

Alternatives

Keep using an external stack probe function with the associated drawbacks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    craneliftIssues related to the Cranelift code generator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions