[all-commits] [llvm/llvm-project] 525392: [NFC][LoopUtils] Add Loop::addStringLoopAttribute ...

Adel Ejjeh via All-commits all-commits at lists.llvm.org
Tue Apr 28 11:12:40 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 52539231c76cc08b3b8c558e0c5e38420ea18059
      https://github.com/llvm/llvm-project/commit/52539231c76cc08b3b8c558e0c5e38420ea18059
  Author: Adel Ejjeh <adel.ejjeh at amd.com>
  Date:   2026-04-28 (Tue, 28 Apr 2026)

  Changed paths:
    M llvm/include/llvm/Analysis/LoopInfo.h
    M llvm/lib/Analysis/LoopInfo.cpp
    M llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
    M llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp

  Log Message:
  -----------
  [NFC][LoopUtils] Add Loop::addStringLoopAttribute and Loop::addIntLoopAttribute (#194676)

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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list