Skip to content

Cranelift: Avoid string conversion for TargetIsa on every function with the incremental cache #11134

Open
@bjorn3

Description

@bjorn3

Feature

Avoid the string conversions in

impl CompileParameters {
fn from_isa(isa: &dyn TargetIsa) -> Self {
Self {
isa: isa.name().to_owned(),
triple: isa.triple().to_string(),
flags: isa.flags().to_string(),
isa_flags: isa
.isa_flags()
.into_iter()
.map(|v| v.value_string())
.collect(),
}
}
}
that are done for every function. Either by hashing a binary representation of the TargetIsa instead or by caching the hash in TargetIsa.

Benefit

This reduces the overhead of computing the caching key, making the incremental cache a bit faster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions