[llvm] [OpenMPIRBuilder] Add support for target workshare loops (PR #73360)

Dominik Adamski via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 02:47:54 PST 2023


================
@@ -2681,11 +2681,255 @@ OpenMPIRBuilder::InsertPointTy OpenMPIRBuilder::applyStaticChunkedWorkshareLoop(
   return {DispatchAfter, DispatchAfter->getFirstInsertionPt()};
 }
 
+// Returns an LLVM function to call for executing an OpenMP static worksharing
+// for loop depending on `type`. Only i32 and i64 are supported by the runtime.
+// Always interpret integers as unsigned similarly to CanonicalLoopInfo.
----------------
DominikAdamski wrote:

CanonicalLoopInfo uses only unsigned loop trip count. See documentation:

> The constraints of a canonical loop in brief are:
> - The number of loop iterations must have been computed before entering the loop.
> - Has an (unsigned) logical induction variable that starts at zero and increments by one.

Source: https://llvm.org/doxygen/classllvm_1_1CanonicalLoopInfo.html#details

https://github.com/llvm/llvm-project/pull/73360


More information about the llvm-commits mailing list