Commit Graph

193883 Commits

Author SHA1 Message Date
John Thompson 3c9fb52218 Pruned some unneeded code and comments.
llvm-svn: 229855
2015-02-19 14:31:48 +00:00
Tobias Grosser c56dcd52be Add missing comments to member variables
Reported-by: Johannes Doerfert
llvm-svn: 229854
2015-02-19 14:28:36 +00:00
Chandler Carruth 352eba1c29 [x86] Dramatically improve v8i16 shuffle lowering by not using its
terribly complex partial blend logic.

This code path was one of the more complex and bug prone when it first
went in and it hasn't faired much better. Ultimately, with the simpler
basis for unpack lowering and support bit-math blending, this is
completely obsolete. In the worst case without this we generate
different but equivalent instructions. However, in many cases we
generate much better code. This is especially true when blends or pshufb
is available.

This does expose one (minor) weakness of the unpack lowering that I'll
try to address.

In case you were wondering, this is actually a big part of what I've
been trying to pull off in the recent string of commits.

llvm-svn: 229853
2015-02-19 14:08:24 +00:00
Nathan Sidwell 5bb231c279 FIX PR 18432, default args, friends & late-parsed members.
Sema::MergeCXXFunctionDecl: propagate hasUnparsedDefaultArg to new decl.

Parser::HandleMemberFunctionDeclDelays: check hasUnparsedDefaultArg
flag.

Parser::ParseLexedMethodDeclaration: handle inherited unparsed default
arg case.

llvm-svn: 229852
2015-02-19 14:03:22 +00:00
Chandler Carruth 2c0390ca4b [x86] Remove the final fallback in the v8i16 lowering that isn't really
needed, and significantly improve the SSSE3 path.

This makes the new strategy much more clear. If we can blend, we just go
with that. If we can't blend, we try to permute into an unpack so
that we handle cases where the unpack doing the blend also simplifies
the shuffle. If that fails and we've got SSSE3, we now call into
factored-out pshufb lowering code so that we leverage the fact that
pshufb can set up a blend for us while shuffling. This generates great
code, especially because we *know* we don't have a fast blend at this
point. Finally, we fall back on decomposing into permutes and blends
because we do at least have a bit-math-based blend if we need to use
that.

This pretty significantly improves some of the v8i16 code paths. We
never need to form pshufb for the single-input shuffles because we have
effective target-specific combines to form it there, but we were missing
its effectiveness in the blends.

llvm-svn: 229851
2015-02-19 13:56:49 +00:00
Anton Yartsev 5b5c7cec08 [analyzer] Different handling of alloca().
+ separate bug report for "Free alloca()" error to be able to customize checkers responsible for this error.
+ Muted "Free alloca()" error for NewDelete checker that is not responsible for c-allocated memory, turned on for unix.MismatchedDeallocator checker.
+ RefState for alloca() - to be able to detect usage of zero-allocated memory by upcoming ZeroAllocDereference checker.
+ AF_Alloca family to handle alloca() consistently - keep proper family in RefState, handle 'alloca' by getCheckIfTracked() facility, etc.
+ extra tests.

llvm-svn: 229850
2015-02-19 13:36:20 +00:00
Chandler Carruth f0f0d27391 [x86] Simplify the pre-SSSE3 v16i8 lowering significantly by decomposing
them into permutes and a blend with the generic decomposition logic.

This works really well in almost every case and lets the code only
manage the expansion of a single input into two v8i16 vectors to perform
the actual shuffle. The blend-based merging is often much nicer than the
pack based merging that this replaces. The only place where it isn't we
end up blending between two packs when we could do a single pack. To
handle that case, just teach the v2i64 lowering to handle these blends
by digging out the operands.

With this we're down to only really random permutations that cause an
explosion of instructions.

llvm-svn: 229849
2015-02-19 13:15:12 +00:00
Jean-Daniel Dupas c31da7010b [Mach-O] Rename enum typename for consistency. NFC
Typename shouldn't mix camel case and underscore.
Thanks to Rui for the remark.

