-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.S-blockedStatus: Blocked on something else such as an RFC or other implementation work.Status: Blocked on something else such as an RFC or other implementation work.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
This is an extension of #94107. It may be a minor perf win.
Basically, when we switch to using opaque pointers, this comment will no longer be true:
rust/compiler/rustc_codegen_llvm/src/type_of.rs
Lines 67 to 69 in 27af517
// Use identified structure types for ADT. Due to pointee types in LLVM IR their definition | |
// might be recursive. Other cases are non-recursive and we can use literal structure types. | |
ty::Adt(..) => Some(String::new()), |
@rustbot label A-llvm T-compiler S-blocked
Edit: the simplest implementation, e.g. changing those lines to
// In LLVM < 15, use identified structure types for ADT. Due to pointee types in LLVM IR their definition
// might be recursive. Other cases are non-recursive and we can use literal structure types.
// In LLVM 15, we use opaque pointers, so there are no pointee types and no potential recursion.
ty::Adt(..) if get_version() < (15, 0, 0) => Some(String::new()),
doesn't work because then we end up infinitely recursing into the pointee type in order to generate a literal struct type. (Removing pointee types from the codegen backend would avoid this, which I am working on.)
tmiasko
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.S-blockedStatus: Blocked on something else such as an RFC or other implementation work.Status: Blocked on something else such as an RFC or other implementation work.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.