-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-codegenArea: Code generationArea: Code generationC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.
Milestone
Description
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.
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.