mirror-llvm-project/polly
Fangrui Song 9a49fc244b
[LoopInfo] Replace raw loop-container accessors with semantic operations (#210653)
getBlocksVector, mutable getBlocksSet, getSubLoopsVector, and
getTopLevelLoopsVector expose LoopInfo's internal containers, so every
caller open-codes loop-nest surgery, keeps the block vector and set in
sync by hand, and freezes the representation. Replace them with two
LoopInfoBase operations:

* removeBlocksIf(LoopT &, Pred): drop matching blocks from a loop.
* takeChildrenIf(LoopT *Parent, Pred): detach and return matching
  children, clearing their parent; a null Parent means the top level.

Both preserve the relative order of what remains. Mutation inside
LoopInfoBase also lets the analysis repair derived state once per edit
and finish a multi-step edit before any query observes it, which an
accessor returning a container cannot.

For the same reason, move hasNoExitBlocks, getExitEdges, and
getUniqueLatchExitBlock onto LoopInfoBase.

Two behavior changes: SimpleLoopUnswitch's deleteDeadBlocksFromLoop runs
its per-child deletion callbacks while the forest is still consistent,
before detaching and destroying dead children; FixIrreducible's
reconnectChildLoops keeps children in their original order rather than
std::partition's.

Aided by Claude Fable 5
2026-07-21 07:01:19 +00:00
..
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] Guard ISL ast gen compute out (#201859) 2026-07-19 11:37:32 +05:30
lib [LoopInfo] Replace raw loop-container accessors with semantic operations (#210653) 2026-07-21 07:01:19 +00:00
test [Polly][test] Add missing REQUIRES line (#210578) 2026-07-19 08:31:21 +00:00
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.