[llvm] [Clang][OpenMP] Handled `NonContig` Descriptor `DimCount` (PR #181987)

Abhinav Gaba via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 18 14:56:09 PST 2026


================
@@ -9945,16 +9945,29 @@ Error OpenMPIRBuilder::emitOffloadingArrays(
                                      ConstantInt::get(Int64Ty, 0));
   SmallBitVector RuntimeSizes(CombinedInfo.Sizes.size());
   for (unsigned I = 0, E = CombinedInfo.Sizes.size(); I < E; ++I) {
+    bool IsNonContigEntry =
+        IsNonContiguous &&
+        (static_cast<std::underlying_type_t<OpenMPOffloadMappingFlags>>(
+             CombinedInfo.Types[I] &
+             OpenMPOffloadMappingFlags::OMP_MAP_NON_CONTIG) != 0);
+    // For NON_CONTIG entries ArgSizes must carry the dimension count
----------------
abhinavgaba wrote:

Explanation of what used to happen are useful, but I think PR comments are a better place for them.

When someone is reading the code in the future, they'd want to know what the comment to explain what the code is doing at the time, not what the previous code that is no longer in the code-base, used to do.

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


More information about the llvm-commits mailing list