This is an archive of the discontinued LLVM Phabricator instance.

Add support for Intel's umonitor/umwait
ClosedPublic

Authored by tlwilmar on Nov 10 2020, 10:27 AM.

Details

Summary

These changes add support for Intel's umonitor/umwait usage in wait code, for architectures that support those intrinsic functions. Usage of umonitor/umwait is off by default, but can be turned on by setting the KMP_USER_LEVEL_MWAIT environment variable.

Patch by Terry Wilmarth and Johnny Peyton.

Diff Detail

Repository
rOMP OpenMP

Event Timeline

tlwilmar created this revision.Nov 10 2020, 10:27 AM
tlwilmar requested review of this revision.Nov 10 2020, 10:27 AM
This revision is now accepted and ready to land.Nov 18 2020, 1:43 PM
This revision was landed with ongoing or failed builds.Nov 19 2020, 11:04 AM
This revision was automatically updated to reflect the committed changes.

This broke compilation for me:

../runtime/src/kmp.h:1371:3: error: always_inline function '_umonitor' requires target feature 'waitpkg', but would be inlined into function '__kmp_umonitor' that is compiled without support for 'waitpkg'
  _umonitor(cacheline);
  ^ 
../runtime/src/kmp.h:1390:10: error: always_inline function '_umwait' requires target feature 'waitpkg', but would be inlined into function '__kmp_umwait' that is compiled without support for 'waitpkg'
  return _umwait(hint, counter);
         ^
2 errors generated.

This broke compilation for me:

../runtime/src/kmp.h:1371:3: error: always_inline function '_umonitor' requires target feature 'waitpkg', but would be inlined into function '__kmp_umonitor' that is compiled without support for 'waitpkg'
  _umonitor(cacheline);
  ^ 
../runtime/src/kmp.h:1390:10: error: always_inline function '_umwait' requires target feature 'waitpkg', but would be inlined into function '__kmp_umwait' that is compiled without support for 'waitpkg'
  return _umwait(hint, counter);
         ^
2 errors generated.

I reverted the commit until we fix it.

This broke compilation for me:

Which compiler/version are you using?

This broke compilation for me:

Which compiler/version are you using?

Latest nightly clang, targeting mingw.

LGTM

https://llvm.org/docs/DeveloperPolicy.html#commit-messages Please use git commit --amend --author= for future patches for proper attribution.

https://llvm.org/docs/DeveloperPolicy.html#commit-messages Please use git commit --amend --author= for future patches for proper attribution.

Will do. Thanks for the notice.

tlwilmar edited the summary of this revision. (Show Details)Nov 30 2020, 9:32 PM
tlwilmar updated this revision to Diff 308534.Nov 30 2020, 9:36 PM

Fixed build problems associated with target attribute for waitpkg.

tlwilmar reopened this revision.Nov 30 2020, 9:37 PM

Build problems associated with target attribute for waitpkg should be fixed now. Please try the new diff.

This revision is now accepted and ready to land.Nov 30 2020, 9:37 PM

Build problems associated with target attribute for waitpkg should be fixed now. Please try the new diff.

Thanks, now it does seem to build correctly in my configurations.

Sorry, I missed one thing.

openmp/runtime/src/kmp_lock.cpp
2779–2781

Change these three lines to just KMP_ATTRIBUTE_TARGET_RTM

tlwilmar updated this revision to Diff 308688.Dec 1 2020, 9:33 AM

One missed change added.

tlwilmar requested review of this revision.Dec 1 2020, 9:35 AM
tlwilmar marked an inline comment as done.
jlpeyton accepted this revision.Dec 1 2020, 10:12 AM

LGTM now.

This revision is now accepted and ready to land.Dec 1 2020, 10:12 AM
This revision was automatically updated to reflect the committed changes.