[polly] [Polly] Add vectorize metadata to loops identified as vectorizable by polly (PR #113994)
Karthika Devi C via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 5 10:48:14 PST 2024
kartcq wrote:
> > This patch adds the metadata, setting it to true for loops created by Polly.
>
> "llvm.loop.vectorize.enable" set to true will just ignore loop-vectorizer's cost heursitic, and vectorize any loop that is semantically legal to do. Being processed by Polly doesn't mean it becomes automatically profitable to vectorizer, and LoopVectorize would still vectorize it if it thinks it is beneficial without the metadata, which currently also only applies to innermost loops.
>
> Also consider that Clang emits a warning when LoopVectorizer does not apply on a loop with "llvm.loop.vectorize.enable" set to true. Users using Polly would get a lot such warnings.
>
> What are the long-term plans? Atm it is only okay-ish because this behaviour is disabled by a flag.
This patch is an initial step in our long-term plan to enhance Polly’s support for the Loop Vectorizer. We are currently evaluating various representative workloads with this patch to identify any gaps, such as instances where Polly is causing the Loop Vectorizer to vectorize unprofitable loops. We are using performance and loop coverage metrics for this evaluation. Ultimately, we aim to implement more constraints on Polly’s side before enabling the metadata that forces vectorization, rather than applying it to all loops created by Polly as we do now.
https://github.com/llvm/llvm-project/pull/113994
More information about the llvm-commits
mailing list