Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enums that don't carry anything in their arms shouldn't use shape glue #2916

Closed
bblum opened this issue Jul 14, 2012 · 3 comments
Closed

Enums that don't carry anything in their arms shouldn't use shape glue #2916

bblum opened this issue Jul 14, 2012 · 3 comments
Labels
A-codegen Area: Code generation C-enhancement Category: An issue proposing an enhancement or a PR with one. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@bblum
Copy link
Contributor

bblum commented Jul 14, 2012

enum fast { x, y, z, w } 
enum slow<T> { a(T), b(T), c(T), d(T) }

fn foo(yy: fast, xx: fast) -> bool {
    ret yy == xx; 
}
fn bar(yy: slow<bool>, xx: slow<bool>) -> bool {
    ret yy == xx; 
}

Both foo and bar generate calls to upcall_cmp_type. It'd be nice if, for performance, the compiler could recognise that fast can be represented by a primitive and skip the upcalls.

Related to #2132.

@eholk
Copy link
Contributor

eholk commented Jul 14, 2012

Oh sad, I was really hoping we handled at least this case.

@bblum
Copy link
Contributor Author

bblum commented Jul 16, 2012

I know, right?

Found during ICFP (#2928).

@catamorphism
Copy link
Contributor

Obsolete, shape glue is dead.

RalfJung pushed a commit to RalfJung/rust that referenced this issue Jun 29, 2023
Remove rustc-workspace-hack

The `rustc-workspace-hack` dependency was removed in rust-lang#109133 and should no longer be needed.
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation C-enhancement Category: An issue proposing an enhancement or a PR with one. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

3 participants