Commit Graph

195398 Commits

Author SHA1 Message Date
Yaron Keren 322bdad085 Silence C4715 'not all control paths return a value' warnings.
llvm-svn: 231455
2015-03-06 07:49:14 +00:00
Rui Ueyama 93ceadfb7b PECOFF: Optimize the writer using parallel_for.
Previously applying 1 million relocations took about 2 seconds on my
Xeon 2.4GHz 8 core workstation. After this patch, it takes about 300
milliseconds. As a result, time to link chrome.dll becomes 23 seconds
to 21 seconds.

llvm-svn: 231454
2015-03-06 06:53:13 +00:00
Eric Fiselier e105ea84a2 Remove unneeded python import
llvm-svn: 231453
2015-03-06 06:22:22 +00:00
Rui Ueyama da9bc2e56d Support: Improve performance of FileOutputBuffer on Windows
We extend an underlying file before mmap'ing it, but it's not needed
on Windows. Extending file is slow on Windows, so we should avoid doing that.
The difference gets larger as the size of an output file gets larger.
It shove off 2 seconds out of 25 seconds when linking chrome.dll with LLD,
for example.

llvm-svn: 231452
2015-03-06 06:07:32 +00:00
Nico Weber 55905145e7 Don't crash on non-public referenced dtors in toplevel classes.
Fixes PR22793, a bug that caused self-hosting to fail after the innocuous
r231254. See the bug for details.

llvm-svn: 231451
2015-03-06 06:01:06 +00:00
Enrico Granata 72146af68c Windows bot
llvm-svn: 231450
2015-03-06 03:37:33 +00:00
Enrico Granata 0ddbf3633c Provide synthetic children for some vector types
Unlike GDB, we tackle the problem of representing vector types in different styles by having a synthetic child provider that recognizes the format you're trying to apply to the variable, and coming up with the right type and number of child values to match that format

This makes for a more compact representation and less visual noise

Fixes rdar://5429347

llvm-svn: 231449
2015-03-06 03:32:20 +00:00
Andrew Wilkins d07b2b4228 [llgo] Disable known failing packages in check-libgo
Summary:
There are two packages in libgo which have
known failures when running the "make check" rule.
This change disables those packages in the tests so
that we can run libgo tests without them until the
root causes are identified and resolved.

Test Plan: ran check-libgo rule

Reviewers: pcc

Reviewed By: pcc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D8003

llvm-svn: 231448
2015-03-06 02:49:07 +00:00
Michael Gottesman 6ff10c959a [objc-arc] Sprinkle some more auto on some iterators.
llvm-svn: 231447
2015-03-06 02:10:03 +00:00
Michael Gottesman 16e6a2057f [objc-arc] Move the detection of potential uses or altering of a ref count onto PtrState.
llvm-svn: 231446
2015-03-06 02:07:12 +00:00
Davide Italiano 5dfe0ffb0c We want to add the entry point to the root set unconditionally, but these
asserts don't allow us to do it. Remove them, they're not really needed
anyway. 

llvm-svn: 231445
2015-03-06 02:05:03 +00:00
Rui Ueyama 41ee2e3ff9 Remove unused function.
llvm-svn: 231444
2015-03-06 01:44:07 +00:00
Michael Zolotukhin 03dd1082ad LegalizeTypes: Handle shift by 0 in ExpandShiftByConstant.
Though such shifts are usually optimized away by combiner, we still can
encounter them after a vector shift is legalized.

llvm-svn: 231443
2015-03-06 01:13:01 +00:00
Rafael Espindola a5b9e1cf39 Remember to move a type to the correct set when setting the body.
We would set the body of a struct type (therefore making it non-opaque)
but were forgetting to move it to the non-opaque set.

Fixes pr22807.

llvm-svn: 231442
2015-03-06 00:50:21 +00:00
Jason Molenda 07e51cc72d Bump major vers # in xcode project file from 330 to 340.
llvm-svn: 231441
2015-03-06 00:45:01 +00:00
John Thompson 84ced5c1af Renamed function to avoid confusion about purpose.
llvm-svn: 231440
2015-03-06 00:39:42 +00:00
Michael Gottesman 6080596328 [objc-arc] Move the checking of whether or not we can match onto PtrStates and out of the main dataflow.
These refactored computations check whether or not we are at a stage
of the sequence where we can perform a match. This patch moves the
computation out of the main dataflow and into
{BottomUp,TopDown}PtrState.

