Skip to content

Commit 70e1552

Browse files
committed
plugin_interface_issue_fix
1 parent 57bd313 commit 70e1552

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8551,8 +8551,15 @@ class MappableExprsHandler {
85518551
// If there is an entry in PartialStruct it means we have a struct with
85528552
// individual members mapped. Emit an extra combined entry.
85538553
if (PartialStruct.Base.isValid()) {
8554-
UnionCurInfo.NonContigInfo.Dims.push_back(0);
8555-
// Emit a combined entry:
8554+
// Prepend a synthetic dimension of length 1 to represent the
8555+
// aggregated struct object. Using 1 (not 0, as 0 produced an
8556+
// incorrect non-contiguous descriptor (DimSize==1), causing the
8557+
// non-contiguous motion clause path to be skipped.) is important:
8558+
// * It preserves the correct rank so targetDataUpdate() computes
8559+
// DimSize == 2 for cases like strided array sections originating
8560+
// from user-defined mappers (e.g. test with s.data[0:8:2]).
8561+
UnionCurInfo.NonContigInfo.Dims.insert(
8562+
UnionCurInfo.NonContigInfo.Dims.begin(), 1);
85568563
emitCombinedEntry(CombinedInfo, UnionCurInfo.Types, PartialStruct,
85578564
/*IsMapThis*/ !VD, OMPBuilder, VD);
85588565
}

0 commit comments

Comments
 (0)