Skip to content

Commit d2f206e

Browse files
committed
Revert "[OpenMP] Group side-effects to improve guarding efficiency"
This reverts commit ca134c3. There seems to be a problem with the tests, investigating now: https://lab.llvm.org/buildbot/#/builders/61/builds/14574
1 parent d9a8d20 commit d2f206e

File tree

2 files changed

+1
-387
lines changed

2 files changed

+1
-387
lines changed

llvm/lib/Transforms/IPO/OpenMPOpt.cpp

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3188,34 +3188,6 @@ struct AAKernelInfoFunction : AAKernelInfo {
31883188
->setDebugLoc(DL);
31893189
};
31903190

3191-
auto &AllocSharedRFI = OMPInfoCache.RFIs[OMPRTL___kmpc_alloc_shared];
3192-
SmallPtrSet<BasicBlock *, 8> Visited;
3193-
for (Instruction *GuardedI : SPMDCompatibilityTracker) {
3194-
BasicBlock *BB = GuardedI->getParent();
3195-
if (!Visited.insert(BB).second)
3196-
continue;
3197-
3198-
SmallVector<std::pair<Instruction *, Instruction *>> Reorders;
3199-
Instruction *LastEffect = nullptr;
3200-
BasicBlock::reverse_iterator IP = BB->rbegin(), IPEnd = BB->rend();
3201-
while (++IP != IPEnd) {
3202-
if (!IP->mayHaveSideEffects() && !IP->mayReadFromMemory())
3203-
continue;
3204-
Instruction *I = &*IP;
3205-
if (OpenMPOpt::getCallIfRegularCall(*I, &AllocSharedRFI))
3206-
continue;
3207-
if (!I->user_empty() || !SPMDCompatibilityTracker.contains(I)) {
3208-
LastEffect = nullptr;
3209-
continue;
3210-
}
3211-
if (LastEffect)
3212-
Reorders.push_back({I, LastEffect});
3213-
LastEffect = &*IP;
3214-
}
3215-
for (auto &Reorder : Reorders)
3216-
Reorder.first->moveBefore(Reorder.second);
3217-
}
3218-
32193191
SmallVector<std::pair<Instruction *, Instruction *>, 4> GuardedRegions;
32203192

32213193
for (Instruction *GuardedI : SPMDCompatibilityTracker) {
@@ -4270,6 +4242,7 @@ void OpenMPOpt::registerAAs(bool IsModulePass) {
42704242
DepClassTy::NONE, /* ForceUpdate */ false,
42714243
/* UpdateAfterInit */ false);
42724244

4245+
42734246
registerFoldRuntimeCall(OMPRTL___kmpc_is_generic_main_thread_id);
42744247
registerFoldRuntimeCall(OMPRTL___kmpc_is_spmd_exec_mode);
42754248
registerFoldRuntimeCall(OMPRTL___kmpc_parallel_level);

0 commit comments

Comments
 (0)