[Attributor] Identify and remove no-op fences
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 18 May 2023 23:46:11 +0000 (16:46 -0700)
committerJohannes Doerfert <johannes@jdoerfert.de>
Tue, 6 Jun 2023 00:14:00 +0000 (17:14 -0700)
commitcb17c48fdd8c0f8ab6cd7ad3f197b052db20d1f6
treedb83bb364ca5c61147c1b9dbdc6a3e5e4b6895ab
parentd3777f20c59373a0075d0d9de3bfdc1429888879
[Attributor] Identify and remove no-op fences

The logic and implementation follows the removal of no-op barriers. If
the fence is not making updates visible, either to the world or the
current thread, it is not needed. Said differently, the fences we remove
do not establish synchronization (happens-before) edges.
This allows us to eliminate some of the regression caused by:
  https://reviews.llvm.org/D145290
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
llvm/test/Transforms/OpenMP/barrier_removal.ll
openmp/libomptarget/test/jit/empty_kernel_lvl2.c