HomePhabricator

Add -fprofile-update={atomic,prefer-atomic,single}

Authored by MaskRay on Sep 29 2020, 10:38 AM.

Description

Add -fprofile-update={atomic,prefer-atomic,single}

GCC 7 introduced -fprofile-update={atomic,prefer-atomic} (prefer-atomic is for
best efforts (some targets do not support atomics)) to increment counters
atomically, which is exactly what we have done with -fprofile-instr-generate
(D50867) and -fprofile-arcs (b5ef137c11b1cc6ae839ee75b49233825772bdd0).
This patch adds the option to clang to surface the internal options at driver level.

GCC 7 also turned on -fprofile-update=prefer-atomic when -pthread is specified,
but it has performance regression
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89307). So we don't follow suit.

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

Details

Committed
MaskRaySep 29 2020, 10:43 AM
Differential Revision
D87737: Add -fprofile-update={atomic,prefer-atomic,single}
Parents
rG5409e4831fef: [InstCombine] adjust duplicate test for masked load; NFC
Branches
Unknown
Tags
Unknown