Commit Graph

173534 Commits

Author SHA1 Message Date
Karthik Bhat ddd0cb5ecf Vectorize intrinsic math function calls in SLPVectorizer.
This patch adds support to recognize and vectorize intrinsic math functions in SLPVectorizer.
Review: http://reviews.llvm.org/D3560 and http://reviews.llvm.org/D3559

llvm-svn: 207901
2014-05-03 09:59:54 +00:00
Chandler Carruth e6c980c41d [leaks] Re-shuffle code such that we don't create a basic block for
initializing an array unless we need it. Specifically, position the
creation of a new basic block after we've checked all of the cases that
bypass the need for it.

Fixes another leak in test/CodeGen* found by LSan.

llvm-svn: 207900
2014-05-03 09:16:57 +00:00
Chandler Carruth 81f9e02ef3 [leaks] Don't leak the fake arguments we synthesize for LLVM option
parsing.

llvm-svn: 207899
2014-05-03 08:39:35 +00:00
Alp Toker 0804343733 Eliminate ASTContext's DelayInitialization flag
Having various possible states of initialization following construction doesn't
add value here.

Also remove the unused size_reserve parameter.

llvm-svn: 207897
2014-05-03 03:46:04 +00:00
Alp Toker b6cc592ea3 Fix a bunch of mislayered clang/Lex includes from Sema
llvm-svn: 207896
2014-05-03 03:45:55 +00:00
Alp Toker b7b579aa93 Update Preprocessor::Initialize() documentation following r207825
llvm-svn: 207895
2014-05-03 03:45:43 +00:00
David Majnemer 085b111d32 CodeGen: Cleanup ABIArgInfo
ABIArgInfo was pretty hard to grok, it had data members with names like
"BoolData0" and "UIntData".  Constructors with lots of bool arguments.
Reusing the same data member for multiple purposes.

It was also wasteful with memory, this new layout is 8 bytes smaller.

llvm-svn: 207894
2014-05-03 02:23:35 +00:00
David Majnemer a2245271af Revert "Sema: Implement DR244"
This was accidentally committed.

This reverts commit r207892.

llvm-svn: 207893
2014-05-03 02:22:11 +00:00
David Majnemer 22fcb08357 Sema: Implement DR244
Naming the destructor using a typedef-name for the class-name is
well-formed.

This fixes PR19620.

llvm-svn: 207892
2014-05-03 02:18:46 +00:00
Nick Lewycky 843571130f Err, wait. Those new test functions in r207890 need CHECK lines.
llvm-svn: 207891
2014-05-03 01:19:39 +00:00
Nick Lewycky d78f92fbb2 Rewrite NRVO determination. Track NRVO candidates on the parser Scope and apply the NRVO candidate flag to all possible NRVO candidates here, and remove the flags in computeNRVO or upon template instantiation. A variable now has NRVO applied if and only if every return statement in that scope returns that variable. This is nearly optimal.
Performs NRVO roughly 7% more often in a bootstrap build of clang. Patch co-authored by Richard Smith.

llvm-svn: 207890
2014-05-03 00:41:18 +00:00
Reid Kleckner e39ee21551 MS ABI x64: Pass small objects with dtors but no copy ctors directly
Passing objects directly (in registers or memory) creates a second copy
of the object in the callee.  The callee always destroys its copy, but
we also have to destroy any temporary created in the caller.  In other
words, copy elision of these kinds of objects is impossible.

Objects larger than 8 bytes with non-trivial dtors and trivial copy
ctors are still passed indirectly, and we can still elide copies of
them.

Fixes PR19640.

llvm-svn: 207889
2014-05-03 00:33:28 +00:00
Chandler Carruth 7d8668288a [leaks] Fix a leak of a basic block when we successfully fold a switch
condition to a constant and emit only the relevant statement. In that
case, we were previously creating the epilog jump destination, a cleanup
scope, and emitting any condition variable into it. Instead, we can emit
the condition variable (if we have one) into the cleanup scope used for
the entire folded case sequence. We avoid creating a jump dest, a basic
block, and an extra cleanup scope. Win!

llvm-svn: 207888
2014-05-03 00:14:49 +00:00
Adam Nemet 6a56c37b95 [LSR] Add llc testcase for r207271/r207569.
See PR19608 for the details but to summarize it was easy to modify the .ll
file to get the desired def-use ordering.

llvm-svn: 207887
2014-05-02 23:49:01 +00:00
Rui Ueyama 82d62c4420 Revert "Remove dead code."
This reverts commit r207884 which was prematurely committed by accident.