llvm-svn: 231439
2015-03-06 00:34:42 +00:00
Michael Gottesman 4eae396ae9 [objc-arc] Refactor (Re-)initialization of PtrState from dataflow -> {TopDown,BottomUp}PtrState Class.
This initialization occurs when we see a new retain or release. Before
we performed the actual initialization inline in the dataflow. That is
just messy.

llvm-svn: 231438
2015-03-06 00:34:39 +00:00
Michael Gottesman feb138e211 [objc-arc] Create two subclasses of PtrState in preparation for moving per ptr state change behavior onto a PtrState class.
This will enable the main ObjCARCOpts dataflow to work with higher
level concepts such as "can this ptr state be modified by this ref
count" and not need to understand the nitty gritty details of how that
is determined. This makes the dataflow cleaner.

llvm-svn: 231437
2015-03-06 00:34:36 +00:00
Michael Gottesman 41c01005ed [objc-arc] Extract out MDNodes into a cache structure so the information can be passed around.
llvm-svn: 231436
2015-03-06 00:34:33 +00:00
Michael Gottesman f6bcb81000 [objc-arc] Remove annotations code.
It will always be in the history if it is needed again. Now it is just dead
code.

llvm-svn: 231435
2015-03-06 00:34:29 +00:00
Rui Ueyama 13003d7774 Core: Make the resolver faster.
In the resolver, we maintain a list of undefined symbols, and when we
visit an archive file, we check that file if undefined symbols can be
resolved using files in the archive. The archive file class provides
find() function to lookup a symbol.

Previously, we call find() for each undefined symbols. Archive files
may be visited multiple times if they are in a --start-group and
--end-group. If we visit a file M times and if we have N undefined
symbols, find() is called M*N times. I found that that is one of the
most significant bottlenecks in LLD when linking a large executable.

find() is not a very cheap operation because it looks up a hash table
for a given string. And a string, or a symbol name, can be pretty long
if you are dealing with C++ symbols.

We can eliminate the bottleneck.

Calling find() with the same symbol multiple times is a waste. If a
result of looking up a symbol is "not found", it stays "not found"
forever because the symbol simply doesn't exist in the archive.
Thus, we should call find() only for newly-added undefined symbols.
This optimization makes O(M*N) O(N).

In this patch, all undefined symbols are added to a vector. For each
archive/shared library file, we maintain a start position P. All
symbols [0, P) are already searched. [P, end of the vector) are not
searched yet. For each file, we scan the vector only once.

This patch changes the order in which undefined symbols are looked for.
Previously, we iterated over the result of _symbolTable.undefines().
Now we iterate over the new vector. This is a benign change but caused
differences in output if remaining undefines exist. This is why some
tests are updated.

The performance improvement of this patch seems sometimes significant.
Previously, linking chrome.dll on my workstation (Xeon 2.4GHz 8 cores)
took about 70 seconds. Now it takes (only?) 30 seconds!

http://reviews.llvm.org/D8091

llvm-svn: 231434
2015-03-06 00:28:41 +00:00
Nadav Rotem c99a38796c Teach ComputeNumSignBits about signed reminder.
This optimization a continuation of r231140 that reasoned about signed div.

llvm-svn: 231433
2015-03-06 00:23:58 +00:00
Rui Ueyama 25d5abdb3a Optimize resolver by using std::unordered_multimap.
_reverseRef is a multimap from atoms to atoms. The map contains
reverse edges of "layout-before" and "group" edges for dead-stripping.

The type of the variable was DenseMap<Atom *, DenseSet<Atom *>>.
This patch changes that to std::unordered_multimap<Atom *, Atom *>.

A DenseMap with a value type of DenseSet was not fast. Inserting 900k
items to the map took about 1.6 seconds on my workstation.
unordered_multimap on the other hand took only 0.6 seconds.
Use of the map also got faster -- originally markLive took 1.3 seconds
in the same test case, and it now took 1.0 seconds. In total we shove
off 1.3 seconds out of 27 seconds in that test case.

llvm-svn: 231432
2015-03-06 00:22:48 +00:00
Hans Wennborg b202b27a22 Add a download link to the web page (PR22764)
llvm-svn: 231431
2015-03-06 00:13:55 +00:00
Michael Gottesman d45907bd38 Fix build error.
llvm-svn: 231430
2015-03-05 23:57:07 +00:00
Kuba Brecka da0204d05f Add a symbolizer testcase for closed stdin/stdout
Reviewed at http://reviews.llvm.org/D7973

