mirror-llvm-project/polly
Karthika Devi C df1838f5d9
[Polly] Skip vectorize.enable for FP loops with dist=1 dependences (#205756)
When -polly-annotate-metadata-vectorize is active, Polly marks its
generated loops with llvm.loop.vectorize.enable=true. This is harmful
for loops with a loop-carried dependence of distance 1 that involve
floating-point operations: the Loop Vectorizer reorders FP operations
(e.g. scalar reduction like q = factor*q), producing results that differ
from the sequential scalar reference and causing correctness failures.

Two changes are made:

1. IslAst.cpp: add PollyVectorizeMetadata to the PerformParallelTest
gate so that dependence-distance computation is performed whenever
-polly-annotate-metadata-vectorize is passed, not only when
-polly-parallel or a vectorizer is active.

2. IslNodeBuilder.cpp / LoopGenerators.cpp: when a loop has a dist=1
dependence involving FP operations, omit the vectorize.enable annotation
entirely. This lets the Loop Vectorizer apply its own cost model and
legality checks decide.
2026-07-15 15:51:38 +05:30
..
ci [Polly] Forward VFS from PassBuilder for IO sandboxing (#188657) 2026-03-28 23:55:05 +01:00
cmake
docs [docs] Create utils/docs (#203962) 2026-06-24 15:12:48 -04:00
include/polly [Polly] Skip vectorize.enable for FP loops with dist=1 dependences (#205756) 2026-07-15 15:51:38 +05:30
lib [Polly] Skip vectorize.enable for FP loops with dist=1 dependences (#205756) 2026-07-15 15:51:38 +05:30
test [Polly] Skip vectorize.enable for FP loops with dist=1 dependences (#205756) 2026-07-15 15:51:38 +05:30
unittests [Polly] Disable PCH reuse for unit tests (#193209) 2026-04-21 12:43:13 +00:00
utils
www
.arclint
.gitattributes
.gitignore
CMakeLists.txt [CMake] Warn when the version of CMake is older than 3.31.0 (#204203) 2026-06-29 11:16:27 -07:00
CREDITS.txt
LICENSE.TXT
Maintainers.md
README

Polly - Polyhedral optimizations for LLVM
-----------------------------------------
http://polly.llvm.org/

Polly uses a mathematical representation, the polyhedral model, to represent and
transform loops and other control flow structures. Using an abstract
representation it is possible to reason about transformations in a more general
way and to use highly optimized linear programming libraries to figure out the
optimal loop structure. These transformations can be used to do constant
propagation through arrays, remove dead loop iterations, optimize loops for
cache locality, optimize arrays, apply advanced automatic parallelization, drive
vectorization, or they can be used to do software pipelining.