llvm-svn: 229848
2015-02-19 12:38:54 +00:00
Chandler Carruth 8817e5e01b [x86] Remove the insanely over-aggressive unpack lowering strategy for
v16i8 shuffles, and replace it with new facilities.

This uses precise patterns to match exact unpacks, and the new
generalized unpack lowering only when we detect a case where we will
have to shuffle both inputs anyways and they terminate in exactly
a blend.

This fixes all of the blend horrors that I uncovered by always lowering
blends through the vector shuffle lowering. It also removes *sooooo*
much of the crazy instruction sequences required for v16i8 lowering
previously. Much cleaner now.

The only "meh" aspect is that we sometimes use pshufb+pshufb+unpck when
it would be marginally nicer to use pshufb+pshufb+por. However, the
difference there is *tiny*. In many cases its a win because we re-use
the pshufb mask. In others, we get to avoid the pshufb entirely. I've
left a FIXME, but I'm dubious we can really do better than this. I'm
actually pretty happy with this lowering now.

For SSE2 this exposes some horrors that were really already there. Those
will have to fixed by changing a different path through the v16i8
lowering.

llvm-svn: 229846
2015-02-19 12:10:37 +00:00
Jozef Kolek 5d171fc291 [mips][microMIPS] Make usage of AND16, OR16 and XOR16 by code generator
Differential Revision: http://reviews.llvm.org/D7611

llvm-svn: 229845
2015-02-19 11:51:32 +00:00
Chandler Carruth 38dea42ddf [x86] The SELECT x86 DAG combine also does legalization. It used to rely
on things not being marked as either custom or legal, but we now do
custom lowering of more VSELECT nodes. To cope with this, manually
replicate the legality tests here. These have to stay in sync with the
set of tests used in the custom lowering of VSELECT.

Ideally, we wouldn't do any of this combine-based-legalization when we
have an actual custom legalization step for VSELECT, but I'm not going
to be able to rewrite all of that today.

I don't have a test case for this currently, but it was found when
compiling a number of the test-suite benchmarks. I'll try to reduce
a test case and add it.

This should at least fix the test-suite fallout on build bots.

llvm-svn: 229844
2015-02-19 11:43:37 +00:00
Pavel Labath b81e653dce Silence unused variable warnings in release builds
llvm-svn: 229843
2015-02-19 11:41:12 +00:00
Igor Laevsky 55d60a4a2f Add few simple tests to check statepoint placement for invoke instructions.
Differential Revision: http://reviews.llvm.org/D7535

llvm-svn: 229842
2015-02-19 11:39:04 +00:00
Michael Kuperstein efd7a96d2e Reverting r229831 due to multiple ARM/PPC/MIPS build-bot failures.
llvm-svn: 229841
2015-02-19 11:38:11 +00:00
Igor Laevsky 9570ff94f7 Implement invoke statepoint verification.
Differential Revision: http://reviews.llvm.org/D7366

llvm-svn: 229840
2015-02-19 11:28:47 +00:00
Yaron Keren bc5986fe6a Spelling correction.
llvm-svn: 229839
2015-02-19 11:21:11 +00:00
Igor Laevsky 77f118f878 Add invoke related functionality into StatepointSite classes.
Differential Revision: http://reviews.llvm.org/D7364

llvm-svn: 229838
2015-02-19 11:02:11 +00:00
Elena Demikhovsky 69e8b45b13 AVX-512: Full implementation for VRNDSCALESS/SD instructions and intrinsics.
llvm-svn: 229837
2015-02-19 10:48:04 +00:00
Chandler Carruth bcb6c5f62d [x86] Add support for bit-wise blending and use it in the v8 and v16
lowering paths. I'm going to be leveraging this to simplify a lot of the
overly complex lowering of v8 and v16 shuffles in pre-SSSE3 modes.

Sadly, this isn't profitable on v4i32 and v2i64. There, the float and
double blending instructions for pre-SSE4.1 are actually pretty good,
and we can't beat them with bit math. And once SSE4.1 comes around we
have direct blending support and this ceases to be relevant.

