platform/upstream/llvm.git
8 years agouse range-based loop; NFCI
Sanjay Patel [Tue, 8 Mar 2016 19:06:12 +0000 (19:06 +0000)]
use range-based loop; NFCI

llvm-svn: 262952

8 years agoAdd self to CODE_OWNERS
Hans Wennborg [Tue, 8 Mar 2016 19:01:15 +0000 (19:01 +0000)]
Add self to CODE_OWNERS

Apparently this makes my email address easier to find.

llvm-svn: 262951

8 years agoMade self.expect() errors a little more readable in the testsuite.
Sean Callanan [Tue, 8 Mar 2016 18:58:48 +0000 (18:58 +0000)]
Made self.expect() errors a little more readable in the testsuite.

self.expect() had two problems:

- If there was a substrs argument, then it overwrote the variable containing
  the command to run with the last substr.  That meant nonsense command text in
  testsuite errors.

- The actual output is not printed, which makes fixing testsuite failures a bit
  annoying (you end up having to use the -tv arguments to dotest).

This fixes both of these issues.  We could do even better, pretty-printing the
criteria for "correct" output, but this at least makes dealing with errors a bit
better.

llvm-svn: 262950

8 years agocmake: include what you use
Saleem Abdulrasool [Tue, 8 Mar 2016 18:56:00 +0000 (18:56 +0000)]
cmake: include what you use

Add a missing include.  This is important in the case HandleLLVMOptions is
included prior to the missing CheckCXXSourceCompiles or CheckCXXCompilerFlag
which includes CheckCXXSourceCompiles.

llvm-svn: 262949

8 years ago[CMake] Refactor add_llvm_implicit_projects to be reusable
Chris Bieneman [Tue, 8 Mar 2016 18:43:28 +0000 (18:43 +0000)]
[CMake] Refactor add_llvm_implicit_projects to be reusable

This adds llvm_add_implicit_projects which takes a project name and is wrapped by add_llvm_implicit_projects.

llvm-svn: 262948

8 years agoSupport floating point values in 128-bit SSE vector registers
Adrian Prantl [Tue, 8 Mar 2016 18:35:09 +0000 (18:35 +0000)]
Support floating point values in 128-bit SSE vector registers

The System-V x86_64 ABI requires floating point values to be passed
in 128-but SSE vector registers (xmm0, ...). When printing such a
variable this currently yields an <invalid load address>.

This patch makes LLDB's DWARF expression evaluator accept 128-bit
registers as scalars. It also relaxes the check that the size of the
result of the DWARF expression be equal to the size of the variable to a
greater-than. DWARF defers to the ABI how smaller values are being placed
in a larger register.

Implementation note: I found the code in Value::SetContext() that changes
the m_value_type after the fact to be questionable. I added a sanity check
that the Value's memory buffer has indeed been written to (this is
necessary, because we may have a scalar value in a vector register), but
really I feel like this is the wrong place to be setting it.

Reviewed by Greg Clayton.

http://reviews.llvm.org/D17897
rdar://problem/24944340

llvm-svn: 262947

8 years ago[AArch64] Disable the MI scheduler to turn bots green after r262942.
Chad Rosier [Tue, 8 Mar 2016 17:33:34 +0000 (17:33 +0000)]
[AArch64] Disable the MI scheduler to turn bots green after r262942.

llvm-svn: 262944

8 years agoRevert r262759 and r262760.
Quentin Colombet [Tue, 8 Mar 2016 17:29:11 +0000 (17:29 +0000)]
Revert r262759 and r262760.
The fix consisting in using the library call for atomic compare and swap when
the instruction is not safe to use may be incorrect. Indeed the library call may
not exist on all platform. In other words, we need a better fix!

llvm-svn: 262943

8 years ago[AArch64] Add MMOs to unscaled pairs.
Chad Rosier [Tue, 8 Mar 2016 17:16:38 +0000 (17:16 +0000)]
[AArch64] Add MMOs to unscaled pairs.

Test to be committed in follow up commit, per discussion in D17097.
http://reviews.llvm.org/D17097

llvm-svn: 262942

8 years agoRevert "ELF: Add /lib and /usr/lib as default search paths."
Rafael Espindola [Tue, 8 Mar 2016 17:13:12 +0000 (17:13 +0000)]
Revert "ELF: Add /lib and /usr/lib as default search paths."

It was causing errors like

/lib/libc.so.6 is incompatible with elf_x86_64

when linking on Fedora.

Every system has different default paths. It seems better to just trust
the driver to pass the correct -L options.

This reverts commit 262910.

llvm-svn: 262941

8 years agorangify, fix function names; NFCI
Sanjay Patel [Tue, 8 Mar 2016 17:12:32 +0000 (17:12 +0000)]
rangify, fix function names; NFCI

llvm-svn: 262940

