platform/upstream/llvm.git
8 years agoGet rid of CHECK-SAME-NOT in tests.
Justin Lebar [Wed, 10 Feb 2016 00:38:15 +0000 (00:38 +0000)]
Get rid of CHECK-SAME-NOT in tests.

Summary: This isn't a FileCheck directive; it does nothing.

Reviewers: jroelofs

Subscribers: cfe-commits, majnemer

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

llvm-svn: 260334

8 years agoThis patch adds doxygen comments for all the intrinsincs in the header file f16cintri...
Ekaterina Romanova [Wed, 10 Feb 2016 00:12:24 +0000 (00:12 +0000)]
This patch adds doxygen comments for all the intrinsincs in the header file f16cintrin.h. The doxygen comments are automatically generated based on Sony's intrinsics document.

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

llvm-svn: 260333

8 years agoAdd binding for counting argument and find called value of call and invoke instructio...
Amaury Sechet [Wed, 10 Feb 2016 00:09:37 +0000 (00:09 +0000)]
Add binding for counting argument and find called value of call and invoke instruction from the C API.

Summary: As per title. This remove the need to rely on internal knowledge of call and invoke instruction to find called value and argument count.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

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

llvm-svn: 260332

8 years agoDon't dereference the first element of an empty container.
Adrian McCarthy [Wed, 10 Feb 2016 00:06:50 +0000 (00:06 +0000)]
Don't dereference the first element of an empty container.

llvm-svn: 260331

8 years agoRemove FreeBSD failure decorator from TestCppIncompleteTypes
Ed Maste [Wed, 10 Feb 2016 00:03:52 +0000 (00:03 +0000)]
Remove FreeBSD failure decorator from TestCppIncompleteTypes

CFLAGS is now being set correctly to pass -flimit-debug-info or
-fno-limit-debug-info on FreeBSD.  I'm not sure which change is
responsible for the fix, though.

llvm.org/pr25626

llvm-svn: 260330

8 years agoARM: improve documentation slightly.
Tim Northover [Tue, 9 Feb 2016 23:55:48 +0000 (23:55 +0000)]
ARM: improve documentation slightly.

It seems the ARMv8 instruction set overview is no longer provided by ARM, so
I've removed it. Since most of the other documents were the same I unified the
two sections.

llvm-svn: 260329

8 years agoAdd status for LLDB on Windows to status.html.
Adrian McCarthy [Tue, 9 Feb 2016 23:52:57 +0000 (23:52 +0000)]
Add status for LLDB on Windows to status.html.

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

llvm-svn: 260328

8 years ago[asan] update the scariness score: tweak a few weights and add tests
Kostya Serebryany [Tue, 9 Feb 2016 23:46:43 +0000 (23:46 +0000)]
[asan] update the scariness score: tweak a few weights and add tests

llvm-svn: 260327

8 years agoChange `CoreTests` to LLDBCoreTests to avoid name clash.
Zachary Turner [Tue, 9 Feb 2016 23:45:21 +0000 (23:45 +0000)]
Change `CoreTests` to LLDBCoreTests to avoid name clash.

lld was already using a target named CoreTests so CMake
was erroring due to this conflict.

llvm-svn: 260326

8 years ago[x86] convert masked load of exactly one element to scalar load
Sanjay Patel [Tue, 9 Feb 2016 23:44:35 +0000 (23:44 +0000)]
[x86] convert masked load of exactly one element to scalar load

This is the load counterpart to the store optimization that was added in:
http://reviews.llvm.org/rL260145

llvm-svn: 260325

8 years agoSplit clone value and instruction in the echo C API test
Amaury Sechet [Tue, 9 Feb 2016 23:41:20 +0000 (23:41 +0000)]
Split clone value and instruction in the echo C API test

Summary: This is a bit of refactoring required to be able to generate instruction in forward basic block. This, for instance, is a requirement for phi in loops.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

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

llvm-svn: 260324

8 years agoRevert "Introduce a cmake module to figure out whether we need to link with libatomic."
Vasileios Kalintiris [Tue, 9 Feb 2016 23:38:28 +0000 (23:38 +0000)]
Revert "Introduce a cmake module to figure out whether we need to link with libatomic."

This reverts commit r260235. It breaks LLVM's bootstrap when building
with a -gcc-toolchain and the system's gcc installation does not provide
the libatomic library and its headers. We should check whether
LIBCXX_GCC_TOOLCHAIN is set and adjust the flags accordingly.

llvm-svn: 260323

8 years agoAdded code that was commented out during testing to stops template member functions...
Greg Clayton [Tue, 9 Feb 2016 23:25:54 +0000 (23:25 +0000)]
Added code that was commented out during testing to stops template member functions from being added to class definitions (see revision 260308 for details).

<rdar://problem/24483905>
<rdar://problem/24508374>

llvm-svn: 260322

8 years agoAdd icmp and conditional branches in the C API echo test.
Amaury Sechet [Tue, 9 Feb 2016 23:15:02 +0000 (23:15 +0000)]
Add icmp and conditional branches in the C API echo test.

Summary:
Improving coverage.

Depends on D16912 .

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 260321

8 years agoRangefy, and replace a switch with `if`s. NFC.
Rui Ueyama [Tue, 9 Feb 2016 23:11:21 +0000 (23:11 +0000)]
Rangefy, and replace a switch with `if`s. NFC.

