Skip to content

Better support for early clobbers #6

@jeremydavis519

Description

@jeremydavis519

LLVM supports output constraints like "=&r", which it calls early clobbers. Such a constraint (i.e. one using an ampersand) indicates that this output might be written before all of the inputs are finished being used so that LLVM will allocate a separate register for that output instead of sharing one with an input. Currently, we require the programmer to write something like this, which goes against our goal of not having to look things up:

let output: out("&r") = 0usize;

My idea right now is to add a new keyword that can be put inside those parentheses--maybe something like this:

let output: out(early "r") = 0usize;

I'm not sure that's the best keyword to use, but it's a bit more expressive than an ampersand.

The same keyword should apply to inout variables, like so:

let input_output: inout(early "r") = 0usize;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions