platform/upstream/llvm.git
9 years agoThis should have been part of r224676.
David Majnemer [Sat, 20 Dec 2014 04:48:34 +0000 (04:48 +0000)]
This should have been part of r224676.

llvm-svn: 224677

9 years agoInstCombine: Squash an icmp+select into bitwise arithmetic
David Majnemer [Sat, 20 Dec 2014 04:45:35 +0000 (04:45 +0000)]
InstCombine: Squash an icmp+select into bitwise arithmetic

(X & INT_MIN) == 0 ? X ^ INT_MIN : X  into  X | INT_MIN
(X & INT_MIN) != 0 ? X ^ INT_MIN : X  into  X & INT_MAX

This fixes PR21993.

llvm-svn: 224676

9 years agoInstSimplify: Don't bother if getScalarSizeInBits returns zero
David Majnemer [Sat, 20 Dec 2014 04:45:33 +0000 (04:45 +0000)]
InstSimplify: Don't bother if getScalarSizeInBits returns zero

getScalarSizeInBits returns zero when the comparison operands are not
integral.  No functionality change intended.

llvm-svn: 224675

9 years agoMove unconditional test compile and link flags into their configuration functions.
Eric Fiselier [Sat, 20 Dec 2014 04:14:14 +0000 (04:14 +0000)]
Move unconditional test compile and link flags into their configuration functions.

llvm-svn: 224674

9 years agoSimplify the code
David Majnemer [Sat, 20 Dec 2014 03:29:59 +0000 (03:29 +0000)]
Simplify the code

No functionality change intended.

llvm-svn: 224673

9 years agoSplit executeShTest into two parts so that it can be better leveraged by libc++
Eric Fiselier [Sat, 20 Dec 2014 03:23:53 +0000 (03:23 +0000)]
Split executeShTest into two parts so that it can be better leveraged by libc++

llvm-svn: 224672

9 years ago[libcxx] Teach libcxx's lit configuration new ways to find lit.site.cfg
Eric Fiselier [Sat, 20 Dec 2014 03:16:55 +0000 (03:16 +0000)]
[libcxx] Teach libcxx's lit configuration new ways to find lit.site.cfg

Summary:
Currently to run tests in tree you need to symlink the lit.site.cfg file generated by the cmake build into the source tree, and teach your VCS to ignore it.

This allows the user to specify where to find the lit.site.cfg file two different ways:
* lit_site_config lit parameter
* LIT_SITE_CONFIG enviroment variable.

example usage:
```
lit -sv --param=libcxx_site_config=path/to/libcxx-build/test/lit.site.cfg path/to/tests
```
Or
```
export LIBCXX_SITE_CONFIG=path/to/libcxx-build/test/lit.site.cfg
lit -sv path/to/tests
```
The command line parameter will override the environment variable.
If neither options are present a warning is issued and the `lit.cfg` file is loaded directly.

Reviewers: mclow.lists, jroelofs, danalbert

Reviewed By: danalbert

Subscribers: ddunbar, cfe-commits

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

llvm-svn: 224671

9 years agoRe-enable compact unwind use on Mac platforms.
Jason Molenda [Sat, 20 Dec 2014 03:12:51 +0000 (03:12 +0000)]
Re-enable compact unwind use on Mac platforms.
When lldb has a binary with protected section contents,
don't use the on-disk representation of that compact
uwnind -- read it only out of live memory where it has
been decrypted.

llvm-svn: 224670

9 years agoInstSimplify: Optimize away pointless comparisons
David Majnemer [Sat, 20 Dec 2014 03:04:38 +0000 (03:04 +0000)]
InstSimplify: Optimize away pointless comparisons

(X & INT_MIN) ? X & INT_MAX : X  into  X & INT_MAX
(X & INT_MIN) ? X : X & INT_MAX  into  X
(X & INT_MIN) ? X | INT_MIN : X  into  X
(X & INT_MIN) ? X : X | INT_MIN  into  X | INT_MIN

llvm-svn: 224669

9 years agoFix a bunch of integer template argument problems in template type diffing.
Richard Trieu [Sat, 20 Dec 2014 03:03:32 +0000 (03:03 +0000)]
Fix a bunch of integer template argument problems in template type diffing.

Reverts most of the changes from r168005.  Since template arguments have proper
conversions now, no extending of integers is needed.  Further, since the
integers are the correct size now, use APSInt::operator== instead of
APSInt::hasSameValue since operator== will check the size and signness match.

Prior to one comparison of APSInt's, check that both are valid.  Previous, one
could be uninitialized.  Also changed APInt to APSInt in GetInt.  This
occassionally produced a sign flip, which will now be caught by operator==.

llvm-svn: 224668

9 years agoFix for PR21758
Richard Trieu [Sat, 20 Dec 2014 02:42:08 +0000 (02:42 +0000)]
Fix for PR21758

When a non-type template argument expression needs a conversion to change it
into the argument type, preserve that information by remaking the
TemplateArgument with an expression that has those conversions.  Also a small
fix to template type diffing to handle the extra conversions in some cases.

llvm-svn: 224667

9 years ago[SROA] Run clang-format over the entire SROA pass as I wrote it before
Chandler Carruth [Sat, 20 Dec 2014 02:39:18 +0000 (02:39 +0000)]
[SROA] Run clang-format over the entire SROA pass as I wrote it before
much of the glory of clang-format, and now any time I touch it I risk
introducing formatting changes as part of a functional commit.