llvm-svn: 260320

8 years agoAdd convergent-removing bits to FunctionAttrs pass.
Justin Lebar [Tue, 9 Feb 2016 23:03:22 +0000 (23:03 +0000)]
Add convergent-removing bits to FunctionAttrs pass.

Summary:
Remove the convergent attribute on any functions which provably do not
contain or invoke any convergent functions.

After this change, we'll be able to modify clang to conservatively add
'convergent' to all functions when compiling CUDA.

Reviewers:  jingyue, joker.eph

Subscribers: llvm-commits, tra, jhen, hfinkel, resistor, chandlerc, arsenm

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

llvm-svn: 260319

8 years agoUpdate documentation about convergent attribute.
Justin Lebar [Tue, 9 Feb 2016 23:03:17 +0000 (23:03 +0000)]
Update documentation about convergent attribute.

Summary:
Be more explicit about what 'convergent' means, and indicate that the
compiler may remove the attribute from a function if it can prove that
the function doesn't in fact execute any convergent ops.

Reviewers: resistor, jingyue, joker.eph

Subscribers: hfinkel, chandlerc, arsenm, jhen, tra, llvm-commits

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

llvm-svn: 260318

8 years agoFix GCC build.
Peter Collingbourne [Tue, 9 Feb 2016 23:01:38 +0000 (23:01 +0000)]
Fix GCC build.

llvm-svn: 260317

8 years ago[CodeGen] Prefer "if (SDValue R = ...)" to "if (R.getNode())". NFCI.
Ahmed Bougacha [Tue, 9 Feb 2016 22:54:12 +0000 (22:54 +0000)]
[CodeGen] Prefer "if (SDValue R = ...)" to "if (R.getNode())". NFCI.

llvm-svn: 260316

8 years ago[X86] Don't reuse an unrelated variable, create a new one. NFC.
Ahmed Bougacha [Tue, 9 Feb 2016 22:54:05 +0000 (22:54 +0000)]
[X86] Don't reuse an unrelated variable, create a new one. NFC.

Using Op makes it look like we're doing something with it.
We're really not.

llvm-svn: 260315

8 years ago[X86] Remove unnecessary assignment. NFC.
Ahmed Bougacha [Tue, 9 Feb 2016 22:53:58 +0000 (22:53 +0000)]
[X86] Remove unnecessary assignment. NFC.

llvm-svn: 260314

8 years agoAdd C binding for AllocaInst::getAllocatedType
Amaury Sechet [Tue, 9 Feb 2016 22:50:53 +0000 (22:50 +0000)]
Add C binding for AllocaInst::getAllocatedType

Summary:
Comes with an awesome test.

Depends on D16912

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 260313

8 years agoWholeProgramDevirt: introduce.
Peter Collingbourne [Tue, 9 Feb 2016 22:50:34 +0000 (22:50 +0000)]
WholeProgramDevirt: introduce.

This pass implements whole program optimization of virtual calls in cases
where we know (via bitset information) that the list of callees is fixed. This
includes the following:

- Single implementation devirtualization: if a virtual call has a single
  possible callee, replace all calls with a direct call to that callee.

- Virtual constant propagation: if the virtual function's return type is an
  integer <=64 bits and all possible callees are readnone, for each class and
  each list of constant arguments: evaluate the function, store the return
  value alongside the virtual table, and rewrite each virtual call as a load
  from the virtual table.

- Uniform return value optimization: if the conditions for virtual constant
  propagation hold and each function returns the same constant value, replace
  each virtual call with that constant.

- Unique return value optimization for i1 return values: if the conditions
  for virtual constant propagation hold and a single vtable's function
  returns 0, or a single vtable's function returns 1, replace each virtual
  call with a comparison of the vptr against that vtable's address.

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

llvm-svn: 260312

8 years agoUpdate documentation to reflect that libc++abi provides __cxa_thread_atexit (and...
Richard Smith [Tue, 9 Feb 2016 22:48:14 +0000 (22:48 +0000)]
Update documentation to reflect that libc++abi provides __cxa_thread_atexit (and has for quite a while). Also document that we have not yet implemented the new inheriting constructor rules.

llvm-svn: 260311

8 years agoFix inverted comparison.
Rafael Espindola [Tue, 9 Feb 2016 22:47:34 +0000 (22:47 +0000)]
Fix inverted comparison.

llvm-svn: 260310

8 years agoImprove the C API echo test tool to emit basic block is the right order.
Amaury Sechet [Tue, 9 Feb 2016 22:36:41 +0000 (22:36 +0000)]
Improve the C API echo test tool to emit basic block is the right order.

Summary: As per title. Also add a facility method to get the name of a basic block from the C API.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

llvm-svn: 260309

8 years agoFixed many issues that were causing differing type definition issues to show up when...
Greg Clayton [Tue, 9 Feb 2016 22:36:24 +0000 (22:36 +0000)]
Fixed many issues that were causing differing type definition issues to show up when parsing expressions.

1) Turns out we weren't correctly uniquing types for C++. We would search our repository for "lldb_private::Process", but yet store just "Process" in the unique type map. Now we store things correctly and correctly unique types.
2) SymbolFileDWARF::CompleteType() can be called at any time in order to complete a C++ or Objective C class. All public inquiries into the SymbolFile go through SymbolVendor, and SymbolVendor correctly takes the module lock before it call the SymbolFile API call, but when we let CompilerType objects out in the wild, they can complete themselves at any time from the expression parser, so the ValueObjects or (SBValue objects in the public API), and many more places. So we now take the module lock when completing a type to avoid two threads being in the SymbolFileDWARF at the same time.
3) If a class has a template member function like:

    class A
    {
        <template T>
        void Foo(T t);
    };

    The DWARF will _only_ contain a DW_TAG_subprogram for "Foo" if anyone specialized it. This would cause a class definition for A inside a.cpp that used a "int" and "float" overload to look like:
    class A
    {
        void Foo(int t);
        void Foo(double t);
    };

    And a version from b.cpp that used a "float" overload to look like:
    class A
    {
        void Foo(float t);
    };

    And a version from c.cpp that use no overloads to look like:

    class A
    {
    };

    Then in an expression if you have two variables, one name "a" from a.cpp in liba.dylib, and one named "b" from b.cpp in libb.dylib, you will get conflicting definitions for "A" and your expression will fail. This all stems from the fact that DWARF _only_ emits template specializations, not generic definitions, and they are only emitted if they are used. There are two solutions to this:
    a) When ever you run into ANY class, you must say "just because this class doesn't have templatized member functions, it doesn't mean that any other instances might not have any, so when ever I run into ANY class, I must parse all compile units and parse all instances of class "A" just in case it has member functions that are templatized.". That is really bad because it means you always pull in ALL DWARF that contains most likely exact duplicate definitions of the class "A" and you bloat the memory that the SymbolFileDWARF plug-in uses in LLDB (since you pull in all DIEs from all compile units that contain a "A" definition) uses for little value most of the time.
    b) Modify DWARF to emit generic template member function definitions so that you know from looking at any instance of class "A" wether it has template member functions or not. In order to do this, we would have to have the ability to correctly parse a member function template, but there is a compiler bug:
    <rdar://problem/24515533> [PR 26553] C++ Debug info should reference DW_TAG_template_type_parameter
    This bugs means that not all of the info needed to correctly make a template member function is in the DWARF. The main source of the problem is if we have DWARF for a template instantiation for "int" like: "void A::Foo<int>(T)" the DWARF comes out as "void A::Foo<int>(int)" (it doesn't mention type "T", it resolves the type to the specialized type to "int"). But if you actually have your function defined as "<template T> void Foo(int t)" and you only use T for local variables inside the function call, we can't correctly make the function prototype up in the clang::ASTContext.

    So the best we can do for now we just omit all member functions that are templatized from the class definition so that "A" never has any template member functions. This means all defintions of "A" look like:

    class A
    {
    };

    And our expressions will work. You won't be able to call template member fucntions in expressions (not a regression, we weren't able to do this before) and if you are stopped in a templatized member function, we won't know that are are in a method of class "A". All things we should fix, but we need <rdar://problem/24515533> fixed first, followed by:

    <rdar://problem/24515624> Classes should always include a template subprogram definition, even when no template member functions are used

    before we can do anything about it in LLDB.

This bug mainly fixed the following Apple radar:

<rdar://problem/24483905>

llvm-svn: 260308

8 years agoPR26349: correctly check whether a digit sequence is empty in the presence of digit...
Richard Smith [Tue, 9 Feb 2016 22:34:35 +0000 (22:34 +0000)]
PR26349: correctly check whether a digit sequence is empty in the presence of digit separators.

llvm-svn: 260307

8 years agoProxy task fix: task_state stack push condition on fork
Jonathan Peyton [Tue, 9 Feb 2016 22:32:41 +0000 (22:32 +0000)]
Proxy task fix: task_state stack push condition on fork

The problem is that the master's thread state was not saved before entering a
parallel region so it does not remember tasks when it returns.

llvm-svn: 260306

8 years ago[mips] Extend MipsAsmParser class to handle %got(sym + const) expressions
Simon Atanasyan [Tue, 9 Feb 2016 22:31:49 +0000 (22:31 +0000)]
[mips] Extend MipsAsmParser class to handle %got(sym + const) expressions

Now the parser supports `%got(sym)` expressions only but `%got(sym + const)`
variant is also valid and accepted by GAS.

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

llvm-svn: 260305

8 years agoconfigure: Remove llvm 3.6 defines
Jan Vesely [Tue, 9 Feb 2016 22:17:48 +0000 (22:17 +0000)]
configure: Remove llvm 3.6 defines

we require llvm 3.7

reviewer: tstellard
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 260304

8 years agoconfigure: Remove cl_khr_fp64 for device that don't support doubles
Jan Vesely [Tue, 9 Feb 2016 22:17:46 +0000 (22:17 +0000)]
configure: Remove cl_khr_fp64 for device that don't support doubles

Also remove definitions if provided by clang (3.7+)
This halves the size of builtin.opt.{cedar,barts}.bc

reviewer: tstellard
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 260303

8 years agoconfigure: Introduce per device defines
Jan Vesely [Tue, 9 Feb 2016 22:17:45 +0000 (22:17 +0000)]
configure: Introduce per device defines

Make cl_khr_fp64 define per-device.
This patch does not change the generated Makefile (for llvm 3.6, 3.7)

v2: Make the device defines per LLVM version, 'all' for all versions

reviewer: tstellard
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 260302

