#
82904401 |
| 14-May-2020 |
Fangrui Song <maskray@google.com> |
Map -O to -O1 instead of -O2
rL82131 changed -O from -O1 to -O2, because -O1 was not different from -O2 at that time.
GCC treats -O as -O1 and there is now work to make -O1 meaningful. We can chang
Map -O to -O1 instead of -O2
rL82131 changed -O from -O1 to -O2, because -O1 was not different from -O2 at that time.
GCC treats -O as -O1 and there is now work to make -O1 meaningful. We can change -O back to -O1 again.
Reviewed By: echristo, dexonsmith, arphaman
Differential Revision: https://reviews.llvm.org/D79916
show more ...
|
#
170ac4be |
| 15-May-2020 |
Djordje Todorovic <djordje.todorovic@syrmia.com> |
[CSInfo][ISEL] Call site info generation support for Mips
Debug entry values functionality provides debug information about call sites and function parameters values at the call entry spot. Conditio
[CSInfo][ISEL] Call site info generation support for Mips
Debug entry values functionality provides debug information about call sites and function parameters values at the call entry spot. Condition for generating this type of information is compiling with -g option and optimization level higher than zero(-O0).
In ISEL phase, while lowering call instructions, collect info about registers that forward arguments into following function frame. We store such info into MachineFunction of the caller function. This is used very late, when dumping DWARF info about call site parameters.
The call site info is visible at MIR level, as callSites attribute of MachineFunction. Also, when using unmodified parameter value inside callee it could be described as DW_OP_entry_value expression. To deal with callSites attribute, we should pass -emit-call-site-info option to llc.
This patch enables functionality in clang frontend and adds call site info generation support for MIPS targets (mips, mipsel, mips64, mips64el).
Patch by Nikola Tesic
Differential Revision: https://reviews.llvm.org/D78105
show more ...
|
#
6a3469f5 |
| 06-May-2020 |
Volodymyr Sapsai <vsapsai@apple.com> |
[ObjC] Add compatibility mode for type checking of qualified id block parameters.
Commit 73152a2ec20766ac45673a129bf1f5fc97ca9bbe fixed type checking for blocks with qualified id parameters. But the
[ObjC] Add compatibility mode for type checking of qualified id block parameters.
Commit 73152a2ec20766ac45673a129bf1f5fc97ca9bbe fixed type checking for blocks with qualified id parameters. But there are existing APIs in Apple SDKs relying on the old type checking behavior. Specifically, these are APIs using NSItemProviderCompletionHandler in Foundation/NSItemProvider.h. To keep existing code working and to allow developers to use affected APIs introduce a compatibility mode that enables the previous and the fixed type checking. This mode is enabled only on Darwin platforms.
Reviewed By: jyknight, ahatanak
Differential Revision: https://reviews.llvm.org/D79511
show more ...
|
#
b56b1e67 |
| 12-May-2020 |
Fangrui Song <maskray@google.com> |
[gcov] Default coverage version to '408*' and delete CC1 option -coverage-exit-block-before-body
gcov 4.8 (r189778) moved the exit block from the last to the second. The .gcda format is compatible w
[gcov] Default coverage version to '408*' and delete CC1 option -coverage-exit-block-before-body
gcov 4.8 (r189778) moved the exit block from the last to the second. The .gcda format is compatible with 4.7 but
* decoding libgcov 4.7 produced .gcda with gcov [4.7,8) can mistake the exit block, emit bogus `%s:'%s' has arcs from exit block\n` warnings, and print wrong `" returned %s` for branch statistics (-b). * decoding libgcov 4.8 produced .gcda with gcov 4.7 has similar issues.
Also, rename "return block" to "exit block" because the latter is the appropriate term.
show more ...
|
#
379e68a7 |
| 11-May-2020 |
Zola Bridges <zbrid@google.com> |
[clang][SLH] Add __has_feature(speculative_load_hardening)
SLH doesn't support asm goto and is unlikely to ever support it. Users of asm goto need a way to choose whether to use asm goto or fallback
[clang][SLH] Add __has_feature(speculative_load_hardening)
SLH doesn't support asm goto and is unlikely to ever support it. Users of asm goto need a way to choose whether to use asm goto or fallback to an SLH compatible code path when SLH is enabled. This feature flag will give users this ability.
Tested via unit test
Reviewed By: mattdr
Differential Revision: https://reviews.llvm.org/D79733
show more ...
|
#
01dc694c |
| 11-May-2020 |
Melanie Blower <melanie.blower@intel.com> |
FP LangOpts should not be dependent on CGOpt This bug was observed by Apple since their compiler processes LangOpts and CGOpts in a different order.
Reviewed By: rjmccall
Differential Revision: htt
FP LangOpts should not be dependent on CGOpt This bug was observed by Apple since their compiler processes LangOpts and CGOpts in a different order.
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D79735
show more ...
|
#
10658691 |
| 11-May-2020 |
Florian Hahn <flo@fhahn.com> |
[Matrix] Add matrix type to Clang.
This patch adds a matrix type to Clang as described in the draft specification in clang/docs/MatrixSupport.rst. It introduces a new option -fenable-matrix, which c
[Matrix] Add matrix type to Clang.
This patch adds a matrix type to Clang as described in the draft specification in clang/docs/MatrixSupport.rst. It introduces a new option -fenable-matrix, which can be used to enable the matrix support.
The patch adds new MatrixType and DependentSizedMatrixType types along with the plumbing required. Loads of and stores to pointers to matrix values are lowered to memory operations on 1-D IR arrays. After loading, the loaded values are cast to a vector. This ensures matrix values use the alignment of the element type, instead of LLVM's large vector alignment.
The operators and builtins described in the draft spec will will be added in follow-up patches.
Reviewers: martong, rsmith, Bigcheese, anemet, dexonsmith, rjmccall, aaron.ballman
Reviewed By: rjmccall
Differential Revision: https://reviews.llvm.org/D72281
show more ...
|
#
8222107a |
| 08-May-2020 |
Haojian Wu <hokein.wu@gmail.com> |
[AST] Preserve the type in RecoveryExprs for broken function calls.
RecoveryExprs are modeled as dependent type to prevent bogus diagnostics and crashes in clang.
This patch allows to preseve the t
[AST] Preserve the type in RecoveryExprs for broken function calls.
RecoveryExprs are modeled as dependent type to prevent bogus diagnostics and crashes in clang.
This patch allows to preseve the type for broken calls when the RecoveryEprs have a known type, e.g. a broken non-overloaded call, a overloaded call when the all candidates have the same return type, so that more features (code completion still work on "take2args(x).^") still work.
However, adding the type is risky, which may result in more clang code being affected leading to new crashes and hurt diagnostic, and it requires large effort to minimize the affect (update all sites in clang to handle errorDepend case), so we add a new flag (off by default) to allow us to develop/test them incrementally.
This patch also has some trivial fixes to suppress diagnostics (to prevent regressions).
Tested:
all existing tests are passed (when both "-frecovery-ast", "-frecovery-ast-type" flags are flipped on);
Reviewed By: sammccall
Subscribers: rsmith, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79160
show more ...
|
#
25544ce2 |
| 10-May-2020 |
Fangrui Song <maskray@google.com> |
[gcov] Default coverage version to '407*' and delete CC1 option -coverage-cfg-checksum
Defaulting to -Xclang -coverage-version='407*' makes .gcno/.gcda compatible with gcov [4.7,8)
In addition, del
[gcov] Default coverage version to '407*' and delete CC1 option -coverage-cfg-checksum
Defaulting to -Xclang -coverage-version='407*' makes .gcno/.gcda compatible with gcov [4.7,8)
In addition, delete clang::CodeGenOptionsBase::CoverageExtraChecksum and GCOVOptions::UseCfgChecksum. We can infer the information from the version.
With this change, .gcda files produced by `clang --coverage a.o` linked executable can be read by gcov 4.7~7. We don't need other -Xclang -coverage* options. There may be a mismatching version warning, though.
(Note, GCC r173147 "split checksum into cfg checksum and line checksum" made gcov 4.7 incompatible with previous versions.)
show more ...
|
#
13a633b4 |
| 10-May-2020 |
Fangrui Song <maskray@google.com> |
[gcov] Delete CC1 option -coverage-no-function-names-in-data
rL144865 incorrectly wrote function names for GCOV_TAG_FUNCTION (this might be part of the reasons the header says "We emit files in a co
[gcov] Delete CC1 option -coverage-no-function-names-in-data
rL144865 incorrectly wrote function names for GCOV_TAG_FUNCTION (this might be part of the reasons the header says "We emit files in a corrupt version of GCOV's "gcda" file format").
rL176173 and rL177475 realized the problem and introduced -coverage-no-function-names-in-data to work around the issue. (However, the description is wrong. libgcov never writes function names, even before GCC 4.2).
In reality, the linker command line has to look like:
clang --coverage -Xclang -coverage-version='407*' -Xclang -coverage-cfg-checksum -Xclang -coverage-no-function-names-in-data
Failing to pass -coverage-no-function-names-in-data can make gcov 4.7~7 either produce wrong results (for one gcov-4.9 program, I see "No executable lines") or segfault (gcov-7). (gcov-8 uses an incompatible format.)
This patch deletes -coverage-no-function-names-in-data and the related function names support from libclang_rt.profile
show more ...
|
#
e8147ad8 |
| 08-May-2020 |
Sriraman Tallam <tmsriram@google.com> |
Uniuqe Names for Internal Linkage Symbols.
This is a standalone patch and this would help Propeller do a better job of code layout as it can accurately attribute the profiles to the right internal l
Uniuqe Names for Internal Linkage Symbols.
This is a standalone patch and this would help Propeller do a better job of code layout as it can accurately attribute the profiles to the right internal linkage function.
This also helps SampledFDO/AutoFDO correctly associate sampled profiles to the right internal function. Currently, if there is more than one internal symbol foo, their profiles are aggregated by SampledFDO.
This patch adds a new clang option, -funique-internal-funcnames, to generate unique names for functions with internal linkage. This patch appends the md5 hash of the module name to the function symbol as a best effort to generate a unique name for symbols with internal linkage.
Differential Revision: https://reviews.llvm.org/D73307
show more ...
|
#
c355bec7 |
| 04-May-2020 |
Melanie Blower <melanie.blower@intel.com> |
Add support for #pragma clang fp reassociate(on|off)
Reviewers: rjmccall, erichkeane, sepavloff
Differential Revision: https://reviews.llvm.org/D78827
|
#
f5360d4b |
| 01-May-2020 |
Melanie Blower <melanie.blower@intel.com> |
Reapply "Add support for #pragma float_control" with buildbot fixes Add support for #pragma float_control
Reviewers: rjmccall, erichkeane, sepavloff
Differential Revision: https://reviews.llvm.org/
Reapply "Add support for #pragma float_control" with buildbot fixes Add support for #pragma float_control
Reviewers: rjmccall, erichkeane, sepavloff
Differential Revision: https://reviews.llvm.org/D72841
This reverts commit fce82c0ed310174fe48e2402ac731b6340098389.
show more ...
|
#
fce82c0e |
| 01-May-2020 |
Melanie Blower <melanie.blower@intel.com> |
Revert "Reapply "Add support for #pragma float_control" with improvements to"
This reverts commit 69aacaf699922ffe0450f567e21208c10c84731f.
|
#
69aacaf6 |
| 01-May-2020 |
Melanie Blower <melanie.blower@intel.com> |
Reapply "Add support for #pragma float_control" with improvements to test cases Add support for #pragma float_control
Reviewers: rjmccall, erichkeane, sepavloff
Differential Revision: https://revie
Reapply "Add support for #pragma float_control" with improvements to test cases Add support for #pragma float_control
Reviewers: rjmccall, erichkeane, sepavloff
Differential Revision: https://reviews.llvm.org/D72841
This reverts commit 85dc033caccaa6ab919d57f9759290be41240146, and makes corrections to the test cases that failed on buildbots.
show more ...
|
#
85dc033c |
| 01-May-2020 |
Melanie Blower <melanie.blower@intel.com> |
Revert "Add support for #pragma float_control"
This reverts commit 4f1e9a17e9d28bdfd035313c96b3a5d4c91a7733. due to fail on buildbot, sorry for the noise
|
#
4f1e9a17 |
| 27-Apr-2020 |
Melanie Blower <melanie.blower@intel.com> |
Add support for #pragma float_control
Reviewers: rjmccall, erichkeane, sepavloff
Differential Revision: https://reviews.llvm.org/D72841
|
#
96717125 |
| 27-Apr-2020 |
Dmitri Gribenko <gribozavr@gmail.com> |
Revert "[analyzer] On-demand parsing capability for CTU"
This reverts commit 811c0c9eb462d1fef6ab6908aab7881e5c4f5fbf. It broke multiple buildbots.
|
#
811c0c9e |
| 27-Apr-2020 |
Endre Fülöp <endre.fulop@sigmatechnology.se> |
[analyzer] On-demand parsing capability for CTU
Summary: Add an option to enable on-demand parsing of needed ASTs during CTU analysis. Two options are introduced. CTUOnDemandParsing enables the feat
[analyzer] On-demand parsing capability for CTU
Summary: Add an option to enable on-demand parsing of needed ASTs during CTU analysis. Two options are introduced. CTUOnDemandParsing enables the feature, and CTUOnDemandParsingDatabase specifies the path to a compilation database, which has all the necessary information to generate the ASTs.
Reviewers: martong, balazske, Szelethus, xazax.hun
Subscribers: ormris, mgorny, whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, steakhal, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75665
show more ...
|
#
8d45d6e3 |
| 22-Apr-2020 |
Fangrui Song <maskray@google.com> |
[Frontend] Drop unneeded CC1 options
|
#
4ca2cad9 |
| 21-Apr-2020 |
Justin Hibbits <jrh29@alumni.cwru.edu> |
[PowerPC] Add clang -msvr4-struct-return for 32-bit ELF
Summary:
Change the default ABI to be compatible with GCC. For 32-bit ELF targets other than Linux, Clang now returns small structs in regis
[PowerPC] Add clang -msvr4-struct-return for 32-bit ELF
Summary:
Change the default ABI to be compatible with GCC. For 32-bit ELF targets other than Linux, Clang now returns small structs in registers r3/r4. This affects FreeBSD, NetBSD, OpenBSD. There is no change for 32-bit Linux, where Clang continues to return all structs in memory.
Add clang options -maix-struct-return (to return structs in memory) and -msvr4-struct-return (to return structs in registers) to be compatible with gcc. These options are only for PPC32; reject them on PPC64 and other targets. The options are like -fpcc-struct-return and -freg-struct-return for X86_32, and use similar code.
To actually return a struct in registers, coerce it to an integer of the same size. LLVM may optimize the code to remove unnecessary accesses to memory, and will return i32 in r3 or i64 in r3:r4.
Fixes PR#40736
Patch by George Koehler!
Reviewed By: jhibbits, nemanjai Differential Revision: https://reviews.llvm.org/D73290
show more ...
|
#
6a308943 |
| 21-Apr-2020 |
Aaron Ballman <aaron@aaronballman.com> |
C++2a -> C++20 in some identifiers; NFC.
|
#
bef187c7 |
| 10-Apr-2020 |
Matt Morehouse <mascasa@google.com> |
Implement `-fsanitize-coverage-whitelist` and `-fsanitize-coverage-blacklist` for clang
Summary: This commit adds two command-line options to clang. These options let the user decide which functions
Implement `-fsanitize-coverage-whitelist` and `-fsanitize-coverage-blacklist` for clang
Summary: This commit adds two command-line options to clang. These options let the user decide which functions will receive SanitizerCoverage instrumentation. This is most useful in the libFuzzer use case, where it enables targeted coverage-guided fuzzing.
Patch by Yannis Juglaret of DGA-MI, Rennes, France
libFuzzer tests its target against an evolving corpus, and relies on SanitizerCoverage instrumentation to collect the code coverage information that drives corpus evolution. Currently, libFuzzer collects such information for all functions of the target under test, and adds to the corpus every mutated sample that finds a new code coverage path in any function of the target. We propose instead to let the user specify which functions' code coverage information is relevant for building the upcoming fuzzing campaign's corpus. To this end, we add two new command line options for clang, enabling targeted coverage-guided fuzzing with libFuzzer. We see targeted coverage guided fuzzing as a simple way to leverage libFuzzer for big targets with thousands of functions or multiple dependencies. We publish this patch as work from DGA-MI of Rennes, France, with proper authorization from the hierarchy.
Targeted coverage-guided fuzzing can accelerate bug finding for two reasons. First, the compiler will avoid costly instrumentation for non-relevant functions, accelerating fuzzer execution for each call to any of these functions. Second, the built fuzzer will produce and use a more accurate corpus, because it will not keep the samples that find new coverage paths in non-relevant functions.
The two new command line options are `-fsanitize-coverage-whitelist` and `-fsanitize-coverage-blacklist`. They accept files in the same format as the existing `-fsanitize-blacklist` option <https://clang.llvm.org/docs/SanitizerSpecialCaseList.html#format>. The new options influence SanitizerCoverage so that it will only instrument a subset of the functions in the target. We explain these options in detail in `clang/docs/SanitizerCoverage.rst`.
Consider now the woff2 fuzzing example from the libFuzzer tutorial <https://github.com/google/fuzzer-test-suite/blob/master/tutorial/libFuzzerTutorial.md>. We are aware that we cannot conclude much from this example because mutating compressed data is generally a bad idea, but let us use it anyway as an illustration for its simplicity. Let us use an empty blacklist together with one of the three following whitelists:
``` # (a) src:* fun:*
# (b) src:SRC/* fun:*
# (c) src:SRC/src/woff2_dec.cc fun:* ```
Running the built fuzzers shows how many instrumentation points the compiler adds, the fuzzer will output //XXX PCs//. Whitelist (a) is the instrument-everything whitelist, it produces 11912 instrumentation points. Whitelist (b) focuses coverage to instrument woff2 source code only, ignoring the dependency code for brotli (de)compression; it produces 3984 instrumented instrumentation points. Whitelist (c) focuses coverage to only instrument functions in the main file that deals with WOFF2 to TTF conversion, resulting in 1056 instrumentation points.
For experimentation purposes, we ran each fuzzer approximately 100 times, single process, with the initial corpus provided in the tutorial. We let the fuzzer run until it either found the heap buffer overflow or went out of memory. On this simple example, whitelists (b) and (c) found the heap buffer overflow more reliably and 5x faster than whitelist (a). The average execution times when finding the heap buffer overflow were as follows: (a) 904 s, (b) 156 s, and (c) 176 s.
We explain these results by the fact that WOFF2 to TTF conversion calls the brotli decompression algorithm's functions, which are mostly irrelevant for finding bugs in WOFF2 font reconstruction but nevertheless instrumented and used by whitelist (a) to guide fuzzing. This results in longer execution time for these functions and a partially irrelevant corpus. Contrary to whitelist (a), whitelists (b) and (c) will execute brotli-related functions without instrumentation overhead, and ignore new code paths found in them. This results in faster bug finding for WOFF2 font reconstruction.
The results for whitelist (b) are similar to the ones for whitelist (c). Indeed, WOFF2 to TTF conversion calls functions that are mostly located in SRC/src/woff2_dec.cc. The 2892 extra instrumentation points allowed by whitelist (b) do not tamper with bug finding, even though they are mostly irrelevant, simply because most of these functions do not get called. We get a slightly faster average time for bug finding with whitelist (b), which might indicate that some of the extra instrumentation points are actually relevant, or might just be random noise.
Reviewers: kcc, morehouse, vitalybuka
Reviewed By: morehouse, vitalybuka
Subscribers: pratyai, vitalybuka, eternalsakura, xwlin222, dende, srhines, kubamracek, #sanitizers, lebedev.ri, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D63616
show more ...
|
#
ced398fd |
| 09-Apr-2020 |
Pratyai Mazumder <feynmanthecurious@gmail.com> |
[SanitizerCoverage] Add -fsanitize-coverage=inline-bool-flag
Reviewers: kcc, vitalybuka
Reviewed By: vitalybuka
Subscribers: cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https:/
[SanitizerCoverage] Add -fsanitize-coverage=inline-bool-flag
Reviewers: kcc, vitalybuka
Reviewed By: vitalybuka
Subscribers: cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77637
show more ...
|
#
c7ff5b38 |
| 26-Mar-2020 |
Serge Pavlov <sepavloff@gmail.com> |
[FPEnv] Use single enum to represent rounding mode
Now compiler defines 5 sets of constants to represent rounding mode. These are:
1. `llvm::APFloatBase::roundingMode`. It specifies all 5 rounding
[FPEnv] Use single enum to represent rounding mode
Now compiler defines 5 sets of constants to represent rounding mode. These are:
1. `llvm::APFloatBase::roundingMode`. It specifies all 5 rounding modes defined by IEEE-754 and is used in `APFloat` implementation.
2. `clang::LangOptions::FPRoundingModeKind`. It specifies 4 of 5 IEEE-754 rounding modes and a special value for dynamic rounding mode. It is used in clang frontend.
3. `llvm::fp::RoundingMode`. Defines the same values as `clang::LangOptions::FPRoundingModeKind` but in different order. It is used to specify rounding mode in in IR and functions that operate IR.
4. Rounding mode representation used by `FLT_ROUNDS` (C11, 5.2.4.2.2p7). Besides constants for rounding mode it also uses a special value to indicate error. It is convenient to use in intrinsic functions, as it represents platform-independent representation for rounding mode. In this role it is used in some pending patches.
5. Values like `FE_DOWNWARD` and other, which specify rounding mode in library calls `fesetround` and `fegetround`. Often they represent bits of some control register, so they are target-dependent. The same names (not values) and a special name `FE_DYNAMIC` are used in `#pragma STDC FENV_ROUND`.
The first 4 sets of constants are target independent and could have the same numerical representation. It would simplify conversion between the representations. Also now `clang::LangOptions::FPRoundingModeKind` and `llvm::fp::RoundingMode` do not contain the value for IEEE-754 rounding direction `roundTiesToAway`, although it is supported natively on some targets.
This change defines all the rounding mode type via one `llvm::RoundingMode`, which also contains rounding mode for IEEE rounding direction `roundTiesToAway`.
Differential Revision: https://reviews.llvm.org/D77379
show more ...
|