8 years agoInvoke DAG postprocessing in the post-RA scheduler
Krzysztof Parzyszek [Tue, 8 Mar 2016 16:54:20 +0000 (16:54 +0000)]
Invoke DAG postprocessing in the post-RA scheduler

This was inadvertently omitted from r262774, which added the mutation
interface.

llvm-svn: 262939

8 years agoTurning on the /bigobj flag for two more files that will not link with MSVC 2015...
Aaron Ballman [Tue, 8 Mar 2016 16:34:37 +0000 (16:34 +0000)]
Turning on the /bigobj flag for two more files that will not link with MSVC 2015 Win64 Debug due to the section limit.

llvm-svn: 262938

8 years agodon't repeat function names in documentation comments; NFC
Sanjay Patel [Tue, 8 Mar 2016 16:26:39 +0000 (16:26 +0000)]
don't repeat function names in documentation comments; NFC

llvm-svn: 262937

8 years ago[ARM] Simplify ARMInstr*.td by getting rid of identity PatFrags (NFC)
Artyom Skrobov [Tue, 8 Mar 2016 16:23:54 +0000 (16:23 +0000)]
[ARM] Simplify ARMInstr*.td by getting rid of identity PatFrags (NFC)

Reviewers: t.p.northover, grosbach, resistor

Subscribers: aemerson, rengolin, llvm-commits

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

llvm-svn: 262936

8 years agoRevert r262599 "[X86][SSE] Improve vector ZERO_EXTEND by combining to ZERO_EXTEND_VEC...
Hans Wennborg [Tue, 8 Mar 2016 16:21:41 +0000 (16:21 +0000)]
Revert r262599 "[X86][SSE] Improve vector ZERO_EXTEND by combining to ZERO_EXTEND_VECTOR_INREG"

This caused PR26870.

llvm-svn: 262935

8 years agoFix problem with uninitilialized bool found by asan.
Manuel Klimek [Tue, 8 Mar 2016 16:17:48 +0000 (16:17 +0000)]
Fix problem with uninitilialized bool found by asan.

llvm-svn: 262934

8 years agoAdd Visual Studio native visualizers for several Clang types
Mike Spertus [Tue, 8 Mar 2016 16:14:23 +0000 (16:14 +0000)]
Add Visual Studio native visualizers for several Clang types