8 years agomath: Fix log2 vectorization on non-fp64 hw
Jan Vesely [Tue, 9 Feb 2016 22:17:42 +0000 (22:17 +0000)]
math: Fix log2 vectorization on non-fp64 hw

reviewer: tstellard
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 260301

8 years agoHave Mac builds use @rpath when supported in CMake
Jonathan Peyton [Tue, 9 Feb 2016 22:15:30 +0000 (22:15 +0000)]
Have Mac builds use @rpath when supported in CMake

The -install_name linker flag will use "@rpath/" when supported in CMake
which is the recommended usage for dynamic libraries on Mac OSX.

llvm-svn: 260300

8 years agoDon't complete a class type just to test if it is a class. Code in CompilerType and...
Greg Clayton [Tue, 9 Feb 2016 22:09:26 +0000 (22:09 +0000)]
Don't complete a class type just to test if it is a class. Code in CompilerType and in clang::QualType knows how to complete a type if it needs to.

llvm-svn: 260299

8 years ago[MemoryBuiltins] Fix an issue with hasNoAliasAttr
Sanjoy Das [Tue, 9 Feb 2016 21:54:18 +0000 (21:54 +0000)]
[MemoryBuiltins] Fix an issue with hasNoAliasAttr

Summary:
`hasNoAliasAttr` is buggy: it checks to see if the called function has
a `noalias` attribute, which is incorrect since functions are not even
allowed to have the `noalias` attribute.  The comment on its only
caller, `llvm::isNoAliasFn`, makes it pretty clear that the intention
to do the `noalias` check on the return value, and not the callee.

Unfortunately I couldn't find a way to test this upstream -- fixing
this does not change the observable behavior of any of the passes that
use this.  This is not very surprising, since `noalias` does not tell
anything about the contents of the allocated memory (so, e.g., you
still cannot fold loads).  I'll be happy to be proven wrong though.

Reviewers: chandlerc, reames

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 260298

8 years agoELF: Add 'using namespace llvm::dwarf'.
Rui Ueyama [Tue, 9 Feb 2016 21:46:11 +0000 (21:46 +0000)]
ELF: Add 'using namespace llvm::dwarf'.

Most constants defined in llvm::dwarf namespace start with "DW_".
We don't have to worry about name conflicts.

llvm-svn: 260297

8 years ago[Verifier] Add checks for masked.load and masked.store intrinsics
Philip Reames [Tue, 9 Feb 2016 21:43:12 +0000 (21:43 +0000)]
[Verifier] Add checks for masked.load and masked.store intrinsics

While trying to track down what appears to be a LoopVectorizer bug, I noticed that we had no validation of the correctness of calls emitted to @llvm.masked.load and @llvm.masked.store.  This meant malformed IR was showing up much much later than it should.  Hopefully, having Verifier rules in place will make this easier to isolate.

llvm-svn: 260296

8 years ago[SelectionDAG] make getMemBasePlusOffset() accessible; NFCI
Sanjay Patel [Tue, 9 Feb 2016 21:42:04 +0000 (21:42 +0000)]
[SelectionDAG] make getMemBasePlusOffset() accessible; NFCI

I reinvented this functionality in http://reviews.llvm.org/D16828 because it was
hidden away as a static function. The changes in x86 are not based on a complete
audit. I suspect there are other possible uses there, and there are almost certainly
more potential users in other targets.

llvm-svn: 260295

8 years agoELF: Add .eh_frame 'P', 'R' and 'L' augmentation characters.
Rui Ueyama [Tue, 9 Feb 2016 21:41:01 +0000 (21:41 +0000)]
ELF: Add .eh_frame 'P', 'R' and 'L' augmentation characters.

This basically reverts commit r260073 because it is found that
augmentation strings don't always start with "zR". It is reported
as https://llvm.org/bugs/show_bug.cgi?id=26541.

llvm-svn: 260294

8 years agoThis brings back commit r259578.
Rafael Espindola [Tue, 9 Feb 2016 21:39:49 +0000 (21:39 +0000)]
This brings back commit r259578.

But now it follows the llvm style, uses an early return and doesn't
include a file named 1.o.

llvm-svn: 260293

8 years agoFix incorrect usage of `str` in _match_decorator_property.
Zachary Turner [Tue, 9 Feb 2016 21:36:38 +0000 (21:36 +0000)]
Fix incorrect usage of `str` in _match_decorator_property.

llvm-svn: 260292

8 years agoRemove skipIf<compiler> decorators.
Zachary Turner [Tue, 9 Feb 2016 21:36:32 +0000 (21:36 +0000)]
Remove skipIf<compiler> decorators.

These were supposed to have been removed in a previous patch,
but I missed them.

llvm-svn: 260291

8 years agoRemove decorators related to debug info types.
Zachary Turner [Tue, 9 Feb 2016 21:36:23 +0000 (21:36 +0000)]
Remove decorators related to debug info types.

All existing usages were ported over to the common decorators.

llvm-svn: 260290

8 years agoDelete all the xfail / skip decorators for specific compilers.
Zachary Turner [Tue, 9 Feb 2016 21:36:15 +0000 (21:36 +0000)]
Delete all the xfail / skip decorators for specific compilers.

Ported everything over to using expectedFailureAll.

llvm-svn: 260289

8 years agoRemove expected failure and skip decorators for host os.
Zachary Turner [Tue, 9 Feb 2016 21:36:02 +0000 (21:36 +0000)]
Remove expected failure and skip decorators for host os.

