Consolidate repeated `makePostTransformationMetadata` boilerplate into
two new `Loop` methods:
- `addStringLoopAttribute`: adds a string-only metadata attribute
- `addIntLoopAttribute`: adds a `{Name, ConstantInt(Value)}` metadata
attribute
Both accept optional `RemovePrefixes` to strip existing attributes
first.
Refactored call sites:
- `Loop::setLoopAlreadyUnrolled` (LoopInfo.cpp)
- `Loop::setLoopMustProgress` (LoopInfo.cpp)
- `postUnswitch` partial/injection (SimpleLoopUnswitch.cpp)
- `LoopVectorizeHints::setAlreadyVectorized`
(LoopVectorizationLegality.cpp)
This consolidation was requested by reviewers of #190258.
This patch was generated with assistance of GitHub Copilot/Claude Opus
and reviewed by a human.
155 KiB
155 KiB