[PATCH] D153744: [LoopUnroll] adjust for new `convergent` semantics

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 00:52:56 PDT 2023


sameerds created this revision.
Herald added subscribers: zzheng, hiraditya.
Herald added a project: All.
sameerds requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Adjust the unrolling check for the new semantics:

- There is no restriction on loops with convergent operations that are controlled inside the loop -- their behavior with respect to cross-thread communication is (partially) implementation-defined, and the loop unrolling is part of the implementation, so...

- Fix unrolling with loop heart intrinsics: in a typical loop with a loop heart in the header that uses a token from outside the loop, duplicating the intrinsic would introduce multiple static uses of a convergence control token in a cycle that does not contain its definition.

Spell out the setup of UnrollLoopOptions to reduce the potential for
confusion caused by very long struct initializers.

Original implementation [D85605 <https://reviews.llvm.org/D85605>] by Nicolai Haehnle <nicolai.haehnle at amd.com>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153744

Files:
  llvm/include/llvm/Analysis/CodeMetrics.h
  llvm/include/llvm/Transforms/Utils/UnrollLoop.h
  llvm/lib/Analysis/CodeMetrics.cpp
  llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
  llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
  llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
  llvm/lib/Transforms/Utils/LoopUnroll.cpp
  llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
  llvm/test/Transforms/LoopUnroll/convergent.controlled.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153744.534453.patch
Type: text/x-patch
Size: 43947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230626/d5b63299/attachment.bin>


More information about the llvm-commits mailing list