summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Do not cache out on some shared implicit AST nodesGabor Horvath2019-12-118-18/+64
| | | | | | | | | | | Some AST nodes which stands for implicit initialization is shared. The analyzer will do the same evaluation on the same nodes resulting in the same state. The analyzer will "cache out", i.e. it thinks that it visited an already existing node in the exploded graph. This is not true in this case and we lose coverage. Since these nodes do not really require any processing from the analyzer we just omit them from the CFG. Differential Revision: https://reviews.llvm.org/D71371
* [AArch64][x86] add tests for possible infinite loops in DAGCombiner; NFCSanjay Patel2019-12-112-5/+65
| | | | | | | This is a reduction of a test that failed (infinite looped) with rGd1f0bdf2d2df (subsequently reverted). I've duplicated it for 2 targets to increase coverage - everything down here is wobbly.
* Revert "[clang][clang-scan-deps] Aggregate the full dependency information."Michael Spencer2019-12-118-648/+155
| | | | | | This reverts commit f978ea498309adaebab8fbf1cd6e520e7e0e11f1. It broke clang-ppc64be-linux, but not sure why yet.
* Revert "[DWARF] Allow cross-CU references of subprogram definitions"Vedant Kumar2019-12-115-249/+7
| | | | | | | | | This reverts commit 30038da15b18ac4e34b9ea7a648382ae481e4770. It causes the stage2 thinLTO bot to fail with: Assertion failed: (CU.getDIE(CalleeSP) && "Expected declaration subprogram DIE for callee") rdar://57840415
* [OpenMP] Use the OpenMP-IR-BuilderJohannes Doerfert2019-12-1111-4/+73
| | | | | | | | | | | | | | | This is a follow up patch to use the OpenMP-IR-Builder, as discussed on the mailing list ([1] and later) and at the US Dev Meeting'19. [1] http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/2019-May/000197.html Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim Subscribers: ppenzin, penzn, llvm-commits, cfe-commits, jfb, guansong, bollu, hiraditya, mgorny Tags: #clang Differential Revision: https://reviews.llvm.org/D69922
* [clang][clang-scan-deps] Aggregate the full dependency information.Michael Spencer2019-12-118-155/+648
| | | | Differential Revision: https://reviews.llvm.org/D70268
* [lit] Improve formatting of error messages. NFCJulian Lettner2019-12-112-10/+10
|
* [lldb/CMake] Simplify linking against cursesJonas Devlieghere2019-12-112-9/+5
| | | | | | Centralize the logic to determine what libraries to link against for curses in the CMake file where it is actually being used. Use target_include_directories instead of include_directories.
* Suppress false-positive -Wuninitialized warnings in the constructor of aRichard Smith2019-12-112-1/+10
| | | | templated but non-template class.
* Don't call export_symbols.py with duplicate libsDavid Tenty2019-12-111-0/+1
| | | | | | | | | | | | | | | | Summary: export_symbols.py discards duplicate symbols, assuming they have public definitions, so if we end up calling it with duplicate libraries we will end up with an inaccurate export list. Reviewers: jasonliu, stevewan, john.brawn Reviewed By: john.brawn Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70918
* [lldb/Host] Use Host/Config.h for LibXML2 instead of a global defineJonas Devlieghere2019-12-114-34/+38
| | | | | Rename LIBXML2_DEFINED to LLDB_ENABLE_LIBXML2 and pass it through Config.h instead of a global define.
* [lldb][dotest] Add `#include <algorithm>` to libc++ detectionJordan Rupprecht2019-12-111-1/+1
| | | | | | | | | | | | Summary: Speculative fix after 34ef51b5f979 broke the lldb buildbot on libc++ tests. Reviewers: echristo, EricWF Subscribers: ldionne, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71376
* Fix detection of __attribute__((may_alias)) to properly look throughRichard Smith2019-12-112-8/+34
| | | | | | | type sugar. We previously missed the attribute in a lot of cases in C++, because there's often other type sugar there (eg, ElaboratedType).
* Revert "[SDAG] remove use restriction in isNegatibleForFree() when called ↵Sanjay Patel2019-12-116-72/+20
| | | | | | | from getNegatedExpression()" This reverts commit d1f0bdf2d2df9bdf11ee2ddfff3df50e53f2f042. The patch can cause infinite loops in DAGCombiner.
* [lldb][dotest] Improve libc++ detectionJordan Rupprecht2019-12-111-3/+10
| | | | | | | | | | | | Summary: The test logic for running libc++ tests only looks to see if `/usr/include/c++/v1` exists. This adds a fallback for including libc++ tests as long as `$(CC) -stdlib=libc++` works. Reviewers: labath, EricWF Subscribers: ldionne, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D71319
* [libc++] Fix fuzzing tests with older GCC compilers.Eric Fiselier2019-12-111-7/+17
| | | | | GCC 5 doesn't support `if constexpr`, so we need to do old-style tag dispatching.
* Add resurrecting Type Validators to projects.rstAdrian Prantl2019-12-111-0/+9
|
* [libc++] Fix fuzzing unit tests with exceptions disabled.Eric Fiselier2019-12-111-0/+6
| | | | We simply turn off the parts of the tests that require exceptions.
* [OPENMP50]Add if clause in teams distribute parallel for simd directive.Alexey Bataev2019-12-115-18/+50
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* [TSan] Pacify flaky test on DarwinJulian Lettner2019-12-111-7/+18
| | | | | | | | | | | This flaky test that I added really gives our CI a lot of headaches. Although I was never able to reproduce this locally, it sporadically hangs/fails on our bots. I decided to silently pass the test whenever we are unable to setup the proper test condition after 10 retries. This is of course suboptimal and a last recourse. Please let me know if you know how to test this better. rdar://57844626
* [LegalizeTypes] In SoftenFloatRes_FP_EXTEND, move the check for input ↵Craig Topper2019-12-111-9/+8
| | | | | | | | | already being promoted above the check for fp16 converting to something other than fp32. The fp16 to larger than fp32 inserts an extend that need to re-legalized if fp16 is promoted. But if we check for fp16 promotion first, then we can avoid emiting the fp_extend all together.
* [libc++] Add fuzzing tests for parts of <random>.Eric Fiselier2019-12-1138-587/+547
| | | | | This patch also re-names the existing fuzzing unit tests so they actually run.
* [ADT] Fix SmallDenseMap assertion with large InlineBucketsNikita Popov2019-12-112-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue encountered in D56362, where I tried to use a SmallSetVector<Instruction*, 128> with an excessively large number of inline elements. This triggers an "Must allocate more buckets than are inline" assertion inside allocateBuckets() under certain usage patterns. The issue is as follows: The grow() method is used either to grow the map, or to rehash it and remove tombstones. The latter is done if the fraction of empty (non-used, non-tombstone) elements is below 1/8. In this case grow() is invoked with the current number of buckets. This is currently incorrectly handled for dense maps using the small rep. The current implementation will switch them over to the large rep, which violates the invariant that the large rep is only used if there are more than InlineBuckets buckets. This patch fixes the issue by staying in the small rep and only moving the buckets. An alternative, if we do want to switch to the large rep in this case, would be to relax the assertion in allocateBuckets(). Differential Revision: https://reviews.llvm.org/D56455
* [OpenMP] Introduce the OpenMP-IR-BuilderJohannes Doerfert2019-12-119-1/+808
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the initial patch for the OpenMP-IR-Builder, as discussed on the mailing list ([1] and later) and at the US Dev Meeting'19. The design is similar to D61953 but: - in a non-WIP status, with proper documentation and working. - using a OpenMPKinds.def file to manage lists of directives, runtime functions, types, ..., similar to the current Clang implementation. - restricted to handle only (simple) barriers, to implement most `#pragma omp barrier` directives and most implicit barriers. - properly hooked into Clang to be used if possible (D69922). - compatible with the remaining code generation. Parts have been extracted into D69853. The plan is to have multiple people working on moving logic from Clang here once the initial scaffolding (=this patch) landed. [1] http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/2019-May/000197.html Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim Subscribers: mgorny, hiraditya, bollu, guansong, jfb, cfe-commits, llvm-commits, penzn, ppenzin Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D69785
* return-object-by-reference ("non trivial") xfail on arm64 in TestTrivialABI.pyJason Molenda2019-12-113-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't think this test case can be handled correctly on AAPCS64. The ABI says that the caller passes the address of the return object in x8. x8 is a caller-spilled (aka "volatile") register, and the function is not required to preserve x8 or to copy the address back into x8 on function exit like the SysV x86_64 ABI does with rax. (from aapcs64: "there is no requirement for the callee to preserve the value stored in x8") From my quick reading of ABISysV_arm64, I worry that it may actually be using the value in x8 at function exit, assuming it still has the address of the return object - if (is_return_value) { // We are assuming we are decoding this immediately after returning from // a function call and that the address of the structure is in x8 reg_info = reg_ctx->GetRegisterInfoByName("x8", 0); This will work on trivial test programs / examples, but if the function does another function call, or overwrites x8 as a scratch register, lldb will provide incorrect values to the user. ABIMacOSX_arm64 doesn't do this, but it also doesn't flag the value as unavailable so we're providing incorrect values to the user all the time. I expect my fix will be to make ABIMacOSX_arm64 flag the return value as unretrievable, unless I've misread the ABI.
* [WebAssembly] Add new `export_name` clang attribute for controlling wasm ↵Sam Clegg2019-12-1121-15/+217
| | | | | | | | | | | | | | | | | | | | export names This is equivalent to the existing `import_name` and `import_module` attributes which control the import names in the final wasm binary produced by lld. This maps the existing This attribute currently requires a string rather than using the symbol name for a couple of reasons: 1. Avoid confusion with static and dynamic linking which is based on symbol name. Exporting a function from a wasm module using this directive is orthogonal to both static and dynamic linking. 2. Avoids name mangling. Differential Revision: https://reviews.llvm.org/D70520
* [InstCombine] Optimize overflow check base on uadd.with.overflow resultNikita Popov2019-12-112-14/+40
| | | | | | | | | | | | | | | | | | | | | Fix for https://bugs.llvm.org/show_bug.cgi?id=40846. This adds a combine for cases where a (a + b) < a style overflow check is performed, but with a + b being the result of uadd.with.overflow, so the overflow result is also already available and we can just use it. Subsequently GVN/CSE will deduplicate the extracts. We can run into this situation if you have both a uadd.with.overflow and a manual add + overflow check in the same function (on the same operands), in which case GVN will rewrite the add to the with.overflow result and leave you with this pattern. The implementation is a bit ugly because I'm handling the various canonicalization edge cases. This does not yet handle the negated version of this pattern. Differential Revision: https://reviews.llvm.org/D58644
* [analyzer] Escape symbols conjured into specific regions during a ↵Gabor Horvath2019-12-1111-50/+155
| | | | | | | | | | conservative EvalCall This patch introduced additional PointerEscape callbacks after conservative calls for output parameters. This should not really affect the current checkers but the upcoming FuchsiaHandleChecker relies on this heavily. Differential Revision: https://reviews.llvm.org/D71224
* [ValueTracking] Pointer is known nonnull after load/storeDanila Kutenin2019-12-117-50/+53
| | | | | | | | | | | If the pointer was loaded/stored before the null check, the check is redundant and can be removed. For now the optimizers do not remove the nullptr check, see https://gcc.godbolt.org/z/H2r5GG. The patch allows to use more nonnull constraints. Also, it found one more optimization in some PowerPC test. This is my first llvm review, I am free to any comments. Differential Revision: https://reviews.llvm.org/D71177
* [ValueTracking] Add tests for non-null check after load/store; NFCDanila Kutenin2019-12-111-17/+110
| | | | Tests for D71177.
* [analyzer] LocalizationChecker: Fix a crash on synthesized accessor stubs.Artem Dergachev2019-12-112-1/+12
| | | | | | The checker was trying to analyze the body of every method in Objective-C @implementation clause but the sythesized accessor stubs that were introduced into it by 2073dd2d have no bodies.
* [analyzer] CStringChecker: Fix overly eager assumption that memcmp args overlap.Artem Dergachev2019-12-113-14/+43
| | | | | | | | | | | | | | | | | While analyzing code `memcmp(a, NULL, n);', where `a' has an unconstrained symbolic value, the analyzer was emitting a warning about the *first* argument being a null pointer, even though we'd rather have it warn about the *second* argument. This happens because CStringChecker first checks whether the two argument buffers are in fact the same buffer, in order to take the fast path. This boils down to assuming `a == NULL' to true. Then the subsequent check for null pointer argument "discovers" that `a' is null. Don't take the fast path unless we are *sure* that the buffers are the same. Otherwise proceed as normal. Differential Revision: https://reviews.llvm.org/D71322
* [analyzer] CStringChecker: Improve warning messages.Artem Dergachev2019-12-117-50/+55
| | | | Differential Revision: https://reviews.llvm.org/D71321
* [MergeFuncs] Remove incorrect attribute copyingNikita Popov2019-12-112-22/+34
| | | | | | | | | | | | | | | Fix for https://bugs.llvm.org/show_bug.cgi?id=44236. This code was originally introduced in rG36512330041201e10f5429361bbd79b1afac1ea1. However, the attribute copying was done in the wrong place (in general call replacement, not thunk generation) and a proper fix was implemented in D12581. Previously this code was just unnecessary but harmless (because FunctionComparator ensured that the attributes of the two functions are exactly the same), but since byval was changed to accept a type this copying is actively wrong and may result in malformed IR. Differential Revision: https://reviews.llvm.org/D71173
* Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=Off builds after D65958 ↵Fangrui Song2019-12-112-2/+3
| | | | and D70450
* Add intrinsics for unary narrowing operationsAndrzej Warzynski2019-12-114-8/+242
| | | | | | | | | | | | | | | | | | | | | Summary: The following intrinsics for unary narrowing operations are added: * @llvm.aarch64.sve.sqxtnb * @llvm.aarch64.sve.uqxtnb * @llvm.aarch64.sve.sqxtunb * @llvm.aarch64.sve.sqxtnt * @llvm.aarch64.sve.uqxtnt * @llvm.aarch64.sve.sqxtunt Reviewers: sdesmalen, rengolin, efriedma Reviewed By: efriedma Subscribers: tschuett, kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71270
* [VFS] Disable check for ../foo on WindowsJonas Devlieghere2019-12-111-0/+2
| | | | | I'm not sure how .. is resolved on Windows. Disable it for now to make the bots happy again.
* [AArch64] Be more careful to skip debug operands in LdSt Optimizier.Florian Hahn2019-12-112-10/+49
| | | | This fixes crashes with $noreg operands.
* [StringRef] Test all default characters in unit testJonas Devlieghere2019-12-111-0/+4
| | | | | The default characters for trim, ltrim and rtrim are " \t\n\v\f\r" but only spaces were tested. Test that the others are trimmed as well.
* [SDAG] remove use restriction in isNegatibleForFree() when called from ↵Sanjay Patel2019-12-116-20/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | getNegatedExpression() This is an alternate fix for the bug discussed in D70595. This also includes minimal tests for other in-tree targets to show the problem more generally. We check the number of uses as a predicate for whether some value is free to negate, but that use count can change as we rewrite the expression in getNegatedExpression(). So something that was marked free to negate during the cost evaluation phase becomes not free to negate during the rewrite phase (or the inverse - something that was not free becomes free). This can lead to a crash/assert because we expect that everything in an expression that is negatible to be handled in the corresponding code within getNegatedExpression(). This patch skips the use check during the rewrite phase. So we determine that some expression isNegatibleForFree (identically to without this patch), but during the rewrite, don't rely on use counts to decide how to create the optimal expression. Differential Revision: https://reviews.llvm.org/D70975
* [OPENMP50]Fix capturing of if condition in target parallel for simdAlexey Bataev2019-12-112-5/+9
| | | | | | | | directive. Fixed capturing of the if condition if no modifer was specified in this condition. Previously could capture it only in outer region and it could lead to a compiler crash.
* [profile] Avoid allocating a page on the stack, NFCVedant Kumar2019-12-114-14/+33
| | | | | | | | | | | | | | | | | | | | | When writing out a profile, avoid allocating a page on the stack for the purpose of writing out zeroes, as some embedded environments do not have enough stack space to accomodate this. Instead, use a small, fixed-size zero buffer that can be written repeatedly. For a synthetic file with >100,000 functions, I did not measure a significant difference in profile write times. We are removing a page-length zero-fill `memset()` in favor of several smaller buffered `fwrite()` calls: in practice, I am not sure there is much of a difference. The performance impact is only expected to affect the continuous sync mode (%c) -- zero padding is less than 8 bytes in all other cases. rdar://57810014 Differential Revision: https://reviews.llvm.org/D71323
* [profile] Delete stale profiles in test/profile/instrprof-value-prof.test, NFCVedant Kumar2019-12-111-0/+1
|
* [profile] Delete stale profile in test/profile/instrprof-set-filename.c, NFCVedant Kumar2019-12-111-0/+2
|
* [VFS] Extend virtual working directory testJonas Devlieghere2019-12-111-0/+25
| | | | | Extend the virtual working directory test with a few edge cases that are not currently tested.
* [OPENMP50]Add if clause in teams distribute simd directive.Alexey Bataev2019-12-116-21/+186
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* Remove TypeValidators (NFC in terms of the testsuite)Adrian Prantl2019-12-1126-635/+14
| | | | | | | | This is a half-implemented feature that as far as we can tell was never used by anything since its original inclusion in 2014. This patch removes it to make remaining the code easier to understand. Differential Revision: https://reviews.llvm.org/D71310
* [ELF][AArch64] Rename --force-bti to -z force-bti and --pac-plt to -z pac-pltFangrui Song2019-12-117-37/+34
| | | | | | | | | | | | | | | | | | | Summary: The original design used --foo but the upstream complained that ELF only options should be -z foo. See https://sourceware.org/ml/binutils/2019-04/msg00151.html https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=8bf6d176b0a442a8091d338d4af971591d19922c made the rename. Our --force-bti and --pac-plt implement the same functionality, so it seems wise to be consistent with GNU ld. Reviewed By: peter.smith Subscribers: emaste, arichardson, kristof.beyls, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71327
* update TestThreadStepOut.py to expect correct source line on arm64.Jason Molenda2019-12-112-3/+3
|
* [DA] Improve dump to show source and sink of the dependenceBardia Mahjour2019-12-112-10/+57
| | | | | | | | | | | | | | | | | | | | Summary: The current da printer shows the dependence without indicating which instructions are being considered as the src vs dst. It also silently ignores call instructions, despite the fact that they create confused dependence edges to other memory instructions. This patch addresses these two issues plus a couple of minor non-functional improvements. Authored By: bmahjour Reviewer: dmgreen, fhahn, philip.pfaffe, chandlerc Reviewed By: dmgreen, fhahn Tags: #llvm Differential Revision: https://reviews.llvm.org/D71088
OpenPOWER on IntegriCloud