Also, some of the test cases look odd because the domain fixer
canonicalizes these to floating point domain. That's OK, it'll use the
integer domain when it matters and some day I may be able to update
enough of LLVM to canonicalize the other way.

This restores almost all of the regressions from teaching x86's vselect
lowering to always use vector shuffle lowering for blends. The remaining
problems are because the v16 lowering path is still doing crazy things.
I'll be re-arranging that strategy in more detail in subsequent commits
to finish recovering the performance here.

llvm-svn: 229836
2015-02-19 10:46:52 +00:00
Chandler Carruth b89464a9b6 [x86,sdag] Two interrelated changes to the x86 and sdag code.
First, don't combine bit masking into vector shuffles (even ones the
target can handle) once operation legalization has taken place. Custom
legalization of vector shuffles may exist for these patterns (making the
predicate return true) but that custom legalization may in some cases
produce the exact bit math this matches. We only really want to handle
this prior to operation legalization.

However, the x86 backend, in a fit of awesome, relied on this. What it
would do is mark VSELECTs as expand, which would turn them into
arithmetic, which this would then match back into vector shuffles, which
we would then lower properly. Amazing.

Instead, the second change is to teach the x86 backend to directly form
vector shuffles from VSELECT nodes with constant conditions, and to mark
all of the vector types we support lowering blends as shuffles as custom
VSELECT lowering. We still mark the forms which actually support
variable blends as *legal* so that the custom lowering is bypassed, and
the legal lowering can even be used by the vector shuffle legalization
(yes, i know, this is confusing. but that's how the patterns are
written).

This makes the VSELECT lowering much more sensible, and in fact should
fix a bunch of bugs with it. However, as you'll see in the test cases,
right now what it does is point out the *hilarious* deficiency of the
new vector shuffle lowering when it comes to blends. Fortunately, my
very next patch fixes that. I can't submit it yet, because that patch,
somewhat obviously, forms the exact and/or pattern that the DAG combine
is matching here! Without this patch, teaching the vector shuffle
lowering to produce the right code infloops in the DAG combiner. With
this patch alone, we produce terrible code but at least lower through
the right paths. With both patches, all the regressions here should be
fixed, and a bunch of the improvements (like using 2 shufps with no
memory loads instead of 2 andps with memory loads and an orps) will
stay. Win!

There is one other change worth noting here. We had hilariously wrong
vectorization cost estimates for vselect because we fell through to the
code path that assumed all "expand" vector operations are scalarized.
However, the "expand" lowering of VSELECT is vector bit math, most
definitely not scalarized. So now we go back to the correct if horribly
naive cost of "1" for "not scalarized". If anyone wants to add actual
modeling of shuffle costs, that would be cool, but this seems an
improvement on its own. Note the removal of 16 and 32 "costs" for doing
a blend. Even in SSE2 we can blend in fewer than 16 instructions. ;] Of
course, we don't right now because of OMG bad code, but I'm going to fix
that. Next patch. I promise.

llvm-svn: 229835
2015-02-19 10:36:19 +00:00
Daniel Jasper 22a3e79aaf Make -fmodules-decluse and -fmodules-strict-decluse compatible options.
They don't actually influence the result of the module compilation.

llvm-svn: 229834
2015-02-19 09:56:13 +00:00
Mohit K. Bhakkad 88077324c6 [LSan][MIPS64] Enable LSan testing for mips64/mips64el
Patch by Sagar Thakur

Reviewers: petarj, earthdok, kcc.

Subscribers:  samsonov, dsanders, mohit.bhakkad, Anand.Takale, llvm-commits.

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

llvm-svn: 229833
2015-02-19 09:14:43 +00:00
Dmitry Vyukov c0e912dd7b tsan: fix PTRACE_ATTACH handling during stop-the-world
If the thread receives a signal concurrently with PTRACE_ATTACH,
we can get notification about the signal before notification about stop.
In such case we need to forward the signal to the thread, otherwise
the signal will be missed (as we do PTRACE_DETACH with arg=0) and
any logic relying on signals will break. After forwarding we need to
continue to wait for stopping, because the thread is not stopped yet.
We do ignore delivery of SIGSTOP, because we want to make stop-the-world
as invisible as possible.

