-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Unroll small loops over Vector<T> elements #6891
Copy link
Copy link
Closed
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimization
Milestone
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimization
Type
Fields
Give feedbackNo fields configured for issues without a type.
This is mentioned briefly in #6742, but I'm splitting it out into its own issue to make tracking easier.
Since Vector.Count is not a constant at source level, any (non-intrinsic) aggregation/searching over Vector elements is very likely to be written as a loop using a symbolic index. The codegen for symbolic indexing uses a copy through memory to fetch the element. Since Vector.Count is a constant at JIT time, and is typically small, and the codegen for fixed-offset indexing extracts the elements from the registers without the copy through memory, these loops are excellent candidates for full unroll. This has been seen e.g. in aspnet/KestrelHttpServer#1138