[PATCH] D67253: clang-misexpect: a standalone tool for verifying the use of __builtin_expect with PGO data
Paul Kirth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 14 20:48:42 PDT 2019
paulkirth updated this revision to Diff 220239.
paulkirth added a comment.
Addresses problems running the standalone tool w/ the libTooling executors.
When using the CodeGenAction and setting LLVM backend options, I found several places where data races occurred. This seems like a more significant architectural issue than mitigating access to a few global variables. To avoid these issues I've locked the executor concurrency to 1, i.e. single threaded. This prevents any data races when the executor is configuring the backends for each compiler invocation.
I've included a python script based on the run-clang-tidy.py that tidy uses. This allows the standalone tool to take advantage of parallellism without running into the data races between threads.
I have also added a new checking mechanism to ensure that PGO profiles and the command line options are compatible.
Lastly, I've included new documentation and tests for the standalone tool.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67253/new/
https://reviews.llvm.org/D67253
Files:
clang-tools-extra/CMakeLists.txt
clang-tools-extra/clang-misexpect/CMakeLists.txt
clang-tools-extra/clang-misexpect/ClangMisExpect.cpp
clang-tools-extra/clang-misexpect/ClangMisExpect.h
clang-tools-extra/clang-misexpect/tool/CMakeLists.txt
clang-tools-extra/clang-misexpect/tool/ClangMisExpectMain.cpp
clang-tools-extra/clang-misexpect/tool/run-clang-misexpect.py
clang-tools-extra/docs/clang-misexpect.rst
clang-tools-extra/test/CMakeLists.txt
clang-tools-extra/test/clang-misexpect/Inputs/basic.proftext
clang-tools-extra/test/clang-misexpect/Inputs/clean.c
clang-tools-extra/test/clang-misexpect/basic.cpp
clang-tools-extra/test/lit.cfg.py
clang/cmake/caches/Fuchsia-stage2.cmake
clang/test/Profile/misexpect-switch-nonconst.c
llvm/lib/Transforms/Utils/MisExpect.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67253.220239.patch
Type: text/x-patch
Size: 40034 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190915/9ba29b6a/attachment-0001.bin>
More information about the cfe-commits
mailing list