[OpenMP][libomptarget] Set the frame pointer then test empty slot condition

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

Reviewers: ABataev, caomhin, Hahnfeld

Reviewed By: ABataev

Subscribers: guansong, openmp-commits

Differential Revision: https://reviews.llvm.org/D52122

llvm-svn: 343006
This commit is contained in:
Gheorghe-Teodor Bercea 2018-09-25 18:48:14 +00:00
parent e02de05b32
commit f7256a593f
1 changed files with 3 additions and 3 deletions

View File

@ -477,13 +477,13 @@ EXTERN void __kmpc_data_sharing_pop_stack(void *FrameStart) {
// 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;