-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Boolean optimization no longer works #62993
Copy link
Copy link
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-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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I'm unsure if this is a bug or not. The following code used to perform just as well as if there were no
letstatements. However, sometime since last year, that has changed.Starting with rust 1.33, all the modulos are always computed. While in 1.32, it would stop processing if the year was not divisible by 4. Using compiler explorer, I was able to find when
is_leap_yearassembly output changed. (link to godbolt with assembly output).I wanted to make sure it wasn't a change in LLVM, so I looked at the llvm-ir. The same logic between the llvm-ir and assembly existed. (link to godbolt with llvm-ir output)
Next was to determine exactly when this change occurred,
nightly-2018-12-24had the optimization andnightly-2018-12-26did not. Unfortunately,nightly-2018-12-25won't install viarustup. I was however able to manually download rustc and std, and was able to verify that it is broken then.So some commit between these two nightly removed this optimization:
rustc 1.33.0-nightly (ddab10a69 2018-12-23)rustc 1.33.0-nightly (f960f377f 2018-12-24)