All decorator invocations are updated to use the generic
expectedFailureAll and skipIf decorators.

llvm-svn: 260288

8 years agoFix name style.
Rafael Espindola [Tue, 9 Feb 2016 21:35:14 +0000 (21:35 +0000)]
Fix name style.

Functions start with a lower case, variables with an upper case.

llvm-svn: 260287

8 years agoUpdate comment style.
Rafael Espindola [Tue, 9 Feb 2016 21:32:56 +0000 (21:32 +0000)]
Update comment style.

llvm-svn: 260286

8 years agoRevert "Correct size calculations for ELF files"
Rafael Espindola [Tue, 9 Feb 2016 21:30:10 +0000 (21:30 +0000)]
Revert "Correct size calculations for ELF files"

This reverts commit r259578.

There are enough issues with this small patch that it is better to
revert and then commit a fixed version (will be committed shortly).

llvm-svn: 260285

8 years agoIf we set the DYLD_INSERT_LIBRARIES environment variable when launching debugserver...
Greg Clayton [Tue, 9 Feb 2016 21:20:17 +0000 (21:20 +0000)]
If we set the DYLD_INSERT_LIBRARIES environment variable when launching debugserver, for use with /usr/lib/libgmalloc.dylib, then make sure we don't pass this environment variable on to any child processes.

llvm-svn: 260284

8 years ago[AArch64] This check is specific to merging instructions. NFC.
Chad Rosier [Tue, 9 Feb 2016 21:20:12 +0000 (21:20 +0000)]
[AArch64] This check is specific to merging instructions. NFC.

llvm-svn: 260283

8 years agoDon't enable -flimit-debug-info by default for the LLDB Xcode builds. This was put...
Greg Clayton [Tue, 9 Feb 2016 21:18:44 +0000 (21:18 +0000)]
Don't enable -flimit-debug-info by default for the LLDB Xcode builds. This was put in back in 2011 when -flimit-debug-info did a lot less than it does now. With llvm-dsymutil doing ODR type unique stuff we still have reasonably sized dSYM files.

llvm-svn: 260282

8 years agoRemove system-libs.test for now
Ehsan Akhgari [Tue, 9 Feb 2016 21:17:58 +0000 (21:17 +0000)]
Remove system-libs.test for now

This test fails in the ninja-x64-msvc-RA-centos6 builder, so the
UNSUPPORTED: system-windows condition is insufficient.  Removing it
for now; I will investigate how this can be fixed later.

llvm-svn: 260281

8 years agoFix a test added in r260263
Ehsan Akhgari [Tue, 9 Feb 2016 21:10:22 +0000 (21:10 +0000)]
Fix a test added in r260263

llvm-svn: 260280

8 years ago[InstCombine][GC] Handle gc.relocations of vector type
Philip Reames [Tue, 9 Feb 2016 21:09:22 +0000 (21:09 +0000)]
[InstCombine][GC] Handle gc.relocations of vector type

We introduced gc.relocates of vector-of-pointer types a couple of weeks back.  Somehow, I missed updating the InstCombine rule to account for this.  If we hit this code path with a vector-of-pointers gc.relocate, we'd crash on a cast<PointerType>.

I also took the chance to do a bit of code style cleanup.

llvm-svn: 260279

8 years agoAdd Tooling functionality to get a name for a QualType that can be used to name
Richard Smith [Tue, 9 Feb 2016 21:04:04 +0000 (21:04 +0000)]
Add Tooling functionality to get a name for a QualType that can be used to name
that type from the global scope.

Patch by Sterling Augustine, derived (with permission) from code from Cling by
Vassil Vassilev and Philippe Canal.

llvm-svn: 260278

8 years agoSimplify and rename ASTMatchFinder's getCXXRecordDecl to make it more obvious
Richard Smith [Tue, 9 Feb 2016 20:59:05 +0000 (20:59 +0000)]
Simplify and rename ASTMatchFinder's getCXXRecordDecl to make it more obvious
what it's actually trying to do.

llvm-svn: 260277

8 years agoFix the test added in r260266
Ehsan Akhgari [Tue, 9 Feb 2016 20:49:24 +0000 (20:49 +0000)]
Fix the test added in r260266

llvm-svn: 260276

8 years ago[AArch64] AArch64LoadStoreOptimizer: fix bug in pre-inc check iterator
Geoff Berry [Tue, 9 Feb 2016 20:47:21 +0000 (20:47 +0000)]
[AArch64] AArch64LoadStoreOptimizer: fix bug in pre-inc check iterator

Summary:
Fix case where a pre-inc/dec load/store would not be formed if the
add/sub that forms the inc/dec part of the operation was the first
instruction in the block being examined.

Reviewers: mcrosier, jmolloy, t.p.northover, junbuml

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 260275

8 years ago[AArch64] Bail even earlier if the instructions modifieds the base register. NFC.
Chad Rosier [Tue, 9 Feb 2016 20:44:41 +0000 (20:44 +0000)]
[AArch64] Bail even earlier if the instructions modifieds the base register. NFC.

llvm-svn: 260274

8 years ago[AArch64] Simplify. NFC.
Chad Rosier [Tue, 9 Feb 2016 20:27:45 +0000 (20:27 +0000)]
[AArch64] Simplify. NFC.

llvm-svn: 260273

