Add comment clarifying vectorization cost estimation.
A comment was added to GCC's vectorizer to explain the cost estimation of loop prologue and epilogue.
This commit adds a comment to vect_estimate_min_profitable_iters in GCC’s vectorization pass. The comment explains the somewhat awkward method of estimating peeling costs by adding the scalar loop statement costs to the vector loop cost vector.
In Details
The vectorization pass in GCC transforms scalar code into vector code to exploit SIMD capabilities. vect_estimate_min_profitable_iters estimates the minimum number of iterations required for vectorization to be profitable. The comment added explains how scalar loop statement costs are combined with vector loop costs to estimate peeling costs, clarifying the cost model used by the vectorizer.
For Context
GCC's vectorization pass automatically converts scalar operations (operating on single values) within loops into vector operations (operating on multiple values simultaneously) to leverage SIMD (Single Instruction, Multiple Data) capabilities of modern processors. This optimization improves performance by processing multiple data elements in parallel. This commit adds a comment to the vectorization code to clarify its cost estimation model of the loop's prologue and epilogue, which impacts the profitability analysis of vectorization.