llvm-svn: 207886
2014-05-02 23:45:28 +00:00
Rui Ueyama 3872d0ae26 Remove "virtual" and add "override".
llvm-svn: 207885
2014-05-02 23:44:02 +00:00
Rui Ueyama d50ed14d92 Remove dead code.
isAlias always returns false and no one is using it. It was
originally added Atom to query if an atom is an alias for another
atom, assuming that alias atoms are different from normal atoms.

We now support atom aliasing, but the way that's implemented is
in a different way than what isAlias assumed. An alias atom is
just a regular defined atom with no content, and it has a layout-
before edge to alias-to atom so that they are layed out at the
same location in the result. So this is dead code, and it doesn't
make much sense to keep it.

llvm-svn: 207884
2014-05-02 23:43:59 +00:00
Richard Trieu a1342406f2 Fix PR 19630, don't crash when file ends with whitespace.
llvm-svn: 207883
2014-05-02 23:40:32 +00:00
Chandler Carruth b2faa59976 [leaks] Parse the schema file every time we try to verify the XML. Yes,
this is wasteful, blah blah, but this is a test utility only. It turns
out that without doing this, libxml2 will always leak a bunch of the XML
data, and that is causing failures with LSan. This is also quite a bit
simpler and I don't think it is slow enough to really be a show stopper.
If someone yells about the runtime of c-index-test, we can do other
things to try to mitigate it, but the current strategy wasn't working
well.

llvm-svn: 207882
2014-05-02 23:30:59 +00:00
Hans Wennborg 55362851a9 Fix clang-cl Driver leak
We were synthesizing new arguments from e.g. '/Tcfile.c' arguments,
but didn't handle ownership correctly.

llvm-svn: 207880
2014-05-02 22:55:30 +00:00
Justin Bogner fb4e3f2f4e clang-c: Fix a typo
llvm-svn: 207879
2014-05-02 22:37:02 +00:00
Rui Ueyama 20822d924e Return the expression result directly.
llvm-svn: 207878
2014-05-02 22:32:01 +00:00
Greg Clayton 745b6688b4 LLDB could segfault if it got a .a file that had extra padding bytes at the end of the file.
<rdar://problem/16732178>

llvm-svn: 207877
2014-05-02 22:25:51 +00:00
David Blaikie 658a20b04d Try simplifying LexicalScopes ownership again.
Committed initially in r207724-r207726 and reverted due to compiler-rt
crashes in r207732.

Instead, fix this harder with unordered_map and store the LexicalScopes
by value in the map. This did necessitate moving the definition of
LexicalScope above the definition of LexicalScopes.

Let's see how the buildbots/compilers tolerate unordered_map::emplace +
std::piecewise_construct + std::forward_as_tuple...

llvm-svn: 207876
2014-05-02 22:21:05 +00:00
Rui Ueyama 19173a39d3 Don't use "auto" where the actual type is not obvious.
llvm-svn: 207875
2014-05-02 21:48:01 +00:00
Chandler Carruth 271635da0d [sanitizers] Propagate the sanitizer options through to the lit context.
This makes it *really* easy to debug leaks FYI:

ASAN_OPTIONS=detect_leaks=1 ./bin/llvm-lit -v <path to test>

llvm-svn: 207874
2014-05-02 21:47:35 +00:00
Chandler Carruth 0702f8eefa [sanitizers] Propagate the sanitizer options through to the lit context.
This makes it *really* easy to debug leaks FYI:

ASAN_OPTIONS=detect_leaks=1 ./bin/llvm-lit -v <path to test>

llvm-svn: 207873
2014-05-02 21:46:39 +00:00
Chandler Carruth 4d9c3df429 [leaks] Fix a leak recently introduced to the pragma handling. This
whole code would be better with std::unique_ptr managing the lifetimes
of the handlers, but I wanted to make a targeted fix to the leaks first.
With this change, all of the Clang preprocessor tests are leak free with
LSan.

llvm-svn: 207872
2014-05-02 21:44:48 +00:00
Benjamin Kramer 6dd9f8feb3 Satisfy GCC's urgent need for parentheses around ‘&&’ within ‘||’.
llvm-svn: 207871
2014-05-02 21:28:49 +00:00
Nico Weber b0f9e4ace7 Remove unused typedef found by gcc's -Wunused-local-typedefs.
llvm-svn: 207870
2014-05-02 21:22:21 +00:00
Rafael Espindola bf8bf54bfc Aliases are always definitions. Delete dead code.
llvm-svn: 207869
2014-05-02 21:10:48 +00:00
Eric Christopher 6c26beb770 Clean up constructor logic and member access for LoopVectorizeHints.
There are public functions that mutate various members as well as
another private member already, so make all the members private to
avoid the discontinuity and add accessors for the values. Should
be no functional change.

