[all-commits] [llvm/llvm-project] 4c4060: [LoopUnroll][NFC] Move unroll pragma helper functi...

Adel Ejjeh via All-commits all-commits at lists.llvm.org
Fri Mar 13 09:13:58 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4c40607f758dad2beaf8a28427ee1fd48df4f408
      https://github.com/llvm/llvm-project/commit/4c40607f758dad2beaf8a28427ee1fd48df4f408
  Author: Adel Ejjeh <adel.ejjeh at amd.com>
  Date:   2026-03-13 (Fri, 13 Mar 2026)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/UnrollLoop.h
    M llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
    M llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
    M llvm/lib/Transforms/Utils/LoopUnroll.cpp

  Log Message:
  -----------
  [LoopUnroll][NFC] Move unroll pragma helper functions to LoopUnroll.cpp (#185895)

Move loop unroll pragma query helpers (`getUnrollMetadataForLoop`,
`hasUnrollFullPragma`, `hasUnrollEnablePragma`,
`hasRuntimeUnrollDisablePragma`, `unrollCountPragmaValue`) from
`LoopUnrollPass.cpp` and `LoopUnrollAndJamPass.cpp` into
`LoopUnroll.cpp`, and declare them in `UnrollLoop.h`.

These functions were duplicated as `static` helpers in both
`LoopUnrollPass.cpp` and `LoopUnrollAndJamPass.cpp`. Making them
available in `UnrollLoop.h` eliminates the duplication and allows
target-specific code (e.g. TTI implementations) to query unroll
pragma metadata when setting unrolling preferences.

This is in preparation for an upcoming AMDGPU-specific change that
enables `AllowExpensiveTripCount` for pragma-unrolled loops in
AMDGPU's `getUnrollingPreferences()` (#181241), while
discussions on changing the default behavior for all targets continue in
#181267.

No functional change.

AI disclaimer: Copilot with Claude Opus was used in code refactoring.



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