Also, clang-format is *way* better at formatting my code than I am.
Most of this is a huge improvement although I reverted a couple of
places where I hit a clang-format bug with lambdas that has been filed
but not (fully) fixed.

llvm-svn: 224666

9 years ago[x86] Change the test added in r223774 to first check the spelling of
Chandler Carruth [Sat, 20 Dec 2014 02:19:22 +0000 (02:19 +0000)]
[x86] Change the test added in r223774 to first check the spelling of
the error message for a bogus processor, and then look specifically for
that error message using FileCheck.

I actually tried to write the test this way at first, but drew a blank
on how to ensure the error message stayed in sync (oops). Now that I've
recalled how to do that, this is clearly better.

It also fixes an issue with a malloc implementation that actually prints
to stderr in all cases, which was causing problems for some builders it
seems.

llvm-svn: 224665

9 years agoLiveIntervalAnalysis: No kill flags for partially undefined uses.
Matthias Braun [Sat, 20 Dec 2014 01:54:50 +0000 (01:54 +0000)]
LiveIntervalAnalysis: No kill flags for partially undefined uses.

We must not add kill flags when reading a vreg with some undefined
subregisters, if subreg liveness tracking is enabled.  This is because
the register allocator may reuse these undefined subregisters for other
values which are not killed.

llvm-svn: 224664

9 years agoLiveIntervalAnalysis: cleanup addKills(), NFC
Matthias Braun [Sat, 20 Dec 2014 01:54:48 +0000 (01:54 +0000)]
LiveIntervalAnalysis: cleanup addKills(), NFC

- Use more const modifiers
- Use references for things that can't be nullptr
- Improve some variable names

llvm-svn: 224663

9 years agoRemoving an outdated FIXME; try block attributes are parsed with the rest of the...
Aaron Ballman [Sat, 20 Dec 2014 01:54:07 +0000 (01:54 +0000)]
Removing an outdated FIXME; try block attributes are parsed with the rest of the statement attributes (as per the standard), and function-try-blocks may not have attributes. NFC.

llvm-svn: 224662

9 years agoUnbreak cmake build with shared libraries enabled.
Matthias Braun [Sat, 20 Dec 2014 01:51:02 +0000 (01:51 +0000)]
Unbreak cmake build with shared libraries enabled.

llvm-svn: 224661

9 years ago[sanitizer] fix a performance regression in sanitizer coverage: move a small perf...
Kostya Serebryany [Sat, 20 Dec 2014 01:45:28 +0000 (01:45 +0000)]
[sanitizer] fix a performance regression in sanitizer coverage: move a small perf-critical function to a header. ALso set the coverage guard to 1 before the early return from CoverageData::Add

llvm-svn: 224660

9 years agoCleanup some redundant code
Enrico Granata [Sat, 20 Dec 2014 01:41:27 +0000 (01:41 +0000)]
Cleanup some redundant code

llvm-svn: 224659

9 years agoMove test into test/std subdirectory.
Eric Fiselier [Sat, 20 Dec 2014 01:40:03 +0000 (01:40 +0000)]
Move test into test/std subdirectory.

llvm-svn: 224658

9 years ago[libunwind] improve x86_64 comments in compact_unwind_encoding.h
Nick Kledzik [Sat, 20 Dec 2014 01:22:54 +0000 (01:22 +0000)]
[libunwind] improve x86_64 comments in compact_unwind_encoding.h

llvm-svn: 224657

9 years ago[libunwind] fix comment in compact_unwind_encoding.h
Nick Kledzik [Sat, 20 Dec 2014 01:14:38 +0000 (01:14 +0000)]
[libunwind] fix comment in compact_unwind_encoding.h

llvm-svn: 224656

9 years agoRemove unused variable and initialization.
Eric Christopher [Sat, 20 Dec 2014 00:07:09 +0000 (00:07 +0000)]
Remove unused variable and initialization.

llvm-svn: 224655

9 years agoDriver: hoist an assertion
Saleem Abdulrasool [Fri, 19 Dec 2014 23:56:31 +0000 (23:56 +0000)]
Driver: hoist an assertion

Remove an unnecessary conditional, hoisting the assertion.  Minor style
tweaks/reflowing.  NFC.

llvm-svn: 224654

9 years agoDriver: refactor a local variable
Saleem Abdulrasool [Fri, 19 Dec 2014 23:56:28 +0000 (23:56 +0000)]
Driver: refactor a local variable

Pull out a getToolChain() into a local variable to share the call across to all
the uses.  NFC.

llvm-svn: 224653

9 years agoNo need to call SetErrorToErrno when pipe2 succeeds.
Oleksiy Vyalov [Fri, 19 Dec 2014 23:52:46 +0000 (23:52 +0000)]
No need to call SetErrorToErrno when pipe2 succeeds.

http://reviews.llvm.org/D6743

llvm-svn: 224652

9 years agoDon't drop attributes when checking explicit specializations.
Nico Weber [Fri, 19 Dec 2014 23:52:45 +0000 (23:52 +0000)]
Don't drop attributes when checking explicit specializations.

Consider a template class with attributes on a method, and an explicit
specialization of that method:

    template <int>
    struct A {
      void foo() final;
    };

    template <>
    void A<0>::foo() {}

