Skip to content

Cranelift: Support stack probes without external function call #2299

Closed

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.

Activity

  1. bjorn3 commented on Sep 2, 2022

    @bjorn3
    ContributorAuthor

    Neither AArch64, nor s390x has support for this yet.

  2. afonso360 commented on Sep 2, 2022

    @afonso360
    Contributor

    Right, should we reopen this or open issues against both backends?

  3. bjorn3 commented on Sep 2, 2022

    @bjorn3
    ContributorAuthor

    Opened #4846 and #4847.

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

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