-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Division by nonzero #54868
Copy link
Copy link
Closed
Labels
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
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.
Rustc seems unable to use the fact that NonZeroU64 isn't zero:
Gives the asm (with -O):
Adding an assume() solves the problem:
Perhaps such assume() should be added at the end of NonZeroU64::get()?