In this example, the attribute is `final`, but it might also be an
__attribute__((visibility("foo"))), noreturn, inline, etc. clang's current
behavior is to strip all attributes, which for some attributes is wrong
(the snippet above allows a subclass of A<0> to override the final method, for
example) and for others disagrees with gcc.

So stop dropping attributes. r95845 added this code without a test case, and
r176728 added the code for dropping attributes on parameters (with tests, but
they still pass).

As an additional wrinkle, do drop dllimport and dllexport, since that's how
these two attributes work. (This is covered by existing tests.)

Fixes PR21942.

The approach is by Richard Smith, initial analysis and typing was done by me.

With this, clang also matches GCC and EDG on all attributes Richard tested.

llvm-svn: 224651

9 years agoRemove unused variable, initializer, and accessor.
Eric Christopher [Fri, 19 Dec 2014 23:46:53 +0000 (23:46 +0000)]
Remove unused variable, initializer, and accessor.

llvm-svn: 224650

9 years agoTweak the assert in ModuleBuilder from r224533 (PR21989)
Hans Wennborg [Fri, 19 Dec 2014 23:35:11 +0000 (23:35 +0000)]
Tweak the assert in ModuleBuilder from r224533 (PR21989)

Turns out there will be left-over deferred inline methods if there have
been errors, because in that case HandleTopLevelDecl bails out early.

llvm-svn: 224649

9 years agoR600: Remove outdated comment
Matt Arsenault [Fri, 19 Dec 2014 23:29:13 +0000 (23:29 +0000)]
R600: Remove outdated comment

llvm-svn: 224648

9 years agoMasked load and store codegen - fixed 128-bit vectors
Elena Demikhovsky [Fri, 19 Dec 2014 23:27:57 +0000 (23:27 +0000)]
Masked load and store codegen - fixed 128-bit vectors
The codegen failed on 128-bit types on AVX2.
I added patterns and in td files and tests.

llvm-svn: 224647

9 years agoR600/SI: Only form min/max with 1 use.
Matt Arsenault [Fri, 19 Dec 2014 23:15:30 +0000 (23:15 +0000)]
R600/SI: Only form min/max with 1 use.

If the condition is used for something else, this increases
the number of instructions.

llvm-svn: 224646

9 years ago[sanitizer] initialize two flas in SetCommonFlagsDefaults
Kostya Serebryany [Fri, 19 Dec 2014 23:09:59 +0000 (23:09 +0000)]
[sanitizer] initialize two flas in SetCommonFlagsDefaults

llvm-svn: 224645

9 years ago[TestEvents] Replace expectedFailureLinux with skipIfLinux
Siva Chandra [Fri, 19 Dec 2014 22:41:43 +0000 (22:41 +0000)]
[TestEvents] Replace expectedFailureLinux with skipIfLinux

Summary:
If we do not mark them as skip, they are still executed, which in
turn is leading to an assertion failure. The change also adds
skipIfLinux to a testlet which was not previously marked with
skipIfLinux. This is because running even that test let leads to an
assertion failure.

Test Plan: dotest.py -C clang -p TestEvents.py

Reviewers: vharron

Reviewed By: vharron

Subscribers: lldb-commits

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

llvm-svn: 224644

9 years ago[TestStaticVariables] Mark the one unmarked test let also expectedFailure.
Siva Chandra [Fri, 19 Dec 2014 22:40:05 +0000 (22:40 +0000)]
[TestStaticVariables] Mark the one unmarked test let also expectedFailure.

Summary:
The test is question here is already annotated
with @expectedFailureDarwin(9980907).

This change also removes an uneccessary (and probably wrong) logic of
byssing few asserts if the compiler is not clang or llvm-gcc.

Both GCC and Clang emit incomplete debug info. Clang emits this:

< 1><0x00000026>    DW_TAG_class_type
                      DW_AT_name                  "A"
                      DW_AT_byte_size             0x00000001
                      DW_AT_decl_file             0x00000001
                      DW_AT_decl_line             0x0000001b
< 2><0x0000002e>      DW_TAG_member
                        DW_AT_name                  "g_points"
                        DW_AT_type                  <0x0000003b>
                        DW_AT_decl_file             0x00000001
                        DW_AT_decl_line             0x0000001e
                        DW_AT_external              yes(1)
                        DW_AT_declaration           yes(1)
                        DW_AT_accessibility         DW_ACCESS_public
< 1><0x0000003b>    DW_TAG_array_type
                      DW_AT_type                  <0x00000046>
< 2><0x00000040>      DW_TAG_subrange_type
                        DW_AT_type                  <0x0000007b>

Notice that the DIE at 0x40 does not specify an upperbound. This is with
Clang-3.5 and Clang ToT.

GCC emits this:

< 1><0x000000aa>    DW_TAG_class_type
                      DW_AT_name                  "A"
                      DW_AT_byte_size             0x00000001
                      DW_AT_decl_file             0x00000001
                      DW_AT_decl_line             0x0000001b
                      DW_AT_sibling               <0x000000c1>
< 2><0x000000b4>      DW_TAG_member
                        DW_AT_name                  "g_points"
                        DW_AT_decl_file             0x00000001
                        DW_AT_decl_line             0x0000001e
                        DW_AT_type                  <0x000000c1>
                        DW_AT_external              yes(1)
                        DW_AT_accessibility         DW_ACCESS_public
                        DW_AT_declaration           yes(1)
< 1><0x000000c1>    DW_TAG_array_type
                      DW_AT_type                  <0x0000007e>
                      DW_AT_sibling               <0x000000cc>
