summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert r342183 "[DAGCombine] Fix crash when store merging created an ↵Amara Emerson2018-09-172-1/+59
| | | | | | | | extract_subvector with invalid index."" Fixed the assertion failure. llvm-svn: 342397
* [DebugInfo] Remove redundant argument. [NFC]Jonas Devlieghere2018-09-172-21/+18
| | | | | | | Removes the redundant UnitType parameter from verifyUnitContents. I also fixed some formatting issues as I was touching the file. llvm-svn: 342396
* [ARM] Cleanup ARM CGP isSupportedValueSam Parker2018-09-172-42/+53
| | | | | | | | | | | | isSupportedValue explicitly checked and accepted many types of value, primarily for debugging reasons. Remove most of these checks and do a bit of refactoring now that the pass is more stable. This also enables ZExts to be sources, but this has very little practical benefit at the moment extend instructions will still be introduced. Differential Revision: https://reviews.llvm.org/D52080 llvm-svn: 342395
* Fix "not all control paths return a value" MSVC warning. NFCI.Simon Pilgrim2018-09-171-0/+1
| | | | llvm-svn: 342394
* [clang-tidy] fix PR37913, templated exception factory diagnosed correctlyJonas Toth2018-09-172-43/+163
| | | | | | | | | | | | | | | | | | | Summary: PR37913 documents wrong behaviour for a templated exception factory function. The check does misidentify dependent types as not derived from std::exception. The fix to this problem is to ignore dependent types, the analysis works correctly on the instantiated function. Reviewers: aaron.ballman, alexfh, hokein, ilya-biryukov Reviewed By: alexfh Subscribers: lebedev.ri, nemanjai, mgorny, kbarton, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D48714 llvm-svn: 342393
* [ARM] Disallow icmp with negative imm and overflowSam Parker2018-09-172-0/+33
| | | | | | | | | | We allow overflowing instructions if they're decreasing and only used by an unsigned compare. Add the extra condition that the icmp cannot be using a negative immediate. Differential Revision: https://reviews.llvm.org/D52102 llvm-svn: 342392
* [UBSan] Partially fix `test/ubsan/TestCases/Misc/log-path_test.cc` so that ↵Dan Liew2018-09-173-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it can run on devices. Summary: In order for this test to work the log file needs to be removed from both from the host and device. To fix this the `rm` `RUN` lines have been replaced with `RUN: rm` followed by `RUN: %device_rm`. Initially I tried having it so that `RUN: %run rm` implicitly runs `rm` on the host as well so that only one `RUN` line is needed. This simplified writing the test however that had two large drawbacks. * It's potentially very confusing (e.g. for use of the device scripts outside of the lit tests) if asking for `rm` to run on device also causes files on the host to be deleted. * This doesn't work well with the glob patterns used in the test. The host shell expands the `%t.log.*` glob pattern and not on the device so we could easily miss deleting old log files from previous test runs if the corresponding file doesn't exist on the host. So instead deletion of files on the device and host are explicitly separate commands. The command to delete files from a device is provided by a new substitution `%device_rm` as suggested by Filipe Cabecinhas. The semantics of `%device_rm` are that: * It provides a way remove files from a target device when the host is not the same as the target. In the case that the host and target are the same it is a no-op. * It interprets shell glob patterns in the context of the device file system instead of the host file system. This solves the globbing problem provided the argument is quoted so that lit's underlying shell doesn't try to expand the glob pattern. * It supports the `-r` and `-f` flags of the `rm` command, with the same semantics. Right now an implementation of `%device_rm` is provided only for ios devices. For all other devices a lit warning is emitted and the `%device_rm` is treated as a no-op. This done to avoid changing the behaviour for other device types but leaves room for others to implement `%device_rm`. The ios device implementation uses the `%run` wrapper to do the work of removing files on a device. The `iossim_run.py` script has been fixed so that it just runs `rm` on the host operating system because the device and host file system are the same. rdar://problem/41126835 Reviewers: vsk, kubamracek, george.karpenkov, eugenis Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D51648 llvm-svn: 342391
* Fix vectorization of canonicalizeMatt Arsenault2018-09-173-0/+21
| | | | llvm-svn: 342390
* FixIdriss Riouak2018-09-171-4/+4
| | | | llvm-svn: 342389
* [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains ↵Idriss Riouak2018-09-172-1/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | about variable cast to void Summary: Hello, i would like to suggest a fix for one of the checks in clang-tidy.The bug was reported in https://bugs.llvm.org/show_bug.cgi?id=32575 where you can find more information. For example: ``` template <typename T0> struct S { template <typename T> void g() const { int a; (void)a; } }; void f() { S<int>().g<int>(); } ``` this piece of code should not trigger any warning by the check modernize-redundant-void-arg but when we execute the following command ``` clang_tidy -checks=-*,modernize-redundant-void-arg test.cpp -- -std=c++11 ``` we obtain the following warning: /Users/eco419/Desktop/clang-tidy.project/void-redundand_2/test.cpp:6:6: warning: redundant void argument list in function declaration [modernize-redundant-void-arg] (void)a; ^~~~ Reviewers: aaron.ballman, hokein, alexfh, JonasToth Reviewed By: aaron.ballman, JonasToth Subscribers: JonasToth, lebedev.ri, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D52135 llvm-svn: 342388
* [GVNHoist] Re-enable GVNHoist by defaultAlexandros Lamprineas2018-09-177-26/+30
| | | | | | | | | | | | Rebase rL341954 since https://bugs.llvm.org/show_bug.cgi?id=38912 has been fixed by rL342055. Precommit testing performed: * Overnight runs of csmith comparing the output between programs compiled with gvn-hoist enabled/disabled. * Bootstrap builds of clang with UbSan/ASan configurations. llvm-svn: 342387
* Use createTemporaryFile in SampleProfTestAlexander Kornienko2018-09-171-3/+5
| | | | | | | | Create a temporary file in the system temporary directory instead of creating a file in the current directory, which may be not writable. (Fix for an issue introduced in r342283.) llvm-svn: 342386
* Add descriptions to completed expressionsRaphael Isemann2018-09-172-8/+65
| | | | | | | | | | | | | | | | | Summary: Completing inside the expression command now uses the new description API to also provide additional information to the user. For now this information are the types of variables/fields and the signatures of completed function calls. Reviewers: #lldb, JDevlieghere Reviewed By: JDevlieghere Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D52103 llvm-svn: 342385
* [ASTImporter] Fix import of VarDecl initGabor Marton2018-09-172-55/+213
| | | | | | | | | | | | | | | | | | Summary: The init expression of a VarDecl is overwritten in the "To" context if we import a VarDecl without an init expression (and with a definition). Please refer to the added tests, especially InitAndDefinitionAreInDifferentTUs. This patch fixes the malfunction by importing the whole Decl chain similarly as we did that in case of FunctionDecls. We handle the init expression similarly to a definition, alas only one init expression will be in the merged ast. Reviewers: a_sidorin, xazax.hun, r.stahl, a.sidorin Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D51597 llvm-svn: 342384
* [OpenCL] Allow blocks to capture arrays in OpenCLAndrew Savonichev2018-09-172-2/+20
| | | | | | | | | | | | | | Summary: Patch by Egor Churaev Reviewers: Anastasia, yaxunl Reviewed By: Anastasia Subscribers: asavonic, bader, cfe-commits Differential Revision: https://reviews.llvm.org/D51722 llvm-svn: 342370
* [llvm-exegesis] Add predefined floating point values so we can test impact ↵Guillaume Chatelet2018-09-175-0/+159
| | | | | | | | | | | | | | of special values on latency. Summary: This will be useful to generate many configurations and test instruction regimes (NaN, Inf, subnormal, normal). Reviewers: courbet Subscribers: mgorny, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D51858 llvm-svn: 342369
* [PowerPC] Fix label address calculation for ppc64Strahinja Petrovic2018-09-172-1/+23
| | | | | | | | This patch fixes calculating address of label for non-pic ppc64. Differential Revision: https://reviews.llvm.org/D50965 llvm-svn: 342368
* Merge two attribute diagnostics into oneAndrew Savonichev2018-09-174-7/+7
| | | | | | | | | | | | | | | | | | Summary: Merged the recently added `err_attribute_argument_negative` diagnostic with existing `err_attribute_requires_positive_integer` diagnostic: the former allows only strictly positive integer, while the latter also allows zero. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51853 llvm-svn: 342367
* Reland r342233: [ThinLTO] Allow setting of maximum cache size with 64-bit numberJames Henderson2018-09-176-3/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | The original was reverted due to an apparent build-bot test failure, but it looks like this is just a flaky test. Also added a C-interface function for large values, and updated llvm-lto's --thinlto-cache-max-size-bytes switch to take a type larger than int. The maximum cache size in terms of bytes is a 64-bit number. However, the methods to set it only took unsigned previously, which meant that the maximum cache size could not be specified above 4GB. That's quite small compared to the output of some projects, so it makes sense to provide the ability to set larger values in that field. We also needed a C-interface function that provides a greater range than the existing thinlto_codegen_set_cache_size_bytes, which also only takes an unsigned, so this change also adds hinlto_codegen_set_cache_size_megabytes. Reviewed by: mehdi_amini, tejohnson, steven_wu Differential Revision: https://reviews.llvm.org/D52023 llvm-svn: 342366
* [Analyzer] Define and use diff_plist in tests, NFCMikhail Maltsev2018-09-1730-29/+34
| | | | | | | | | This patch defines a new substitution and uses it to reduce duplication in the Clang Analyzer test cases. Differential Revision: https://reviews.llvm.org/D52036 llvm-svn: 342365
* [llvm-objcopy] Add missing alias for --strip-all-gnuAlexander Shaposhnikov2018-09-172-0/+5
| | | | | | | | | | | | | This diff adds -S as an alias for --strip-all-gnu (for compatibility with binutils' objcopy). Patch by Dmitry Golovin! Test plan: make check-all Differential revision: https://reviews.llvm.org/D52163 llvm-svn: 342364
* [clang-Format] Fix indentation of member call after blockIlya Biryukov2018-09-173-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: before patch: > echo "test() {([]() -> {int b = 32;return 3;}).as("");});" | clang-format -style=Google ``` test() { ([]() -> { int b = 32; return 3; }) .as(); }); ``` after patch: > echo "test() {([]() -> {int b = 32;return 3;}).as("");});" | clang-format -style=Google ``` test() { ([]() -> { int b = 32; return 3; }).as(); }); ``` Patch by Anders Karlsson (ank)! Reviewers: klimek Reviewed By: klimek Subscribers: danilaml, acoomans, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D45719 llvm-svn: 342363
* [clangd] Get rid of AST matchers in SymbolCollector. NFCEric Liu2018-09-171-13/+36
| | | | | | | | | | Reviewers: ilya-biryukov, kadircet Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52089 llvm-svn: 342362
* Fix typoFangrui Song2018-09-171-1/+1
| | | | llvm-svn: 342361
* [NFC] Turn unsigned counters into boolean flagsMax Kazantsev2018-09-171-8/+13
| | | | llvm-svn: 342360
* scan-build: Add support of the option --exclude like in scan-build-pySylvestre Ledru2018-09-171-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: To exclude thirdparty code. To test: With /tmp/foo.c ``` void test() { int x; x = 1; // warn } ``` ``` $ scan-build --exclude non-existing/ --exclude /tmp/ -v gcc -c foo.c scan-build: Using '/usr/lib/llvm-7/bin/clang' for static analysis scan-build: Emitting reports for this run to '/tmp/scan-build-2018-09-16-214531-8410-1'. foo.c:3:3: warning: Value stored to 'x' is never read x = 1; // warn ^ ~ 1 warning generated. scan-build: File '/tmp/foo.c' deleted: part of an ignored directory. scan-build: 0 bugs found. ``` Reviewers: jroelofs Reviewed By: jroelofs Subscribers: whisperity, cfe-commits Differential Revision: https://reviews.llvm.org/D52153 llvm-svn: 342359
* [Lexer] Add xray_instrument featurePetr Hosek2018-09-172-0/+12
| | | | | | | | | This can be used to detect whether the code is being built with XRay instrumentation using the __has_feature(xray_instrument) predicate. Differential Revision: https://reviews.llvm.org/D52159 llvm-svn: 342358
* [sanitizer_common] Fuchsia now supports .preinit_arrayPetr Hosek2018-09-171-2/+2
| | | | | | | | | Support for .preinit_array has been implemented in Fuchsia's libc, add Fuchsia to the list of platforms that support this feature. Differential Revision: https://reviews.llvm.org/D52155 llvm-svn: 342357
* [XRay] Simplify FDR buffer managementDean Michael Berris2018-09-174-102/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change makes XRay FDR mode use a single backing store for the buffer queue, and have indexes into that backing store instead. We also remove the reliance on the internal allocator implementation in the FDR mode logging implementation. In the process of making this change we found an inconsistency with the way we're returning buffers to the queue, and how we're setting the extents. We take the chance to simplify the way we're managing the extents of each buffer. It turns out we do not need the indirection for the extents, so we co-host the atomic 64-bit int with the buffer object. It also seems that we've not been returning the buffers for the thread running the flush functionality when writing out the files, so we can run into a situation where we could be missing data. We consolidate all the allocation routines now into xray_allocator.h, where we used to have routines defined in xray_buffer_queue.cc. Reviewers: mboerger, eizan Subscribers: jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D52077 llvm-svn: 342356
* [XRay] Fix FDR initializationDean Michael Berris2018-09-171-3/+14
| | | | | | Follow-up to D51606. llvm-svn: 342355
* [DebugInfo] Fix build when std::vector::iterator is a pointerKristina Brooks2018-09-161-1/+1
| | | | | | | | | | | | std::vector::iterator type may be a pointer, then iterator::value_type fails to compile since iterator is not a class, namespace, or enumeration. Patch by orivej (Orivej Desh) Differential Revision: https://reviews.llvm.org/D52142 llvm-svn: 342354
* [NFC] Minor refactoring to setup the stage for supporting pointers in ↵Shuai Wang2018-09-162-43/+106
| | | | | | ExprMutationAnalyzer llvm-svn: 342353
* [X86][SSE] Always enable ISD::SRL -> ISD::MULHU for v8i16Simon Pilgrim2018-09-163-84/+38
| | | | | | For constant non-uniform cases we'll never introduce more and/andn/or selects than already occur in generic pre-SSE41 ISD::SRL lowering. llvm-svn: 342352
* scan-build: remove trailing whitespacesSylvestre Ledru2018-09-161-4/+4
| | | | llvm-svn: 342351
* Also manages clang-X as tool for scan-buildSylvestre Ledru2018-09-161-1/+1
| | | | | | | | | | | | | | Summary: This will make scan-build-7 clang-7 -c foo.c &> /dev/null Reviewers: jroelofs Subscribers: kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52151 llvm-svn: 342350
* [X86][AVX] Enable ISD::SRL -> ISD::MULHU for v16i16Simon Pilgrim2018-09-163-42/+23
| | | | | | Now that rL340913 has landed with improved v16i16 selects as shuffles. llvm-svn: 342349
* [DAGCombiner] try to convert pow(x, 1/3) to cbrt(x)Sanjay Patel2018-09-167-10/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up suggested in D51630 and originally proposed as an IR transform in D49040. Copying the motivational statement by @evandro from that patch: "This transformation helps some benchmarks in SPEC CPU2000 and CPU2006, such as 188.ammp, 447.dealII, 453.povray, and especially 300.twolf, as well as some proprietary benchmarks. Otherwise, no regressions on x86-64 or A64." I'm proposing to add only the minimum support for a DAG node here. Since we don't have an LLVM IR intrinsic for cbrt, and there are no other DAG ways to create a FCBRT node yet, I don't think we need to worry about DAG builder, legalization, a strict variant, etc. We should be able to expand as needed when adding more functionality/transforms. For reference, these are transform suggestions currently listed in SimplifyLibCalls.cpp: // * cbrt(expN(X)) -> expN(x/3) // * cbrt(sqrt(x)) -> pow(x,1/6) // * cbrt(cbrt(x)) -> pow(x,1/9) Also, given that we bail out on long double for now, there should not be any logical differences between platforms (unless there's some platform out there that has pow() but not cbrt()). Differential Revision: https://reviews.llvm.org/D51753 llvm-svn: 342348
* [x86] fix uses check in broadcast transform (PR38949)Sanjay Patel2018-09-162-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugs.llvm.org/show_bug.cgi?id=38949 It's not clear to me that we even need a one-use check in this fold. Ie, 2 independent loads might be better than a load+dependent shuffle. Note that the existing re-use tests are not affected. We actually do form a broadcast node in those tests now because there's no extra use of the insert_subvector node in those cases. But something later in isel pattern matching decides that it is not worth using a broadcast for the full load in those tests: Legalized selection DAG: %bb.0 'test_broadcast_2f64_4f64_reuse:' t7: v2f64,ch = load<(load 16 from %ir.p0)> t0, t2, undef:i64 t4: i64,ch = CopyFromReg t0, Register:i64 %1 t10: ch = store<(store 16 into %ir.p1)> t7:1, t7, t4, undef:i64 t18: v4f64 = insert_subvector undef:v4f64, t7, Constant:i64<0> t20: v4f64 = insert_subvector t18, t7, Constant:i64<2> Becomes: t7: v2f64,ch = load<(load 16 from %ir.p0)> t0, t2, undef:i64 t4: i64,ch = CopyFromReg t0, Register:i64 %1 t10: ch = store<(store 16 into %ir.p1)> t7:1, t7, t4, undef:i64 t21: v4f64 = X86ISD::SUBV_BROADCAST t7 ISEL: Starting selection on root node: t21: v4f64 = X86ISD::SUBV_BROADCAST t7 ... Created node: t27: v4f64 = INSERT_SUBREG IMPLICIT_DEF:v4f64, t7, TargetConstant:i32<7> Morphed node: t21: v4f64 = VINSERTF128rr t27, t7, TargetConstant:i8<1> llvm-svn: 342347
* [x86] add failure to splat test (PR38949); NFCSanjay Patel2018-09-161-0/+27
| | | | llvm-svn: 342346
* [NFC][InstCombine] One more test pattern for comparisons with low-bit-mask.Roman Lebedev2018-09-162-0/+510
| | | | | | | | https://rise4fun.com/Alive/UGzE <- non-canonical, but has extra uses. https://bugs.llvm.org/show_bug.cgi?id=38123 llvm-svn: 342345
* Fix -Wdangling-else gcc warning. NFCI.Simon Pilgrim2018-09-161-2/+4
| | | | llvm-svn: 342344
* [NFC][InstCombine] Some more tests for comparisons with low-bit-mask.Roman Lebedev2018-09-164-0/+1214
| | | | | | | https://bugs.llvm.org/show_bug.cgi?id=38123 https://bugs.llvm.org/show_bug.cgi?id=38708 llvm-svn: 342343
* [ELF] Use llvm::toLower instead of libc call tolowerFangrui Song2018-09-151-1/+2
| | | | | | | | | | | | | | | | | | | tolower() has some overhead because current locale is considered (though in lld the default "C" locale is used which does not matter too much). llvm::toLower is more efficient as it compiles to a compare and a conditional jump, as opposed to a libc call if tolower is used. Disregarding locale also matches gdb's behavior (gdb/minsyms.h): #define SYMBOL_HASH_NEXT(hash, c) \ ((hash) * 67 + TOLOWER ((unsigned char) (c)) - 113) where TOLOWER (include/safe-ctype.h) is a macro that uses a lookup table under the hood which is similar to llvm::toLower. Reviewers: ruiu, espindola Subscribers: emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D52128 llvm-svn: 342342
* configure: Rework support for gfx9+ devices that were added post LLVM 3.9Jan Vesely2018-09-151-2/+12
| | | | | | | | v2: Fix reference to Vega12/20 enabling commit Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewer: Aaron Watry llvm-svn: 342341
* [NFC] cosmetic tweaks to ExprMutationAnalyzer to be more consistentShuai Wang2018-09-152-16/+17
| | | | | | especially considering future changes. llvm-svn: 342340
* [llvm-readobj] Make some commonly used short options visibile in -helpFangrui Song2018-09-151-0/+9
| | | | | | | | | | | | | | For people who use llvm-readelf as a replacement of GNU readelf, they would like to see -d -r ... listed in llvm-readelf -help. It also helps understanding the confusing -s (which is unfortunately different in semantics). Reviewers: phosek, ruiu, echristo Reviewed By: ruiu, echristo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52129 llvm-svn: 342339
* .travis: Add llvm-7 buildJan Vesely2018-09-151-0/+20
| | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewer: Aaron Watry llvm-svn: 342338
* .travis: Use source whitelist alias for llvm-6 repositoryJan Vesely2018-09-151-1/+1
| | | | | | | | Fixes issue with unauthenticated packages. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewer: Aaron Watry llvm-svn: 342337
* Revert r342148 (and follow-on fix attempts r342154, r342180, r342182, r342193)Nico Weber2018-09-158-42/+43
| | | | | | | Many bots buildling with make have been broken for several days, e.g. http://lab.llvm.org:8011/builders/lld-x86_64-darwin13 llvm-svn: 342336
* [InstCombine] Support (sub (sext x), (sext y)) --> (sext (sub x, y)) and ↵Craig Topper2018-09-153-7/+156
| | | | | | | | | | | | | | | | | | | (sub (zext x), (zext y)) --> (zext (sub x, y)) Summary: If the sub doesn't overflow in the original type we can move it above the sext/zext. This is similar to what we do for add. The overflow checking for sub is currently weaker than add, so the test cases are constructed for what is supported. Reviewers: spatel Reviewed By: spatel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52075 llvm-svn: 342335
OpenPOWER on IntegriCloud