http://reviews.llvm.org/D7723

 --This line, and those below, will be ignored--
M    lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
M    test/tsan/signal_segv_handler.cc

llvm-svn: 229832
2015-02-19 09:02:29 +00:00
Michael Kuperstein ba5b04c798 Use std::bitset for SubtargetFeatures
Previously, subtarget features were a bitfield with the underlying type being uint64_t. 
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.

No functional change.

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

llvm-svn: 229831
2015-02-19 09:01:04 +00:00
Mohit K. Bhakkad 36f974d76b [LSan] [MIPS] adding support of LSan for mips64/mips64el arch
Patch by Sagar Thakur

Reviewers: petarj, earthdok, kcc.

Subscribers:  samsonov, dsanders, mohit.bhakkad, Anand.Takale, llvm-commits.

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

llvm-svn: 229830
2015-02-19 07:30:39 +00:00
David Majnemer 12d3783add Mark DR1940 as implemented
llvm-svn: 229829
2015-02-19 07:29:01 +00:00
David Majnemer 6440548434 Mark DR1947 as implemented
llvm-svn: 229828
2015-02-19 07:28:57 +00:00
David Majnemer 7da2302780 Mark DR1948 as implemented
llvm-svn: 229827
2015-02-19 07:28:55 +00:00
David Majnemer 54dc82e1d2 Mark DR1994 as a duplicate of DR529
llvm-svn: 229826
2015-02-19 07:28:52 +00:00
David Majnemer 2dbad01349 Mark DR1968 as implemented
llvm-svn: 229825
2015-02-19 07:28:49 +00:00
Davide Italiano faafae33fa [Support/Timer] Make GetMallocUsage() aware of jemalloc.
Differential Revision:	D7657
Reviewed by:	shankarke, majnemer

llvm-svn: 229824
2015-02-19 07:27:14 +00:00
NAKAMURA Takumi 8f2085ed16 CXXNameMangler::mangleUnresolvedPrefix(): Prune an obsolete \param, according to r229809. [-Wdocumentation]
llvm-svn: 229823
2015-02-19 07:14:26 +00:00
David Majnemer cb34c67c2a Itanium ABI: Don't pass nullptr to a bool argument
llvm-svn: 229822
2015-02-19 05:51:14 +00:00
Lang Hames c6ba0bf33b [Orc][Kaleidoscope] Fix typo in tutorial comment.
llvm-svn: 229821
2015-02-19 05:33:30 +00:00
Tobias Grosser d1e33e7061 ScopDetection: Only detect scops that have at least one read and one write
Scops that only read seem generally uninteresting and scops that only write are
most likely initializations where there is also little to optimize.  To not
waste compile time we bail early.

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

llvm-svn: 229820
2015-02-19 05:31:07 +00:00
Dmitri Gribenko 3e1551c96f Provide the same ABI regardless of NDEBUG
For projects depending on LLVM, I find it very useful to combine a
release-no-asserts build of LLVM with a debug+asserts build of the dependent
project.  The motivation is that when developing a dependent project, you are
debugging that project itself, not LLVM.  In my usecase, a significant part of
the runtime is spent in LLVM optimization passes, so I would like to build LLVM
without assertions to get the best performance from this combination.

Currently, `lib/Support/Debug.cpp` changes the set of symbols it provides
depending on NDEBUG, while `include/llvm/Support/Debug.h` requires extra
symbols when NDEBUG is not defined.  Thus, it is not possible to enable
assertions in an external project that uses facilities of `Debug.h`.

This patch changes `Debug.cpp` and `Valgrind.cpp` to always define the symbols
that other code may depend on when #including LLVM headers without NDEBUG.

http://reviews.llvm.org/D7662

