[Openmp-commits] [PATCH] D52122: [OpenMP][libomptarget] Set the frame pointer then test empty slot condition

Gheorghe-Teodor Bercea via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Sep 14 13:43:36 PDT 2018

gtbercea created this revision.
gtbercea added reviewers: ABataev, caomhin, Hahnfeld.
Herald added subscribers: openmp-commits, guansong.

NFC - just fixing a bug: the empty slot test was before the re-setting of the Stack pointer.

  rOMP OpenMP



Index: libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
--- libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
+++ libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
@@ -465,13 +465,13 @@
     // Pointer to next available stack.
     void *&StackP = DataSharingState.StackPtr[WID];
+    // Pop the frame.
+    StackP = FrameStart;
     // If the current slot is empty, we need to free the slot after the
     // pop.
     bool SlotEmpty = (StackP == &SlotP->Data[0]);
-    // Pop the frame.
-    StackP = FrameStart;
     if (SlotEmpty && SlotP->Prev) {
       // Before removing the slot we need to reset StackP.
       StackP = SlotP->PrevSlotStackPtr;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52122.165575.patch
Type: text/x-patch
Size: 730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20180914/73525381/attachment.bin>

More information about the Openmp-commits mailing list