-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.WG-llvmWorking group: LLVM backend code generationWorking group: LLVM backend code generation
Description
See https://play.rust-lang.org/?gist=2754f11f7236754b2121eb9e4c12aa73&version=nightly&mode=release. The length of the Vec
is read before being written to.
I would have expected the peephole optimizer in LLVM to recognize that pattern. Interestingly, it's not a regression; according to https://rust.godbolt.org/, the issue was even present in rustc 1.0
.
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-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.WG-llvmWorking group: LLVM backend code generationWorking group: LLVM backend code generation