summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [ConstantRange] [a, b) udiv a full range is [0, umax(b)).Florian Hahn2019-04-252-2/+10
| | | | | | | | | | Reviewers: nikic, spatel, efriedma Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D60536 llvm-svn: 359180
* [Testing] Move clangd::Annotations to llvm testing supportIlya Biryukov2019-04-259-132/+345
| | | | | | | | | | | | | | | | | | | | | | | Summary: Annotations allow writing nice-looking unit test code when one needs access to locations from the source code, e.g. running code completion at particular offsets in a file. See comments in Annotations.cpp for more details on the API. Also got rid of a duplicate annotations parsing code in clang's code complete tests. Reviewers: gribozavr, sammccall Reviewed By: gribozavr Subscribers: mgorny, hiraditya, ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D59814 llvm-svn: 359179
* [yaml2obj] - Don't crash on invalid inputs.George Rimar2019-04-254-13/+15
| | | | | | | | | | | | | | yaml2obj might crash on invalid input when unable to parse the YAML. Recently a crash with a very similar nature was fixed for an empty files. This patch revisits the fix and does it in yaml::Input instead. It seems to be more correct way to handle such situation. With that crash for invalid inputs is also fixed now. Differential revision: https://reviews.llvm.org/D61059 llvm-svn: 359178
* Fix include order. NFCI.Simon Pilgrim2019-04-251-1/+1
| | | | llvm-svn: 359177
* [X86][SSE] combineBitcastvxi1 - add support for bitcasting to non-scalar ↵Simon Pilgrim2019-04-252-1724/+183
| | | | | | | | | | integers Truncate the movmsk scalar integer result to the equivalent scalar integer width as before but then bitcast to the requested type. We still have the issue identified in PR41594 but D61114 should handle this. llvm-svn: 359176
* Fix compilation error with -DLIBCXXABI_ENABLE_THREADS=OFFMichael Platings2019-04-251-0/+3
| | | | | | | | | | | | The error is: libcxxabi/src/cxa_guard_impl.h: In instantiation of ‘__cxxabiv1::{anonymous}::LibcppMutex __cxxabiv1::{anonymous}::GlobalStatic<__cxxabiv1::{anonymous}::LibcppMutex>::instance’: libcxxabi/src/cxa_guard_impl.h:529:62: required from here libcxxabi/src/cxa_guard_impl.h:510:23: error: ‘__cxxabiv1::{anonymous}::LibcppMutex __cxxabiv1::{anonymous}::GlobalStatic<__cxxabiv1::{anonymous}::LibcppMutex>::instance’ has incomplete type _LIBCPP_SAFE_STATIC T GlobalStatic<T>::instance = {}; ^ llvm-svn: 359175
* [Support] Add a GTest matcher for Optional<T>Ilya Biryukov2019-04-253-1/+74
| | | | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61071 llvm-svn: 359174
* [NFC][LoopIdiomRecognize] Some basic baseline tests for bcmp loop idiomRoman Lebedev2019-04-254-0/+2734
| | | | | | | Doubt this is the final test coverage, but this appears to have good coverage already, so i figure i might as well precommit it. llvm-svn: 359173
* [NFC] test commit removing excess lineNikolai Kosjar2019-04-251-1/+0
| | | | llvm-svn: 359172
* [MIPS] Use custom bitcast lowering to avoid excessive instructionsSimon Atanasyan2019-04-254-7/+45
| | | | | | | | | | | | | On Mips32r2 bitcast can be expanded to two sw instructions and an ldc1 when using bitcast i64 to double or an sdc1 and two lw instructions when using bitcast double to i64. By introducing custom lowering that uses mtc1/mthc1 we can avoid excessive instructions. Patch by Mirko Brkusanin. Differential Revision: https://reviews.llvm.org/D61069 llvm-svn: 359171
* [X86] Remove part of an if condition that should always be true.Craig Topper2019-04-251-1/+1
| | | | | | | | The IndexReg will always be non-null at this point. Earlier in the function, if IndexReg was null we set it to CurDAG->getRegister(0, VT) which made it non-null. llvm-svn: 359170
* [JITLink] Make the JITLink MachO/x86-64 eh-frame test work on Windows.Lang Hames2019-04-251-6/+1
| | | | | | | This should fix the MachO/x86-64 eh-frame regression test by ensuring that the symbols __ZTIi and ___gxx_personality_v0 are defined on all platforms. llvm-svn: 359169
* [llvm-rtdyld] Add support for passing command line arguments to rtdyld-run code.Lang Hames2019-04-251-5/+19
| | | | | | | | | | | | | | | | | The --args option can now be used to pass arguments to code linked with llvm-rtdyld. E.g. $ llvm-rtdyld file1.o file2.o --args a b c is equivalent to: $ ld -o program file1.o file2.o $ ./program a b c This is the rtdyld counterpart to the jitlink change in r359115, and makes benchmarking and comparison between the tools easier. llvm-svn: 359168
* Enable LoopVectorization by default.Alina Sbirlea2019-04-255-517/+11
| | | | | | | | | | | | | | | | | Summary: When refactoring vectorization flags, vectorization was disabled by default in the new pass manager. This patch re-enables is for both managers, and changes the assumptions opt makes, based on the new defaults. Comments in opt.cpp should clarify the intended use of all flags to enable/disable vectorization. Reviewers: chandlerc, jgorbe Subscribers: jlebar, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61091 llvm-svn: 359167
* [llvm-objdump] errorToErrorCode+message -> toStringFangrui Song2019-04-252-5/+4
| | | | | | For test/Object/elf-invalid-phdr.test, the intended error message got lost due to errorToErrorCode(). llvm-svn: 359166
* [PowerPC][NFC]Update licence to Apache 2Jinsong Ji2019-04-251-17/+3
| | | | llvm-svn: 359164
* Consolidate existing utilities for interpreting vector predicate maskes [NFC]Philip Reames2019-04-254-47/+61
| | | | llvm-svn: 359163
* Update test to better check for the non-constexpr-ness of a move ↵Marshall Clow2019-04-251-5/+20
| | | | | | constructor. Fixes PR#41577. llvm-svn: 359162
* Fix unused variable warning in LoopFusion pass.Kit Barton2019-04-251-7/+5
| | | | | | | | | | Do not wrap the contents of printFusionCandidates in the LLVM_DEBUG macro. This fixes an unused variable warning generated when compiling without asserts but with -DENABLE_LLVM_DUMP. Differential Revision: https://reviews.llvm.org/D61035 llvm-svn: 359161
* [InstCombine] Be consistent w/handling of masked intrinsics style wise [NFC]Philip Reames2019-04-252-5/+6
| | | | llvm-svn: 359160
* Use modern type trait implementations when available.Richard Smith2019-04-252-14/+45
| | | | | | | | | | | | | | Teach libcxx to stop using various deprecated __has_* type traits, in favor of the ("modern", C++11 era) __is_* type traits. This is mostly just a simplification, but fixes at least one bug: _Atomic T should be considered trivially-destructible, but is not considered to be POD by Clang, and __has_trivial_destructor is specified in the GCC documentation as returning false for non-POD non-class types. Differential Revision: https://reviews.llvm.org/D48292 llvm-svn: 359159
* Fix typo in comment in r312851.Richard Smith2019-04-251-2/+2
| | | | | | Thanks to Nico Weber for pointing this out! llvm-svn: 359158
* [utils] Add a lldb data formatter for llvm::SmallString.Davide Italiano2019-04-251-0/+11
| | | | | | | | | Result: (lldb) p val (llvm::SmallString<32>) $31 = "patatino" llvm-svn: 359157
* Hide stderr output from lldb-argdumperAdrian Prantl2019-04-243-31/+46
| | | | | | | | | | | | | Under very specific circumstances the default shell /bin/sh might print stuff to stderr before launching lldb-argdumper, which then confuses the JSON parser. This patch suppresses stderr output from lldb-argdumper to avoid this situation. rdar://problem/50149390 Differential Revision: https://reviews.llvm.org/D61101 llvm-svn: 359156
* PR41427: This has apparently been fixed already, just add a regressionRichard Smith2019-04-241-0/+17
| | | | | | test. llvm-svn: 359155
* Fix spelling error. NFCAustin Kerbow2019-04-241-1/+1
| | | | | | | | | | | | | | | | Summary: Test commit. Reviewers: msearles, jkorous Reviewed By: jkorous Subscribers: dexonsmith, arsenm, jvesely, nhaehnle, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61093 llvm-svn: 359154
* llvm-cvtres: Make new dupe resource error a bit friendlierNico Weber2019-04-2410-51/+60
| | | | | | | | | | | | For well-known type IDs, include the name of the type. To not duplicate the ID->name map, make llvm-readobj call this new function as well. It has slightly different output, so this also requires updating a few tests. Differential Revision: https://reviews.llvm.org/D61086 llvm-svn: 359153
* posix_spawn should retry upon EINTRJF Bastien2019-04-241-6/+10
| | | | | | | | | | | | | | | | | | | Summary: We've seen cases of bots failing with: clang: error: unable to execute command: posix_spawn failed: Interrupted system call Add a small retry loop to posix_spawn in case this happens. Don't retry too much in case there's some systemic problem going on, but retry a few times. <rdar://problem/50181448> Reviewers: Bigcheese, arphaman Subscribers: jkorous, dexonsmith, kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61096 llvm-svn: 359152
* Mark new jitlink test XFAIL for windowsReid Kleckner2019-04-241-1/+6
| | | | llvm-svn: 359151
* [sanitizer_common] Remove some old commented-out printf statements, and ↵Mitch Phillips2019-04-241-6/+1
| | | | | | fixed up the order of includes. llvm-svn: 359150
* Recommitting r358783 and r358786 "[MS] Emit S_HEAPALLOCSITE debug info" with ↵Amy Huang2019-04-249-0/+182
| | | | | | | | | | | | | | | | | | | fixes for buildbot error (undefined assembler label). Summary: This emits labels around heapallocsite calls and S_HEAPALLOCSITE debug info in codeview. Currently only changes FastISel, so emitting labels still needs to be implemented in SelectionDAG. Reviewers: rnk Subscribers: aprantl, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D61083 llvm-svn: 359149
* [codeview] Fix symbol names for dynamic initializers and atexit stubsReid Kleckner2019-04-245-15/+120
| | | | | | | | | | | | | | | | Summary: Add a new variant to GlobalDecl for these so that we can detect them more easily during debug info emission and handle them appropriately. Reviewers: rsmith, rjmccall, jyu2 Subscribers: aprantl, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60930 llvm-svn: 359148
* [DAGCombiner] scale repeated FP divisor by splat factorSanjay Patel2019-04-242-16/+28
| | | | | | | | | | | | | | If we have a vector FP division with a splatted divisor, use the existing transform that converts 'x/y' into 'x * (1.0/y)' to allow more conversions. This can then potentially be converted into a scalar FP division by existing combines (rL358984) as seen in the tests here. That can be a potentially big perf difference if scalar fdiv has better timing (including avoiding possible frequency throttling for vector ops). Differential Revision: https://reviews.llvm.org/D61028 llvm-svn: 359147
* [PowerPC] Allow using initial-exec TLS with PICJoerg Sonnenberger2019-04-243-6/+21
| | | | | | | | | | Using initial-exec TLS variables is a reasonable performance optimisation for system libraries. Use the correct PIC mechanism to get hold of the GOT to avoid text relocations. Differential Revision: https://reviews.llvm.org/D61026 llvm-svn: 359146
* Skip test introduced in r359140 on windowsFrederic Riss2019-04-241-0/+2
| | | | | | | Not sure what is or is not supposed to work on Windows and I have no way to investigate this. llvm-svn: 359145
* Add period at end of comment.Sean Fertile2019-04-241-1/+1
| | | | llvm-svn: 359144
* [X86] Attempt to fix use-after-poison from r359121.Craig Topper2019-04-241-2/+5
| | | | llvm-svn: 359143
* [clang-tidy] Add new checker: llvm-prefer-isa-or-dyn-cast-in-conditionalsDon Hinton2019-04-248-0/+379
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Looks at conditionals and finds cases of ``cast<>``, which will assert rather than return a null pointer, and ``dyn_cast<>`` where the return value is not captured. Additionally, finds cases that match the pattern ``var.foo() && isa<X>(var.foo())``, where the method is called twice and could be expensive. .. code-block:: c++ // Finds cases like these: if (auto x = cast<X>(y)) <...> if (cast<X>(y)) <...> // But not cases like these: if (auto f = cast<Z>(y)->foo()) <...> if (cast<Z>(y)->foo()) <...> Reviewers: alexfh, rjmccall, hokein, aaron.ballman, JonasToth Reviewed By: aaron.ballman Subscribers: xbolva00, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D59802 llvm-svn: 359142
* [SystemInitializerFull] Fix header sorting (NFC)Jonas Devlieghere2019-04-241-2/+1
| | | | | | Made some changes downstream that touched the header sorting. llvm-svn: 359141
* Fix infinite recursion when calling C++ template functionsFrederic Riss2019-04-244-3/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When we encounter a templated function in the debug information, we were creating an AST that looked like this: FunctionTemplateDecl 0x12980ab90 <<invalid sloc>> <invalid sloc> foo<int> |-TemplateTypeParmDecl 0x12980aad0 <<invalid sloc>> <invalid sloc> class depth 0 index 0 T |-FunctionDecl 0x12980aa30 <<invalid sloc>> <invalid sloc> foo<int> 'int (int)' extern | |-TemplateArgument type 'int' | `-ParmVarDecl 0x12980a998 <<invalid sloc>> <invalid sloc> t1 'int' `-FunctionDecl 0x12980aa30 <<invalid sloc>> <invalid sloc> foo<int> 'int (int)' extern |-TemplateArgument type 'int' `-ParmVarDecl 0x12980a998 <<invalid sloc>> <invalid sloc> t1 'int' Note that the FunctionTemplateDecl has 2 children which are identical (as in have the same address). This is not what Clang is doing: FunctionTemplateDecl 0x7f89d206c6f8 </tmp/template.cpp:1:1, line:4:1> line:2:5 foo |-TemplateTypeParmDecl 0x7f89d206c4a8 <line:1:10, col:19> col:19 referenced typename depth 0 index 0 T |-FunctionDecl 0x7f89d206c660 <line:2:1, line:4:1> line:2:5 foo 'int (T)' | `-ParmVarDecl 0x7f89d206c570 <col:9, col:11> col:11 t1 'T' `-FunctionDecl 0x7f89d206cb60 <line:2:1, line:4:1> line:2:5 used foo 'int (int)' |-TemplateArgument type 'int' `-ParmVarDecl 0x7f89d206ca68 <col:9, col:11> col:11 t1 'int':'int' The 2 chidlren are different and actually repesent different things: the first one is the unspecialized version and the second one is specialized. (Just looking at the names shows another major difference which is that we create the parent with a name of "foo<int>" when it should be just "foo".) The fact that we have those 2 identical children confuses the ClangImporter and generates an infinite recursion (reported in https://llvm.org/pr41473). We cannot create the unspecialized version as the debug information doesn't contain a mapping from the template parameters to their use in the prototype. This patch just creates 2 different FunctionDecls for those 2 children of the FunctionTemplateDecl. This avoids the infinite recursion and allows us to call functions. As the XFAILs in the added test show, we've still got issues in our handling of templates. I believe they are mostly centered on the fact that we create do not register "foo" as a template, but "foo<int>". This is a bigger change that will need changes to the debug information generation. I believe this change makes sense on its own. Reviewers: shafik, clayborg, jingham Subscribers: aprantl, javed.absar, kristof.beyls, lldb-commits Differential Revision: https://reviews.llvm.org/D61044 llvm-svn: 359140
* [AMDGPU] gfx1010 SOP instructionsStanislav Mekhanoshin2019-04-248-160/+555
| | | | | | Differential Revision: https://reviews.llvm.org/D61080 llvm-svn: 359139
* [ScriptInterpreterPython] find_first_of -> find (NFC)Jonas Devlieghere2019-04-241-1/+2
| | | | | | Follow up to r357198. llvm-svn: 359138
* [COFF] Don't emit .gfids sections when CFG is offReid Kleckner2019-04-242-2/+12
| | | | | | | Put them on the list of GuardFidChunks instead of the main Chunks list, even with CFG is off. It will be ignored if CFG is disabled. llvm-svn: 359137
* [SLP] Fix crash after r358519, by V. Porpodas.Alexey Bataev2019-04-242-1/+49
| | | | | | | | | | | | | | | | Summary: The code did not check if operand was undef before casting it to Instruction. Reviewers: RKSimon, ABataev, dtemirbulatov Reviewed By: ABataev Subscribers: uabelho Tags: #llvm Differential Revision: https://reviews.llvm.org/D61024 llvm-svn: 359136
* Try once more to ensure constant initializaton of ManagedStaticsReid Kleckner2019-04-242-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, use the old style of linker initialization for MSVC 2019 in addition to 2017. MSVC 2019 emits a dynamic initializer for ManagedStatic when compiled in debug mode, and according to zturner, also sometimes in release mode. I wasn't able to reproduce that, but it seems best to stick with the old code that works. When clang is using the MSVC STL, we have to give ManagedStatic a constexpr constructor that fully zero initializes all fields, otherwise it emits a dynamic initializer. The MSVC STL implementation of std::atomic has a non-trivial (but constexpr) default constructor that zero initializes the atomic value. Because one of the fields has a non-trivial constructor, ManagedStatic ends up with a non-trivial ctor. The ctor is not constexpr, so clang ends up emitting a dynamic initializer, even though it simply does zero initialization. To make it constexpr, we must initialize all fields of the ManagedStatic. However, while the constructor that takes a pointer is marked constexpr, clang says it does not evaluate to a constant because it contains a cast from a pointer to an integer. I filed this as: https://developercommunity.visualstudio.com/content/problem/545566/stdatomic-value-constructor-is-not-actually-conste.html Once we do that, we can add back the LLVM_REQUIRE_CONSTANT_INITIALIZATION marker, and so far as I'm aware it compiles successfully on all supported targets. llvm-svn: 359135
* [pstl] Make the default backend be the serial backend and always provide ↵Louis Dionne2019-04-2411-287/+20
| | | | | | | | | | | | | | | | | | parallel policies Summary: Before this change, the default backend was TBB but one could disable anything related to TBB by removing the parallel policies. This change uses the serial backend by default and removes the ability to disable parallel policies, which is not useful anymore. Reviewers: rodgert, MikeDvorskiy Subscribers: mgorny, jkorous, dexonsmith, jdoerfert, libcxx-commits Differential Revision: https://reviews.llvm.org/D59792 llvm-svn: 359134
* [compiler-rt] NFC fixed [whitespace/braces] LINT warningVitaly Buka2019-04-241-1/+1
| | | | llvm-svn: 359133
* [OPENMP]Initial support for non-rectangular loop nest.Alexey Bataev2019-04-243-14/+105
| | | | | | | Added basic semantic analysis for the non-rectangular loop nests for OpenMP 5.0 support. llvm-svn: 359132
* Add optional arg to profile count getters to filterXinliang David Li2019-04-249-24/+41
| | | | | | | | synthetic profile count. Differential Revision: http://reviews.llvm.org/D61025 llvm-svn: 359131
* add postfixexpression.cpp.Jason Molenda2019-04-241-0/+4
| | | | llvm-svn: 359130
OpenPOWER on IntegriCloud