summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] modernize-use-emplace: remove unnecessary make_pair callsJakub Kuderski2017-04-284-24/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When there is a push_back with a call to make_pair, turn it into emplace_back and remove the unnecessary make_pair call. Eg. ``` std::vector<std::pair<int, int>> v; v.push_back(std::make_pair(1, 2)); // --> v.emplace_back(1, 2); ``` make_pair doesn't get removed when explicit template parameters are provided, because of potential problems with type conversions. Reviewers: Prazek, aaron.ballman, hokein, alexfh Reviewed By: Prazek, alexfh Subscribers: JDevlieghere, JonasToth, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D32395 llvm-svn: 301651
* CMake: ignore git stderr when trying to sort out revision. NFC.Tim Northover2017-04-282-2/+4
| | | | llvm-svn: 301650
* [InlineCost] Improve the cost heuristic for SwitchJun Bum Lim2017-04-2810-115/+405
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The motivation example is like below which has 13 cases but only 2 distinct targets ``` lor.lhs.false2: ; preds = %if.then switch i32 %Status, label %if.then27 [ i32 -7012, label %if.end35 i32 -10008, label %if.end35 i32 -10016, label %if.end35 i32 15000, label %if.end35 i32 14013, label %if.end35 i32 10114, label %if.end35 i32 10107, label %if.end35 i32 10105, label %if.end35 i32 10013, label %if.end35 i32 10011, label %if.end35 i32 7008, label %if.end35 i32 7007, label %if.end35 i32 5002, label %if.end35 ] ``` which is compiled into a balanced binary tree like this on AArch64 (similar on X86) ``` .LBB853_9: // %lor.lhs.false2 mov w8, #10012 cmp w19, w8 b.gt .LBB853_14 // BB#10: // %lor.lhs.false2 mov w8, #5001 cmp w19, w8 b.gt .LBB853_18 // BB#11: // %lor.lhs.false2 mov w8, #-10016 cmp w19, w8 b.eq .LBB853_23 // BB#12: // %lor.lhs.false2 mov w8, #-10008 cmp w19, w8 b.eq .LBB853_23 // BB#13: // %lor.lhs.false2 mov w8, #-7012 cmp w19, w8 b.eq .LBB853_23 b .LBB853_3 .LBB853_14: // %lor.lhs.false2 mov w8, #14012 cmp w19, w8 b.gt .LBB853_21 // BB#15: // %lor.lhs.false2 mov w8, #-10105 add w8, w19, w8 cmp w8, #9 // =9 b.hi .LBB853_17 // BB#16: // %lor.lhs.false2 orr w9, wzr, #0x1 lsl w8, w9, w8 mov w9, #517 and w8, w8, w9 cbnz w8, .LBB853_23 .LBB853_17: // %lor.lhs.false2 mov w8, #10013 cmp w19, w8 b.eq .LBB853_23 b .LBB853_3 .LBB853_18: // %lor.lhs.false2 mov w8, #-7007 add w8, w19, w8 cmp w8, #2 // =2 b.lo .LBB853_23 // BB#19: // %lor.lhs.false2 mov w8, #5002 cmp w19, w8 b.eq .LBB853_23 // BB#20: // %lor.lhs.false2 mov w8, #10011 cmp w19, w8 b.eq .LBB853_23 b .LBB853_3 .LBB853_21: // %lor.lhs.false2 mov w8, #14013 cmp w19, w8 b.eq .LBB853_23 // BB#22: // %lor.lhs.false2 mov w8, #15000 cmp w19, w8 b.ne .LBB853_3 ``` However, the inline cost model estimates the cost to be linear with the number of distinct targets and the cost of the above switch is just 2 InstrCosts. The function containing this switch is then inlined about 900 times. This change use the general way of switch lowering for the inline heuristic. It etimate the number of case clusters with the suitability check for a jump table or bit test. Considering the binary search tree built for the clusters, this change modifies the model to be linear with the size of the balanced binary tree. The model is off by default for now : -inline-generic-switch-cost=false This change was originally proposed by Haicheng in D29870. Reviewers: hans, bmakam, chandlerc, eraman, haicheng, mcrosier Reviewed By: hans Subscribers: joerg, aemerson, llvm-commits, rengolin Differential Revision: https://reviews.llvm.org/D31085 llvm-svn: 301649
* [libclang] Expose some target information via the C API.Emilio Cobos Alvarez2017-04-286-3/+146
| | | | | | | | | | | This allows users to query the target triple and target pointer width, which would make me able to fix https://github.com/servo/rust-bindgen/issues/593 and other related bugs in an elegant way (without having to manually parse the target triple in the command line arguments). Differential Revision: https://reviews.llvm.org/D32389 llvm-svn: 301648
* Use the -Wunknown-warning-option group for the "unknown warning group"Alex Lorenz2017-04-282-3/+6
| | | | | | | | | | | diagnostic in #pragma diagnostic This matches the warning group that's specified for the unknown warning options that are passed-in as command line arguments. rdar://29526025 llvm-svn: 301647
* Move variable local to where ita used. NFCI.Simon Pilgrim2017-04-281-1/+1
| | | | llvm-svn: 301646
* Memory intrinsic value profile optimization: Avoid divide by 0Teresa Johnson2017-04-282-0/+23
| | | | | | | | | | | | | | Summary: Skip memops if the total value profiled count is 0, we can't correctly scale up the counts and there is no point anyway. Reviewers: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32624 llvm-svn: 301645
* [DAGCombiner] Add ComputeNumSignBits vector demanded elements support to ↵Simon Pilgrim2017-04-282-18/+50
| | | | | | | | ASHR and INSERT_VECTOR_ELT (reapplied) Reapplied r299221 after fix for nondeterminism in ThinLTO builder (rL301599), with extra check for implicit truncation of inserted element. llvm-svn: 301644
* [Sema] Avoid an invalid redefinition error that was presented forAlex Lorenz2017-04-283-0/+46
| | | | | | | | | | of a function whose previous definition was typo-corrected rdar://28550928 Differential Revision: https://reviews.llvm.org/D25113 llvm-svn: 301643
* Remove lock from ConstString::GetLengthPavel Labath2017-04-281-18/+11
| | | | | | | | | | | | | | | Summary: ConstStrings are immutable, so there is no need to grab even a reader lock in order to read the length field. Reviewers: #lldb, labath Reviewed By: labath Subscribers: zturner, labath, lldb-commits Differential Revision: https://reviews.llvm.org/D32306 Patch by Scott Smith <scott.smith@purestorage.com> llvm-svn: 301642
* [X86][SSE] Added new tests from D32416 to show codegen deltaSimon Pilgrim2017-04-281-0/+87
| | | | llvm-svn: 301641
* [Polly] [PPCGCodeGeneration] Add managed memory support to GPU codeSiddharth Bhat2017-04-284-8/+246
| | | | | | | | | | | | | | | | | | | | | | generation. This needs changes to GPURuntime to expose synchronization between host and device. 1. Needs better function naming, I want a better name than "getOrCreateManagedDeviceArray" 2. DeviceAllocations is used by both the managed memory and the non-managed memory path. This exploits the fact that the two code paths are never run together. I'm not sure if this is the best design decision Reviewed by: PhilippSchaad Tags: #polly Differential Revision: https://reviews.llvm.org/D32215 llvm-svn: 301640
* [X86][SSE] Renames all ones test to better match type.Simon Pilgrim2017-04-281-130/+204
| | | | | | Added 8f32/4f64 optsize tests discussed on D32416 llvm-svn: 301639
* [X86][SSE] Add codegen test for _mm_set_pd1 (PR32827)Simon Pilgrim2017-04-281-0/+16
| | | | llvm-svn: 301638
* [X86][SSE] Add _mm_set_pd1 (PR32827)Simon Pilgrim2017-04-282-0/+25
| | | | | | Matches _mm_set_ps1 implementation llvm-svn: 301637
* Resurrect pselect MainLoop implementationPavel Labath2017-04-282-94/+209
| | | | | | | | | | | | | | | | | | | | Summary: It turns out that even though ppoll is available on all the android devices we support, it does not seem to be working properly on all of them -- MainLoop just does a busy loop with ppoll returning EINTR and not making any progress. This brings back the pselect implementation and makes it available on android. I could not do any cmake checks for this as the ppoll symbol is actually avaiable -- it just does not work. Reviewers: beanz, eugene Subscribers: srhines, lldb-commits Differential Revision: https://reviews.llvm.org/D32600 llvm-svn: 301636
* [index] Handle vector types in USR generatorAlex Lorenz2017-04-282-1/+18
| | | | | | rdar://25339187 llvm-svn: 301635
* [ARM] GlobalISel: fixup r301632Diana Picus2017-04-281-42/+0
| | | | | | | Actually remove ARMInstructionSelector.h... Forgot to stage the removal in the previous commit. llvm-svn: 301633
* [ARM] GlobalISel: Get rid of ARMInstructionSelector.h. NFC.Diana Picus2017-04-283-3/+31
| | | | | | | | | Declare the ARMInstructionSelector in an anonymous namespace, to make it more in line with the other targets which were migrated to this in r299637 in order to avoid TableGen'erated headers being included in non-GlobalISel builds. llvm-svn: 301632
* [DWARF] - Fix mistype in dump output of pub* tables. NFC.George Rimar2017-04-281-1/+1
| | | | | | | There was a garbage character in output introduced by myself in r290040 "[DWARF] - Introduce DWARFDebugPubTable class for dumping pub* sections." llvm-svn: 301631
* [DebugInfo][X86] Improve X86 Optimize LEAs handling of debug values.Andrew Ng2017-04-285-99/+156
| | | | | | | | | | | | | | | This is a follow up to the fix in r298360 to improve the handling of debug values when redundant LEAs are removed. The fix in r298360 effectively discarded the debug values. This patch now attempts to preserve the debug values by using the DWARF DW_OP_stack_value operation via prependDIExpr. Moved functions appendOffset and prependDIExpr from Local.cpp to DebugInfoMetadata.cpp and made them available as static member functions of DIExpression. Differential Revision: https://reviews.llvm.org/D31604 llvm-svn: 301630
* [WebAssembly] Update calls to computeKnownBits after the changes from r301620.Craig Topper2017-04-282-5/+6
| | | | | | I didn't realize WebAssembly wasn't a default build target so I missed that changes were needed. llvm-svn: 301629
* [X86][NFC] Refactor RepMovsRepeats in preparation for D32481.Clement Courbet2017-04-281-49/+45
| | | | | | Differential Revision: https://reviews.llvm.org/D32583 llvm-svn: 301628
* [ARM] GlobalISel: Tighten test. NFCDiana Picus2017-04-281-27/+27
| | | | | | Explicitly check types and load sizes in the IRTranslator test. llvm-svn: 301627
* [ValueTracking] Convert computeKnownBitsFromRangeMetadata to use KnownBits ↵Craig Topper2017-04-283-11/+10
| | | | | | struct. llvm-svn: 301626
* [EarlyCSE] Mark the condition of assume intrinsic as trueMax Kazantsev2017-04-282-3/+199
| | | | | | | | | | | | | | EarlyCSE should not just ignore assumes. It should use the fact that its condition is true for all dominated instructions. Reviewers: sanjoy, reames, apilipenko, anna, skatkov Reviewed By: reames, sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32482 llvm-svn: 301625
* Update to isl-0.18-592-gb50ad59Tobias Grosser2017-04-2828-331/+419
| | | | | | This is just a general maintenance update. llvm-svn: 301624
* [EarlyCSE] Remove guards with conditions known to be trueMax Kazantsev2017-04-282-3/+174
| | | | | | | | | | | | | | | | | If a condition is calculated only once, and there are multiple guards on this condition, we should be able to remove all guards dominated by the first of them. This patch allows EarlyCSE to try to find the condition of a guard among the known values, and if it is true, remove the guard. Otherwise we keep the guard and mark its condition as 'true' for future consideration. Reviewers: sanjoy, reames, apilipenko, skatkov, anna, dberlin Reviewed By: reames, sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32476 llvm-svn: 301623
* Fix unset-insert-libraries-on-exec.cc to use "%env" to make it work in iOS ↵Kuba Mracek2017-04-281-1/+1
| | | | | | simulator. llvm-svn: 301622
* Fix the reexec-insert-libraries-env.cc testcase to use %env to make it work ↵Kuba Mracek2017-04-281-1/+1
| | | | | | on iOS simulator. llvm-svn: 301621
* [SelectionDAG] Use KnownBits struct in DAG's computeKnownBits and ↵Craig Topper2017-04-2831-748/+678
| | | | | | | | | | | | simplifyDemandedBits This patch replaces the separate APInts for KnownZero/KnownOne with a single KnownBits struct. This is similar to what was done to ValueTracking's version recently. This is largely a mechanical transformation from KnownZero to Known.Zero. Differential Revision: https://reviews.llvm.org/D32569 llvm-svn: 301620
* clang/test/ARCMT/remap-applying.c: Use %/s on the command line of echo(1).NAKAMURA Takumi2017-04-282-2/+2
| | | | llvm-svn: 301619
* [SelectionDAG] Use various APInt methods to reduce temporary APInt creationCraig Topper2017-04-286-39/+30
| | | | | | This patch uses various APInt methods to reduce the number of temporary APInts. These were all found while working through converting SelectionDAG's computeKnownBits to also use the KnownBits struct recently added to the ValueTracking version. llvm-svn: 301618
* [asan] Add a compilation wrapper that codesigns shared libraries to support ↵Kuba Mracek2017-04-283-4/+40
| | | | | | | | | | iOS simulator testing Tests that run on the iOS simulator require the dlopen'd dylibs are codesigned. This patch adds the "iossim_compile.py" wrapper that codesigns any produces dylib. Differential Revision: https://reviews.llvm.org/D32561 llvm-svn: 301617
* Remove unnecessary semicolonSanjoy Das2017-04-281-1/+1
| | | | | | This shows up as a -Wpendatic error on GCC. llvm-svn: 301616
* [StackMaps] Increase the size of the "location size" fieldSanjoy Das2017-04-2821-347/+1082
| | | | | | | | | | | | | | | | | | | | Summary: In some cases LLVM (especially the SLP vectorizer) will create vectors that are 256 bytes (or larger). Given that this is intentional[0] is likely to get more common, this patch updates the StackMap binary format to deal with the spill locations for said vectors. This change also bumps the stack map version from 2 to 3. [0]: https://reviews.llvm.org/D32533#738350 Reviewers: reames, kavon, skatkov, javed.absar Subscribers: mcrosier, nemanjai, llvm-commits Differential Revision: https://reviews.llvm.org/D32629 llvm-svn: 301615
* COFF Import: expose both symbolsSaleem Abdulrasool2017-04-283-3/+10
| | | | | | | | | COFF Import libraries which use the obsolete CONSTANT export are supposed to get two symbols, one with the `_imp_` prefix and one without. Ensure that we expose both for iteration. This is necessary to fix the librarian with COFF CONSTANT exports. llvm-svn: 301614
* clang/test/Index/index-module.m: Relax expressions to satisfy DOSish path ↵NAKAMURA Takumi2017-04-281-1/+1
| | | | | | separator \\, since r301597. llvm-svn: 301613
* [APInt] Use inplace shift methods where possible. NFCICraig Topper2017-04-2811-30/+41
| | | | llvm-svn: 301612
* Move functionality for handling module maps as inputs from the -emit-moduleRichard Smith2017-04-288-286/+353
| | | | | | | | | | | | | | | | | | | action to the general FrontendAction infrastructure. This permits applying -E, -ast-dump, -fsyntax-only, and so on to a module map compilation. (The -E form is not currently especially useful yet as there's no good way to take the output and use it to actually build a module.) In order to support this, -cc1 now accepts -x <lang>-module-map in all cases where it accepts -x <lang> for a language we can parse (not ir/ast). And for uniformity, we also accept -x <lang>-header for all such languages (we used to reject for cuda and renderscript), and -x <lang>-cpp-output for all such languages (we used to reject for c, cl, and renderscript). (None of these new alternatives are accepted by the driver yet, so no user-visible changes.) llvm-svn: 301610
* Provide a mechanism to do some pre-loading of symbols up front.Jim Ingham2017-04-2811-4/+78
| | | | | | | | | | | Loading a shared library can require a large amount of work; rather than do that serially for each library, this patch will allow parallelization of the symbols and debug info name indexes. From scott.smith@purestorage.com https://reviews.llvm.org/D32598 llvm-svn: 301609
* Add a newline to suppress compiler warnings.Jim Ingham2017-04-281-1/+1
| | | | llvm-svn: 301608
* [llvm-pdbdump] Allow printing only a portion of a stream.Zachary Turner2017-04-286-8/+102
| | | | | | | | | | | | When dumping raw data from a stream, you might know the offset of a certain record you're interested in, as well as how long that record is. Previously, you had to dump the entire stream and wade through the bytes to find the interesting record. This patch allows you to specify an offset and length on the command line, and it will only dump the requested range. llvm-svn: 301607
* [WebAssembly] Add some tests for wasm MC layerSam Clegg2017-04-284-6/+134
| | | | | | | | Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32558 llvm-svn: 301606
* [ASTImporter] Move structural equivalence context to its own file. NFCIBruno Cardoso Lopes2017-04-284-1413/+1451
| | | | | | | | | | | Create a header and impl file for the structural equivalence context. This is to allow other users outside clang importer. NFCI Differential Revision: https://reviews.llvm.org/D31777 rdar://problem/30167717 llvm-svn: 301604
* Resurrect the standalone build of LLDBKamil Rytarowski2017-04-282-2/+2
| | | | | | | | Switch includes "llvm/Config/config.h" to "llvm/Config/llvm-config.h". Tested on NetBSD 7.99.70 amd64 llvm-svn: 301603
* [ARCMigrate] When applying changes from remap files, disable the ↵Argyrios Kyrtzidis2017-04-285-7/+19
| | | | | | | | | 'adjustRemovals' functionality of EditedSource 'adjustRemovals' is used to avoid situation when removing a range inadvertently causes 2 separate identifiers to get joined into one. But it is not useful when the edits are character precise, as is the case with the remap files. llvm-svn: 301602
* Use a consistent style. NFCGeorge Burgess IV2017-04-271-4/+3
| | | | llvm-svn: 301601
* integrate SBTrace changes into Xcode projectTim Hammerquist2017-04-271-0/+12
| | | | llvm-svn: 301600
* [SROA] Fix nondeterminism exposed by Simon's r299221.Davide Italiano2017-04-271-14/+12
| | | | | | | Use a SmallSetSetVector instead of a SmallPtrSet as iterating over the latter is not stable ('<' relies on addresses). llvm-svn: 301599
OpenPOWER on IntegriCloud