8 years ago[AArch64] Add an assert to ensure we don't scale an offset that can't be scaled.
Chad Rosier [Tue, 9 Feb 2016 20:18:07 +0000 (20:18 +0000)]
[AArch64] Add an assert to ensure we don't scale an offset that can't be scaled.

llvm-svn: 260272

8 years agoUse __nl_symbol_ptr instead of __got in the stubs pass on x86 archs.
Pete Cooper [Tue, 9 Feb 2016 20:11:17 +0000 (20:11 +0000)]
Use __nl_symbol_ptr instead of __got in the stubs pass on x86 archs.

The non lazy atoms generated in the stubs pass use an image cache to
hold all of the pointers.  On arm archs, this is the __got section,
but on x86 archs it should be __nl_symbol_ptr.

rdar://problem/24572729

llvm-svn: 260271

8 years ago[PGO] Fix issue: explicitly defaulted assignop is not profiled
Xinliang David Li [Tue, 9 Feb 2016 20:02:59 +0000 (20:02 +0000)]
[PGO] Fix issue: explicitly defaulted assignop is not profiled

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

llvm-svn: 260270

8 years agoFix a typo in r260263
Ehsan Akhgari [Tue, 9 Feb 2016 20:02:35 +0000 (20:02 +0000)]
Fix a typo in r260263

llvm-svn: 260269

8 years agoPass /bigobj when building lib/ASTMatchers/Dynamic/Registry.cpp
Reid Kleckner [Tue, 9 Feb 2016 19:53:30 +0000 (19:53 +0000)]
Pass /bigobj when building lib/ASTMatchers/Dynamic/Registry.cpp

This is the third time it has crossed the 2^16 section limit. We've
already spent time optimizing this file to reduce template
instantiations, and it's not clear that there is anymore low hanging
fruit.

llvm-svn: 260267

8 years agoclang-cl: Enable plugins on Windows
Ehsan Akhgari [Tue, 9 Feb 2016 19:43:13 +0000 (19:43 +0000)]
clang-cl: Enable plugins on Windows

llvm-svn: 260266

8 years agoclang-cl: Support loading plugins on Windows
Ehsan Akhgari [Tue, 9 Feb 2016 19:43:11 +0000 (19:43 +0000)]
clang-cl: Support loading plugins on Windows

This builds on the support being added to LLVM to import and export
registries from DLLs.  This will allow us to pick up the registry
entries added in the DLL's copy of FrontendPluginRegistry.

This will allow us to use plugins on Windows using:
$ clang-cl -Xclang -load -Xclang plugin.dll \
           -Xclang -add-plugin -Xclang foo

llvm-svn: 260265

8 years ago[AArch64] Add a FIXME about invalid KILL markers after the ld/st opt pass.
Chad Rosier [Tue, 9 Feb 2016 19:42:19 +0000 (19:42 +0000)]
[AArch64] Add a FIXME about invalid KILL markers after the ld/st opt pass.

llvm-svn: 260264

8 years agollvm-config: Add preliminary Windows support
Ehsan Akhgari [Tue, 9 Feb 2016 19:41:14 +0000 (19:41 +0000)]
llvm-config: Add preliminary Windows support

Summary:
This patch adds Windows support for a few of the llvm-config commands,
including cflags, ldflags, libs, and system-libs.

Currently llvm-config is untested, so this patch adds tests for the
commands that it fixes as well.

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 260263

8 years agoTurn on LLVM_ENABLE_PLUGINS by default on Windows
Ehsan Akhgari [Tue, 9 Feb 2016 19:37:27 +0000 (19:37 +0000)]
Turn on LLVM_ENABLE_PLUGINS by default on Windows

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 260262

8 years agoAdd support for importing and exporting Registry objects on Windows
Ehsan Akhgari [Tue, 9 Feb 2016 19:37:25 +0000 (19:37 +0000)]
Add support for importing and exporting Registry objects on Windows

On Windows, the DLL containing the registry will get its own global head
and tail variables, so the entries registered in the DLL will be
invisible to the consumer.

In order to solve this, we need to export a getter function from the
plugin DLL per registry and copy over the data inside it.  This patch
adds support for this.  This will be used to support clang plugins on
Windows.

llvm-svn: 260261

8 years ago[AArch64] Remove redundant calls and clang format. NFC.
Chad Rosier [Tue, 9 Feb 2016 19:33:42 +0000 (19:33 +0000)]
[AArch64] Remove redundant calls and clang format. NFC.

llvm-svn: 260260

8 years ago[Hexagon] Fixing relocation generation and adding tests.
Colin LeMahieu [Tue, 9 Feb 2016 19:18:02 +0000 (19:18 +0000)]
[Hexagon] Fixing relocation generation and adding tests.

llvm-svn: 260259

8 years ago[MC] Adding GOTREL expression variant.
Colin LeMahieu [Tue, 9 Feb 2016 19:17:34 +0000 (19:17 +0000)]
[MC] Adding GOTREL expression variant.

llvm-svn: 260258

8 years ago[AArch64] Hoist now common logic. NFC.
Chad Rosier [Tue, 9 Feb 2016 19:17:18 +0000 (19:17 +0000)]
[AArch64] Hoist now common logic. NFC.

llvm-svn: 260257

