-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Missed optimization comparing TypeId arrays #84253
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.
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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Edit: Look nikic example below.
I tried this code:
I expected to see this happen:
This code should compile to
return trueorreturn false.Instead, this happened:
asm contains useless operations
Meta
rustc --version --verbose:Proposed fix
If I add additional SROA flag, useless code is eliminated. I think, we need to add another SROA to pipeline somewhere before last instcombine and dead code elimination.
Here godbolt link.