llvm-svn: 207868
2014-05-02 20:40:04 +00:00
Alex McCarthy e14ddef034 Fix null pointer segfault when calling dump() on a DeclStmt containing a VarDecl.
llvm-svn: 207867
2014-05-02 20:24:11 +00:00
Justin Bogner c475e1bc77 llvm-cov: Fix handling of line zero appearing in a line table
Reading line tables in llvm-cov was pretty broken, but would happen to
work as long as no line in the table was 0. It's not clear to me
whether a line of zero *should* show up in these tables, but deciding
to read a string in the middle of the line table is certainly the
wrong thing to do if it does.

I've also added some comments, as trying to figure out what this block
of code was doing was fairly unpleasant.

llvm-svn: 207866
2014-05-02 20:01:24 +00:00
Daniel Sanders 6ef0a2f1be [tablegen] !strconcat accepts more than two arguments but this wasn't documented or tested.
Summary:
* Updated the documentation
* Added a test for >2 arguments
* Added a check for the lexical concatenation
* Made the existing test a bit stricter.

Reviewers: t.p.northover

Reviewed By: t.p.northover

Subscribers: t.p.northover, llvm-commits

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

llvm-svn: 207865
2014-05-02 19:25:52 +00:00
Joerg Sonnenberger a53b3593f0 Use posix_spawn on NetBSD as well.
llvm-svn: 207864
2014-05-02 19:09:40 +00:00
Joerg Sonnenberger bf2a31053b For now, use FreeBSD's host configuration for NetBSD as well.
llvm-svn: 207863
2014-05-02 19:01:25 +00:00
Joerg Sonnenberger 420708a374 Fix format string for 32bit systems.
llvm-svn: 207862
2014-05-02 19:00:27 +00:00
Joerg Sonnenberger 2cd8f5245f Use correct readline header on NetBSD.
llvm-svn: 207861
2014-05-02 18:59:49 +00:00
Joerg Sonnenberger ff9620f975 LLDB_INVALID_ADDRESS may not be too large for a uintptr_t, so cast
first.

llvm-svn: 207860
2014-05-02 18:58:51 +00:00
Joerg Sonnenberger 6764b3e82a EOF is outside the value range of char on architectures with unsigned
char like ARM. Check for EOF explicitly.

llvm-svn: 207859
2014-05-02 18:53:53 +00:00
Chad Rosier 3ba81bdb45 [driver] Enable the slp vectorizer at -Oz.
PR19568

llvm-svn: 207858
2014-05-02 18:41:57 +00:00
Rafael Espindola 7cdc8a1f30 Remove dead declaration.
llvm-svn: 207857
2014-05-02 18:37:07 +00:00
Nico Weber 4b2acde21a Teach GlobalDCE how to remove empty global_ctor entries.
This moves most of GlobalOpt's constructor optimization
code out of GlobalOpt into Transforms/Utils/CDtorUtils.{h,cpp}. The
public interface is a single function OptimizeGlobalCtorsList() that
takes a predicate returning which constructors to remove.

GlobalOpt calls this with a function that statically evaluates all
constructors, just like it did before. This part of the change is
behavior-preserving.

Also add a call to this from GlobalDCE with a filter that removes global
constructors that contain a "ret" instruction and nothing else – this
fixes PR19590.

llvm-svn: 207856
2014-05-02 18:35:25 +00:00
Joerg Sonnenberger 4f51a0740a LLDB_INVALID_OFFSET can be large than a size_t on ILP32 systems, so use
SIZE_MAX here.

llvm-svn: 207855
2014-05-02 18:26:40 +00:00
Hans Wennborg 802df13e4d Fix bad comment from r207573.
llvm-svn: 207854
2014-05-02 18:12:30 +00:00
Akira Hatanaka f76388dd7e [GVN] Pass the phi-translated address of a load instead of the untranslated
address to AnalyzeLoadFromClobberingLoad. This fixes a bug in load-PRE where
PRE is applied to a load that is not partially redundant.

<rdar://problem/16638765>.

llvm-svn: 207853
2014-05-02 17:59:17 +00:00
Eric Christopher 25c4e67d69 Small formatting change.
llvm-svn: 207852
2014-05-02 17:52:19 +00:00
Saleem Abdulrasool 734bca04ff MC: place .file records into the correct section
.file records are supposed to have a section identifier of 65534
(IMAGE_SCN_DEBUG) rather than 0.  This is spelt out clearly within the PE/COFF
specification.  Fix this minor oversight with the implementation for support for
.file records.

llvm-svn: 207851
2014-05-02 17:45:24 +00:00
Tim Northover 820e041a3c DAGCombine: prevent formation of illegal ConstantFP nodes.
llvm-svn: 207850
2014-05-02 17:25:02 +00:00