This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Merge barrier elimination into AAExecutionDomain
ClosedPublic

Authored by jdoerfert on Dec 20 2022, 11:52 PM.

Details

Summary

With this patch we track aligned barriers in AAExecutionDomain and also
delete unnecessary barriers there. This allows us to eliminate barriers
across blocks, across functions, and in the presence of complex accesses
that do not force a barrier. Further, we can use the collected
information to enable store-load forwarding in a threaded environment
(follow up patch).

Diff Detail

Event Timeline

jdoerfert created this revision.Dec 20 2022, 11:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 20 2022, 11:52 PM
jdoerfert requested review of this revision.Dec 20 2022, 11:52 PM
Herald added a project: Restricted Project. · View Herald Transcript

Run the barrier_removal.ll test also as part of the OpenMP-opt module pass.

tianshilei1992 added inline comments.Jan 14 2023, 3:11 PM
llvm/include/llvm/Transforms/IPO/Attributor.h
3335
5008–5011

No need for the two functions.

5041

It is not necessary to make it a pointer, same as AlignedBarriers.

llvm/lib/Transforms/IPO/OpenMPOpt.cpp
2533

The whole function can be avoided if they are not pointer. Wasting tiny piece of memory (if they are empty) is not a big deal.

2589

And this could be !ED.AlignedBarriers.empty()

tianshilei1992 accepted this revision.Jan 14 2023, 3:11 PM
This revision is now accepted and ready to land.Jan 14 2023, 3:11 PM

Minor things

llvm/include/llvm/Transforms/IPO/Attributor.h
167

I know this is unrelated, but probably a good chance to fix that typo

llvm/lib/Transforms/IPO/Attributor.cpp
812

To be consistent with the other dbgs()

llvm/lib/Transforms/IPO/OpenMPOpt.cpp
2907

I think. please check

This revision was landed with ongoing or failed builds.Jan 22 2023, 4:35 PM
This revision was automatically updated to reflect the committed changes.