This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][libomp] Fix register constraint for tpause and umwait
ClosedPublic

Authored by jlpeyton on Feb 24 2022, 2:16 PM.

Details

Summary

Register constraint switched to "=q" which means very specifically (from https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints)

Any register accessible as rl. In 32-bit mode, a, b, c, and d; in 64-bit mode, any integer register."

Older gcc versions (8.x and below) were trying to use esi or edi for the 8 bit flag variable, but it wound up displaying this error in the end:

kmp_lock.cpp: In function ‘void __kmp_spin_backoff(kmp_backoff_t*)’:
kmp_lock.cpp:2684:1: error: unsupported size for integer register

Hence the correct restriction is "=q" instead of "=r".

Fixes: https://github.com/llvm/llvm-project/issues/53309

Diff Detail

Event Timeline

jlpeyton created this revision.Feb 24 2022, 2:16 PM
jlpeyton requested review of this revision.Feb 24 2022, 2:16 PM
tlwilmar accepted this revision.Mar 7 2022, 9:27 AM

Looks good to me.

This revision is now accepted and ready to land.Mar 7 2022, 9:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 9:27 AM