< 2><0x000000ca>      DW_TAG_subrange_type

The DIE at 0xca is missing attributes. This is with gcc-4.8.2.

Test Plan: dotest.py -C clang -P TestStaticVariables.py

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 224643

9 years ago[TestCompletion] Spawn LLDB with '--no-use-colors'.
Siva Chandra [Fri, 19 Dec 2014 22:37:23 +0000 (22:37 +0000)]
[TestCompletion] Spawn LLDB with '--no-use-colors'.

Summary:
TestCompletion was broken for Ubuntu (and probably for Debian also).
The issue was that the lldb prompt in color (which is the default
behavior) was confusing pexpect.

Test Plan: "http://199.223.233.39:8011/lldb-try-clang-build-clang-test/"

Reviewers: zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 224642

9 years agoEH: Sink computation of local PadMap variable into function that uses it
Reid Kleckner [Fri, 19 Dec 2014 22:30:08 +0000 (22:30 +0000)]
EH: Sink computation of local PadMap variable into function that uses it

No functionality change.

llvm-svn: 224635

9 years ago[LIT] Add JSONMetricValue type to wrap types supported by the json encoder.
Eric Fiselier [Fri, 19 Dec 2014 22:29:12 +0000 (22:29 +0000)]
[LIT] Add JSONMetricValue type to wrap types supported by the json encoder.

Summary:
The following types can be encoded and decoded by the json library:
`dict`, `list`, `tuple`, `str`, `unicode`, `int`, `long`, `float`, `bool`, `NoneType`.

`JSONMetricValue` can be constructed with any of these types, and used as part of Test.Result.
This patch also adds a toMetricValue function that converts a value into a MetricValue.

Reviewers: ddunbar, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, llvm-commits

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

llvm-svn: 224628

9 years agoAdd printing the LC_ROUTINES load commands with llvm-objdump’s -private-headers.
Kevin Enderby [Fri, 19 Dec 2014 22:25:22 +0000 (22:25 +0000)]
Add printing the LC_ROUTINES load commands with llvm-objdump’s -private-headers.

llvm-svn: 224627

9 years ago[libcxx] Add <experimental/type_traits> for LFTS
Eric Fiselier [Fri, 19 Dec 2014 22:21:44 +0000 (22:21 +0000)]
[libcxx] Add <experimental/type_traits> for LFTS

Summary:
This adds the <experimental/type_traits> (minus invocation traits). Mostly just the `_v` traits.

Reviewers: K-ballo, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 224626

9 years agoAdd the ExceptionHandling::MSVC enumeration
Reid Kleckner [Fri, 19 Dec 2014 22:19:48 +0000 (22:19 +0000)]
Add the ExceptionHandling::MSVC enumeration

It is intended to be used for a family of personality functions that
have similar IR preparation requirements. Typically when interoperating
with MSVC personality functions, bits of functionality need to be
outlined from the main function into helper functions. There is also
usually more than one landing pad per invoke, which does not match the
LLVM IR landingpad representation.

None of this is implemented yet. This change just adds a new enum that
is active for *-windows-msvc and delegates to the EH removal preparation
pass.  No functionality change for other targets.

llvm-svn: 224625

9 years agoModel sqrtss as a binary operation with one source operand tied to the destination...
Sanjay Patel [Fri, 19 Dec 2014 22:16:28 +0000 (22:16 +0000)]
Model sqrtss as a binary operation with one source operand tied to the destination (PR14221)

