Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5 |
|
#
f3587d41 |
| 20-Apr-2024 |
Vitaly Buka <vitalybuka@google.com> |
[sancov] Apply branch weights when checking counters (#89458)
It reduces instrumentation overhead by ~50%.
|
#
11019be4 |
| 19-Apr-2024 |
Vitaly Buka <vitalybuka@google.com> |
[test][sancov] Regenerate with update_test_checks (#89457)
Prepare for #89458
|
Revision tags: llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5 |
|
#
41d5033e |
| 31-May-2022 |
Nikita Popov <npopov@redhat.com> |
[IR] Enable opaque pointers by default
This enabled opaque pointers by default in LLVM. The effect of this is twofold:
* If IR that contains *neither* explicit ptr nor %T* types is passed to tool
[IR] Enable opaque pointers by default
This enabled opaque pointers by default in LLVM. The effect of this is twofold:
* If IR that contains *neither* explicit ptr nor %T* types is passed to tools, we will now use opaque pointer mode, unless -opaque-pointers=0 has been explicitly passed. * Users of LLVM as a library will now default to opaque pointers. It is possible to opt-out by calling setOpaquePointers(false) on LLVMContext.
A cmake option to toggle this default will not be provided. Frontends or other tools that want to (temporarily) keep using typed pointers should disable opaque pointers via LLVMContext.
Differential Revision: https://reviews.llvm.org/D126689
show more ...
|
Revision tags: llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3 |
|
#
86d1a0b3 |
| 05-Sep-2021 |
Arthur Eubanks <aeubanks@google.com> |
[test] Remove some legacy PM tests in llvm/test/Instrumentation
|
Revision tags: llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init |
|
#
7b789562 |
| 21-Jul-2021 |
Fangrui Song <i@maskray.me> |
[sanitizer] Place module_ctor/module_dtor in llvm.used
This removes an abuse of ELF linker behaviors while keeping Mach-O/COFF linker behaviors unchanged.
ELF: when module_ctor is in a comdat, this
[sanitizer] Place module_ctor/module_dtor in llvm.used
This removes an abuse of ELF linker behaviors while keeping Mach-O/COFF linker behaviors unchanged.
ELF: when module_ctor is in a comdat, this patch removes reliance on a linker abuse (an SHT_INIT_ARRAY in a section group retains the whole group) by using SHF_GNU_RETAIN. No linker behavior difference when module_ctor is not in a comdat.
Mach-O: module_ctor gets `N_NO_DEAD_STRIP`. No linker behavior difference because module_ctor is already referenced by a `S_MOD_INIT_FUNC_POINTERS` section (GC root).
PE/COFF: no-op. SanitizerCoverage already appends module_ctor to `llvm.used`. Other sanitizers: llvm.used for local linkage is not implemented in `TargetLoweringObjectFileCOFF::emitLinkerDirectives` (once implemented or switched to a non-local linkage, COFF can use module_ctor in comdat (i.e. generalize ELF-specific rL301586)).
There is no object file size difference.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D106246
show more ...
|
#
39248779 |
| 20-Jul-2021 |
Fangrui Song <i@maskray.me> |
[IR] Rename `comdat noduplicates` to `comdat nodeduplicate`
In the textual format, `noduplicates` means no COMDAT/section group deduplication is performed. Therefore, if both sets of sections are re
[IR] Rename `comdat noduplicates` to `comdat nodeduplicate`
In the textual format, `noduplicates` means no COMDAT/section group deduplication is performed. Therefore, if both sets of sections are retained, and they happen to define strong external symbols with the same names, there will be a duplicate definition linker error.
In PE/COFF, the selection kind lowers to `IMAGE_COMDAT_SELECT_NODUPLICATES`. The name describes the corollary instead of the immediate semantics. The name can cause confusion to other binary formats (ELF, wasm) which have implemented/ want to implement the "no deduplication" selection kind. Rename it to be clearer.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D106319
show more ...
|
Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4 |
|
#
9558456b |
| 18-Mar-2021 |
Fangrui Song <i@maskray.me> |
[SanitizerCoverage] Make __start_/__stop_ symbols extern_weak
On ELF, we place the metadata sections (`__sancov_guards`, `__sancov_cntrs`, `__sancov_bools`, `__sancov_pcs` in section groups (either
[SanitizerCoverage] Make __start_/__stop_ symbols extern_weak
On ELF, we place the metadata sections (`__sancov_guards`, `__sancov_cntrs`, `__sancov_bools`, `__sancov_pcs` in section groups (either `comdat any` or `comdat noduplicates`).
With `--gc-sections`, LLD since D96753 and GNU ld `-z start-stop-gc` may garbage collect such sections. If all `__sancov_bools` are discarded, LLD will error `error: undefined hidden symbol: __start___sancov_cntrs` (other sections are similar).
``` % cat a.c void discarded() {} % clang -fsanitize-coverage=func,trace-pc-guard -fpic -fvisibility=hidden a.c -shared -fuse-ld=lld -Wl,--gc-sections ... ld.lld: error: undefined hidden symbol: __start___sancov_guards >>> referenced by a.c >>> /tmp/a-456662.o:(sancov.module_ctor_trace_pc_guard) ```
Use the `extern_weak` linkage (lowered to undefined weak symbols) to avoid the undefined error.
Differential Revision: https://reviews.llvm.org/D98903
show more ...
|
Revision tags: llvmorg-12.0.0-rc3 |
|
#
4d63892a |
| 25-Feb-2021 |
Fangrui Song <i@maskray.me> |
[SanitizerCoverage] Drop !associated on metadata sections
In SanitizerCoverage, the metadata sections (`__sancov_guards`, `__sancov_cntrs`, `__sancov_bools`) are referenced by functions. After inli
[SanitizerCoverage] Drop !associated on metadata sections
In SanitizerCoverage, the metadata sections (`__sancov_guards`, `__sancov_cntrs`, `__sancov_bools`) are referenced by functions. After inlining, such a `__sancov_*` section can be referenced by more than one functions, but its sh_link still refers to the original function's section. (Note: a SHF_LINK_ORDER section referenced by a section other than its linked-to section violates the invariant.)
If the original function's section is discarded (e.g. LTO internalization + `ld.lld --gc-sections`), ld.lld may report a `sh_link points to discarded section` error.
This above reasoning means that `!associated` is not appropriate to be called by an inlinable function. Non-interposable functions are inline candidates, so we have to drop `!associated`. A `__sancov_pcs` is not referenced by other sections but is expected to parallel a metadata section, so we have to make sure the two sections are retained or discarded at the same time. A section group does the trick. (Note: we have a module ctor, so `getUniqueModuleId` guarantees to return a non-empty string, and `GetOrCreateFunctionComdat` guarantees to return non-null.)
For interposable functions, we could keep using `!associated`, but LTO can change the linkage to `internal` and allow such functions to be inlinable, so we have to drop `!associated`, too. To not interfere with section group resolution, we need to use the `noduplicates` variant (section group flag 0). (This allows us to get rid of the ModuleID parameter.) In -fno-pie and -fpie code (mostly dso_local), instrumented interposable functions have WeakAny/LinkOnceAny linkages, which are rare. So the section group header overload should be low.
This patch does not change the object file output for COFF (where `!associated` is ignored).
Reviewed By: morehouse, rnk, vitalybuka
Differential Revision: https://reviews.llvm.org/D97430
show more ...
|
#
5bcb199a |
| 25-Feb-2021 |
Fangrui Song <i@maskray.me> |
[test] Improve SanitizerCoverage tests
|
#
e9445765 |
| 25-Feb-2021 |
Fangrui Song <i@maskray.me> |
[test] Improve SanitizerCoverage tests on !associated and comdat
|
Revision tags: llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2 |
|
#
153df137 |
| 30-Jul-2020 |
Ilya Leoshkevich <iii@linux.ibm.com> |
[SanitizerCoverage] Fix types of __stop* and __start* symbols
If a section is supposed to hold elements of type T, then the corresponding CreateSecStartEnd()'s Ty parameter represents T*. Forwarding
[SanitizerCoverage] Fix types of __stop* and __start* symbols
If a section is supposed to hold elements of type T, then the corresponding CreateSecStartEnd()'s Ty parameter represents T*. Forwarding it to GlobalVariable constructor causes the resulting GlobalVariable's type to be T*, and its SSA value type to be T**, which is one indirection too many. This issue is mostly masked by pointer casts, however, the global variable still gets an incorrect alignment, which causes SystemZ to choose wrong instructions to access the section.
show more ...
|
Revision tags: llvmorg-11.0.0-rc1 |
|
#
9b1539be |
| 27-Jul-2020 |
Arthur Eubanks <aeubanks@google.com> |
[NewPM][Sancov] Pin RUN lines with -sancov to legacy PM
Since the NPM pass is named sancov-module, not sancov. This makes all tests under Instrumentation/SanitizerCoverage pass when -enable-new-pm i
[NewPM][Sancov] Pin RUN lines with -sancov to legacy PM
Since the NPM pass is named sancov-module, not sancov. This makes all tests under Instrumentation/SanitizerCoverage pass when -enable-new-pm is on by default.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D84687
show more ...
|
Revision tags: llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1 |
|
#
08032e71 |
| 05-May-2020 |
Pratyai Mazumder <feynmanthecurious@gmail.com> |
[SanitizerCoverage] Replace the unconditional store with a load, then a conditional store.
Reviewers: vitalybuka, kcc
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https
[SanitizerCoverage] Replace the unconditional store with a load, then a conditional store.
Reviewers: vitalybuka, kcc
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D79392
show more ...
|
#
0c61e911 |
| 14-Apr-2020 |
Pratyai Mazumder <feynmanthecurious@gmail.com> |
[SanitizerCoverage] The section name for inline-bool-flag was too long for darwin builds, so shortening it.
Summary: Following up on the comments on D77638.
Not undoing rGd6525eff5ebfa0ef1d6cd75cb9
[SanitizerCoverage] The section name for inline-bool-flag was too long for darwin builds, so shortening it.
Summary: Following up on the comments on D77638.
Not undoing rGd6525eff5ebfa0ef1d6cd75cb9b40b1881e7a707 here at the moment, since I don't know how to test mac builds. Please let me know if I should include that here too.
Reviewers: vitalybuka
Reviewed By: vitalybuka
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77889
show more ...
|
#
89e0662d |
| 12-Apr-2020 |
Eli Friedman <efriedma@quicinc.com> |
Make IRBuilder automatically set alignment on load/store/alloca.
This is equivalent in terms of LLVM IR semantics, but we want to transition away from using MaybeAlign to represent the alignment of
Make IRBuilder automatically set alignment on load/store/alloca.
This is equivalent in terms of LLVM IR semantics, but we want to transition away from using MaybeAlign to represent the alignment of these instructions.
Differential Revision: https://reviews.llvm.org/D77984
show more ...
|
#
e8d1c652 |
| 09-Apr-2020 |
Pratyai Mazumder <feynmanthecurious@gmail.com> |
[SanitizerCoverage] sancov/inline-bool-flag instrumentation.
Summary: New SanitizerCoverage feature `inline-bool-flag` which inserts an atomic store of `1` to a boolean (which is an 8bit integer in
[SanitizerCoverage] sancov/inline-bool-flag instrumentation.
Summary: New SanitizerCoverage feature `inline-bool-flag` which inserts an atomic store of `1` to a boolean (which is an 8bit integer in practice) flag on every instrumented edge.
Implementation-wise it's very similar to `inline-8bit-counters` features. So, much of wiring and test just follows the same pattern.
Reviewers: kcc, vitalybuka
Reviewed By: vitalybuka
Subscribers: llvm-commits, hiraditya, jfb, cfe-commits, #sanitizers
Tags: #clang, #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D77244
show more ...
|