-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Unobservable vec, and arrays writes always always emit for size >= 3 #96497
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.A-codegenArea: Code generationArea: Code generationT-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.A-codegenArea: Code generationArea: Code generationT-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.
While revealing that dead
Vec<_>writes always emit, to someone else, I decided to look into this for arrays.It seems that, for any
[T; N], such that T is not a ZST or enum with a single possible value, and 3 <= N, then array writes are always emit. This applies to allowing emitting redundant memcpys, memclrs, memfills, and all related operations.https://rust.godbolt.org/z/7vrT5xnxq
As for
Vec<T>, as long as T isn't as described above, then unobservable writes and operations are usually emit.https://rust.godbolt.org/z/jhM75Mj5E