This is a continuation of r167064 ( http://llvm.org/viewvc/llvm-project?view=revision&revision=167064 ).
That patch started to fix PR14221 ( http://llvm.org/bugs/show_bug.cgi?id=14221 ), but it was not completed.

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

llvm-svn: 224624

9 years agoR600/SI: isLegalOperand() shouldn't check constant bus for SALU instructions
Tom Stellard [Fri, 19 Dec 2014 22:15:37 +0000 (22:15 +0000)]
R600/SI: isLegalOperand() shouldn't check constant bus for SALU instructions

The constant bus restrictions only apply to VALU instructions.  This
enables SIFoldOperands to fold immediates into SALU instructions.

llvm-svn: 224623

9 years agoR600/SI: Make sure non-inline constants aren't folded into mubuf soffset operand
Tom Stellard [Fri, 19 Dec 2014 22:15:30 +0000 (22:15 +0000)]
R600/SI: Make sure non-inline constants aren't folded into mubuf soffset operand

mubuf instructions now define the soffset field using the SCSrc_32
register class which indicates that only SGPRs and inline constants
are allowed.

llvm-svn: 224622

9 years agoRemove isSubroutineType test for isCompositeType, getTag() is enough.
Yaron Keren [Fri, 19 Dec 2014 22:15:09 +0000 (22:15 +0000)]
Remove isSubroutineType test for isCompositeType, getTag() is enough.

llvm-svn: 224621

9 years agoDR1048: drop top-level cv-qualifiers when deducing the return type of a
Richard Smith [Fri, 19 Dec 2014 22:10:51 +0000 (22:10 +0000)]
DR1048: drop top-level cv-qualifiers when deducing the return type of a
lambda-expression in C++11, to match the C++14 rules.

llvm-svn: 224620

9 years agoUpdate SmallPtrSet::insert's doc comment to match the new return type
David Blaikie [Fri, 19 Dec 2014 21:45:11 +0000 (21:45 +0000)]
Update SmallPtrSet::insert's doc comment to match the new return type

llvm-svn: 224619

9 years agoRemove unneeded configuration code.
Eric Fiselier [Fri, 19 Dec 2014 21:42:17 +0000 (21:42 +0000)]
Remove unneeded configuration code.

llvm-svn: 224618

9 years ago[Sanitizer] Refactor CommonFlags interface. NFC.
Alexey Samsonov [Fri, 19 Dec 2014 21:40:04 +0000 (21:40 +0000)]
[Sanitizer] Refactor CommonFlags interface. NFC.

Add CommonFlags::SetDefaults() and CommonFlags::ParseFromString(),
so that this object can be easily tested. Enforce
that ParseCommonFlagsFromString() and SetCommonFlagsDefaults()
work only with singleton CommonFlags, shared across all sanitizer
runtimes.

llvm-svn: 224617

9 years agoAdd printing the LC_SUB_CLIENT load command with llvm-objdump’s -private-headers.
Kevin Enderby [Fri, 19 Dec 2014 21:06:24 +0000 (21:06 +0000)]
Add printing the LC_SUB_CLIENT load command with llvm-objdump’s -private-headers.

llvm-svn: 224616

9 years agoCodeGen: do not attempt to invalidate virtual registers for zero-sized phis.
Peter Collingbourne [Fri, 19 Dec 2014 20:50:07 +0000 (20:50 +0000)]
CodeGen: do not attempt to invalidate virtual registers for zero-sized phis.

llvm-svn: 224615

9 years ago[ASan] Change activation strategy.
Alexey Samsonov [Fri, 19 Dec 2014 20:35:53 +0000 (20:35 +0000)]
[ASan] Change activation strategy.

Now ASan deactivation doesn't modify common or ASan-specific runtime
flags. Flags stay constant after initialization, and "deactivation"
instead stashes initialized runtime state, and deactivates the
runtime. Activation then just restores the original state (possibly,
overriden by some activation flags provided in system property on
Android).

llvm-svn: 224614

9 years ago[Sanitizer] Make Quarantine::Init slightly safer.
Alexey Samsonov [Fri, 19 Dec 2014 20:35:50 +0000 (20:35 +0000)]
[Sanitizer] Make Quarantine::Init slightly safer.

ASan Quarantine can be reinitialized at activation/deactivation.
Make max_size_/min_size_ atomic.

llvm-svn: 224613

9 years ago[Hexagon] Removing old variants of instructions and updating references.
Colin LeMahieu [Fri, 19 Dec 2014 20:29:29 +0000 (20:29 +0000)]
[Hexagon] Removing old variants of instructions and updating references.

llvm-svn: 224612

9 years agomerge consecutive stores of extracted vector elements
Sanjay Patel [Fri, 19 Dec 2014 20:23:41 +0000 (20:23 +0000)]
merge consecutive stores of extracted vector elements

Add a path to DAGCombiner::MergeConsecutiveStores()
to combine multiple scalar stores when the store operands
are extracted vector elements. This is a partial fix for
PR21711 ( http://llvm.org/bugs/show_bug.cgi?id=21711 ).

For the new test case, codegen improves from:

   vmovss  %xmm0, (%rdi)
   vextractps      $1, %xmm0, 4(%rdi)
   vextractps      $2, %xmm0, 8(%rdi)
   vextractps      $3, %xmm0, 12(%rdi)
   vextractf128    $1, %ymm0, %xmm0
   vmovss  %xmm0, 16(%rdi)
   vextractps      $1, %xmm0, 20(%rdi)
   vextractps      $2, %xmm0, 24(%rdi)
   vextractps      $3, %xmm0, 28(%rdi)
   vzeroupper
   retq

To:

   vmovups %ymm0, (%rdi)
   vzeroupper
   retq

Patch reviewed by Nadav Rotem.

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

llvm-svn: 224611

9 years ago[Hexagon] Adding bit extraction and table indexing instructions.
Colin LeMahieu [Fri, 19 Dec 2014 20:01:08 +0000 (20:01 +0000)]
[Hexagon] Adding bit extraction and table indexing instructions.

llvm-svn: 224610

9 years ago[Hexagon] Adding bit insertion instructions.
Colin LeMahieu [Fri, 19 Dec 2014 19:54:38 +0000 (19:54 +0000)]
[Hexagon] Adding bit insertion instructions.

llvm-svn: 224609

9 years ago[Hexagon] Adding more xtype shift instructions.
Colin LeMahieu [Fri, 19 Dec 2014 19:51:35 +0000 (19:51 +0000)]
[Hexagon] Adding more xtype shift instructions.

llvm-svn: 224608

9 years agoAdd printing the LC_SUB_LIBRARY load command with llvm-objdump’s -private-headers.
Kevin Enderby [Fri, 19 Dec 2014 19:48:16 +0000 (19:48 +0000)]
Add printing the LC_SUB_LIBRARY load command with llvm-objdump’s -private-headers.

llvm-svn: 224607

9 years agoDon't emit the "WARNING: no locations" message when breakpoints are set in
Jim Ingham [Fri, 19 Dec 2014 19:45:31 +0000 (19:45 +0000)]
Don't emit the "WARNING: no locations" message when breakpoints are set in
the dummy target.  Say they were set in the dummy target instead.

llvm-svn: 224606

9 years ago[ASan] Introduce AllocatorOptions to configure allocator behavior.
Alexey Samsonov [Fri, 19 Dec 2014 19:35:11 +0000 (19:35 +0000)]
[ASan] Introduce AllocatorOptions to configure allocator behavior.

Summary:
Reduce the dependency of allocator code on runtime flags. Instead,
pass a bunch of options that configure allocator behavior at
initialization or re-initialization. That would allow us to
cleaner modify allocator behavior during a program execution
when ASan is activated or de-activated.

Test Plan: regression test suite

Reviewers: kcc

Subscribers: llvm-commits, eugenis

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

llvm-svn: 224605

9 years ago[Hexagon] Adding xtype shift instructions.
Colin LeMahieu [Fri, 19 Dec 2014 19:34:50 +0000 (19:34 +0000)]
[Hexagon] Adding xtype shift instructions.

llvm-svn: 224604

9 years ago[libcxx] Allow the use of ccache when running the test suite.
Eric Fiselier [Fri, 19 Dec 2014 19:27:32 +0000 (19:27 +0000)]
[libcxx] Allow the use of ccache when running the test suite.

Summary:
In order to get the bots running quicker I would like to be able to use ccache
with the test suite. This patch adds support for running the test suite using
ccache. To use ccache pass `--param=use_ccache=true` when running the test suite.

ccache will not cache any command that invokes ld, so the build step needs to be
split into two separate compile commands. The cost of splitting the build step
into two parts when not using ccache seems to be minimal. On my machine I saw a
difference of ~5 seconds on a 5 minute test suite run.

A full test suite run with ccache generates about 250MB of cached data.

I recorded the following times for running the test suite in the following configurations:
- no ccache: 340s
- initial ccache run: 380s
- rerun with ccache (no changes): 53s.
- rerun with ccache (<string> changed): 80s
- rerun with ccache (<cmath> changed): 169s
- rerun with ccache (<valarray> changed): 69s

Reviewers: mclow.lists, jroelofs, danalbert

Reviewed By: jroelofs

Subscribers: cfe-commits

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

llvm-svn: 224603

9 years agoAudit uses of ConstString::AsCString() to make sure they weren't assuming
Jim Ingham [Fri, 19 Dec 2014 19:20:44 +0000 (19:20 +0000)]
Audit uses of ConstString::AsCString() to make sure they weren't assuming
they would always get a non-NULL string back.

<rdar://problem/19298575>

llvm-svn: 224602

9 years ago[ASan] Restrict the set of flags overriden at activation.
Alexey Samsonov [Fri, 19 Dec 2014 19:16:07 +0000 (19:16 +0000)]
[ASan] Restrict the set of flags overriden at activation.

Summary:
Change the way ASan flag parsing is performed at activation: instead
of overwriting all ASan and common flags from the activation string,
ASan will now only override a handful of whitelisted flags.
This is a first step towards making runtime flags immutable after
initialization. I plan to re-factor the activation stragegy to
the following one:

  - Parse commandline flags. Override the defaults from compile
    definition, env var, etc. Flags are immutable at this point.
  - Initiailize the runtime from commandline flags.
  - If ASan needs to be started deactivated, stash the runtime
    state in "asan_deactivated_flags" and deactivate the runtime.
  - When ASan is activated, override "asan_deactivated_flags" with
    activation flags, and use it to re-activate the runtime.

Test Plan: regression test suite

Reviewers: eugenis, kcc

Subscribers: llvm-commits

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

llvm-svn: 224601

9 years ago[ASan] Move flag validation from ParseFlagsFromString() to InitializeFlags().
Alexey Samsonov [Fri, 19 Dec 2014 19:16:02 +0000 (19:16 +0000)]
[ASan] Move flag validation from ParseFlagsFromString() to InitializeFlags().

llvm-svn: 224600

9 years ago[Hexagon] Adding transfers to and from control registers.
Colin LeMahieu [Fri, 19 Dec 2014 19:06:32 +0000 (19:06 +0000)]
[Hexagon] Adding transfers to and from control registers.

llvm-svn: 224599

9 years ago[Hexagon] Adding doubleregs for control registers. Renaming control register class.
Colin LeMahieu [Fri, 19 Dec 2014 18:56:10 +0000 (18:56 +0000)]
[Hexagon] Adding doubleregs for control registers.  Renaming control register class.

llvm-svn: 224598

9 years agobuiltins: rely on the compiler for user label prefix
Saleem Abdulrasool [Fri, 19 Dec 2014 18:54:13 +0000 (18:54 +0000)]
builtins: rely on the compiler for user label prefix

clang does not like the definition of builtins.  In order to work around this,
we use a SUN CC to redefine the generated name.  However, this requires that we
account for the user label prefix.  Rather than hard coding that into the file,
rely on the compiler to tell us the information and use the preprocessor to
generate the name as we do in the assembly routines.  NFC.

llvm-svn: 224597

9 years agoAllow to disable all sanitizers with "-fno-sanitize=all" option.
Alexey Samsonov [Fri, 19 Dec 2014 18:41:43 +0000 (18:41 +0000)]
Allow to disable all sanitizers with "-fno-sanitize=all" option.

Summary:
This patch adds "all" sanitizer group. A shortcut "-fno-sanitize=all"
can be used to disable all sanitizers for a given source file.

"-fsanitize=all" option makes no sense, and will produce an error.

This group can also be useful when we add "-fsanitize-recover=<list>"
options (patch in http://reviews.llvm.org/D6302), as it would allow
to conveniently enable/disable recovery for all specified sanitizers.

Test Plan: regression test suite

Reviewers: kcc, rsmith

Subscribers: cfe-commits

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

llvm-svn: 224596

9 years agoAdded a fixit to remove empty parens from a C++11 attribute argument list when we...
Aaron Ballman [Fri, 19 Dec 2014 18:37:22 +0000 (18:37 +0000)]
Added a fixit to remove empty parens from a C++11 attribute argument list when we diagnose this as an error.

llvm-svn: 224595

9 years ago[DebugInfo] Move all DWARF headers to the public include directory.
Frederic Riss [Fri, 19 Dec 2014 18:26:33 +0000 (18:26 +0000)]
[DebugInfo] Move all DWARF headers to the public include directory.

dsymutil needs access to DWARF specific inforamtion, the small DIContext
wrapper isn't sufficient. Other DWARF consumers might want to use it too
(I'm looking at you lldb).

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

llvm-svn: 224594

9 years agoDon't generate lldb inline test Makefiles if Makefile already exists.
Zachary Turner [Fri, 19 Dec 2014 18:26:33 +0000 (18:26 +0000)]
Don't generate lldb inline test Makefiles if Makefile already exists.

Differential Revision: http://reviews.llvm.org/D6664
Reviewed by: Sean Callanan

llvm-svn: 224593

9 years agoFix an address space id reset with array decay's
Pekka Jaaskelainen [Fri, 19 Dec 2014 18:04:27 +0000 (18:04 +0000)]
Fix an address space id reset with array decay's
implicit conversion.

The issue was produced with OpenCL C code that
called a function with a constant string literal
argument.

llvm-svn: 224592

9 years ago(diagnostics) fix typo in test...
Andreas Simbuerger [Fri, 19 Dec 2014 17:22:46 +0000 (17:22 +0000)]
(diagnostics) fix typo in test...

llvm-svn: 224591

9 years ago[BBVectorize] Remove two more redundant assignments.
Tilmann Scheller [Fri, 19 Dec 2014 17:21:38 +0000 (17:21 +0000)]
[BBVectorize] Remove two more redundant assignments.

Found by the Clang static analyzer.

llvm-svn: 224590

9 years ago[BBVectorize] Remove redundant assignment.
Tilmann Scheller [Fri, 19 Dec 2014 17:13:12 +0000 (17:13 +0000)]
[BBVectorize] Remove redundant assignment.

Found by the Clang static analyzer.

llvm-svn: 224589

9 years agoReapply: [InstCombine] Fix visitSwitchInst to use right operand types for sub cstexpr
Bruno Cardoso Lopes [Fri, 19 Dec 2014 17:12:35 +0000 (17:12 +0000)]
Reapply: [InstCombine] Fix visitSwitchInst to use right operand types for sub cstexpr

The visitSwitchInst generates SUB constant expressions to recompute the
switch condition. When truncating the condition to a smaller type, SUB
expressions should use the previous type (before trunc) for both
operands. Also, fix code to also return the modified switch when only
the truncation is performed.

This fixes an assertion crash.

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

rdar://problem/19191835

llvm-svn: 224588

9 years ago[LoopVectorize] Remove redundant assignment.
Tilmann Scheller [Fri, 19 Dec 2014 17:02:31 +0000 (17:02 +0000)]
[LoopVectorize] Remove redundant assignment.

Found by the Clang static analyzer.

llvm-svn: 224587

9 years ago[ARM] Remove dead assignment.
Tilmann Scheller [Fri, 19 Dec 2014 16:57:33 +0000 (16:57 +0000)]
[ARM] Remove dead assignment.

Found by the Clang static analyzer.

llvm-svn: 224586

9 years agoUse ObjCMultipleMethodNames to match the option.
Fariborz Jahanian [Fri, 19 Dec 2014 16:55:51 +0000 (16:55 +0000)]
Use ObjCMultipleMethodNames to match the option.

llvm-svn: 224585

9 years ago(diagnostics) Fix typo.
Andreas Simbuerger [Fri, 19 Dec 2014 16:49:39 +0000 (16:49 +0000)]
(diagnostics) Fix typo.

Thanks Albert Cohen.

llvm-svn: 224584

9 years agouse -0.0 when creating an fneg instruction
Sanjay Patel [Fri, 19 Dec 2014 16:44:08 +0000 (16:44 +0000)]
use -0.0 when creating an fneg instruction

Backends recognize (-0.0 - X) as the canonical form for fneg
and produce better code. Eg, ppc64 with 0.0:

   lis r2, ha16(LCPI0_0)
   lfs f0, lo16(LCPI0_0)(r2)
   fsubs f1, f0, f1
   blr

vs. -0.0:

   fneg f1, f1
   blr

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

llvm-svn: 224583

9 years agoAttributes accepting an EnumArgument are allowed to pass a string literal, or an...
Aaron Ballman [Fri, 19 Dec 2014 16:42:04 +0000 (16:42 +0000)]
Attributes accepting an EnumArgument are allowed to pass a string literal, or an identifier. VariadicEnumArguments now behave consistently instead of only accepting a string literal.

This change affects the only attribute accepting a variadic enumeration: callable_when.

llvm-svn: 224582

9 years agoFixed a typo in a comment. NFC.
Alexander Kornienko [Fri, 19 Dec 2014 15:37:02 +0000 (15:37 +0000)]
Fixed a typo in a comment. NFC.

llvm-svn: 224581

9 years ago[lsan] Add debug output to leak_check_before_thread_started.cc.
Sergey Matveev [Fri, 19 Dec 2014 15:33:13 +0000 (15:33 +0000)]
[lsan] Add debug output to leak_check_before_thread_started.cc.

Trying to investigate why this test is flaky.

llvm-svn: 224580

9 years agoPutting unevaluated expression warnings, and evaluated typeid warnings, under their...
Aaron Ballman [Fri, 19 Dec 2014 14:56:49 +0000 (14:56 +0000)]
Putting unevaluated expression warnings, and evaluated typeid warnings, under their own warning flags. Amends r224465.

llvm-svn: 224578

9 years ago[sanitizer] Rename InitIfLinkerInitialized to InitLinkerInitialized.
Sergey Matveev [Fri, 19 Dec 2014 14:45:19 +0000 (14:45 +0000)]
[sanitizer] Rename InitIfLinkerInitialized to InitLinkerInitialized.

llvm-svn: 224577

9 years agoRevert "[InstCombine] Fix visitSwitchInst to use right operand types for sub cstexpr"
Bruno Cardoso Lopes [Fri, 19 Dec 2014 14:36:24 +0000 (14:36 +0000)]
Revert "[InstCombine] Fix visitSwitchInst to use right operand types for sub cstexpr"

Reverts commit r224574 to appease buildbots:

The visitSwitchInst generates SUB constant expressions to recompute the
switch condition. When truncating the condition to a smaller type, SUB
expressions should use the previous type (before trunc) for both
operands. This fixes an assertion crash.

llvm-svn: 224576

9 years agotsan: intercept closedir
Dmitry Vyukov [Fri, 19 Dec 2014 14:29:40 +0000 (14:29 +0000)]
tsan: intercept closedir

llvm-svn: 224575

9 years ago[InstCombine] Fix visitSwitchInst to use right operand types for sub cstexpr
Bruno Cardoso Lopes [Fri, 19 Dec 2014 14:23:15 +0000 (14:23 +0000)]
[InstCombine] Fix visitSwitchInst to use right operand types for sub cstexpr

The visitSwitchInst generates SUB constant expressions to recompute the
switch condition. When truncating the condition to a smaller type, SUB
expressions should use the previous type (before trunc) for both
operands. This fixes an assertion crash.

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

rdar://problem/19191835

llvm-svn: 224574

9 years ago[asan] Test BB- and edge- level coverage on Android.
Evgeniy Stepanov [Fri, 19 Dec 2014 12:21:40 +0000 (12:21 +0000)]
[asan] Test BB- and edge- level coverage on Android.

llvm-svn: 224572

9 years ago[asan] Add tests for direct (mmap-ed) mode for BB- and edge-level coverage.
Evgeniy Stepanov [Fri, 19 Dec 2014 11:49:46 +0000 (11:49 +0000)]
[asan] Add tests for direct (mmap-ed) mode for BB- and edge-level coverage.

llvm-svn: 224571

9 years agoRemove redundant assignment.
Tilmann Scheller [Fri, 19 Dec 2014 11:29:34 +0000 (11:29 +0000)]
Remove redundant assignment.

Found with the Clang static analyzer.

llvm-svn: 224570

9 years ago[asan] Resurrect sanitize-coverage test on Android.
Evgeniy Stepanov [Fri, 19 Dec 2014 10:40:14 +0000 (10:40 +0000)]
[asan] Resurrect sanitize-coverage test on Android.

The test got silently disabled because of a typo in the lit config.
Also, compiler flags have changed (asan-coverage -> fsanitize-coverage).

llvm-svn: 224569

9 years agoRemove wrong semi-colons
Jeroen Ketema [Fri, 19 Dec 2014 09:18:23 +0000 (09:18 +0000)]
Remove wrong semi-colons

Patch by Alastair Donaldson

llvm-svn: 224568

9 years agoLTO: Export local context symbols
Duncan P. N. Exon Smith [Fri, 19 Dec 2014 07:19:50 +0000 (07:19 +0000)]
LTO: Export local context symbols

Export symbols in libLTO.dylib for the local context-related functions
added in r221733 (`LTO_API_VERSION=11`)... and add the missing
definition for `lto_codegen_create_in_local_context()`.

llvm-svn: 224567

9 years agoRename MapValue(Metadata*) to MapMetadata()
Duncan P. N. Exon Smith [Fri, 19 Dec 2014 06:06:18 +0000 (06:06 +0000)]
Rename MapValue(Metadata*) to MapMetadata()

Instead of reusing the name `MapValue()` when mapping `Metadata`, use
`MapMetadata()`.  The old name doesn't make much sense after the
`Metadata`/`Value` split.

llvm-svn: 224566

9 years agoTest commit
Andrew Wilkins [Fri, 19 Dec 2014 02:45:48 +0000 (02:45 +0000)]
Test commit

Just changing whitespace to test commit access...

llvm-svn: 224565

9 years ago[Sanitizer] Get rid of parseArgument helper function. NFC.
Alexey Samsonov [Fri, 19 Dec 2014 02:35:16 +0000 (02:35 +0000)]
[Sanitizer] Get rid of parseArgument helper function. NFC.

llvm-svn: 224564