[all-commits] [llvm/llvm-project] aaf16b: [OpenMP] libomp: eliminate pause from atomic CAS l...

Andrey Churbanov via All-commits all-commits at lists.llvm.org
Tue Mar 9 07:30:54 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aaf16b80dd4cdeb84caae8f3785ce7e4cc7a0f69
      https://github.com/llvm/llvm-project/commit/aaf16b80dd4cdeb84caae8f3785ce7e4cc7a0f69
  Author: AndreyChurbanov <andrey.churbanov at intel.com>
  Date:   2021-03-09 (Tue, 09 Mar 2021)

  Changed paths:
    M openmp/runtime/src/kmp_atomic.cpp

  Log Message:
  -----------
  [OpenMP] libomp: eliminate pause from atomic CAS loops

For clang this change is NFC cleanup, because clang
never calls atomic functions from runtime library.

Basically, pause is good in spin-loops waiting for something.
Atomic CAS loops do not wait for anything,
each CAS failure means some other thread progressed.

Performance experiments show that the pause only causes unnecessary slowdown
on CPUs with slow pause instruction, no difference on CPUs with fast pause
instruction, removal of the pause gives lesser binary size which is good.

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




More information about the All-commits mailing list