platform/upstream/llvm.git
9 years agoRemember to move a type to the correct set when setting the body.
Rafael Espindola [Fri, 6 Mar 2015 00:50:21 +0000 (00:50 +0000)]
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

9 years agoBump major vers # in xcode project file from 330 to 340.
Jason Molenda [Fri, 6 Mar 2015 00:45:01 +0000 (00:45 +0000)]
Bump major vers # in xcode project file from 330 to 340.

llvm-svn: 231441

9 years agoRenamed function to avoid confusion about purpose.
John Thompson [Fri, 6 Mar 2015 00:39:42 +0000 (00:39 +0000)]
Renamed function to avoid confusion about purpose.

llvm-svn: 231440

9 years ago[objc-arc] Move the checking of whether or not we can match onto PtrStates and out...
Michael Gottesman [Fri, 6 Mar 2015 00:34:42 +0000 (00:34 +0000)]
[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

9 years ago[objc-arc] Refactor (Re-)initialization of PtrState from dataflow -> {TopDown,BottomU...
Michael Gottesman [Fri, 6 Mar 2015 00:34:39 +0000 (00:34 +0000)]
[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

9 years ago[objc-arc] Create two subclasses of PtrState in preparation for moving per ptr state...
Michael Gottesman [Fri, 6 Mar 2015 00:34:36 +0000 (00:34 +0000)]
[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

9 years ago[objc-arc] Extract out MDNodes into a cache structure so the information can be passe...
Michael Gottesman [Fri, 6 Mar 2015 00:34:33 +0000 (00:34 +0000)]
[objc-arc] Extract out MDNodes into a cache structure so the information can be passed around.

llvm-svn: 231436

9 years ago[objc-arc] Remove annotations code.
Michael Gottesman [Fri, 6 Mar 2015 00:34:29 +0000 (00:34 +0000)]
[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

9 years agoCore: Make the resolver faster.
Rui Ueyama [Fri, 6 Mar 2015 00:28:41 +0000 (00:28 +0000)]
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

9 years agoTeach ComputeNumSignBits about signed reminder.
Nadav Rotem [Fri, 6 Mar 2015 00:23:58 +0000 (00:23 +0000)]
Teach ComputeNumSignBits about signed reminder.

This optimization a continuation of r231140 that reasoned about signed div.

llvm-svn: 231433

9 years agoOptimize resolver by using std::unordered_multimap.
Rui Ueyama [Fri, 6 Mar 2015 00:22:48 +0000 (00:22 +0000)]
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

9 years agoAdd a download link to the web page (PR22764)
Hans Wennborg [Fri, 6 Mar 2015 00:13:55 +0000 (00:13 +0000)]
Add a download link to the web page (PR22764)

llvm-svn: 231431

9 years agoFix build error.
Michael Gottesman [Thu, 5 Mar 2015 23:57:07 +0000 (23:57 +0000)]
Fix build error.

llvm-svn: 231430

9 years agoAdd a symbolizer testcase for closed stdin/stdout
Kuba Brecka [Thu, 5 Mar 2015 23:41:47 +0000 (23:41 +0000)]
Add a symbolizer testcase for closed stdin/stdout

Reviewed at http://reviews.llvm.org/D7973

llvm-svn: 231429

9 years agoPrint out which symbolizer are we using when verbosity >= 2
Kuba Brecka [Thu, 5 Mar 2015 23:38:23 +0000 (23:38 +0000)]
Print out which symbolizer are we using when verbosity >= 2

Reviewed at http://reviews.llvm.org/D8087

llvm-svn: 231428

9 years ago[objc-arc] Change some casts and loop iterators to use auto.
Michael Gottesman [Thu, 5 Mar 2015 23:29:06 +0000 (23:29 +0000)]
[objc-arc] Change some casts and loop iterators to use auto.

llvm-svn: 231427

9 years ago[objc-arc] Extract out state specific to a ref count from the main objc arc sequence...
Michael Gottesman [Thu, 5 Mar 2015 23:29:03 +0000 (23:29 +0000)]
[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

9 years ago[objc-arc] Extract blot map vector into its own file. NFC.
Michael Gottesman [Thu, 5 Mar 2015 23:28:58 +0000 (23:28 +0000)]
[objc-arc] Extract blot map vector into its own file. NFC.

llvm-svn: 231425

9 years ago[modules] Rework merging of redeclaration chains on module import.
Richard Smith [Thu, 5 Mar 2015 23:24:12 +0000 (23:24 +0000)]
[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

9 years agoRemove libedit and libncurses from LLDB_SYSTEM_LIBS if they're disabled.
Chaoren Lin [Thu, 5 Mar 2015 23:22:54 +0000 (23:22 +0000)]
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

9 years ago[X86] Remove stale comment. NFC.
Ahmed Bougacha [Thu, 5 Mar 2015 23:18:41 +0000 (23:18 +0000)]
[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

9 years agoUse std::string instead of StringRef to prevent use-after-free.
Daniel Jasper [Thu, 5 Mar 2015 23:17:32 +0000 (23:17 +0000)]
Use std::string instead of StringRef to prevent use-after-free.

Discovered by asan.

llvm-svn: 231421

9 years agoWhen we have a symbol, like "NSLog" that we try to call in an expression, make sure...
Greg Clayton [Thu, 5 Mar 2015 23:12:02 +0000 (23:12 +0000)]
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

9 years ago[PATCH] Patch to fix the AST for vector splat from any
Fariborz Jahanian [Thu, 5 Mar 2015 23:06:09 +0000 (23:06 +0000)]
[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

9 years agoAll FileCheck directives allow patterns.
Paul Robinson [Thu, 5 Mar 2015 23:04:26 +0000 (23:04 +0000)]
All FileCheck directives allow patterns.

llvm-svn: 231418

9 years agoFix test to use explicit load type.
Peter Collingbourne [Thu, 5 Mar 2015 22:55:42 +0000 (22:55 +0000)]
Fix test to use explicit load type.

llvm-svn: 231417

9 years agoGo bindings: use MDNode::replaceAllUsesWith instead of MDTuple::replaceAllUsesWith.
Peter Collingbourne [Thu, 5 Mar 2015 22:55:38 +0000 (22:55 +0000)]
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

9 years agosymbolicate the application specific backtraces that are in MacOSX crash log files.
Greg Clayton [Thu, 5 Mar 2015 22:53:06 +0000 (22:53 +0000)]
symbolicate the application specific backtraces that are in MacOSX crash log files.

<rdar://problem/20039160>

llvm-svn: 231415

9 years ago[RewriteStatepointsForGC] Yet more test cases for relocation
Philip Reames [Thu, 5 Mar 2015 22:28:06 +0000 (22:28 +0000)]
[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

9 years ago[sanitizer] Reconstruct the function that dumps block/edge coverage, hopefully making...
Kostya Serebryany [Thu, 5 Mar 2015 22:19:25 +0000 (22:19 +0000)]
[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

9 years ago[CODE_OWNERS] Change the ownership of register allocators.
Quentin Colombet [Thu, 5 Mar 2015 22:15:17 +0000 (22:15 +0000)]
[CODE_OWNERS] Change the ownership of register allocators.

llvm-svn: 231412

9 years agoInstructions: Use delegated constructors to reduce duplication
Benjamin Kramer [Thu, 5 Mar 2015 22:05:26 +0000 (22:05 +0000)]
Instructions: Use delegated constructors to reduce duplication

NFC.

llvm-svn: 231411

9 years agoRevert "[UBSan] Add testcases for -fsanitize=shift-base and -fsanitize=shift-exponent."
Alexey Samsonov [Thu, 5 Mar 2015 21:57:47 +0000 (21:57 +0000)]
Revert "[UBSan] Add testcases for -fsanitize=shift-base and -fsanitize=shift-exponent."

The test case fails on AArch64.

llvm-svn: 231410

9 years agoRevert "[UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize...
Alexey Samsonov [Thu, 5 Mar 2015 21:57:35 +0000 (21:57 +0000)]
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

9 years ago[AVX] Lower / fast-isel scalar FP selects into VBLENDV instructions (PR22483)
Sanjay Patel [Thu, 5 Mar 2015 21:46:54 +0000 (21:46 +0000)]
[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

9 years agoXFAIL tests that are known to fail occasionally on Linux
Vince Harron [Thu, 5 Mar 2015 21:35:28 +0000 (21:35 +0000)]
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

9 years agoSelectionDAGBuilder: Merge 3 copies of the limited precision exp2 emission code.
Benjamin Kramer [Thu, 5 Mar 2015 21:13:08 +0000 (21:13 +0000)]
SelectionDAGBuilder: Merge 3 copies of the limited precision exp2 emission code.

NFC intended.

llvm-svn: 231406

9 years agoFix uninitialized memory references in WinEHPrepare
Andrew Kaylor [Thu, 5 Mar 2015 21:06:42 +0000 (21:06 +0000)]
Fix uninitialized memory references in WinEHPrepare

llvm-svn: 231405

9 years agoRun ShTests when the executor is an instance of LocalExecutor
Eric Fiselier [Thu, 5 Mar 2015 20:27:01 +0000 (20:27 +0000)]
Run ShTests when the executor is an instance of LocalExecutor

llvm-svn: 231404

9 years agoEarly return. NFC.
Rui Ueyama [Thu, 5 Mar 2015 20:22:14 +0000 (20:22 +0000)]
Early return. NFC.

llvm-svn: 231403

9 years agoMove use of __builtin_longjmp under the same conditions as the only
Joerg Sonnenberger [Thu, 5 Mar 2015 20:17:05 +0000 (20:17 +0000)]
Move use of __builtin_longjmp under the same conditions as the only
caller of the function.

llvm-svn: 231402

9 years agoSDAG: Merge the meat of two ExpandAtomic implementations.
Benjamin Kramer [Thu, 5 Mar 2015 20:04:29 +0000 (20:04 +0000)]
SDAG: Merge the meat of two ExpandAtomic implementations.

The copies already diverged, don't let them become any worse. Reduce
redundancy in code with a little macro metaprogramming.

llvm-svn: 231401

9 years ago[AArch64] Teach AsmPrinter about GlobalAddress operands.
Ahmed Bougacha [Thu, 5 Mar 2015 20:04:21 +0000 (20:04 +0000)]
[AArch64] Teach AsmPrinter about GlobalAddress operands.

Fixes PR22761, rdar://20024866.
Differential Revision: http://reviews.llvm.org/D8042

llvm-svn: 231400

9 years ago[RewriteStatepointsForGC] Add additional tests around relocation
Philip Reames [Thu, 5 Mar 2015 19:52:13 +0000 (19:52 +0000)]
[RewriteStatepointsForGC] Add additional tests around relocation

These are focused around the actual relocation rewriting itself, not the rest of the infrastructure.

llvm-svn: 231399

9 years agoUse the correct func begin symbol in all places in ppc.
Rafael Espindola [Thu, 5 Mar 2015 19:47:50 +0000 (19:47 +0000)]
Use the correct func begin symbol in all places in ppc.

I missed an occurrence of the old symbol in my previous patch.

llvm-svn: 231398

9 years agoTableGen: Initialize ErrorInfo to ~0ULL in the MatchInstructionImpl
Tom Stellard [Thu, 5 Mar 2015 19:46:55 +0000 (19:46 +0000)]
TableGen: Initialize ErrorInfo to ~0ULL in the MatchInstructionImpl

This is what all the targets check for and is consistent with the
initialized value of MissingFeatures, which is sometimes assinged
to ErrorInfo.

llvm-svn: 231397

9 years ago[ARM] Enable vector extload combine for legal types.
Ahmed Bougacha [Thu, 5 Mar 2015 19:37:53 +0000 (19:37 +0000)]
[ARM] Enable vector extload combine for legal types.

This commit enables forming vector extloads for ARM.
It only does so for legal types, and when we can't fold the extension
in a wide/long form of the user instruction.

Enabling it for larger types isn't as good an idea on ARM as it is on
X86, because:
- we pretend that extloads are legal, but end up generating vld+vmov
- we have instructions like vld {dN, dM}, which can't be generated
  when we "manually expand" extloads to vld+vmov.

For legal types, the combine doesn't fire that often: in the
integration tests only in a big endian testcase, where it removes a
pointless AND.

Related to rdar://19723053
Differential Revision: http://reviews.llvm.org/D7423

llvm-svn: 231396

9 years agoResolver: Update preload map after File::beforeLink().
Rui Ueyama [Thu, 5 Mar 2015 19:25:58 +0000 (19:25 +0000)]
Resolver: Update preload map after File::beforeLink().

We maintain a map from symbols to archive files for the archive file
pre-loading. That map is created at the beginning of the resolve()
and is never updated. However, the input file list may be updated by
File::beforeLink(). This is a patch to update the map after beforeLink.

llvm-svn: 231395

9 years agoCorrectly quote arguments in LLDB driver
Pavel Labath [Thu, 5 Mar 2015 19:17:56 +0000 (19:17 +0000)]
Correctly quote arguments in LLDB driver

Summary:
LLDB driver was simply tacking quotes around the strings in lldb commands, hoping that will work.
This changes it to properly escape quotes and backslashes.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 231394

9 years agoClang side change following r231392.
Zachary Turner [Thu, 5 Mar 2015 19:15:09 +0000 (19:15 +0000)]
Clang side change following r231392.

Changes call to PrintStackTrace(FILE*) to call
PrintStackTrace(raw_ostream&)

llvm-svn: 231393

9 years agoReplace PrintStackTrace(FILE*) with PrintStackTrace(raw_ostream&)
Zachary Turner [Thu, 5 Mar 2015 19:10:52 +0000 (19:10 +0000)]
Replace PrintStackTrace(FILE*) with PrintStackTrace(raw_ostream&)

This will be followed by a change on the clang side to update
the only user of this function with the new version.

Differential Revision: http://reviews.llvm.org/D8074
Reviewed By: Reid Kleckner

llvm-svn: 231392

9 years agoRemove accidental errs() call in Verifier
Reid Kleckner [Thu, 5 Mar 2015 19:05:25 +0000 (19:05 +0000)]
Remove accidental errs() call in Verifier

llvm-svn: 231391

9 years agoUse the generic Lfunc_begin label on ppc.
Rafael Espindola [Thu, 5 Mar 2015 18:55:50 +0000 (18:55 +0000)]
Use the generic Lfunc_begin label on ppc.

This removes yet another custom label to mark the start of a function.

llvm-svn: 231390

9 years agoX86: Optimize address mode matching for FRAME_ALLOC_RECOVER nodes
David Majnemer [Thu, 5 Mar 2015 18:50:12 +0000 (18:50 +0000)]
X86: Optimize address mode matching for FRAME_ALLOC_RECOVER nodes

We know that the absolute symbol will be less than 2GB and thus will
always fit.

llvm-svn: 231389

9 years agoRevert busted CallSite change from r231386
Reid Kleckner [Thu, 5 Mar 2015 18:32:14 +0000 (18:32 +0000)]
Revert busted CallSite change from r231386

llvm-svn: 231388

9 years agoSilence -Wmissing-braces warning from clang-cl
Reid Kleckner [Thu, 5 Mar 2015 18:26:58 +0000 (18:26 +0000)]
Silence -Wmissing-braces warning from clang-cl

The first element of STACKFRAME64 is a struct and Clang wants us to put
braces around it's initialization. Instead, drop the zero. The result
should be the same.

llvm-svn: 231387

9 years agoReplace llvm.frameallocate with llvm.frameescape
Reid Kleckner [Thu, 5 Mar 2015 18:26:34 +0000 (18:26 +0000)]
Replace llvm.frameallocate with llvm.frameescape

Turns out it's pretty straightforward and simplifies the implementation.

Reviewers: andrew.w.kaylor

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

llvm-svn: 231386

9 years agoRevert r231276 (including r231277): Add a lock() function in PassRegistry to speed...
Erik Eckstein [Thu, 5 Mar 2015 17:53:00 +0000 (17:53 +0000)]
Revert r231276 (including r231277): Add a lock() function in PassRegistry to speed up multi-thread synchronization.

llvm-svn: 231385

9 years agomoved Windows-specific flags under the WINDOWS guard in CMake
Andrey Churbanov [Thu, 5 Mar 2015 17:50:48 +0000 (17:50 +0000)]
moved Windows-specific flags under the WINDOWS guard in CMake

llvm-svn: 231384

9 years agoadded KMP_NESTED_HOT_TEAMS macro definition
Andrey Churbanov [Thu, 5 Mar 2015 17:48:53 +0000 (17:48 +0000)]
added KMP_NESTED_HOT_TEAMS macro definition

llvm-svn: 231383

9 years ago[Windows] Implement PrintStackTrace(FILE*)
Zachary Turner [Thu, 5 Mar 2015 17:47:52 +0000 (17:47 +0000)]
[Windows] Implement PrintStackTrace(FILE*)

llvm::sys::PrintBacktrace(FILE*) is supposed to print a backtrace
of the current thread given the current PC.  This function was
unimplemented on Windows, and instead the only time we could
print a backtrace was as the result of an exception through
LLVMUnhandledExceptionFilter.

This patch implements backtracing of self by using
RtlCaptureContext to get a CONTEXT for the current thread, and
moving the printing and StackWalk64 code to a common method that
printing own stack trace and printing stack trace of an exception
can use.

Differential Revision: http://reviews.llvm.org/D8068
Reviewed by: Reid Kleckner

llvm-svn: 231382

9 years agominor change: comment improved
Andrey Churbanov [Thu, 5 Mar 2015 17:46:50 +0000 (17:46 +0000)]
minor change: comment improved

llvm-svn: 231381

9 years ago[DagCombiner] Allow shuffles to merge through bitcasts
Simon Pilgrim [Thu, 5 Mar 2015 17:14:04 +0000 (17:14 +0000)]
[DagCombiner] Allow shuffles to merge through bitcasts

Currently shuffles may only be combined if they are of the same type, despite the fact that bitcasts are often introduced in between shuffle nodes (e.g. x86 shuffle type widening).

This patch allows a single input shuffle to peek through bitcasts and if the input is another shuffle will merge them, shuffling using the smallest sized type, and re-applying the bitcasts at the inputs and output instead.

Dropped old ShuffleToZext test - this patch removes the use of the zext and vector-zext.ll covers these anyhow.

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

llvm-svn: 231380

9 years agoFileCheck: Document CHECK-SAME, follow-up to r230612
Duncan P. N. Exon Smith [Thu, 5 Mar 2015 17:00:05 +0000 (17:00 +0000)]
FileCheck: Document CHECK-SAME, follow-up to r230612

llvm-svn: 231379

9 years agoWhile reviewing the changes to Clang to add builtin support for the vsld, vsrd, and...
Kit Barton [Thu, 5 Mar 2015 16:24:38 +0000 (16:24 +0000)]
While reviewing the changes to Clang to add builtin support for the vsld, vsrd, and vsrad instructions, it was pointed out that the builtins are generating the LLVM opcodes (shl, lshr, and ashr) not calls to the intrinsics. This patch changes the implementation of the vsld, vsrd, and vsrad instructions from from intrinsics to VXForm_1 instructions and makes them legal with P8 Altivec. It also removes the definition of the int_ppc_altivec_vsld, int_ppc_altivec_vsrd, and int_ppc_altivec_vsrad intrinsics.

llvm-svn: 231378

9 years agoRework reverse_iterator::operator[] so as not to use the base iterators operator...
Marshall Clow [Thu, 5 Mar 2015 16:07:37 +0000 (16:07 +0000)]
Rework reverse_iterator::operator[] so as not to use the base iterators operator [], which can cause constness problems. Fixes PR17883

llvm-svn: 231375

9 years agoRevert change r231366 as it broke clang-native-arm-cortex-a9 Analysis/properties...
Igor Laevsky [Thu, 5 Mar 2015 15:41:14 +0000 (15:41 +0000)]
Revert change r231366 as it broke clang-native-arm-cortex-a9 Analysis/properties.m test.

llvm-svn: 231374

9 years agoFix bitselect for float/double types v2
Tom Stellard [Thu, 5 Mar 2015 15:31:05 +0000 (15:31 +0000)]
Fix bitselect for float/double types v2

We need to reinterpret float/double types as uint/ulong in order to
perform the bitwise operations.

This has been tested with piglit, OpenCV, and the ocl conformance tests.

v2:
  - Use vector operations rather than splitting vectors into scalar
    components.

Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 231373

9 years agoAVX-512, SKX: Enabled masked_load/store operations for this target.
Elena Demikhovsky [Thu, 5 Mar 2015 15:11:35 +0000 (15:11 +0000)]
AVX-512, SKX: Enabled masked_load/store operations for this target.

Added lowering for ISD::CONCAT_VECTORS and ISD::INSERT_SUBVECTOR for i1 vectors,
it is needed to pass all masked_memop.ll tests for SKX.

llvm-svn: 231371

9 years ago[clang-tidy] Slighly clarified a comment.
Alexander Kornienko [Thu, 5 Mar 2015 14:58:03 +0000 (14:58 +0000)]
[clang-tidy] Slighly clarified a comment.

llvm-svn: 231370

9 years ago[clang-tidy] Replace unrecognized namespace ending comments.
Alexander Kornienko [Thu, 5 Mar 2015 14:56:11 +0000 (14:56 +0000)]
[clang-tidy] Replace unrecognized namespace ending comments.

Summary:
Replace unrecognized namespace ending comments. This will help in particular when a namespace ending comment is mistyped or doesn't fit the regexp for other reason, e.g.:

  namespace a {
  namespace b {
  namespace {
  } // anoynmous namespace
  } // b
  } // namesapce a

Reviewers: djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

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

llvm-svn: 231369

9 years agoFix -Woverflow warning in unittest.
Frederic Riss [Thu, 5 Mar 2015 14:43:15 +0000 (14:43 +0000)]
Fix -Woverflow warning in unittest.

llvm-svn: 231368

9 years agotsan: fix signal handling during stop-the-world
Dmitry Vyukov [Thu, 5 Mar 2015 14:37:28 +0000 (14:37 +0000)]
tsan: fix signal handling during stop-the-world

Long story short: stop-the-world briefly resets SIGSEGV handler to SIG_DFL.
This breaks programs that handle and continue after SIGSEGV (namely JVM).
See the test and comments for details.

This is reincarnation of reverted r229678 (http://reviews.llvm.org/D7722).
Changed:
- execute TracerThreadDieCallback only on tracer thread
- reset global data in TracerThreadSignalHandler/TracerThreadDieCallback
- handle EINTR from waitpid

Add 3 new test:
- SIGSEGV during leak checking
- StopTheWorld operation during signal storm from an external process
- StopTheWorld operation when the program generates and handles SIGSEGVs

http://reviews.llvm.org/D8032

llvm-svn: 231367

9 years agoTeach lowering to correctly handle invoke statepoint and gc results tied to them...
Igor Laevsky [Thu, 5 Mar 2015 14:11:21 +0000 (14:11 +0000)]
Teach lowering to correctly handle invoke statepoint and gc results tied to them. Note that we still can not lower gc.relocates for invoke statepoints.
Also it extracts getCopyFromRegs helper function in SelectionDAGBuilder as we need to be able to customize type of the register exported from basic block during lowering of the gc.result.

llvm-svn: 231366

9 years ago[clang-tidy] Fix diag message in clang-tidy misc-uniqueptr-reset-release if right...
Alexander Kornienko [Thu, 5 Mar 2015 13:53:21 +0000 (13:53 +0000)]
[clang-tidy] Fix diag message in clang-tidy misc-uniqueptr-reset-release if right side is rvalue

http://reviews.llvm.org/D8071

Patch by Alexey Sokolov!

llvm-svn: 231365

9 years ago[clang-tidy] Refactor: Move google clang-tidy checks to namespace clang::tidy::google
Alexander Kornienko [Thu, 5 Mar 2015 13:46:14 +0000 (13:46 +0000)]
[clang-tidy] Refactor: Move google clang-tidy checks to namespace clang::tidy::google

http://reviews.llvm.org/D7994

Patch by Richard Thomson!

llvm-svn: 231364

9 years agoRecommit "[IAS] Teach -cc1as about the 'target-abi' option."
Toma Tabacu [Thu, 5 Mar 2015 13:39:14 +0000 (13:39 +0000)]
Recommit "[IAS] Teach -cc1as about the 'target-abi' option."

Added a REQUIRES for the Mips target.
Also, switched to using plain CHECKs, at the suggestion of Eric Christopher.

llvm-svn: 231363

9 years agoFix compilation after 'Make DataLayout Non-Optional in the Module' commit
Tobias Grosser [Thu, 5 Mar 2015 09:48:20 +0000 (09:48 +0000)]
Fix compilation after 'Make DataLayout Non-Optional in the Module' commit

llvm-svn: 231362

9 years agoSymbolizer refactoring: Link symbolizer tools into a fallback chain
Kuba Brecka [Thu, 5 Mar 2015 09:47:13 +0000 (09:47 +0000)]
Symbolizer refactoring: Link symbolizer tools into a fallback chain

Reviewed at http://reviews.llvm.org/D8049

llvm-svn: 231361

9 years ago[PBQP] Use a local bit-matrix to speedup searching an edge in the graph.
Arnaud A. de Grandmaison [Thu, 5 Mar 2015 09:12:59 +0000 (09:12 +0000)]
[PBQP] Use a local bit-matrix to speedup searching an edge in the graph.

Build time (user time) for building llvm+clang+lldb in release mode:
 - default allocator: 9086 seconds
 - with PBQP: 9126 seconds
 - with PBQP + local bit matrix cache: 9097 seconds

llvm-svn: 231360

9 years ago[InstCombine] Fix an assertion when fmul has a ConstantExpr operand
Michael Kuperstein [Thu, 5 Mar 2015 08:38:57 +0000 (08:38 +0000)]
[InstCombine] Fix an assertion when fmul has a ConstantExpr operand

isNormalFp and isFiniteNonZeroFp should not assume vector operands can not be constant expressions.

Patch by Pawel Jurek <pawel.jurek@intel.com>
Differential Revision: http://reviews.llvm.org/D8053

llvm-svn: 231359

9 years agoRevert "[TableGen] Implement at least some support for multiple explicit results...
Craig Topper [Thu, 5 Mar 2015 07:17:52 +0000 (07:17 +0000)]
Revert "[TableGen] Implement at least some support for multiple explicit results in an instruction pattern. No functional change to existing patterns."

This is failing on several build bots.

llvm-svn: 231358

9 years ago[TableGen] Implement at least some support for multiple explicit results in an instru...
Craig Topper [Thu, 5 Mar 2015 07:11:36 +0000 (07:11 +0000)]
[TableGen] Implement at least some support for multiple explicit results in an instruction pattern. No functional change to existing patterns.

This should help with the AVX512 masked gather changes Elena is working on. This patch is derived from some of the changes Elena made to tablegen, but modified by me to support arbitrary number of results.

llvm-svn: 231357

9 years ago[TableGen] Add support constraining a vector type in a pattern to have a specific...
Craig Topper [Thu, 5 Mar 2015 07:11:34 +0000 (07:11 +0000)]
[TableGen] Add support constraining a vector type in a pattern to have a specific element type and for constraining a vector type to have the same number of elements as another vector type. This is useful for AVX512 mask operations so we relate the mask type to the type of the other arguments.

llvm-svn: 231356

9 years agoFix leftover Dependences.cpp -> DependenceInfo.cpp
Tobias Grosser [Thu, 5 Mar 2015 06:52:42 +0000 (06:52 +0000)]
Fix leftover Dependences.cpp -> DependenceInfo.cpp

llvm-svn: 231355

9 years ago[X86] Use vmovss to handle inserting an element into index 0 of a v8f32 vector of...
Craig Topper [Thu, 5 Mar 2015 06:38:42 +0000 (06:38 +0000)]
[X86] Use vmovss to handle inserting an element into index 0 of a v8f32 vector of zeros.

llvm-svn: 231354

9 years agoRemove useless break after return.
Frederic Riss [Thu, 5 Mar 2015 06:13:39 +0000 (06:13 +0000)]
Remove useless break after return.

Pointed out by Paul Robinson.

llvm-svn: 231353

9 years agoAdd a few more performance tips
Philip Reames [Thu, 5 Mar 2015 05:55:55 +0000 (05:55 +0000)]
Add a few more performance tips

These came from my own experience and may not apply equally to all use cases.  Any alternate perspective anyone has should be used to refine these.

As always, grammar and spelling adjustments are more than welcome.  Please just directly commit a fix if you see something problematic.

llvm-svn: 231352

9 years agoRevert "[dsymutil] MSVC does generate move constructors, but it should accept to...
Frederic Riss [Thu, 5 Mar 2015 05:29:05 +0000 (05:29 +0000)]
Revert "[dsymutil] MSVC does generate move constructors, but it should accept to default them"

This reverts commit r231350.

It turns out MSVC doesn't generate implicit move constructors and also doesn't accept to default them...
See for example http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc/builds/2786

llvm-svn: 231351

9 years ago[dsymutil] MSVC does generate move constructors, but it should accept to default...
Frederic Riss [Thu, 5 Mar 2015 05:17:06 +0000 (05:17 +0000)]
[dsymutil] MSVC does generate move constructors, but it should accept to default them

llvm-svn: 231350

9 years agoAdd a link to the new PerformanceTips docs from the 3.7 release notes
Philip Reames [Thu, 5 Mar 2015 05:11:05 +0000 (05:11 +0000)]
Add a link to the new PerformanceTips docs from the 3.7 release notes

llvm-svn: 231349

9 years agoRevert r231324 "Remove the conditional addition of the execution dependency fixing"
Hans Wennborg [Thu, 5 Mar 2015 03:24:49 +0000 (03:24 +0000)]
Revert r231324 "Remove the conditional addition of the execution dependency fixing"

See PR22799.

llvm-svn: 231348

9 years ago[MBP] Use range based for-loops throughout this code. Several had
Chandler Carruth [Thu, 5 Mar 2015 03:19:05 +0000 (03:19 +0000)]
[MBP] Use range based for-loops throughout this code. Several had
already been added and the inconsistency made choosing names and
changing code more annoying. Plus, wow are they better for this code!

llvm-svn: 231347

9 years ago[test] Expand a bit on the test case from r231251. NFC.
Argyrios Kyrtzidis [Thu, 5 Mar 2015 03:12:33 +0000 (03:12 +0000)]
[test] Expand a bit on the test case from r231251. NFC.

llvm-svn: 231346

9 years agoRemove dead code.
Rui Ueyama [Thu, 5 Mar 2015 02:58:13 +0000 (02:58 +0000)]
Remove dead code.

This hook is called from one of the hottest loops in LLD and does nothing.

llvm-svn: 231345

9 years agoFix build with GCC:
Nick Lewycky [Thu, 5 Mar 2015 02:56:05 +0000 (02:56 +0000)]
Fix build with GCC:
 - GCC doesn't support #pragma mark, only Apple GCC and clang. Wrap the pragma mark's in #if 0 to make gcc ignore them but xcode still see them.
 - Wrap a bunch of "#pragma clang" lines in #ifdef __clang__.
 - Pacify gcc's -Wparenthesis in a case where it's quite reasonable.

llvm-svn: 231344

9 years ago[sanitizer] add a run-time flag to dump the coverage counter bitset
Kostya Serebryany [Thu, 5 Mar 2015 02:48:51 +0000 (02:48 +0000)]
[sanitizer] add a run-time flag to dump the coverage counter bitset

llvm-svn: 231343

9 years agoAdd support for the DWARFv3 (circa 2005) DW_OP_form_tls_address
Jason Molenda [Thu, 5 Mar 2015 02:42:06 +0000 (02:42 +0000)]
Add support for the DWARFv3 (circa 2005) DW_OP_form_tls_address
operator in addition to the vendor-extension DW_OP_GNU_push_tls_address.
clang on PS4 and Darwin will be emitting the standard opcode
as of r231286 via http://reviews.llvm.org/D8018

Behavior of this standard  opcode is the same as
DW_OP_GNU_push_tls_address.

<rdar://problem/20043195>

llvm-svn: 231342

9 years ago[MBP] NFC, run clang-format over this code and tweak things to make the
Chandler Carruth [Thu, 5 Mar 2015 02:35:31 +0000 (02:35 +0000)]
[MBP] NFC, run clang-format over this code and tweak things to make the
result reasonable.

This code predated clang-format and so there was a reasonable amount of
crufty formatting that had accumulated. This should ensure that neither
myself nor others end up with formatting-only changes sneaking into
other fixes.

llvm-svn: 231341

9 years ago[MBP] This is no longer 'block-placement2'. ;] The old variants are long
Chandler Carruth [Thu, 5 Mar 2015 02:28:25 +0000 (02:28 +0000)]
[MBP] This is no longer 'block-placement2'. ;] The old variants are long
gone, update this code to reflect that.

llvm-svn: 231340