llvm-svn: 231429
2015-03-05 23:41:47 +00:00
Kuba Brecka 334f9c4ed8 Print out which symbolizer are we using when verbosity >= 2
Reviewed at http://reviews.llvm.org/D8087

llvm-svn: 231428
2015-03-05 23:38:23 +00:00
Michael Gottesman a9fc016281 [objc-arc] Change some casts and loop iterators to use auto.
llvm-svn: 231427
2015-03-05 23:29:06 +00:00
Michael Gottesman 68b91dbf84 [objc-arc] Extract out state specific to a ref count from the main objc arc sequence dataflow. This will allow me to separate the actual ARC queries from the meat of the dataflow algorithm.
llvm-svn: 231426
2015-03-05 23:29:03 +00:00
Michael Gottesman 0be6920e23 [objc-arc] Extract blot map vector into its own file. NFC.
llvm-svn: 231425
2015-03-05 23:28:58 +00:00
Richard Smith fe620d26ea [modules] Rework merging of redeclaration chains on module import.
We used to save out and eagerly load a (potentially huge) table of merged
formerly-canonical declarations when we loaded each module. This was extremely
inefficient in the presence of large amounts of merging, and didn't actually
save any merging lookup work, because we still needed to perform name lookup to
check that our merged declaration lists were complete. This also resulted in a
loss of laziness -- even if we only needed an early declaration of an entity, we
would eagerly pull in all declarations that had been merged into it regardless.

We now store the relevant fragments of the table within the declarations
themselves. In detail:

 * The first declaration of each entity within a module stores a list of first
   declarations from imported modules that are merged into it.
 * Loading that declaration pre-loads those other entities, so that they appear
   earlier within the redeclaration chain.
 * The name lookup tables list the most recent local lookup result, if there
   is one, or all directly-imported lookup results if not.

llvm-svn: 231424
2015-03-05 23:24:12 +00:00
Chaoren Lin 6fb4915bd6 Remove libedit and libncurses from LLDB_SYSTEM_LIBS if they're disabled.
Reviewers: clayborg, zturner, vharron, sbest

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8065

llvm-svn: 231423
2015-03-05 23:22:54 +00:00
Ahmed Bougacha c6dcf7a7cc [X86] Remove stale comment. NFC.
It turns out 256bit V[SZ]EXT nodes are still
generated by the new shuffle lowering, so this
is here to stay!

llvm-svn: 231422
2015-03-05 23:18:41 +00:00
Daniel Jasper 08201e394e Use std::string instead of StringRef to prevent use-after-free.
Discovered by asan.

llvm-svn: 231421
2015-03-05 23:17:32 +00:00
Greg Clayton 12ba733ce8 When we have a symbol, like "NSLog" that we try to call in an expression, make sure we prioritize the external symbols over the internal one.
This is a temporary fix until a more comprehensive fix can be made for finding functions that we call in expressions.

We find "NSLog" in ClangExpressionDeclMap::FindExternalVisibleDecls() in after a call to target->GetImages().FindFunctions(...). Note that there are two symbols: NSLog from CFNetwork which is not external, and NSLog from Foundation which _is_ external. We do something with the external symbol with:

                    if (extern_symbol)
                    {
                        AddOneFunction (context, NULL, extern_symbol, current_id);
                        context.m_found.function = true;
                    }

Then later we try to lookup the _Z5NSLogP8NSStringz name and we don't find it so we call ClangExpressionDeclMap::GetFunctionAddress() with "_Z5NSLogP8NSStringz" as the name and the sc_list_size is zero at the "if" statement at line 568 because we don't find the mangled name and we extract the basename "NSLog" and call:

            FindCodeSymbolInContext(ConstString(basename), m_parser_vars->m_sym_ctx, sc_list);
            sc_list_size = sc_list.GetSize();

and we get a list size of two again, and we proceed to search for the symbol again, this time ignoring the external vs non-external-ness of the symbols that we find. This fix ensures we prioritize the external symbol until we get a real fix from Sean Callanan when he gets back to make sure we don't do multiple lookups for the same symbol we already resolved.

<rdar://problem/19879282>

llvm-svn: 231420
2015-03-05 23:12:02 +00:00
Fariborz Jahanian 28d94b1df2 [PATCH] Patch to fix the AST for vector splat from any
arithmetic type to a vector so that the arithmatic type
matches the vector element type. Without which it crashes
in Code Gen. rdar://20000762

llvm-svn: 231419
2015-03-05 23:06:09 +00:00
Paul Robinson 282b3d3ff5 All FileCheck directives allow patterns.
llvm-svn: 231418
2015-03-05 23:04:26 +00:00
Peter Collingbourne 68a640c080 Fix test to use explicit load type.
llvm-svn: 231417
2015-03-05 22:55:42 +00:00
Peter Collingbourne febd93c7c9 Go bindings: use MDNode::replaceAllUsesWith instead of MDTuple::replaceAllUsesWith.
Fixes llgo following Duncan's changes to debug info in r231082. llgo needs
to replace composite types, which are no longer represented using MDTuple.

llvm-svn: 231416
2015-03-05 22:55:38 +00:00
Greg Clayton 48d157dd41 symbolicate the application specific backtraces that are in MacOSX crash log files.
<rdar://problem/20039160> 

llvm-svn: 231415
2015-03-05 22:53:06 +00:00
Philip Reames e21ce4540c [RewriteStatepointsForGC] Yet more test cases for relocation
At this point, we should have decent coverage of the involved code.  I've got a few more test cases to cleanup and submit, but what's here is already reasonable.

I've got a collection of liveness tests which will be posted for review along with a decent liveness algorithm in the next few days.  Once those are in, the code in this file should be well tested and I can start renaming things without risk of serious breakage.  

llvm-svn: 231414
2015-03-05 22:28:06 +00:00
Kostya Serebryany 769ddaa2d4 [sanitizer] Reconstruct the function that dumps block/edge coverage, hopefully making it more robust. Also increase the allowed coverage size on 32-bit.
llvm-svn: 231413
2015-03-05 22:19:25 +00:00
Quentin Colombet 2cd9d0b783 [CODE_OWNERS] Change the ownership of register allocators.
llvm-svn: 231412
2015-03-05 22:15:17 +00:00
Benjamin Kramer fc165f1434 Instructions: Use delegated constructors to reduce duplication
NFC.

llvm-svn: 231411
2015-03-05 22:05:26 +00:00
Alexey Samsonov 4833452c0c Revert "[UBSan] Add testcases for -fsanitize=shift-base and -fsanitize=shift-exponent."
The test case fails on AArch64.

llvm-svn: 231410
2015-03-05 21:57:47 +00:00
Alexey Samsonov 48a9db034a Revert "[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent."
It's not that easy. If we're only checking -fsanitize=shift-base we
still need to verify that exponent has sane value, otherwise
UBSan-inserted checks for base will contain undefined behavior
themselves.

llvm-svn: 231409
2015-03-05 21:57:35 +00:00
Sanjay Patel 302404b277 [AVX] Lower / fast-isel scalar FP selects into VBLENDV instructions (PR22483)
This patch reduces code size for all AVX targets and increases speed for some chips.

SSE 4.1 introduced the useless (see code comments) 2-register form of BLENDV and
only in the packed float/double flavors.

AVX subsequently made the instruction useful by adding a 4-register operand form.

So we just need to paper over the lack of scalar forms of this instruction, complicate
the code to choose float or double forms, and use blendv on scalars since all FP is in
xmm registers anyway.

This gives us an approximately 50% speed up for a blendv microbenchmark sequence
on SandyBridge and Haswell:
blendv : 29.73 cycles/iter
logic : 43.15 cycles/iter

No new test cases with this patch because:

1. fast-isel-select-sse.ll tests the positive side for regular X86 lowering and fast-isel
2. sse-minmax.ll and fp-select-cmp-and.ll confirm that we're not firing for scalar selects without AVX
3. fp-select-cmp-and.ll and logical-load-fold.ll confirm that we're not firing for scalar selects with constants.

http://llvm.org/bugs/show_bug.cgi?id=22483

Differential Revision: http://reviews.llvm.org/D8063

llvm-svn: 231408
2015-03-05 21:46:54 +00:00
Vince Harron 6caca38f68 XFAIL tests that are known to fail occasionally on Linux
Trying to get the build green so we can notice new failures easier.

Differential Revision: http://reviews.llvm.org/D8039

llvm-svn: 231407
2015-03-05 21:35:28 +00:00
Benjamin Kramer fb0abceb5c SelectionDAGBuilder: Merge 3 copies of the limited precision exp2 emission code.
NFC intended.

llvm-svn: 231406
2015-03-05 21:13:08 +00:00