llvm-svn: 229819
2015-02-19 05:30:16 +00:00
Larisse Voufo ee3c1b2a71 Update C++ implementation status page with recent changes w.r.t. to sized deallocation.
llvm-svn: 229818
2015-02-19 04:34:13 +00:00
Alexey Bataev 054829b1bd [MSVC] Improved lookup into dependent/non-dependent bases of dependent class
Patch improves lookup into dependendt bases of dependent class and adds lookup
into non-dependent bases.
Differential Revision: http://reviews.llvm.org/D7173

llvm-svn: 229817
2015-02-19 04:28:23 +00:00
Rui Ueyama 3966c61536 PECOFF: Fix base relocation for an absolute symbol.
Previously we wrongly emitted a base relocation entry for an absolute symbol.
That made the loader to rewrite some instruction operands with wrong values
only when a DLL is not loaded at the default address. That caused a
misterious crash of some executable.

Absolute symbols will of course never change value wherever the binary is
loaded to memory. We shouldn't emit base relocations for absolute symbols.

llvm-svn: 229816
2015-02-19 04:22:27 +00:00
Ben Langmuir 07236733be Revert adding hostname to module hash
I didn't realize how easily the hostname could change - for example just
changing wireless networks seems to prompt it in some cases.

Users can always set their own local module cache path to avoid this.

This reverts commits r228592, 228594, 228601 and 228613.
rdar://19287368

llvm-svn: 229815
2015-02-19 04:03:57 +00:00
Rui Ueyama 3e6490f1e8 PECOFF: use llvm-readobj to dump .reloc section
When this test was written, no llvm tool could print out contents
of base relocation section. Now llvm-readobj is able to dump it in
a text format. Use that tool to make this test readable.

llvm-svn: 229814
2015-02-19 04:02:17 +00:00
Justin Bogner 91f2e3c9c2 InstrProf: Always emit a coverage region for the condition of an if
When tools like llvm-cov show regions, it's much easier to understand
what's happening if the condition of an if shows a counter as well as
the body.

llvm-svn: 229813
2015-02-19 03:10:30 +00:00
Larisse Voufo 62d8aa5caf Fix a test case.
llvm-svn: 229812
2015-02-19 03:03:23 +00:00
Filipe Cabecinhas 54a2ba8b76 [Headers] Add tests for _mm256_insert_epi64 and fix its definition
Summary:
The definition for _mm256_insert_epi64 was taking an int, which would get
truncated before being inserted in the vector.

Original patch by Joshua Magee!

Reviewers: bruno, craig.topper

Subscribers: cfe-commits

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

llvm-svn: 229811
2015-02-19 03:02:33 +00:00
Eric Fiselier 2d38959cd9 Mark more tuple tests as unsupported in C++98 && C++03
llvm-svn: 229810
2015-02-19 02:44:09 +00:00
David Majnemer b8014dd7c0 Itanium ABI: Properly qualify the destructor-name
We didn't have enough qualificaiton before the scope specifier and we
had too much qualification in the destructor name itself.

llvm-svn: 229809
2015-02-19 02:16:16 +00:00
Eric Fiselier 0a52cd7937 [libcxx] Mark most tuple tests UNSUPPORTED for c++03 and c++98.
Summary: No declaration for the type `tuple` is given in c++03 or c++98 modes. Mark all tests that use the actual `tuple` type as UNSUPPORTED.

Reviewers: jroelofs, mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

llvm-svn: 229808
2015-02-19 02:10:42 +00:00
Lang Hames 56678fe634 [Orc][Kaleidoscope] Make the 'fully lazy' orc kaleidoscope tutorial lazier still.
The new JIT doesn't IRGen stubs until they're referenced.

llvm-svn: 229807
2015-02-19 01:32:43 +00:00
Lang Hames af53ed1a7f [Orc] Fix a bug in the compile callback manager: trampoline ids need to be fixed
up before returning them to the available pool.

llvm-svn: 229806
2015-02-19 01:31:25 +00:00
Eric Christopher d84f5d30e2 Remove the local subtarget variable from the SystemZ asm printer
and update the two calls accordingly.

llvm-svn: 229805
2015-02-19 01:26:28 +00:00