summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* CMake: Don't install llvm-tblgen twiceTom Stellard2017-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: The add_tablegen macros defines its own install target, and it was also calling add_llvm_utility which adds another install target. Configuring with -DLLVM_TOOLS_INSTALL_DIR set to something other than 'bin' along with -DLLVM_INSTALL_UTILS=ON was causing llvm-tablgen to be installed to two separate directories. Reviewers: beanz, hans Reviewed By: beanz Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D30656 llvm-svn: 297403
* Handle ":" as a regular token character in linker scripts.Rui Ueyama2017-03-095-65/+97
| | | | | | | | | This is an alternative to https://reviews.llvm.org/D30500 to simplify the version definition parser and allow ":" in symbol names. Differential Revision: https://reviews.llvm.org/D30722 llvm-svn: 297402
* [Hexagon] Refactor the DAG preprocessing code, NFCKrzysztof Parzyszek2017-03-091-32/+88
| | | | | | Extract individual transformations into their own functions. llvm-svn: 297401
* Minor format change. nfc.Rong Xu2017-03-091-5/+5
| | | | llvm-svn: 297400
* [PGO] Refactor profile dumping function for ease of adding other profile kindRong Xu2017-03-092-43/+64
| | | | | | | | Refactor the dumping function so that we can add other value profile kind easily. Differential Revision: https://reviews.llvm.org/D30752 llvm-svn: 297399
* Add front() method to SetVector.Jan Sjodin2017-03-091-0/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D27262 llvm-svn: 297398
* [DebugInfo] Append extended dereferencing mechanism to variables' ↵Konstantin Zhuravlyov2017-03-093-2/+166
| | | | | | | | DIExpression for targets that support more than one address space Differential Revision: https://reviews.llvm.org/D29673 llvm-svn: 297397
* [FileCheck] Added --enable-var-scope option to enable scope for regex variables.Artem Belevich2017-03-094-21/+88
| | | | | | | | | | | | | If `--enable-var-scope` is in effect, variables with names that start with `$` are considered to be global. All other variables are local. All local variables get undefined at the beginning of each CHECK-LABEL block. Global variables are not affected by CHECK-LABEL. This makes it easier to ensure that individual tests are not affected by variables set in preceding tests. Differential Revision: https://reviews.llvm.org/D30749 llvm-svn: 297396
* [Cmake] Generate a PollyConfig.cmake.Michael Kruse2017-03-093-0/+170
| | | | | | | | | | | Generate a PollyConfig.cmake for use with Cmake's find_package in out-of-tree projects. Contributed-by: Philip Pfaffe <philip.pfaffe@gmail.com> Differential Revision: https://reviews.llvm.org/D30495 llvm-svn: 297395
* [Hexagon] Add -mhvx option to the Hexagon backendKrzysztof Parzyszek2017-03-091-2/+8
| | | | llvm-svn: 297393
* Reapply r297382: "[compiler-rt][builtins] Add __isOSVersionAtLeast()"Erik Pilkington2017-03-099-2/+191
| | | | | | Looks like the problem was a case-insensitive include of dispatch/dispatch.h. llvm-svn: 297392
* [Hexagon] Propagate zext of i1 into arithmetic code in selection DAGKrzysztof Parzyszek2017-03-094-54/+156
| | | | | | | (op ... (zext i1 c) ...) -> (select c (op ... 1 ...), (op ... 0 ...)) llvm-svn: 297391
* [InstSimplify] vector div/rem with any zero element in divisor is undefSanjay Patel2017-03-095-25/+31
| | | | | | | | | | | This was suggested as a DAG simplification in the review for rL297026 : http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170306/435253.html ...but let's start with IR since we have actual docs for IR (LangRef). Differential Revision: https://reviews.llvm.org/D30665 llvm-svn: 297390
* Retry: [ubsan] Detect UB loads from bitfieldsVedant Kumar2017-03-095-7/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | It's possible to load out-of-range values from bitfields backed by a boolean or an enum. Check for UB loads from bitfields. This is the motivating example: struct S { BOOL b : 1; // Signed ObjC BOOL. }; S s; s.b = 1; // This is actually stored as -1. if (s.b == 1) // Evaluates to false, -1 != 1. ... Changes since the original commit: - Single-bit bools are a special case (see CGF::EmitFromMemory), and we can't avoid dealing with them when loading from a bitfield. Don't try to insert a check in this case. Differential Revision: https://reviews.llvm.org/D30423 llvm-svn: 297389
* Revert "[compiler-rt][builtins] Add __isOSVersionAtLeast()"Erik Pilkington2017-03-099-191/+2
| | | | | | This reverts r297382, it was causing build failures. llvm-svn: 297388
* [ARM] Remove t2xtpk feature from testsSam Parker2017-03-095-7/+7
| | | | | | | | | I previously removed the T2XtPk feature from the ARM backend, but it looks like I missed some of the tests that were using the feature. Differential Revision: https://reviews.llvm.org/D30778 llvm-svn: 297386
* [DAG] recognize div/rem by 0 as undef before trying constant foldingSanjay Patel2017-03-094-224/+95
| | | | | | | | | | | | | | | | | | | | As discussed in the review thread for rL297026, this is actually 2 changes that would independently fix all of the test cases in the patch: 1. Return undef in FoldConstantArithmetic for div/rem by 0. 2. Move basic undef simplifications for div/rem (simplifyDivRem()) before foldBinopIntoSelect() as a matter of efficiency. I will handle the case of vectors with any zero element as a follow-up. That change is the DAG sibling for D30665 + adding a check of vector elements to FoldConstantVectorArithmetic(). I'm deleting the test for PR30693 because it does not test for the actual bug any more (dangers of using bugpoint). Differential Revision: https://reviews.llvm.org/D30741 llvm-svn: 297384
* [sanitizer] Fix android buildbots after r297370Maxim Ostapenko2017-03-091-0/+2
| | | | llvm-svn: 297383
* [compiler-rt][builtins] Add __isOSVersionAtLeast()Erik Pilkington2017-03-099-2/+191
| | | | | | | | | | | | | | | | | This predicate compares the host's marketing OS version to one passed as argument. Currently, only darwin targets are supported. This is done by parsing the SystemVersion.plist file. Also added in this patch is some lit testing infrastructure for builtins, which previously had none. This part of the patch was written by Alex Lorenz (with some minor modifications). This patch is part of a feature I proposed here: http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html Differential revision: https://reviews.llvm.org/D30136 llvm-svn: 297382
* [X86][SSE] Speed up constant pool shuffle mask decoding with direct copy ↵Simon Pilgrim2017-03-091-7/+27
| | | | | | | | (PR32037). If the constants are already the correct size, we can copy them directly into the shuffle mask. llvm-svn: 297381
* [mips] Revert fixes for PR32020.Simon Dardis2017-03-099-567/+165
| | | | | | | | | | | | | | | The fix introduces segfaults and clobbers the value to be stored when the atomic sequence loops. Revert "[Target/MIPS] Kill dead code, no functional change intended." This reverts commit r296153. Revert "Recommit "[mips] Fix atomic compare and swap at O0."" This reverts commit r296134. llvm-svn: 297380
* Fixed typos in comments. NFCI.Simon Pilgrim2017-03-091-6/+6
| | | | llvm-svn: 297379
* fix build on CygwinNuno Lopes2017-03-091-0/+3
| | | | llvm-svn: 297378
* [SelectionDAG] Make SelectCode return voidJoey Gouly2017-03-091-2/+1
| | | | | | | | | | | SelectCode has been returning nullptr since 182dac0 ("SDAG: Make SelectCodeCommon return void", 2016-05-10). Make SelectCode also return void instead, as all callers have been updated. Patch by Sven van Haastregt. Review: https://reviews.llvm.org/D30497 llvm-svn: 297377
* [ARM] remove FIXMEs and add vcmp MC testSjoerd Meijer2017-03-092-5/+12
| | | | | | | | | Minor cleanup in ARMInstrVFP.td: removed some FIXMEs and added a MC test for vcmp that was actually missing. Differential Revision: https://reviews.llvm.org/D30745 llvm-svn: 297376
* [ScopDetect/Info] Allow unconditional hoisting of loads from dereferenceable ↵Tobias Grosser2017-03-094-11/+135
| | | | | | | | | | | | ptrs In case LLVM pointers are annotated with !dereferencable attributes/metadata or LLVM can look at the allocation from which a pointer is derived, we can know that dereferencing pointers is safe and can be done unconditionally. We use this information to proof certain pointers as save to hoist and then hoist them unconditionally. llvm-svn: 297375
* [PM/Inliner] Make the new PM's inliner process call edges across anChandler Carruth2017-03-095-71/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | entire SCC before iterating on newly-introduced call edges resulting from any inlined function bodies. This more closely matches the behavior of the old PM's inliner. While it wasn't really clear to me initially, this behavior is actually essential to the inliner behaving reasonably in its current design. Because the inliner is fundamentally a bottom-up inliner and all of its cost modeling is designed around that it often runs into trouble within an SCC where we don't have any meaningful bottom-up ordering to use. In addition to potentially cyclic, infinite inlining that we block with the inline history mechanism, it can also take seemingly simple call graph patterns within an SCC and turn them into *insanely* large functions by accidentally working top-down across the SCC without any of the threshold limitations that traditional top-down inliners use. Consider this diabolical monster.cpp file that Richard Smith came up with to help demonstrate this issue: ``` template <int N> extern const char *str; void g(const char *); template <bool K, int N> void f(bool *B, bool *E) { if (K) g(str<N>); if (B == E) return; if (*B) f<true, N + 1>(B + 1, E); else f<false, N + 1>(B + 1, E); } template <> void f<false, MAX>(bool *B, bool *E) { return f<false, 0>(B, E); } template <> void f<true, MAX>(bool *B, bool *E) { return f<true, 0>(B, E); } extern bool *arr, *end; void test() { f<false, 0>(arr, end); } ``` When compiled with '-DMAX=N' for various values of N, this will create an SCC with a reasonably large number of functions. Previously, the inliner would try to exhaust the inlining candidates in a single function before moving on. This, unfortunately, turns it into a top-down inliner within the SCC. Because our thresholds were never built for that, we will incrementally decide that it is always worth inlining and proceed to flatten the entire SCC into that one function. What's worse, we'll then proceed to the next function, and do the exact same thing except we'll skip the first function, and so on. And at each step, we'll also make some of the constant factors larger, which is awesome. The fix in this patch is the obvious one which makes the new PM's inliner use the same technique used by the old PM: consider all the call edges across the entire SCC before beginning to process call edges introduced by inlining. The result of this is essentially to distribute the inlining across the SCC so that every function incrementally grows toward the inline thresholds rather than allowing the inliner to grow one of the functions vastly beyond the threshold. The code for this is a bit awkward, but it works out OK. We could consider in the future doing something more powerful here such as prioritized order (via lowest cost and/or profile info) and/or a code-growth budget per SCC. However, both of those would require really substantial work both to design the system in a way that wouldn't break really useful abstraction decomposition properties of the current inliner and to be tuned across a reasonably diverse set of code and workloads. It also seems really risky in many ways. I have only found a single real-world file that triggers the bad behavior here and it is generated code that has a pretty pathological pattern. I'm not worried about the inliner not doing an *awesome* job here as long as it does *ok*. On the other hand, the cases that will be tricky to get right in a prioritized scheme with a budget will be more common and idiomatic for at least some frontends (C++ and Rust at least). So while these approaches are still really interesting, I'm not in a huge rush to go after them. Staying even closer to the existing PM's behavior, especially when this easy to do, seems like the right short to medium term approach. I don't really have a test case that makes sense yet... I'll try to find a variant of the IR produced by the monster template metaprogram that is both small enough to be sane and large enough to clearly show when we get this wrong in the future. But I'm not confident this exists. And the behavior change here *should* be unobservable without snooping on debug logging. So there isn't really much to test. The test case updates come from two incidental changes: 1) We now visit functions in an SCC in the opposite order. I don't think there really is a "right" order here, so I just update the test cases. 2) We no longer compute some analyses when an SCC has no call instructions that we consider for inlining. llvm-svn: 297374
* [DeLICM] Add -polly-delicm-overapproximate-writes option.Michael Kruse2017-03-092-1/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the current limitations of DeLICM is that it only creates PHI WRITEs that it knows are read by some PHI. Such writes may not span all instances of a statement. Polly's code generator currently does not support MemoryAccesses that are not executed in all instances ('partial accesses') and so has to give up on a possible mapping. This workaround has once been suggested by Tobias Grosser: Try to interpolate an arbitrary expansion to all instances. It will be checked for possible conflicts with the existing Knowledge and can be applied if the conflict checking result is that no semantics are changed. Expansion is done by simplifying the mapping by coalescing with the hope that coalescing will find a polyhedral 'rule' of the relevant map. It is then 'gist'-ed using the domain of the relevant instances such that the rule is expanded to the universe and finally intersected with the domain of all statement instances. The expansion makes conflicts become more likely, the found rule may still not encompass all statement instances and the found rule exposes internals of isl's implementation of coalesce and gist. The latter means that the result depends on how much effort the implementation invests into finding a rule which may change between versions of isl. Trivial implementations of gist and coalesce just return the input arguments. A patch that makes codegen support partial accesses is in preparation as well. Differential Revision: https://reviews.llvm.org/D30763 llvm-svn: 297373
* [mips] Fix return loweringSimon Dardis2017-03-093-5/+14
| | | | | | | | | | | | | Fix a machine verifier issue where a instruction was using a invalid register. The return pseudo is expanded and has the return address register added to it. The return register may have been spuriously mark as killed earlier. This partially resolves PR/27458 Thanks to Quentin Colombet for reporting the issue! llvm-svn: 297372
* [include-fixer] Remove line number from Symbol identitySam McCall2017-03-0912-208/+178
| | | | | | | | | | | | | | | | | | | Summary: Remove line number from Symbol identity. For our purposes (include-fixer and clangd autocomplete), function overloads within the same header should mostly be treated as a single combined symbol. We may want to track individual occurrences (line number, full type info) and aggregate this during mapreduce, but that's not done here. Reviewers: hokein, bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30685 llvm-svn: 297371
* [sanitizer] Bail out with warning if user dlopens shared library with ↵Maxim Ostapenko2017-03-097-4/+41
| | | | | | | | | | | | RTLD_DEEPBIND flag People keep hitting on spurious failures in malloc/free routines when using sanitizers with shared libraries dlopened with RTLD_DEEPBIND (see https://github.com/google/sanitizers/issues/611 for details). Let's check for this flag and bail out with warning message instead of failing in random places. Differential Revision: https://reviews.llvm.org/D30504 llvm-svn: 297370
* cmake: Increase LINK_INTERFACE_MULTIPLICITY of lldbCorePavel Labath2017-03-091-1/+1
| | | | | | | | | | | | This is necessary to get debug builds of unit tests working on linux. I think we are at a point where removing dependencies does not prevent us from depending on the whole world yet. What it does do though, is make the dependency chains longer as the dependency graph gets sparser, which means we need to repeat the libraries more times to get the thing to link. llvm-svn: 297369
* Fix remaining threading issues in Log.hPavel Labath2017-03-093-119/+142
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes two threading issues in the logging code. The access to the mask and options flags had data races when we were trying to enable/disable logging while another thread was writing to the log. Since we can log from almost any context, and we want it to be fast, so I avoided locking primitives and used atomic variables instead. I have also removed the (unused) setters for the mask and flags to make sure that the only way to set them is through the enable/disable channel functions. I also add tests, which when run under tsan, verify that the use cases like "doing an LLDB_LOGV while another thread disables logging" are data-race-free. Reviewers: zturner, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30702 llvm-svn: 297368
* [clang-tidy] Update the doc according to r297311.Haojian Wu2017-03-091-1/+1
| | | | llvm-svn: 297367
* [ELF] - Implemented -znotextGeorge Rimar2017-03-095-5/+25
| | | | | | | | | | | | | gold linker manual describes them as: -z text Do not permit relocations in read-only segments -z notext Permit relocations in read-only segments (default) In LLD default is to not permit them. Patch implements -z notext. Differential revision: https://reviews.llvm.org/D30530 llvm-svn: 297366
* [ELF] - Do not try to create .eh_frame_hdr for relocatable output.George Rimar2017-03-092-5/+15
| | | | | | | | | | | | | .eh_frame_hdr is a header constructed for .eh_frame sections. We do not proccess .eh_frame when doing relocatable output, so should not try to create .eh_frame_hdr too. Previous behavior without this patch is segfault. Fixes PR32118. Differential revision: https://reviews.llvm.org/D30566 llvm-svn: 297365
* Fix up the places where AddressSpace.hpp is included.Ed Schouten2017-03-096-4/+2
| | | | | | | | | | | | | | | | The AddressSpace.hpp header declares two classes: LocalAddressSpace and RemoteAddressSpace. These classes are only used in a very small number of source files, but passed in as template arguments to many other classes. Let's go ahead and only include AddressSpace.hpp in source files where at least one of these two classes is mentioned. This gets rid of a cyclic header dependency that was already present, but only caused breakage on macOS until recently. Reported by: Marshall Clow llvm-svn: 297364
* Remove a useless subsitution in doxygen2rst which was incorrectly replacing ↵Sylvestre Ledru2017-03-092-6/+5
| | | | | | | | | | | | | | | | * by \* Summary: For example, "int\* a;" is displayed instead of "int* a;" Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30740 llvm-svn: 297363
* [SSP] In opt remarks, stream Function directlyAdam Nemet2017-03-092-9/+26
| | | | | | | With this, it shows up as an attribute in YAML and non-printable characters are properly removed by GlobalValue::getRealLinkageName. llvm-svn: 297362
* [SLP] Mark values in Dot that need to be extractedAdam Nemet2017-03-091-3/+9
| | | | llvm-svn: 297361
* Remove LLDB's recursive directory deletion function.Zachary Turner2017-03-095-89/+2
| | | | | | LLVM now has such a function, so we use that instead. llvm-svn: 297360
* [coroutines] Fix assertion in DependentCoawaitExpr when the argument is ↵Eric Fiselier2017-03-092-1/+9
| | | | | | | | | | | | | | | | | | | non-dependent. Summary: A `co_await arg` expression has a dependent type whenever the promise type is still dependent, even if the argument to co_await is not. This is because we cannot attempt the `await_transform(<arg>)` until after we know the promise type. This patch fixes an assertion in the constructor of `DependentCoawaitExpr` that asserted that `arg` must also be dependent. Reviewers: rsmith, GorNishanov, aaron.ballman Reviewed By: GorNishanov Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D30772 llvm-svn: 297358
* Fix wrong assertion failure.Rui Ueyama2017-03-092-0/+18
| | | | | | | | | | Previously, if you have foo=bar in a definition file, this assertion could fire because when symbols are read from file they could be mangled. It seems that due to historical reasons underscore mangling scheme is really ad-hoc, and I cannot find a clean way to handle this. I had to just de-mangle symbols to search again. llvm-svn: 297357
* [coroutines] Build and pass coroutine_handle to await_suspendGor Nishanov2017-03-097-60/+226
| | | | | | | | | | | | | | | | Summary: This patch adds passing a coroutine_handle object to await_suspend calls. It builds the coroutine_handle using coroutine_handle<PromiseType>::from_address(__builtin_coro_frame()). (a revision of https://reviews.llvm.org/D26316 that for some reason refuses to apply via arc patch) Reviewers: GorNishanov Subscribers: mehdi_amini, cfe-commits, EricWF Differential Revision: https://reviews.llvm.org/D30769 llvm-svn: 297356
* Disable unsigned integer sanitizer for basic_string::replace(). Patch from ↵Eric Fiselier2017-03-091-0/+4
| | | | | | | | | | | | | | | | | | tomcherry@google.com basic_string::replace() has the below line __sz += __n2 - __n1; which fails overflow checks if __n1 > __n2, as the negative result from the subtraction then overflows the original __sz when added to it. This behavior is valid as unsigned integer overflow is defined to wrap around the maximum value and that produces the correct final value for __sz. Therefore, we disable this check on this function. llvm-svn: 297355
* DAG: Check no signed zeros instead of unsafe math attributeMatt Arsenault2017-03-097-28/+48
| | | | llvm-svn: 297354
* Print an error message instead of an assertion failure.Rui Ueyama2017-03-091-1/+4
| | | | | | | This assertion is failing on a Chromium builder and I cannot figure out why. This patch let it print out more info. llvm-svn: 297353
* Add a cmake cache file for a stage-2 build with ThinLTOMehdi Amini2017-03-091-0/+6
| | | | | | | This is intended to be targetted by a Green Dragon stage-2 bot I'm bringing up currently. WIP. llvm-svn: 297351
* WholeProgramDevirt: Implement importing for uniform ret val opt.Peter Collingbourne2017-03-093-0/+46
| | | | | | Differential Revision: https://reviews.llvm.org/D29854 llvm-svn: 297350
* Fix handling of -fmodule-map-file=X where X has no directory component.Richard Smith2017-03-092-2/+13
| | | | llvm-svn: 297349
OpenPOWER on IntegriCloud