This is one of a series of changes to improve the MSVC visualization of Clang types.
This one focuses on Record and SubstTemplateTypeParmType meaning that, for example,
a TemplateArgumentLoc no longer displays incomprehensibly in the locals window as

  {Argument={DeclArg={Kind=1 QT=0x033acb00 D=0xcccccccc {DeclType=???}}...

but instead much more usefully as

  Type template parameter: SubstTemplateTypeParm: {Identifier (("T"))} => Record, {Identifier (("A"))}

Additional types and improvements will be made in subsequent commits

llvm-svn: 262933

8 years agoRemove a couple tabs that crept in
Marshall Clow [Tue, 8 Mar 2016 15:45:06 +0000 (15:45 +0000)]
Remove a couple tabs that crept in

llvm-svn: 262932

8 years agoImplement P0272R1: Give 'std::string' a non-const '.data()' member function
Marshall Clow [Tue, 8 Mar 2016 15:44:30 +0000 (15:44 +0000)]
Implement P0272R1: Give 'std::string' a non-const '.data()' member function

llvm-svn: 262931

8 years agoAdd DAG mutation interface to the DFA packetizer
Krzysztof Parzyszek [Tue, 8 Mar 2016 15:33:51 +0000 (15:33 +0000)]
Add DAG mutation interface to the DFA packetizer

llvm-svn: 262930

8 years agoAVX512: Add extract_subvector patterns v8i1->v4i1 , v4i1->v2i1.
Igor Breger [Tue, 8 Mar 2016 15:21:25 +0000 (15:21 +0000)]
AVX512: Add extract_subvector patterns v8i1->v4i1 , v4i1->v2i1.

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

llvm-svn: 262929

8 years agoImplement P0253R1: Fixing a design mistake in the searchers interface.
Marshall Clow [Tue, 8 Mar 2016 15:12:52 +0000 (15:12 +0000)]
Implement P0253R1: Fixing a design mistake in the searchers interface.

llvm-svn: 262928

8 years ago[Fix r262788] Fix missed prototype with the old llvm* name.
Filipe Cabecinhas [Tue, 8 Mar 2016 14:22:13 +0000 (14:22 +0000)]
[Fix r262788] Fix missed prototype with the old llvm* name.

llvm-svn: 262927

8 years ago[gold] Avoid assertion failures when taking a pointer to an empty vector.
Benjamin Kramer [Tue, 8 Mar 2016 14:02:46 +0000 (14:02 +0000)]
[gold] Avoid assertion failures when taking a pointer to an empty vector.

llvm-svn: 262926

8 years agoFix log in Broadcaster causing a crash
Tamas Berghammer [Tue, 8 Mar 2016 13:33:14 +0000 (13:33 +0000)]
Fix log in Broadcaster causing a crash

llvm-svn: 262925

8 years ago[llvm-config] Get rid of code related to the Makefile builds
Filipe Cabecinhas [Tue, 8 Mar 2016 11:49:24 +0000 (11:49 +0000)]
[llvm-config] Get rid of code related to the Makefile builds

Summary: I left --build-system for backwards compat, in case there are scripts using it. Feel free to ask for its removal too.

Reviewers: chapuni, tstellarAMD

Subscribers: llvm-commits

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

llvm-svn: 262924

8 years agoTry to fix windows build after rL262863
Tamas Berghammer [Tue, 8 Mar 2016 11:43:56 +0000 (11:43 +0000)]
Try to fix windows build after rL262863

llvm-svn: 262923

8 years agoBump libclang API version after r262318
Kevin Funk [Tue, 8 Mar 2016 10:34:23 +0000 (10:34 +0000)]
Bump libclang API version after r262318

llvm-svn: 262922

8 years agoSema: Methods in unavailable classes are unavailable
Duncan P. N. Exon Smith [Tue, 8 Mar 2016 10:28:52 +0000 (10:28 +0000)]
Sema: Methods in unavailable classes are unavailable

Similar to the template cases in r262050, when a C++ method in an
unavailable struct/class calls unavailable API, don't diagnose an error.
I.e., this case was failing:

    void foo() __attribute__((unavailable));
    struct __attribute__((unavailable)) A {
      void bar() { foo(); }
    };

Since A is unavailable, A::bar is allowed to call foo.  However, we were
emitting a diagnostic here.  This commit checks up the context chain
from A::bar, in a manner inspired by SemaDeclAttr.cpp:isDeclUnavailable.

I expected to find other related issues but failed to trigger them:

- I wondered if DeclBase::getAvailability should check for
  `TemplateDecl` instead of `FunctionTemplateDecl`, but I couldn't find
  a way to trigger this.  I left behind a few extra tests to make sure
  we don't regress.

- I wondered if Sema::isFunctionConsideredUnavailable should be
  symmetric, checking up the context chain of the callee (this commit
  only checks up the context chain of the caller).  However, I couldn't
  think of a testcase that didn't require first referencing the
  unavailable type; this, we already diagnose.

rdar://problem/25030656

llvm-svn: 262921

8 years agoUse c_str() instead of GetCString() to fix build
Ewan Crawford [Tue, 8 Mar 2016 10:03:23 +0000 (10:03 +0000)]
Use c_str() instead of GetCString() to fix build

llvm-svn: 262920

8 years ago[X86] Regenerated vector float extension tests
Simon Pilgrim [Tue, 8 Mar 2016 09:17:12 +0000 (09:17 +0000)]
[X86] Regenerated vector float extension tests

llvm-svn: 262919

8 years agoRemove pr25342 test-case.
Junmo Park [Tue, 8 Mar 2016 07:42:12 +0000 (07:42 +0000)]
Remove pr25342 test-case.

This commit removes pr25342 for reverting r262670 clearly.

llvm-svn: 262918

8 years agoAlso clang-format *.c run-time library files
Tobias Grosser [Tue, 8 Mar 2016 07:34:58 +0000 (07:34 +0000)]
Also clang-format *.c run-time library files

llvm-svn: 262917

8 years agoRevert "[InstCombine] Combine A->B->A BitCast"
Junmo Park [Tue, 8 Mar 2016 07:09:46 +0000 (07:09 +0000)]
Revert "[InstCombine] Combine A->B->A BitCast"

This reverts commit r262670 due to compile failure.

llvm-svn: 262916

8 years agoSema: Treat 'strict' availability flag like unavailable
Duncan P. N. Exon Smith [Tue, 8 Mar 2016 06:12:54 +0000 (06:12 +0000)]
Sema: Treat 'strict' availability flag like unavailable

This is a follow-up to r261512, which made the 'strict' availability
attribute flag behave like 'unavailable'.  However, that fix was
insufficient.  The following case would (erroneously) error when the
deployment target was older than 10.9:

    struct __attribute__((availability(macosx,strict,introduced=10.9))) A;
    __attribute__((availability(macosx,strict,introduced=10.9))) void f(A*);

The use of A* in the argument list for f is valid here, since f and A
have the same availability.

The fix is to return AR_Unavailable from DeclBase::getAvailability
instead of AR_NotYetIntroduced.  This also reverts the special handling
added in r261163, instead relying on the well-tested logic for
AR_Unavailable.

rdar://problem/23791325

llvm-svn: 262915

8 years agoThis is actually a FileSpec, so use .GetCString() instead
Enrico Granata [Tue, 8 Mar 2016 05:59:47 +0000 (05:59 +0000)]
This is actually a FileSpec, so use .GetCString() instead

llvm-svn: 262914

8 years agoUse .c_str() here to unbreak the Linux build
Enrico Granata [Tue, 8 Mar 2016 05:57:52 +0000 (05:57 +0000)]
Use .c_str() here to unbreak the Linux build

llvm-svn: 262913

8 years agoA few more improvements on the way to the command alias refactoring
Enrico Granata [Tue, 8 Mar 2016 05:37:15 +0000 (05:37 +0000)]
A few more improvements on the way to the command alias refactoring

- move alias help generation to CommandAlias, out of CommandInterpreter
- make alias creation use argument strings instead of OptionArgVectorSP; the former is a more reasonable currency than the latter
- remove m_is_alias from CommandObject, it wasn't actually being used

llvm-svn: 262912

8 years agoELF: Rename NoInhibitExec -> NoinhibitExec.
Rui Ueyama [Tue, 8 Mar 2016 04:06:29 +0000 (04:06 +0000)]
ELF: Rename NoInhibitExec -> NoinhibitExec.

The variables corresponding to command line options are named mechanically.
Because the option for the variable is -noinhibit-exec and not -no-inhibit-exec,
it should be name this way.

llvm-svn: 262911

8 years agoELF: Add /lib and /usr/lib as default search paths.
Rui Ueyama [Tue, 8 Mar 2016 04:06:27 +0000 (04:06 +0000)]
ELF: Add /lib and /usr/lib as default search paths.

GNU ld and gold have these paths as default search paths.
If you don't want these directories, pass -nostdlib.

llvm-svn: 262910

8 years agoTurn GetAliasOptions() into GetAlias()
Enrico Granata [Tue, 8 Mar 2016 03:56:12 +0000 (03:56 +0000)]
Turn GetAliasOptions() into GetAlias()

Eventually, there will be more things that CommandAlias contains, and I don't want accessors for each of them on the CommandIntepreter
Eventually, we also won't pass around copies of CommandAlias, but that's for a later patch

llvm-svn: 262909

8 years agoSelectionDAG: Appease the bots that don't like my union
Justin Bogner [Tue, 8 Mar 2016 03:51:58 +0000 (03:51 +0000)]
SelectionDAG: Appease the bots that don't like my union

Should fix the breakage in r262902.

llvm-svn: 262908

8 years agoFix evaluation order. Spotted by Alexander Riccio!
Peter Collingbourne [Tue, 8 Mar 2016 03:50:36 +0000 (03:50 +0000)]
Fix evaluation order. Spotted by Alexander Riccio!

llvm-svn: 262907

8 years ago[Power9] Implement new vsx instructions: load, store instructions for vector and...
Kit Barton [Tue, 8 Mar 2016 03:49:13 +0000 (03:49 +0000)]
[Power9] Implement new vsx instructions: load, store instructions for vector and scalar

We follow the comments mentioned in http://reviews.llvm.org/D16842#344378 to
implement this new patch.

This patch implements the following vsx instructions:

Vector load/store:
lxv lxvx lxvb16x lxvl lxvll lxvh8x lxvwsx
stxv stxvb16x stxvh8x stxvl stxvll stxvx
Scalar load/store:
lxsd lxssp lxsibzx lxsihzx
stxsd stxssp stxsibx stxsihx
21 instructions

Phabricator: http://reviews.llvm.org/D16919
llvm-svn: 262906

8 years agoAttempt to fix the Ubuntu buildbot by making FindLongestCommandWord a free template...
Enrico Granata [Tue, 8 Mar 2016 03:48:41 +0000 (03:48 +0000)]
Attempt to fix the Ubuntu buildbot by making FindLongestCommandWord a free template function in lldb_private

llvm-svn: 262905

8 years agoUnbreak linux build broken by r262901
Jason Molenda [Tue, 8 Mar 2016 03:24:13 +0000 (03:24 +0000)]
Unbreak linux build broken by r262901

llvm-svn: 262904

8 years ago[WebAssembly] Update for spec change from tableswitch to br_table.
Dan Gohman [Tue, 8 Mar 2016 03:18:12 +0000 (03:18 +0000)]
[WebAssembly] Update for spec change from tableswitch to br_table.

Also note that the operand order changed; the default label is now listed
after the regular labels.

llvm-svn: 262903

8 years agoRe-apply "SelectionDAG: Store SDNode operands in an ArrayRecycler"
Justin Bogner [Tue, 8 Mar 2016 03:14:29 +0000 (03:14 +0000)]
Re-apply "SelectionDAG: Store SDNode operands in an ArrayRecycler"

This re-applies r262886 with a fix for 32 bit platforms that have 8 byte
pointer alignment, effectively reverting r262892.

Original Message:

  Currently some SDNode operands are malloc'd, some are stored inline in
  subclasses of SDNode, and some are thrown into a BumpPtrAllocator.
  This scheme is complex, inconsistent, and makes refactoring SDNodes
  fairly difficult.

  Instead, we can allocate all of the operands using an ArrayRecycler
  that wraps a BumpPtrAllocator. This keeps the cache locality when
  iterating operands, improves locality when iterating SDNodes without
  looking at operands, and vastly simplifies the ownership semantics.

  It also means we stop overallocating SDNodes by 2-3x and will make it
  simpler to fix the rampant undefined behaviour we have in how we
  mutate SDNodes from one kind to another (See llvm.org/pr26808).

  This is NFC other than the changes in memory behaviour, and I ran some
  LNT tests to make sure this didn't hurt compile time. Not many tests
  changed: there were a couple of 1-2% regressions reported, but there
  were more improvements (of up to 4%) than regressions.

llvm-svn: 262902

8 years agoMove ProcessAliasOptionsArgs to be a static on CommandAlias; it wasn't using any...
Enrico Granata [Tue, 8 Mar 2016 03:00:27 +0000 (03:00 +0000)]
Move ProcessAliasOptionsArgs to be a static on CommandAlias; it wasn't using any instance data on the CommandInterpreter anyway

This small step removes one piece of alias machinery from the CommandInterpreter into the CommandAlias

llvm-svn: 262901

8 years agoChange the way command aliases are stored. Go from a model where a map holds the...
Enrico Granata [Tue, 8 Mar 2016 02:49:15 +0000 (02:49 +0000)]
Change the way command aliases are stored. Go from a model where a map holds the alias -> underlying command binding and another map holds the alias -> options, to a model where one single map holds the alias -> (all useful data) combination

Right now, obviously, this is just the pair of (CommandObjectSP,OptionArgVectorSP), so NFC

This is step one of a larger - and tricky - refactoring which will turn command aliases into interesting objects instead of passive storage that the command interpreter does smart things to
This refactoring, in turn, will allow us to do interesting things with aliases, such as intelligent and customizable help

llvm-svn: 262900

8 years ago[MIR] Change the token name for '<' and '>' to be consitent with the LLVM IR parser.
Quentin Colombet [Tue, 8 Mar 2016 02:00:43 +0000 (02:00 +0000)]
[MIR] Change the token name for '<' and '>' to be consitent with the LLVM IR parser.
Thanks to Ahmed Bougacha for noticing!

llvm-svn: 262899

8 years ago[AArch64][GlobalISel] Add a test case for the IRTranslator.
Quentin Colombet [Tue, 8 Mar 2016 01:48:08 +0000 (01:48 +0000)]
[AArch64][GlobalISel] Add a test case for the IRTranslator.

llvm-svn: 262898

8 years ago[AArch64] Initialize GlobalISel as part of the target initialization.
Quentin Colombet [Tue, 8 Mar 2016 01:45:36 +0000 (01:45 +0000)]
[AArch64] Initialize GlobalISel as part of the target initialization.

llvm-svn: 262897

8 years ago[GlobalISel] Introduce initializer method to support start/stop-after features.
Quentin Colombet [Tue, 8 Mar 2016 01:38:55 +0000 (01:38 +0000)]
[GlobalISel] Introduce initializer method to support start/stop-after features.

llvm-svn: 262896

8 years agoAdd doxygen comments to bmiintrin.h's intrinsics.
Ekaterina Romanova [Tue, 8 Mar 2016 01:36:59 +0000 (01:36 +0000)]
Add doxygen comments to bmiintrin.h's intrinsics.
The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream.

llvm-svn: 262895

8 years ago[analyzer] Fix missed leak from MSVC specific allocation functions
Anna Zaks [Tue, 8 Mar 2016 01:21:51 +0000 (01:21 +0000)]
[analyzer] Fix missed leak from MSVC specific allocation functions

Add the wide character strdup variants (wcsdup, _wcsdup) and the MSVC
version of alloca (_alloca) and other differently named function used
by the Malloc checker.

A patch by Alexander Riccio!

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

llvm-svn: 262894

8 years ago[MIR] Teach the parser/printer that generic virtual registers do not need a register...
Quentin Colombet [Tue, 8 Mar 2016 01:17:03 +0000 (01:17 +0000)]
[MIR] Teach the parser/printer that generic virtual registers do not need a register class.

llvm-svn: 262893

8 years agoRevert "SelectionDAG: Store SDNode operands in an ArrayRecycler"
Justin Bogner [Tue, 8 Mar 2016 01:07:03 +0000 (01:07 +0000)]
Revert "SelectionDAG: Store SDNode operands in an ArrayRecycler"

Looks like the largest SDNode is different between 32 and 64 bit now,
so this is breaking 32 bit bots. Reverting while I figure out a fix.

This reverts r262886.

llvm-svn: 262892

8 years agoA couple more UB fixes for C++14 sized deallocation.
Richard Smith [Tue, 8 Mar 2016 00:59:44 +0000 (00:59 +0000)]
A couple more UB fixes for C++14 sized deallocation.

llvm-svn: 262891

8 years ago[MIR] Teach the parser how to parse complex types of generic machine instructions.
Quentin Colombet [Tue, 8 Mar 2016 00:57:31 +0000 (00:57 +0000)]
[MIR] Teach the parser how to parse complex types of generic machine instructions.
By complex types, I mean aggregate or vector types.

llvm-svn: 262890

8 years agoUse class="svn" for features with SVN status.
Richard Smith [Tue, 8 Mar 2016 00:45:37 +0000 (00:45 +0000)]
Use class="svn" for features with SVN status.

llvm-svn: 262889

8 years agoMove [[nodiscard]] tests into test/CXX tree.
Richard Smith [Tue, 8 Mar 2016 00:44:49 +0000 (00:44 +0000)]
Move [[nodiscard]] tests into test/CXX tree.

llvm-svn: 262888

8 years agoDefine __has_cpp_attribute(fallthrough) to a more reasonable value. (What year is...
Richard Smith [Tue, 8 Mar 2016 00:40:32 +0000 (00:40 +0000)]
Define __has_cpp_attribute(fallthrough) to a more reasonable value. (What year is it?!)

llvm-svn: 262887

8 years agoSelectionDAG: Store SDNode operands in an ArrayRecycler
Justin Bogner [Tue, 8 Mar 2016 00:39:51 +0000 (00:39 +0000)]
SelectionDAG: Store SDNode operands in an ArrayRecycler

Currently some SDNode operands are malloc'd, some are stored inline in
subclasses of SDNode, and some are thrown into a BumpPtrAllocator.
This scheme is complex, inconsistent, and makes refactoring SDNodes
fairly difficult.

Instead, we can allocate all of the operands using an ArrayRecycler
that wraps a BumpPtrAllocator. This keeps the cache locality when
iterating operands, improves locality when iterating SDNodes without
looking at operands, and vastly simplifies the ownership semantics.

It also means we stop overallocating SDNodes by 2-3x and will make it
simpler to fix the rampant undefined behaviour we have in how we
mutate SDNodes from one kind to another (See llvm.org/pr26808).

This is NFC other than the changes in memory behaviour, and I ran some
LNT tests to make sure this didn't hurt compile time. Not many tests
changed: there were a couple of 1-2% regressions reported, but there
were more improvements (of up to 4%) than regressions.

llvm-svn: 262886

8 years ago[MIR] Teach the printer how to print complex types for generic machine instructions.
Quentin Colombet [Tue, 8 Mar 2016 00:38:01 +0000 (00:38 +0000)]
[MIR] Teach the printer how to print complex types for generic machine instructions.

Before this change, we would get the type definition in the middle
of the instruction.
E.g., %0(48) = G_ADD %struct_alias = type { i32, i16 } %edi, %edi

Now, we have just the expected type name:
%0(48) = G_ADD %struct_alias %edi, %edi

llvm-svn: 262885

8 years ago[AsmParser] Expose an API to parse a string starting with a type.
Quentin Colombet [Tue, 8 Mar 2016 00:37:07 +0000 (00:37 +0000)]
[AsmParser] Expose an API to parse a string starting with a type.

Without actually parsing a type it is difficult to perdict where
the type definition ends. In other words, instead of expecting
the user of the parser API to hand over only the relevant bits
of the string being parsed, take the whole string, parse the type,
and get back the number of characters that have been read.

This will be used by the MIR testing infrastructure.

llvm-svn: 262884

8 years agoRevert revisions 262636, 262643, 262679, and 262682.
Easwaran Raman [Tue, 8 Mar 2016 00:36:35 +0000 (00:36 +0000)]
Revert revisions 262636, 262643, 262679, and 262682.

llvm-svn: 262883

8 years agoAdd accidentally forgotten testcase from r262881.
Richard Smith [Tue, 8 Mar 2016 00:34:49 +0000 (00:34 +0000)]
Add accidentally forgotten testcase from r262881.

llvm-svn: 262882

8 years agoP0188R1: add support for standard [[fallthrough]] attribute. This is almost
Richard Smith [Tue, 8 Mar 2016 00:32:55 +0000 (00:32 +0000)]
P0188R1: add support for standard [[fallthrough]] attribute. This is almost
exactly the same as clang's existing [[clang::fallthrough]] attribute, which
has been updated to have the same semantics. The one significant difference
is that [[fallthrough]] is ill-formed if it's not used immediately before a
switch label (even when -Wimplicit-fallthrough is disabled). To support that,
we now build a CFG of any function that uses a '[[fallthrough]];' statement
to check.

In passing, fix some bugs with our support for statement attributes -- in
particular, diagnose their use on declarations, rather than asserting.

llvm-svn: 262881

8 years ago[MIR] Print the type of generic machine instructions.
Quentin Colombet [Tue, 8 Mar 2016 00:29:15 +0000 (00:29 +0000)]
[MIR] Print the type of generic machine instructions.

llvm-svn: 262880

8 years ago[MIR] Teach the mir parser about types on generic machine instructions.
Quentin Colombet [Tue, 8 Mar 2016 00:20:48 +0000 (00:20 +0000)]
[MIR] Teach the mir parser about types on generic machine instructions.

llvm-svn: 262879

8 years ago[lit] Teach lit about global-isel requirement.
Quentin Colombet [Tue, 8 Mar 2016 00:03:40 +0000 (00:03 +0000)]
[lit] Teach lit about global-isel requirement.

llvm-svn: 262878

8 years ago[llvm-config] Teach llvm-config about global-isel.
Quentin Colombet [Tue, 8 Mar 2016 00:02:50 +0000 (00:02 +0000)]
[llvm-config] Teach llvm-config about global-isel.

llvm-config can know tell whether or not a build has been configured to support
global-isel.
Use '--has-global-isel' for that.

llvm-svn: 262877

8 years ago[tsan] Add support for pointer typed atomic stores, loads, and cmpxchg
Anna Zaks [Mon, 7 Mar 2016 23:16:23 +0000 (23:16 +0000)]
[tsan] Add support for pointer typed atomic stores, loads, and cmpxchg

TSan instrumentation functions for atomic stores, loads, and cmpxchg work on
integer value types. This patch adds casts before calling TSan instrumentation
functions in cases where the value is a pointer.

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

llvm-svn: 262876

8 years ago[x86] add test to show missing optimization
Sanjay Patel [Mon, 7 Mar 2016 23:13:06 +0000 (23:13 +0000)]
[x86] add test to show missing optimization

This should make it clearer how this proposed patch:
http://reviews.llvm.org/D11393
...will change codegen.

llvm-svn: 262875

8 years ago[x86] simplify test and tighten checks
Sanjay Patel [Mon, 7 Mar 2016 22:53:23 +0000 (22:53 +0000)]
[x86] simplify test and tighten checks

I noticed this test as part of:
http://reviews.llvm.org/D11393
...which is confusing enough as-is.
Let's show the exact codegen, so the changes will be more obvious.

llvm-svn: 262874

8 years ago[MachineInstr] Get rid of some GlobalISel ifdefs.
Quentin Colombet [Mon, 7 Mar 2016 22:47:23 +0000 (22:47 +0000)]
[MachineInstr] Get rid of some GlobalISel ifdefs.

Now the type API is always available, but when global-isel is not
built the implementation does nothing.

Note: The implementation free of ifdefs is WIP and tracked here in PR26576.
llvm-svn: 262873

8 years agoImplement support for [[nodiscard]] in C++1z that is based off existing support for...
Aaron Ballman [Mon, 7 Mar 2016 22:44:55 +0000 (22:44 +0000)]
Implement support for [[nodiscard]] in C++1z that is based off existing support for warn_unused_result, and treat it as an extension pre-C++1z. This also means extending the existing warn_unused_result attribute so that it can be placed on an enum as well as a class.

llvm-svn: 262872

8 years agoImplement P0025R0: 'An algorithm to clamp a value between a pair of boundary values...
Marshall Clow [Mon, 7 Mar 2016 22:43:49 +0000 (22:43 +0000)]
Implement P0025R0: 'An algorithm to clamp a value between a pair of boundary values' for C++17

llvm-svn: 262871

8 years agoRemove unused import in Orc C API
Amaury Sechet [Mon, 7 Mar 2016 22:40:07 +0000 (22:40 +0000)]
Remove unused import in Orc C API

Summary: It is not used.

Reviewers: lhames

Subscribers: llvm-commits

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

llvm-svn: 262870

8 years ago[IR] Provide an API to skip the details of a structured type when printed.
Quentin Colombet [Mon, 7 Mar 2016 22:32:42 +0000 (22:32 +0000)]
[IR] Provide an API to skip the details of a structured type when printed.

The mir infrastructure will need this for generic instructions and currently
this feature was only available through the anonymous TypePrinter class.

llvm-svn: 262869

8 years ago[AsmParser] Add a function to parse a standalone type.
Quentin Colombet [Mon, 7 Mar 2016 22:09:05 +0000 (22:09 +0000)]
[AsmParser] Add a function to parse a standalone type.

This is useful for MIR serialization. Indeed generic machine instructions
must have a type and we don't want to duplicate the logic in the MIParser.

llvm-svn: 262868

8 years ago[MIR] Teach the MIPrinter about size for generic virtual registers.
Quentin Colombet [Mon, 7 Mar 2016 21:57:52 +0000 (21:57 +0000)]
[MIR] Teach the MIPrinter about size for generic virtual registers.

llvm-svn: 262867

8 years agonon-member swap for array was mistakenly taking const ref params. Fixed and added...
Marshall Clow [Mon, 7 Mar 2016 21:57:10 +0000 (21:57 +0000)]
non-member swap for array was mistakenly taking const ref params. Fixed and added test. Thanks to Ben Craig for the catch

llvm-svn: 262866

8 years agoFix broken example for bitreverse documentation
Matt Arsenault [Mon, 7 Mar 2016 21:54:52 +0000 (21:54 +0000)]
Fix broken example for bitreverse documentation

llvm-svn: 262865

8 years agoAMDGPU: Match more med3 integer patterns
Matt Arsenault [Mon, 7 Mar 2016 21:54:48 +0000 (21:54 +0000)]
AMDGPU: Match more med3 integer patterns

llvm-svn: 262864

8 years agoChange over the broadcaster/listener process to hold shared or weak pointers
Jim Ingham [Mon, 7 Mar 2016 21:50:25 +0000 (21:50 +0000)]
Change over the broadcaster/listener process to hold shared or weak pointers
to each other.  This should remove some infrequent teardown crashes when the
listener is not the debugger's listener.

Processes now need to take a ListenerSP, not a Listener&.

This required changing over the Process plugin class constructors to take a ListenerSP, instead
of a Listener&.   Other than that there should be no functional change.

<rdar://problem/24580184> CrashTracer: [USER] Xcode at â€¦ework: lldb_private::Listener::BroadcasterWillDestruct + 39

llvm-svn: 262863

8 years ago[MIR] Teach the parser how to handle the size of generic virtual registers.
Quentin Colombet [Mon, 7 Mar 2016 21:48:43 +0000 (21:48 +0000)]
[MIR] Teach the parser how to handle the size of generic virtual registers.

llvm-svn: 262862

8 years ago[MachineRegisterInfo] Add a method to set the size of a virtual register a posteriori.
Quentin Colombet [Mon, 7 Mar 2016 21:41:39 +0000 (21:41 +0000)]
[MachineRegisterInfo] Add a method to set the size of a virtual register a posteriori.
This is required for mir testing.

llvm-svn: 262861

8 years agoSmall formating change in Core.cpp . NFC
Amaury Sechet [Mon, 7 Mar 2016 21:39:20 +0000 (21:39 +0000)]
Small formating change in Core.cpp . NFC

llvm-svn: 262860

8 years agodoxygen: Also show private members
Tobias Grosser [Mon, 7 Mar 2016 21:38:19 +0000 (21:38 +0000)]
doxygen: Also show private members

llvm-svn: 262859

8 years agodoxygen: Fix region marker
Tobias Grosser [Mon, 7 Mar 2016 21:35:01 +0000 (21:35 +0000)]
doxygen: Fix region marker

llvm-svn: 262858

8 years agoDrop comment separators
Tobias Grosser [Mon, 7 Mar 2016 21:26:41 +0000 (21:26 +0000)]
Drop comment separators

The cause trouble in the doxygen output.

llvm-svn: 262857

8 years ago[MachineRegisterInfo] Get rid of the global-isel ifdefs.
Quentin Colombet [Mon, 7 Mar 2016 21:22:09 +0000 (21:22 +0000)]
[MachineRegisterInfo] Get rid of the global-isel ifdefs.
One additional pointer is not a big deal size-wise and it makes
the code much nicer!

llvm-svn: 262856

8 years agodocs: Add doxygen mainpage
Tobias Grosser [Mon, 7 Mar 2016 21:17:48 +0000 (21:17 +0000)]
docs: Add doxygen mainpage

(and test if doxygen is updated on-commit)

llvm-svn: 262855

8 years agoAMDGPU: Remove a fixme for ptrrtoint handling
Matt Arsenault [Mon, 7 Mar 2016 21:12:46 +0000 (21:12 +0000)]
AMDGPU: Remove a fixme for ptrrtoint handling

llvm-svn: 262854

8 years agoAMDGPU: Move function only used by R600
Matt Arsenault [Mon, 7 Mar 2016 21:10:13 +0000 (21:10 +0000)]
AMDGPU: Move function only used by R600

llvm-svn: 262853

8 years agoDAGCombiner: Check legality before creating extract_vector_elt
Matt Arsenault [Mon, 7 Mar 2016 21:10:09 +0000 (21:10 +0000)]
DAGCombiner: Check legality before creating extract_vector_elt

Problem not hit by any in tree target.

llvm-svn: 262852

8 years agoModule Debugging: Fix a crash when emitting debug info for nested tag types
Adrian Prantl [Mon, 7 Mar 2016 20:58:52 +0000 (20:58 +0000)]
Module Debugging: Fix a crash when emitting debug info for nested tag types
whose DeclContext is not yet complete by deferring their emission.

rdar://problem/24918680

llvm-svn: 262851