[all-commits] [llvm/llvm-project] ac2940: [OpenMPOpt] Fix incorrect end-of-kernel barrier re...

Daniel Woodworth via All-commits all-commits at lists.llvm.org
Wed Sep 27 09:35:56 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ac29405b93d7a07cef05eadfcd13a2d602269a2c
      https://github.com/llvm/llvm-project/commit/ac29405b93d7a07cef05eadfcd13a2d602269a2c
  Author: Daniel Woodworth <daniel.woodworth at intel.com>
  Date:   2023-09-27 (Wed, 27 Sep 2023)

  Changed paths:
    M llvm/lib/Transforms/IPO/OpenMPOpt.cpp
    M llvm/test/Transforms/OpenMP/barrier_removal.ll

  Log Message:
  -----------
  [OpenMPOpt] Fix incorrect end-of-kernel barrier removal (#65670)

Barrier removal in OpenMPOpt normally removes barriers by proving that
they are redundant with barriers preceding them. However, it can't do
this with the "pseudo-barrier" at the end of kernels because that can't
be removed. Instead, it removes the barriers preceding the end of the
kernel which that end-of-kernel barrier is redundant with. However,
these barriers aren't always redundant with the end-of-kernel barrier
when loops are involved, and removing them can lead to incorrect results
in compiled code.

This change fixes this by requiring that these pre-end-of-kernel
barriers also have the kernel end as a unique successor before removing
them. It also changes the initialization of `ExitED` for kernels since
the kernel end is not an aligned barrier.




More information about the All-commits mailing list