8 years ago[AArch64] Rename variable to make it clear we're merging here, not pairing.
Chad Rosier [Tue, 9 Feb 2016 19:09:22 +0000 (19:09 +0000)]
[AArch64] Rename variable to make it clear we're merging here, not pairing.

llvm-svn: 260256

8 years ago[libclang] indexing: make sure to not visit init-list expressions twice.
Argyrios Kyrtzidis [Tue, 9 Feb 2016 19:07:24 +0000 (19:07 +0000)]
[libclang] indexing: make sure to not visit init-list expressions twice.

llvm-svn: 260255

8 years ago[libclang] indexing: handle 'TopLevelDeclInObjCContainers' at the point where they...
Argyrios Kyrtzidis [Tue, 9 Feb 2016 19:07:21 +0000 (19:07 +0000)]
[libclang] indexing: handle 'TopLevelDeclInObjCContainers' at the point where they are reported.

It isn't much benefit and doesn't worth the complexity to try to handle them after the container is encountered.

llvm-svn: 260254

8 years ago[libclang] indexing: for a synthesized property reference have the parent be the...
Argyrios Kyrtzidis [Tue, 9 Feb 2016 19:07:19 +0000 (19:07 +0000)]
[libclang] indexing: for a synthesized property reference have the parent be the ObjC implementation decl.

llvm-svn: 260253

8 years ago[Frontend] Handle ASTConsumer::shouldSkipFunctionBody via the MultiplexConsumer.
Argyrios Kyrtzidis [Tue, 9 Feb 2016 19:07:16 +0000 (19:07 +0000)]
[Frontend] Handle ASTConsumer::shouldSkipFunctionBody via the MultiplexConsumer.

llvm-svn: 260252

8 years ago[ASTUnit] Change the parameter of ASTUnit::LoadFromCompilerInvocationAction to accept...
Argyrios Kyrtzidis [Tue, 9 Feb 2016 19:07:13 +0000 (19:07 +0000)]
[ASTUnit] Change the parameter of ASTUnit::LoadFromCompilerInvocationAction to accept a more general FrontendAction.

llvm-svn: 260251

8 years ago[libclang] indexing: Have the semantic container of synthesized ObjC getter/setter...
Argyrios Kyrtzidis [Tue, 9 Feb 2016 19:07:07 +0000 (19:07 +0000)]
[libclang] indexing: Have the semantic container of synthesized ObjC getter/setter methods be the implementation decl.

Matches the behavior of other ObjC methods.

llvm-svn: 260250

8 years ago[AArch64] Separage the codegen logic for widening vs. pairing. NFC.
Chad Rosier [Tue, 9 Feb 2016 19:02:12 +0000 (19:02 +0000)]
[AArch64] Separage the codegen logic for widening vs. pairing. NFC.

llvm-svn: 260249

8 years agoAligned __stub_helper section to 4-bytes.
Pete Cooper [Tue, 9 Feb 2016 18:56:37 +0000 (18:56 +0000)]
Aligned __stub_helper section to 4-bytes.

ld64 aligns most of the stub's to 2 byte alignment, expect for
the stub helper common atoms which are 4 byte aligned.

This adds a new field to StubInfo which tracks this alignment
and ensures that this is the alignment we get in the final image.

rdar://problem/24570220

llvm-svn: 260248

8 years agoMention the --all-files option in the -p help string.
Jim Ingham [Tue, 9 Feb 2016 18:53:49 +0000 (18:53 +0000)]
Mention the --all-files option in the -p help string.

llvm-svn: 260247

8 years agoSimplify EnterTokenStream API to make it more robust for memory management
David Blaikie [Tue, 9 Feb 2016 18:52:09 +0000 (18:52 +0000)]
Simplify EnterTokenStream API to make it more robust for memory management

While this won't help fix things like the bug that r260219 addressed, it
seems like good tidy up to have anyway.

(it might be nice if "makeArrayRef" always produced a MutableArrayRef &
let it decay to an ArrayRef when needed - then I'd use that for the
MutableArrayRefs in this patch)

If we had std::dynarray I'd use that instead of unique_ptr+size_t,
ideally (but then it'd have to be threaded down through the Preprocessor
all the way - no idea how painful that would be)

llvm-svn: 260246

8 years ago[llvm-readobj][ELF] Show MIPS GOT content when there is another zero-sized section...
Simon Atanasyan [Tue, 9 Feb 2016 18:45:35 +0000 (18:45 +0000)]
[llvm-readobj][ELF] Show MIPS GOT content when there is another zero-sized section at the same address

It is possible to have .got section and one or more zero-sized section
at the same address. This patch first checks that GOT (or GOT PLT)
section should have non-zero size using corresponding dynamic tags. Then
it looks up not empty section at the specified address.

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

llvm-svn: 260245

8 years ago[FunctionAttrs] Fix SCC logic around operand bundles
Sanjoy Das [Tue, 9 Feb 2016 18:40:40 +0000 (18:40 +0000)]
[FunctionAttrs] Fix SCC logic around operand bundles

FunctionAttrs does an "optimistic" analysis of SCCs as a unit, which
means normally it is able to disregard calls from an SCC into itself.
However, calls and invokes with operand bundles are allowed to have
memory effects not fully described by the memory effects on the call
target, so we can't be optimistic around operand-bundled calls from an
SCC into itself.

llvm-svn: 260244

8 years agoFix a formatting problems with llvm-size and the -m option.
Kevin Enderby [Tue, 9 Feb 2016 18:33:15 +0000 (18:33 +0000)]
Fix a formatting problems with llvm-size and the -m option.
It was using format() with a string for 64-bit types but was
passed a 32-bit type in places when printing values for
32-bit Mach-O files.

rdar://24542509

llvm-svn: 260243

8 years ago[AArch64] Cleanup to simplify logic when widening vs. pairing loads/stores. NFC.
Chad Rosier [Tue, 9 Feb 2016 18:10:20 +0000 (18:10 +0000)]
[AArch64] Cleanup to simplify logic when widening vs. pairing loads/stores. NFC.

The logic to pair instructions and merge narrow instructions has become cloogy
and error prone.  This patch beings to unravel these two similar, but distinct
optimizations.

llvm-svn: 260242

8 years agoRevert "Avoid forcing emission of delayed dllexported classes on template instantiation"
Reid Kleckner [Tue, 9 Feb 2016 17:48:27 +0000 (17:48 +0000)]
Revert "Avoid forcing emission of delayed dllexported classes on template instantiation"

This reverts commit r260194.

It caused PR26549. There's probably a better way to do this also.

llvm-svn: 260241

8 years ago[x86] make getOneTrueElt() a helper function ; NFC
Sanjay Patel [Tue, 9 Feb 2016 17:39:58 +0000 (17:39 +0000)]
[x86] make getOneTrueElt() a helper function ; NFC

As mentioned in http://reviews.llvm.org/D16828 , the related masked load transform
will need this logic, so I'm moving it out to make that patch smaller.

llvm-svn: 260240

8 years agoFix invalid shift operator overload in Scalar
Pavel Labath [Tue, 9 Feb 2016 17:28:01 +0000 (17:28 +0000)]
Fix invalid shift operator overload in Scalar

Summary: This also fixes an infinite recursion between lldb_private::operator>> () and Scalar::operator>>= ().

Reviewers: sagar, tberghammer, labath

Subscribers: lldb-commits

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

Patch by Marianne Mailhot-Sarrasin

llvm-svn: 260239

8 years ago[MS ABI] Cleanup emitVTableDefinitions
David Majnemer [Tue, 9 Feb 2016 17:27:52 +0000 (17:27 +0000)]
[MS ABI] Cleanup emitVTableDefinitions

Use the VFTable components to determine whether or not we should emit
RTTI data instead of duplicating the VFTableBuilder's logic.

llvm-svn: 260238

8 years agoIntroduce a cmake module to figure out whether we need to link with libatomic.
Vasileios Kalintiris [Tue, 9 Feb 2016 17:00:38 +0000 (17:00 +0000)]
Introduce a cmake module to figure out whether we need to link with libatomic.

Summary:
This fixes the tests under std/atomics for 32-bit MIPS CPUs where the
8-byte atomic operations call into the libatomic library.

Reviewers: dsanders, mclow.lists, EricWF, jroelofs, joerg

Subscribers: cfe-commits

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

llvm-svn: 260235

8 years ago[lsan] Run the tests for each supported arch and suffix each one to distinguish them.
Daniel Sanders [Tue, 9 Feb 2016 16:22:39 +0000 (16:22 +0000)]
[lsan] Run the tests for each supported arch and suffix each one to distinguish them.

Summary:
Previously, the tests only ran for the 64-bit equivalent of the default target
(see -m64).
Given the supported architecture list only contains 64-bit targets, this happens
to work out the same as the supported targets in most cases but may matter for
X86_64/X86_64h on Darwin.

For other targets, the practical effect is that the test names contain the
architecture. This resolves some confusion when lsan tests fail since their
name no longer implies that they are trying to test the default target.

Reviewers: samsonov

Subscribers: tberghammer, danalbert, llvm-commits, srhines

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

llvm-svn: 260232

8 years ago[dfsan] Run the tests for each supported arch and suffix each one to distinguish...
Daniel Sanders [Tue, 9 Feb 2016 16:20:37 +0000 (16:20 +0000)]
[dfsan] Run the tests for each supported arch and suffix each one to distinguish them.

Summary:
Previously, the tests only ran for the 64-bit equivalent of the default target
(see -m64).
Given the supported architecture list only contains 64-bit targets, this happens
to work out the same as the supported targets in most cases but may matter for
X86_64/X86_64h on Darwin.

For other targets, the practical effect is that the test names contain the
architecture. This resolves some confusion when msan tests fail since their
name no longer implies that they are trying to test the default target.

Reviewers: samsonov

Subscribers: tberghammer, danalbert, llvm-commits, srhines

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

llvm-svn: 260231

8 years ago[msan] Run the tests for each supported arch and suffix each one to distinguish them.
Daniel Sanders [Tue, 9 Feb 2016 16:18:15 +0000 (16:18 +0000)]
[msan] Run the tests for each supported arch and suffix each one to distinguish them.

Summary:
Previously, the tests only ran for the 64-bit equivalent of the default target
(see -m64).
Given the supported architecture list only contains 64-bit targets, this happens
to work out the same as the supported targets in most cases but may matter for
X86_64/X86_64h on Darwin.

For other targets, the practical effect is that the test names contain the
architecture. This resolves some confusion when msan tests fail since their
name no longer implies that they are trying to test the default target.

Reviewers: samsonov

Subscribers: tberghammer, danalbert, srhines, llvm-commits

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

llvm-svn: 260230