summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Add size of section header to data relocation offsets.Sam Clegg2017-04-285-14/+45
| | | | | | | | | | | Also, add test for data relocations and fix addend to be signed. Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32513 llvm-svn: 301690
* [tests] Ensure all test cases use named variablesTobias Grosser2017-04-288-195/+194
| | | | | | | | | | | | | | | This makes it easier to read and possibly even modify the test cases, as there is no need to keep the variable increment in steps of one. More importantly, by using explicit variable names we do not need to rely on the implicit numbering of statements when dumping the scop information. This makes it easier to read and possibly even modify the test cases. Furthermore, by using explicit variables we do not need to rely on the implicit numbering of statements when dumping the scop information. In a future commit, this implicit numbering will likely not be used any more to refer to LLVM-IR values as it is very expensive to construct. llvm-svn: 301689
* [ValueTracking] Teach isSafeToSpeculativelyExecute() about the speculatable ↵Matt Arsenault2017-04-282-0/+29
| | | | | | | | attribute Patch by Tom Stellard llvm-svn: 301688
* [WebAssembly] Write initial memory in pages not bytesSam Clegg2017-04-285-3/+29
| | | | | | | | Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D32660 llvm-svn: 301687
* Public headers need to be public.Tim Hammerquist2017-04-281-2/+2
| | | | llvm-svn: 301686
* TableGen: Add IntrHasSideEffects property for intrinsicsMatt Arsenault2017-04-285-1/+21
| | | | | | | | | | | | | | | The IntrNoMem, IntrReadMem, IntrWriteMem, and IntrArgMemOnly intrinsic properties differ from their corresponding LLVM IR attributes by specifying that the intrinsic, in addition to its memory properties, has no other side effects. The IntrHasSideEffects flag used in combination with one of the memory flags listed above, makes it possible to define an intrinsic such that its properties at the CodeGen layer match its properties at the IR layer. Patch by Tom Stellard llvm-svn: 301685
* Enable -fno-split-dwarf-inlining even when -gsplit-dwarf isn't specified.David Blaikie2017-04-282-4/+13
| | | | | | | | | | | | | | Since -gsplit-dwarf is specified on a backend compile (in ThinLTO parlance) it isn't passed during the frontend compile (because no ELF object/dwo file is produced then), yet the -fno-split-dwarf-inlining value needs to be encoded in the LLVM DebugInfo metadata to have effect... So let it be specified & it'll be silently ignored if -gsplit-dwarf isn't used in the end, otherwise it'll be used on a per-cu basis depending on where it's specified in the frontend compile actions. llvm-svn: 301684
* Change the format of the map file.Rui Ueyama2017-04-282-61/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we printed out input sections and input files in separate columns as shown below. Address Size Align Out In File Symbol 0000000000201000 0000000000000015 4 .text 0000000000201000 000000000000000e 4 .text 0000000000201000 000000000000000e 4 foo.o 0000000000201000 0000000000000000 0 _start 0000000000201005 0000000000000000 0 f(int) 000000000020100e 0000000000000000 0 local 0000000000201010 0000000000000002 4 bar.o 0000000000201010 0000000000000000 0 foo 0000000000201011 0000000000000000 0 bar This format doesn't make much sense because for each input section, there's always exactly one input file. This patch changes the format to this. Address Size Align Out In Symbol 0000000000201000 0000000000000015 4 .text 0000000000201000 000000000000000e 4 foo.o:(.text) 0000000000201000 0000000000000000 0 _start 0000000000201005 0000000000000000 0 f(int) 000000000020100e 0000000000000000 0 local 0000000000201010 0000000000000002 4 bar.o:(.text) 0000000000201010 0000000000000000 0 foo 0000000000201011 0000000000000000 0 bar Differential Revision: https://reviews.llvm.org/D32657 llvm-svn: 301683
* Make getParamAlignment use argument numbersReid Kleckner2017-04-2816-32/+48
| | | | | | | | | | | | | | | | | | The method is called "get *Param* Alignment", and is only used for return values exactly once, so it should take argument indices, not attribute indices. Avoids confusing code like: IsSwiftError = CS->paramHasAttr(ArgIdx, Attribute::SwiftError); Alignment = CS->getParamAlignment(ArgIdx + 1); Add getRetAlignment to handle the one case in Value.cpp that wants the return value alignment. This is a potentially breaking change for out-of-tree backends that do their own call lowering. llvm-svn: 301682
* GlobalISel: Followup for r301679Matthias Braun2017-04-281-1/+2
| | | | llvm-svn: 301681
* Add speculatable function attributeMatt Arsenault2017-04-2819-18/+133
| | | | | | | | This attribute tells the optimizer that the function may be speculated. Patch by Tom Stellard llvm-svn: 301680
* TargetLowering: Add finalizeLowering() function; NFCMatthias Braun2017-04-286-24/+27
| | | | | | | | | | | | | | | | | Adds a new method finalizeLowering to TargetLoweringBase. This is in preparation for an upcoming commit. This function is meant for target specific adjustments to MachineFrameInfo or register reservations. Move the freezeRegisters() and the hasCopyImplyingStackAdjustment() handling into the new function to prove the concept. As an added bonus GlobalISel no longer missed the hasCopyImplyingStackAdjustment() handling with this. Differential Revision: https://reviews.llvm.org/D32621 llvm-svn: 301679
* Remove LinkerScript::flush.Rafael Espindola2017-04-283-34/+67
| | | | | | | | | | | | | | | | | | | | This patch replaces flush with a last ditch attempt at synchronizing the section list with the linker script "AST". The synchronization is a bit of a hack and should in time be avoided by creating the AST earlier so that modifications can be made directly to it instead of modifying the section list and synchronizing it back. This is the main step for fixing https://bugs.llvm.org/show_bug.cgi?id=32816. With this in place I think the only missing thing would be to have processCommands assign section indexes as dummy offsets so that the sort in OutputSection::finalize works. With this LinkerScript::assignAddresses becomes much simpler, which should help with the thunk work. llvm-svn: 301678
* AMDGPU: Add new amdgcn.init.exec intrinsicsMarek Olsak2017-04-287-0/+196
| | | | | | | | | | v2: More tests, bug fixes, cosmetic changes. Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, llvm-commits, t-tye Differential Revision: https://reviews.llvm.org/D31762 llvm-svn: 301677
* limit to 2 parallel links when using thinltoBob Haarman2017-04-281-7/+11
| | | | | | | | | | | | | | | | Summary: When using ThinLTO, the linker performs its own parallelism. This change limits the number of parallel link jobs that Ninja will issue to keep the total number of threads reasonable when linking with ThinLTO. Reviewers: hans, ruiu Subscribers: mgorny, mehdi_amini, Prazek Differential Revision: https://reviews.llvm.org/D31990 llvm-svn: 301676
* Use toString(Inputfile*) to format a file object.Rui Ueyama2017-04-283-6/+4
| | | | llvm-svn: 301674
* Kill off the old SimplifyInstruction API by converting remaining users.Daniel Berlin2017-04-2821-105/+125
| | | | llvm-svn: 301673
* [IPO/MergeFunctions] This function is used only under DEBUG().Davide Italiano2017-04-281-0/+4
| | | | llvm-svn: 301672
* [RS4GC] Simplify attribute handling code NFCReid Kleckner2017-04-281-47/+25
| | | | | | | Avoids use of AttributeList::getNumSlots, making it easier to change the underlying implementation. llvm-svn: 301671
* [Codegen] Disable Polly's codegen verification by defaultTobias Grosser2017-04-281-1/+1
| | | | | | | | | | | | | | | | | As has been reported in the previous commit, codegen verification can result in quadratic compile time increases for large functions with many scops. This is certainly not something we would like to have in the Polly default configuration. Hence, we disable codegen verification by default -- also to see if this resolves some of the compilation timeouts we currently see on the AOSP buildbots. We still leave this feature in Polly as it has shown _very_ useful for debugging. In fact, we may want to have a discussion if we can bring this feature back in a way that does not impact compilation time so much. Thanks to Eli Friedman <efriedma@codeaurora.org> for reporting this issue and for providing the test case in the previous commit (where I forgot to acknowledge him). llvm-svn: 301670
* [CodeGen] Skip verify if -polly-codegen-verify is set to falseTobias Grosser2017-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, we always tried to verify the function and printed verification errors, but just did not abort in case -polly-codegen-verify=false was set and verification failed. As verification can become very cosly -- for large functions with many scops we may verify the very same function very often -- this can affect compile time very negatively. Hence, we respect the -polly-codegen-verify flag with this check, ensuring that no verification is run if -polly-codegen-verify=false. This reduces code generation time from 26 seconds to 4 seconds on the test case below with -polly-codegen-verify=false: struct X { int x; }; void a(); #define SIG (int x, X **y, X **z) typedef void (*fn)SIG; #define FN { for (int i = 0; i < x; ++i) { (*y)[i].x += (*z)[i].x; } a(); } #define FN5 FN FN FN FN FN #define FN25 FN5 FN5 FN5 FN5 #define FN125 FN25 FN25 FN25 FN25 FN25 #define FN250 FN125 FN125 #define FN1250 FN250 FN250 FN250 FN250 FN250 void x SIG { FN1250 } llvm-svn: 301669
* Remove trailing whitespace from the -Map output.Rui Ueyama2017-04-281-4/+4
| | | | | | | If a string is shorter than 7 characters, we used to print out trailing whitespace characters. llvm-svn: 301668
* [CodeGen][ObjC] Don't retain captured Objective-C pointers at blockAkira Hatanaka2017-04-285-19/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | creation that are const-qualified. When a block captures an ObjC object pointer, clang retains the pointer to prevent prematurely destroying the object the pointer points to before the block is called or copied. When the captured object pointer is const-qualified, we can avoid emitting the retain/release pair since the pointer variable cannot be modified in the scope in which the block literal is introduced. For example: void test(const id x) { callee(^{ (void)x; }); } This patch implements that optimization. rdar://problem/28894510 Differential Revision: https://reviews.llvm.org/D32601 llvm-svn: 301667
* Use Argument::hasAttribute and AttributeList::ReturnIndex moreReid Kleckner2017-04-2815-141/+103
| | | | | | | | | | | This eliminates many extra 'Idx' induction variables in loops over arguments in CodeGen/ and Target/. It also reduces the number of places where we assume that ReturnIndex is 0 and that we should add one to argument numbers to get the corresponding attribute list index. NFC llvm-svn: 301666
* Cleanup: Use DIExpression::prepend in buildDbgValueForSpill(). (NFC)Adrian Prantl2017-04-283-13/+5
| | | | llvm-svn: 301665
* Add remaining SBTrace headers to LLDB frameworkTim Hammerquist2017-04-281-0/+4
| | | | llvm-svn: 301664
* [IR] Delete unused Argument::removeAttr overloadReid Kleckner2017-04-282-11/+0
| | | | | | It doesn't make sense to remove an AttributeList from an argument. llvm-svn: 301663
* Clean up DIExpression::prependDIExpr a little. (NFC)Adrian Prantl2017-04-286-27/+20
| | | | llvm-svn: 301662
* Remove a redundant local variable.Rui Ueyama2017-04-281-4/+3
| | | | llvm-svn: 301661
* Bitcode: Do not remove empty summary entries when reading a per-module summary.Peter Collingbourne2017-04-283-29/+0
| | | | | | | | This became no longer necessary after D19462 landed, and will be incompatible with an upcoming change to the summary data structures that changes how we represent references. llvm-svn: 301660
* Speed up the -Map option.Rui Ueyama2017-04-282-63/+108
| | | | | | | | | | | | | | | | | | | | | | We found that some part of code for the -Map option takes O(m*n) where m is the number of input sections in some file and n is the number of symbols in the same file. If you do LTO, we usually have only a few object files as inputs for the -Map option feature, so this performance characteristic was worse than I expected. This patch rewrites the -Map option feature to speed it up. I eliminated the O(m*n) bottleneck and also used multi-threading. As a result, clang link time with the -Map option improved from 18.7 seconds to 11.2 seconds. Without -Map, it takes 7.7 seconds, so the -Map option is now about 3x faster than before for this test case (from 11.0 seconds to 3.5 seconds.) The generated output file size was 223 MiB, and the file contains 1.2M lines. Differential Revision: https://reviews.llvm.org/D32631 llvm-svn: 301659
* IR: fix some doxygen grammar (NFC)Saleem Abdulrasool2017-04-281-1/+1
| | | | | | | Fix a bit of the doxygen grammar that was off that I noticed while looking at this file for another issue. llvm-svn: 301658
* COFF: actually synthesize CONST imports properlySaleem Abdulrasool2017-04-284-0/+30
| | | | | | | | | | CONSTANT imports expect both the `_imp_` prefixed and non-prefixed symbols should be added to the symbol table. This allows for linking symbols like _NSConcreteGlobalBlock in WinObjC. The previous change would generate the import library properly by handling the option but would not consume the generated entry properly. llvm-svn: 301657
* [APInt] Add clearSignBit method. Use it and setSignBit in a few places. NFCICraig Topper2017-04-285-6/+11
| | | | llvm-svn: 301656
* [LazyValueInfo] Fix typo in comment. NFCCraig Topper2017-04-281-1/+1
| | | | llvm-svn: 301655
* [ValueTracking] Use APInt::isSubsetOf and APInt::intersects. NFCCraig Topper2017-04-281-2/+2
| | | | llvm-svn: 301654
* [bpf] add bigendian support to disassemblerAlexei Starovoitov2017-04-282-7/+37
| | | | | | | | | . swap 4-bit register encoding, 16-bit offset and 32-bit imm to support big endian archs . add a test Reported-by: David S. Miller <davem@davemloft.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org> llvm-svn: 301653
* [DOXYGEN] Minor improvements in doxygen comments.Ekaterina Romanova2017-04-281-166/+0
| | | | | | | | | | | | - I removed doxygen comments for the intrinsics that "alias" the other existing documented intrinsics and that only sligtly differ in spelling (single underscores vs. double underscores). #define _tzcnt_u16(a) (__tzcnt_u16((a))) It will be very hard to keep the documentation for these "aliases" in sync with the documentation for the intrinsics they alias to. Out of sync documentation will be more confusing than no documentation. I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. llvm-svn: 301652
* [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
OpenPOWER on IntegriCloud