-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Terrible code generation with a zillion bounds checks. #73512
Copy link
Copy link
Open
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.C-bugCategory: This is a bug.Category: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.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.
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.C-bugCategory: This is a bug.Category: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This is probably a duplicate of something.
In psychon/x11rb#491 we have a function that looks like:
Basically, it takes a byte stream in a wire format and parses it into an in-memory struct.
The generated assembly looks like
LBB4888_16 is the ParseError::InsufficientData return and LBB4888_13 is the ParseError::ParseError return.
The compiler really should be able to consolidate the adjacent bounds checks. And although much smaller, not condensing the adjacent
jb/jes is a comically easy missed optimization.Meta
rustc --version --verbose: