summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Testbed and skeleton of a new expression parserSean Callanan2016-12-1613-0/+381
| | | | | | | | | | | | | | | | | | | | LLVM's JIT is now the foundation of dynamic-compilation features for many languages. Clang also has low-level support for dynamic compilation (ASTImporter and ExternalASTSource, notably). How the compiler is set up for dynamic parsing is generally left up to individual clients, for example LLDB's C/C++/Objective-C expression parser and the ROOT project. Although this arrangement offers external clients the flexibility to implement dynamic features as they see fit, the lack of an in-tree client means that subtle bugs can be introduced that cause regressions in the external clients but aren't caught by tests (or users) until much later. LLDB for example regularly encounters complicated ODR violation scenarios where it is not immediately clear who is at fault. Other external clients (notably, Cling) rely on similar functionality, and another goal is to break this functionality up into composable parts so that any client can be built easily on top of Clang without requiring extensive additional code. I propose that the parts required to build a simple expression parser be added to Clang. Initially, I aim to have the following features: - A piece that looks up external declarations from a variety of sources (e.g., from previous dynamic compilations, from modules, or from DWARF) and uses clear conflict resolution rules to reconcile differences, with easily understood errors. This functionality will be supported by in-tree tests. - A piece that works hand in hand with the LLVM JIT to resolve the locations of external declarations so that e.g. variables can be redeclared and (for high-performance applications like DTrace) external variables can be accessed directly from the registers where they reside. This commit adds a tester that parses a sequence of source files and then uses them as source data for an expression. External references are resolved using an ExternalASTSource that responds to name queries using an ASTImporter. This is the setup that LLDB uses, and the motivating reason for MinimalImport in ASTImporter. When complete, this tester will implement the first of the above goals. Differential Revision: https://reviews.llvm.org/D27180 llvm-svn: 290004
* ModuleSummaryAnalysis: Remove some duplicate code. NFCI.Peter Collingbourne2016-12-161-5/+0
| | | | llvm-svn: 290003
* Fix compiler warning.Zachary Turner2016-12-161-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D27860 llvm-svn: 290002
* Fix a bugs with using some Mach-O command line flags like "-arch armv7m".Kevin Enderby2016-12-1611-58/+111
| | | | | | | | | | | | | | | | | | The Mach-O command line flag like "-arch armv7m" does not match the arch name part of its llvm Triple which is "thumbv7m-apple-darwin”. I think the best way to fix this is to have llvm::object::MachOObjectFile::getArchTriple() optionally return the name of the Mach-O arch flag that would be used with -arch that matches the CPUType and CPUSubType. Then change llvm::object::MachOUniversalBinary::ObjectForArch::getArchTypeName() to use that and change it to getArchFlagName() as the type name is really part of the Triple and the -arch flag name is a Mach-O thing for a specific Triple with a specific Mcpu value. rdar://29663637 llvm-svn: 290001
* Resubmit "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."Zachary Turner2016-12-1616-1174/+1347
| | | | | | | The original patch was broken due to some undefined behavior as well as warnings that were triggering -Werror. llvm-svn: 290000
* [libFuzzer] avoid msan false positives in more casesKostya Serebryany2016-12-163-6/+12
| | | | llvm-svn: 289999
* [libFuzzer] add an experimental flag -experimental_len_control=1 that sets ↵Kostya Serebryany2016-12-166-9/+32
| | | | | | max_len to 1M and tries to increases the actual max sizes of mutations very gradually. Also remove a bit of dead code llvm-svn: 289998
* Really revert all changes from r289979. Apparently conflict resolution failedReid Kleckner2016-12-161-76/+35
| | | | llvm-svn: 289997
* IRGen: Fix assertion failure when creating debug info for an integer ↵Peter Collingbourne2016-12-162-6/+17
| | | | | | constant wider than 64 bits. llvm-svn: 289996
* [libclang] Restore the CXXRecordDecl path for ↵Argyrios Kyrtzidis2016-12-164-35/+103
| | | | | | | | | clang_Type_getNumTemplateArguments and clang_Type_getTemplateArgumentAsType Patch by Emilio Cobos Álvarez! See https://reviews.llvm.org/D26907 llvm-svn: 289995
* Fix compiler warning.Zachary Turner2016-12-161-1/+0
| | | | llvm-svn: 289994
* [ThinLTO] Import composite types as declarationsTeresa Johnson2016-12-1610-51/+173
| | | | | | | | | | | | | | | | | | | | | | | | Summary: When reading the metadata bitcode, create a type declaration when possible for composite types when we are importing. Doing this in the bitcode reader saves memory. Also it works naturally in the case when the type ODR map contains a definition for the same composite type because it was used in the importing module (buildODRType will automatically use the existing definition and not create a type declaration). For Chromium built with -g2, this reduces the aggregate size of the generated native object files by 66% (from 31G to 10G). It reduced the time through the ThinLTO link and backend phases by about 20% on my machine. Reviewers: mehdi_amini, dblaikie, aprantl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27775 llvm-svn: 289993
* Preserve loop metadata when folding branches to a common destination.Michael Kuperstein2016-12-162-0/+33
| | | | | | Differential Revision: https://reviews.llvm.org/D27830 llvm-svn: 289992
* Revert r289979 due to regressionsYaxun Liu2016-12-1628-590/+240
| | | | llvm-svn: 289991
* [Sema] Transform the default arguments of a lambda expression when theAkira Hatanaka2016-12-162-1/+31
| | | | | | | | | | | | | | | | lambda expression is instantiated. Rather than waiting until Sema::CheckCXXDefaultArgExpr tries to transform the default arguments (which fails because it can't get the template arguments that are used), transform the default arguments earlier when the lambda expression is transformed in TransformLambdaExpr. rdar://problem/27535319 Differential Revision: https://reviews.llvm.org/D23096 llvm-svn: 289990
* [OpenMP] support the 'is_device_ptr' clause with 'target parallel' pragmaKelvin Li2016-12-164-3/+566
| | | | | | | | This patch is to add support of the 'is_device_ptr' clause in the 'target parallel' pragma. Differential Revision: https://reviews.llvm.org/D27821 llvm-svn: 289989
* [CodeGenPrep] Skip merging empty case blocksJun Bum Lim2016-12-168-45/+352
| | | | | | | | | | | | | | This is recommit of r287553 after fixing the invalid loop info after eliminating an empty block and unit test failures in AVR and WebAssembly : Summary: Merging an empty case block into the header block of switch could cause ISel to add COPY instructions in the header of switch, instead of the case block, if the case block is used as an incoming block of a PHI. This could potentially increase dynamic instructions, especially when the switch is in a loop. I added a test case which was reduced from the benchmark I was targetting. Reviewers: t.p.northover, mcrosier, manmanren, wmi, joerg, davidxl Subscribers: joerg, qcolombet, danielcdh, hfinkel, mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D22696 llvm-svn: 289988
* Inline stripInvariantGroupMetadata out of existenceSanjoy Das2016-12-161-7/+2
| | | | | | | As a one liner function, I don't think it is pulling its weight in terms of helping readability. llvm-svn: 289987
* Remove the temporary fix to the RUN line that was committed in r289924.Akira Hatanaka2016-12-161-5/+21
| | | | | | | Also, dump the AST and run FileCheck to make sure the expected nodes are created in the AST. llvm-svn: 289986
* Fix clang buildZachary Turner2016-12-161-7/+7
| | | | llvm-svn: 289985
* Revert "Update for LLVM global variable debug info API change."Adrian Prantl2016-12-1614-93/+61
| | | | | | This reverts commit r289921. llvm-svn: 289984
* Revert "Fix debug info metadata for upstream change in LLVM."Adrian Prantl2016-12-161-1/+1
| | | | llvm-svn: 289983
* Revert "[IR] Remove the DIExpression field from DIGlobalVariable."Adrian Prantl2016-12-16191-1014/+650
| | | | | | | | | | | | | | | | | This reverts commit 289920 (again). I forgot to implement a Bitcode upgrade for the case where a DIGlobalVariable has not DIExpression. Unfortunately it is not possible to safely upgrade these variables without adding a flag to the bitcode record indicating which version they are. My plan of record is to roll the planned follow-up patch that adds a unit: field to DIGlobalVariable into this patch before recomitting. This way we only need one Bitcode upgrade for both changes (with a version flag in the bitcode record to safely distinguish the record formats). Sorry for the churn! llvm-svn: 289982
* Revert "[CodeView] Hook CodeViewRecordIO for reading/writing symbols."Zachary Turner2016-12-1616-1325/+1174
| | | | | | | This reverts commit r289978, which is failing due to some rebase/merge issues. llvm-svn: 289981
* Fix comment on the verifier (typo + doxygen) (NFC)Mehdi Amini2016-12-161-2/+2
| | | | llvm-svn: 289980
* [OpenCL] Allow disabling types and declarations associated with extensionsYaxun Liu2016-12-1629-275/+666
| | | | | | | | | | | | | | | | | | Added a map to associate types and declarations with extensions. Refactored existing diagnostic for disabled types associated with extensions and extended it to declarations for generic situation. Fixed some bugs for types associated with extensions. Allow users to use pragma to declare types and functions for supported extensions, e.g. #pragma OPENCL EXTENSION the_new_extension_name : begin // declare types and functions associated with the extension here #pragma OPENCL EXTENSION the_new_extension_name : end Differential Revision: https://reviews.llvm.org/D21698 llvm-svn: 289979
* [CodeView] Hook CodeViewRecordIO for reading/writing symbols.Zachary Turner2016-12-1616-1174/+1325
| | | | | | | | | This is the 3rd of 3 patches to get reading and writing of CodeView symbol and type records to use a single codepath. Differential Revision: https://reviews.llvm.org/D26427 llvm-svn: 289978
* Strip invalid TBAA when reading bitcodeMehdi Amini2016-12-164-2/+49
| | | | | | | | This ensures backward compatibility on bitcode loading. Differential Revision: https://reviews.llvm.org/D27839 llvm-svn: 289977
* GDB pretty printer for llvm::OptionalDavid Blaikie2016-12-161-0/+29
| | | | | | | | | | (some other implementations of an optional pretty printer print the full name of the optional type (including template parameter) - but seems if the template parameter isn't printed for std::vector, not sure why it would be printed for optional, so erring on the side of consistency in that direction here - compact, etc, as well) llvm-svn: 289976
* Reapply "[LV] Enable vectorization of loops with conditional stores by default"Matthew Simpson2016-12-166-7/+7
| | | | | | | | This patch reapplies r289863. The original patch was reverted because it exposed a bug causing the loop vectorizer to crash in the Python runtime on PPC. The underlying issue was fixed with r289958. llvm-svn: 289975
* Implement LaneBitmask::any(), use it to replace !none(), NFCIKrzysztof Parzyszek2016-12-1625-72/+73
| | | | llvm-svn: 289974
* Fix CodeGenPrepare::stripInvariantGroupMetadataSanjoy Das2016-12-162-5/+5
| | | | | | | | | | | | `dropUnknownNonDebugMetadata` takes a list of "known" metadata IDs. The only reason it worked at all is that `getMetadataID` returns something unrelated -- it returns the subclass ID of the receiver (which is used in `dyn_cast` etc.). That does not numerically match `LLVMContext::MD_invariant_group` and ends up dropping `invariant_group` along with every other metadata that does not numerically match `LLVMContext::MD_invariant_group`. llvm-svn: 289973
* [ARM] Add ARMISD::VLD1DUP to match vld1_dup more consistently.Eli Friedman2016-12-165-25/+316
| | | | | | | | | | | | | | | | | | | | Currently, there are substantial problems forming vld1_dup even if the VDUP survives legalization. The lack of an actual node leads to terrible results: not only can we not form post-increment vld1_dup instructions, but we form scalar pre-increment and post-increment loads which force the loaded value into a GPR. This patch fixes that by combining the vdup+load into an ARMISD node before DAGCombine messes it up. Also includes a crash fix for vld2_dup (see testcase @vld2dupi8_postinc_variable). Recommiting with fix to avoid forming vld1dup if the type of the load doesn't match the type of the vdup (see https://llvm.org/bugs/show_bug.cgi?id=31404). Differential Revision: https://reviews.llvm.org/D27694 llvm-svn: 289972
* Follow-up for r289831: Lower the unjoined thread count to 100 in the ↵Kuba Mracek2016-12-161-1/+1
| | | | | | | | libcxx-future.mm testcase. Turns out 1000 unjoined threads are a bit too rough in certain environments. llvm-svn: 289971
* [analyzer] Fix crash in MallocChecker.Devin Coughlin2016-12-162-2/+7
| | | | | | | | | | | | | Fix a crash in the MallocChecker when the extent size for the argument to new[] is not known. A patch by Abramo Bagnara and Dániel Krupp! https://reviews.llvm.org/D27849 Differential Revision: https://reviews.llvm.org/D27849 llvm-svn: 289970
* Fix name typo in SelectonDAGJoel Jones2016-12-162-5/+5
| | | | llvm-svn: 289969
* [ELF] - Linkerscript: Implement two argument version of ALIGN()Rui Ueyama2016-12-162-1/+30
| | | | | | | | | | Fixes http://llvm.org/PR31129 Patch by Alexander Richardson! Differential Revision: https://reviews.llvm.org/D27848 llvm-svn: 289968
* AMDGPU: Fix name for v_ashrrev_i16Matt Arsenault2016-12-167-15/+15
| | | | llvm-svn: 289967
* [libFuzzer] Fix index error in SearchMemory() implementation for Windows.Marcos Pividori2016-12-161-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D27731 llvm-svn: 289966
* [libFuzzer] Remove unnecessary includes of posix headers.Marcos Pividori2016-12-163-3/+0
| | | | | | | | | Remove includes of "unistd.h" header, which is missing in non posix systems. Differential Revision: https://reviews.llvm.org/D277300 llvm-svn: 289965
* [libFuzzer] Update tests to use more general functions instead of posix ↵Marcos Pividori2016-12-162-1/+8
| | | | | | | | | | | specific. Replace sleep() posix function by a more portable sleep_for() function from std. Also, ignore memmem() and strcasestr() on Windows. Differential Revision: https://reviews.llvm.org/D27729 llvm-svn: 289964
* [CMake] Put headers relative to clangChris Bieneman2016-12-161-10/+6
| | | | | | | | When libcxx isn't building with an installed LLVM we copy the libcxx headers into the LLVM build directory so that a clang in that build tree can find the headers relative to itself. This is only important in situations where you don't have headers installed under /, which is common these days on Darwin. llvm-svn: 289963
* Fix -Wself-assign from r289955Hans Wennborg2016-12-161-7/+8
| | | | llvm-svn: 289962
* Revert "dwarfdump: Support/process relocations on a CU's abbrev_off"David Blaikie2016-12-163-11/+0
| | | | | | | | | Reverting because this breaks lld's gdb_index support - it's probably double counting the abbrev relocation offset. This reverts commit r289954. llvm-svn: 289961
* Revert "[CodeGenPrep] Skip merging empty case blocks"Jun Bum Lim2016-12-166-349/+42
| | | | | | This reverts commit r289951. llvm-svn: 289960
* [InstCombine] auto-generate checks; NFCSanjay Patel2016-12-161-2/+15
| | | | llvm-svn: 289959
* [LV] Don't attempt to type-shrink scalarized instructionsMatthew Simpson2016-12-162-5/+74
| | | | | | | | | | After r288909, instructions feeding predicated instructions may be scalarized if profitable. Since these instructions will remain scalar, we shouldn't attempt to type-shrink them. We should only truncate vector types to their minimal bit widths. This bug was exposed by enabling the vectorization of loops containing conditional stores by default. llvm-svn: 289958
* Pass sample pgo flags to thinlto.Dehao Chen2016-12-166-0/+44
| | | | | | | | | | | | Summary: ThinLTO needs to invoke SampleProfileLoader pass during link time in order to annotate profile correctly after module importing. Reviewers: davidxl, mehdi_amini, tejohnson Subscribers: pcc, davide, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D27790 llvm-svn: 289957
* Fix broken escaping of commands in the buildLuke Drummond2016-12-163-43/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | A combination of broken escaping in CMake and in the python swig generation scripts meant that the swig generation step would fail whenever there were spaces or special characters in parameters passed to swig. The fix for this in CMakeLists is to use the VERBATIM option on all COMMAND-based custom builders relying on CMake to properly escape each argument in the generated file. Within the python swig scripts, the fix is to call subprocess.Popen with a list of raw argument strings rather than ones that are incorrectly manually escaped, then passed to a shell subprocess via subprocess.Popen(' '.join(params)). This also prevents nasty things happening such as accidental command-injection. This allows us to have the swig / python executables in paths containing special chars and spaces, (or on shared storage on Win32, e.g \\some\path or C:\Program Files\swig\swig.exe). Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D26757 llvm-svn: 289956
* [X86] Fold (setcc (cmp (atomic_load_add x, -C) C), COND) to (setcc (LADD x, ↵Hans Wennborg2016-12-162-9/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -C), COND) (PR31367) atomic_load_add returns the value before addition, but sets EFLAGS based on the result of the addition. That means it's setting the flags based on effectively subtracting C from the value at x, which is also what the outer cmp does. This targets a pattern that occurs frequently with reference counting pointers: void decrement(long volatile *ptr) { if (_InterlockedDecrement(ptr) == 0) release(); } Clang would previously compile it (for 32-bit at -Os) as: 00000000 <?decrement@@YAXPCJ@Z>: 0: 8b 44 24 04 mov 0x4(%esp),%eax 4: 31 c9 xor %ecx,%ecx 6: 49 dec %ecx 7: f0 0f c1 08 lock xadd %ecx,(%eax) b: 83 f9 01 cmp $0x1,%ecx e: 0f 84 00 00 00 00 je 14 <?decrement@@YAXPCJ@Z+0x14> 14: c3 ret and with this patch it becomes: 00000000 <?decrement@@YAXPCJ@Z>: 0: 8b 44 24 04 mov 0x4(%esp),%eax 4: f0 ff 08 lock decl (%eax) 7: 0f 84 00 00 00 00 je d <?decrement@@YAXPCJ@Z+0xd> d: c3 ret (Equivalent variants with _InterlockedExchangeAdd, std::atomic<>'s fetch_add or pre-decrement operator generate the same code.) Differential Revision: https://reviews.llvm.org/D27781 llvm-svn: 289955
OpenPOWER on IntegriCloud