platform/upstream/llvm.git
8 years agoRemove unused includes
David Majnemer [Thu, 11 Feb 2016 17:54:39 +0000 (17:54 +0000)]
Remove unused includes

llvm-svn: 260552

8 years ago[GlobalISel][IRTranslator] Change the ownership of the MIRBuilder field.
Quentin Colombet [Thu, 11 Feb 2016 17:53:23 +0000 (17:53 +0000)]
[GlobalISel][IRTranslator] Change the ownership of the MIRBuilder field.

llvm-svn: 260551

8 years ago[GlobalISel][IRTranslator] Fix a typo in assert.
Quentin Colombet [Thu, 11 Feb 2016 17:52:28 +0000 (17:52 +0000)]
[GlobalISel][IRTranslator] Fix a typo in assert.

llvm-svn: 260550

8 years ago[GlobalISel][IRTranslator] Teach the pass how to translate Add instructions.
Quentin Colombet [Thu, 11 Feb 2016 17:51:31 +0000 (17:51 +0000)]
[GlobalISel][IRTranslator] Teach the pass how to translate Add instructions.

llvm-svn: 260549

8 years agoRevert "Revert r260388 "[MS ABI] Never reference dllimport'd vtables""
David Majnemer [Thu, 11 Feb 2016 17:49:28 +0000 (17:49 +0000)]
Revert "Revert r260388 "[MS ABI] Never reference dllimport'd vtables""

This reverts commit r260449.

We would supress our emission of vftable definitions if we thought
another translation unit would provide the definition because we saw an
explicit instantiation declaration.  This is not the case with
dllimport, we want to synthesize a definition of the vftable regardless.

This fixes PR26569.

llvm-svn: 260548

8 years ago[GlobalISel] Add a MachineIRBuilder class.
Quentin Colombet [Thu, 11 Feb 2016 17:44:59 +0000 (17:44 +0000)]
[GlobalISel] Add a MachineIRBuilder class.
Helper class to build machine instrs. This is a higher abstraction
than MachineInstrBuilder.

llvm-svn: 260547

8 years ago[Renderscript] Fix typo in mips64 argument reading code.
Aidan Dodds [Thu, 11 Feb 2016 17:17:12 +0000 (17:17 +0000)]
[Renderscript] Fix typo in mips64 argument reading code.

A typo in the mips64 argument reading code would cause register passed arguments to be truncated to 32bits.

llvm-svn: 260546

8 years ago[lanai] Add Lanai triple.
Jacques Pienaar [Thu, 11 Feb 2016 17:16:20 +0000 (17:16 +0000)]
[lanai] Add Lanai triple.

Add triple for the Lanai backend.

General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend".

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

llvm-svn: 260545

8 years agoAdd a test case to show isKnownNonZero() returns correctly; NFC
Jun Bum Lim [Thu, 11 Feb 2016 17:11:49 +0000 (17:11 +0000)]
Add a test case to show isKnownNonZero() returns correctly; NFC

Summary:
Added a test case just to make sure that isKnownNonZero() returns false
when we cannot guarantee that a ConstantExpr is a non-zero constant.

Reviewers: sanjoy, majnemer, mcrosier, nlewycky

Subscribers: nlewycky, mssimpso, mcrosier, llvm-commits

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

llvm-svn: 260544

8 years ago[Modules] Don't infinite recurse on implicit import of circular modules in preamble
Ben Langmuir [Thu, 11 Feb 2016 17:04:42 +0000 (17:04 +0000)]
[Modules] Don't infinite recurse  on implicit import of circular modules in preamble

Update the Preprocessor's VisibleModuleSet when typo-correction creates
an implicit module import so that we won't accidentally write an invalid
SourceLocation into the preamble AST.  This would later lead to infinite
recursion when loading the preamble AST because we use the value in
ImportLocs to prevent visiting a module twice.

rdar://problem/24440990

llvm-svn: 260543

8 years agoUse new --match-full-lines FileCheck feature for Preprocessor/init.c.
James Y Knight [Thu, 11 Feb 2016 16:51:29 +0000 (16:51 +0000)]
Use new --match-full-lines FileCheck feature for Preprocessor/init.c.

This required fixing a few check lines which had omitted trailing
characters, and were passing incorrectly (e.g., asserting that
__UINT64_C_SUFFIX__ is "UL" instead of the "ULL" that it actually is set
to). All were obviously broken tests, not broken code.

llvm-svn: 260542

8 years agoFixed typo in r260530
Jun Bum Lim [Thu, 11 Feb 2016 16:46:13 +0000 (16:46 +0000)]
Fixed typo in r260530

llvm-svn: 260541

8 years agoAdd -match-full-lines argument to FileCheck.
James Y Knight [Thu, 11 Feb 2016 16:46:09 +0000 (16:46 +0000)]
Add -match-full-lines argument to FileCheck.

This is useful for some tests where more-exact matching is useful, such
as clang's Preprocessor tests.

llvm-svn: 260540

8 years ago[Windows] Fill in read/write information in SignalContext
Reid Kleckner [Thu, 11 Feb 2016 16:44:35 +0000 (16:44 +0000)]
[Windows] Fill in read/write information in SignalContext

Implements https://github.com/google/sanitizers/issues/653

llvm-svn: 260539

8 years agoRevert r260507: "[X86] Enable the LEA optimization pass by default."
Hans Wennborg [Thu, 11 Feb 2016 16:44:06 +0000 (16:44 +0000)]
Revert r260507: "[X86] Enable the LEA optimization pass by default."

This caused PR26575.

llvm-svn: 260538

8 years agoRevert r260266 (and r260276), "clang-cl: Enable plugins on Windows"
NAKAMURA Takumi [Thu, 11 Feb 2016 16:43:08 +0000 (16:43 +0000)]
Revert r260266 (and r260276), "clang-cl: Enable plugins on Windows"

It doesn't work, at least, i686-win32.

llvm-svn: 260537

8 years agoRevert r260265, "clang-cl: Support loading plugins on Windows"
NAKAMURA Takumi [Thu, 11 Feb 2016 16:33:20 +0000 (16:33 +0000)]
Revert r260265, "clang-cl: Support loading plugins on Windows"

It causes memory exhaust on mingw-w64(x64). Investigating.

llvm-svn: 260536

8 years ago[clang-tidy] google-runtime-int: fix a false positive in implicit code.
Alexander Kornienko [Thu, 11 Feb 2016 16:22:58 +0000 (16:22 +0000)]
[clang-tidy] google-runtime-int: fix a false positive in implicit code.

llvm-svn: 260535

8 years ago[AArch64] Refactoring findMatchingStore() in aarch64-ldst-opt; NFC
Jun Bum Lim [Thu, 11 Feb 2016 16:18:24 +0000 (16:18 +0000)]
[AArch64] Refactoring findMatchingStore() in aarch64-ldst-opt; NFC

Summary: This change makes findMatchingStore() follow the same coding style introduced in r260275.

Reviewers: gberry, junbuml

Subscribers: aemerson, rengolin, haicheng, bmakam, mssimpso

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

llvm-svn: 260534

8 years ago[ARM] Add command-line options for ARMv8.2-A
Oliver Stannard [Thu, 11 Feb 2016 16:05:52 +0000 (16:05 +0000)]
[ARM] Add command-line options for ARMv8.2-A

This allows ARMv8.2-A to be targeted either by using "armv8.2a" in the
triple, or by using -march=armv8.2-a (or the alias -march=armv8.2a).

The FP16 extension can be enabled with the "+fp16" suffix to the -march
or -mcpu option. This is consistent with the AArch64 option, rather than
the usual ARM option of -mfpu. We have agreed with the team which will
be upstreaming this to GCC that we want to use this new option format
for new architecture extensions for both ARM and AArch64.

Most of the work for this was done by the TargetParser patch in llvm.

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

llvm-svn: 260533

8 years agoMerge branch 'arcpatch-D16922'
Cong Liu [Thu, 11 Feb 2016 16:03:27 +0000 (16:03 +0000)]
Merge branch 'arcpatch-D16922'

llvm-svn: 260532

8 years agoRename CheckLibcxxAtomic.cmake variable result names so they don't clash with LLVM
Eric Fiselier [Thu, 11 Feb 2016 15:52:52 +0000 (15:52 +0000)]
Rename CheckLibcxxAtomic.cmake variable result names so they don't clash with LLVM

llvm-svn: 260531

8 years ago[InstCombine] Simplify a known nonzero incoming value of PHI
Jun Bum Lim [Thu, 11 Feb 2016 15:50:07 +0000 (15:50 +0000)]
[InstCombine] Simplify a known nonzero incoming value of PHI

Summary:
When a PHI is used only to be compared with zero, it is possible to replace an
incoming value with any non-zero constant if the incoming value can be proved as
a known nonzero value. For example, in below code, we can replace the incoming value %v with
any non-zero constant based on the fact that the PHI is only used to be compared with zero
and %v is a known non-zero value:
  %v = select %cond, 1, 2
  %p = phi [%v, BB] ...
  %c = icmp eq, %p, 0

Reviewers: mcrosier, jmolloy, sanjoy

Subscribers: hfinkel, mcrosier, majnemer, llvm-commits, haicheng, bmakam, mssimpso, gberry

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

llvm-svn: 260530

8 years agoDrop the hidden visibility from DebugHandlerBase for now.
Benjamin Kramer [Thu, 11 Feb 2016 15:41:56 +0000 (15:41 +0000)]
Drop the hidden visibility from DebugHandlerBase for now.

If a class has hidden visibility all derived classes and all classes
that have it as a member must have hidden visibility too. That may
be fixable here but requires changes to quite a lot of debug info
classes.

This is also one of the things that GCC enforces aggressively while
clang ignores it, making testing more annoying than necessary.

llvm-svn: 260529

8 years agoSort includes. NFC.
Rafael Espindola [Thu, 11 Feb 2016 15:24:48 +0000 (15:24 +0000)]
Sort includes. NFC.

llvm-svn: 260528

8 years agoAdd some tests to ensure that the __regex_word does not conflict with any of ctype_ba...
Marshall Clow [Thu, 11 Feb 2016 15:23:04 +0000 (15:23 +0000)]
Add some tests to ensure that the __regex_word does not conflict with any of ctype_base's values.
Hopefully this will catch cases like https://llvm.org/bugs/show_bug.cgi?id=26476 in the future.

llvm-svn: 260527

8 years agoProperly down-cast a sentinal node pointer through void*
Eric Fiselier [Thu, 11 Feb 2016 15:22:37 +0000 (15:22 +0000)]
Properly down-cast a sentinal node pointer through void*

llvm-svn: 260526

8 years ago[Renderscript] Refactor target argument reading code.
Aidan Dodds [Thu, 11 Feb 2016 15:16:37 +0000 (15:16 +0000)]
[Renderscript] Refactor target argument reading code.

This patch reworks the function argument reading code, allowing us to annotate arguments with their types.  The type/size information is needed to correctly parse arguments passed on the stack.

llvm-svn: 260525

8 years agoFix r260515 - Correct typos in CMake changes
Eric Fiselier [Thu, 11 Feb 2016 15:05:56 +0000 (15:05 +0000)]
Fix r260515 - Correct typos in CMake changes

llvm-svn: 260524

8 years ago[AArch64] Improve load/store optimizer to handle LDUR + LDR.
Chad Rosier [Thu, 11 Feb 2016 14:25:08 +0000 (14:25 +0000)]
[AArch64] Improve load/store optimizer to handle LDUR + LDR.

This patch allows the mixing of scaled and unscaled load/stores to form
load/store pairs.

This is a reapplication of r259812, which had an incorrect assert.  The
test_stur_str_no_assert() test is a reduced version of the issue hit in
the AArch64 self-host.

PR24465

llvm-svn: 260523

8 years agoRevert "Bail on compilation as soon as a job fails."
Rafael Espindola [Thu, 11 Feb 2016 14:13:17 +0000 (14:13 +0000)]
Revert "Bail on compilation as soon as a job fails."

This reverts commit r260448.

It was causing Driver/output-file-cleanup.c to fail.

llvm-svn: 260522

8 years ago[MC] Fixed parsing of macro arguments where expressions with spaces are present.
Scott Egerton [Thu, 11 Feb 2016 13:48:49 +0000 (13:48 +0000)]
[MC] Fixed parsing of macro arguments where expressions with spaces are present.

Summary:
Fixed an issue for mips with an instruction such as 'sdc1 $f1, 272 +8(a0)' which has a space between '272' and '+'. The parser would then parse '272' and '+8' as two arguments instead of a single expression resulting in one too many arguments in the pseudo instruction.
The reason that the test case has been changed is so that the expected
output matches the output of the GNU assembler.

Reviewers: vkalintiris, dsanders

Subscribers: dsanders, llvm-commits

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

llvm-svn: 260521

8 years agoMake context-sensitive isDereferenceable queries in isSafeToLoadUnconditionally
Artur Pilipenko [Thu, 11 Feb 2016 13:42:59 +0000 (13:42 +0000)]
Make context-sensitive isDereferenceable queries in isSafeToLoadUnconditionally

This is a part of the refactoring to unify isSafeToLoadUnconditionally and isDereferenceablePointer functions. In the subsequent change isSafeToSpeculativelyExecute will be modified to use isSafeToLoadUnconditionally instead of isDereferenceableAndAlignedPointer.

Reviewed By: reames

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

llvm-svn: 260520

8 years agoPartial revert of rL260506.
Andrey Bokhanko [Thu, 11 Feb 2016 13:27:02 +0000 (13:27 +0000)]
Partial revert of rL260506.

After some experiments I discovered that clang doesn't support static
initialization of flexible array members in full, so restored this paragraph in
"GCC extensions not implemented yet" list.

llvm-svn: 260519

8 years agoclang-format: [JS] Support for (.. of ..) loops.
Daniel Jasper [Thu, 11 Feb 2016 13:24:15 +0000 (13:24 +0000)]
clang-format: [JS] Support for (.. of ..) loops.

Before:
  for (var i of[2, 3]) {}

After:
  for (var i of [2, 3]) {}

llvm-svn: 260518

8 years agoclang-format: Make indentation after "<<" more consistent.
Daniel Jasper [Thu, 11 Feb 2016 13:15:14 +0000 (13:15 +0000)]
clang-format: Make indentation after "<<" more consistent.

Before:
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaa;

After:
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
  Diag(aaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
      << aaa;

llvm-svn: 260517

8 years agoseparate nested >>
Eric Fiselier [Thu, 11 Feb 2016 12:51:19 +0000 (12:51 +0000)]
separate nested >>

llvm-svn: 260516

8 years agoRe-commit "Introduce a cmake module to figure out whether we need to link with libato...
Vasileios Kalintiris [Thu, 11 Feb 2016 12:43:04 +0000 (12:43 +0000)]
Re-commit "Introduce a cmake module to figure out whether we need to link with libatomic."

This re-applies commit r260235. However, this time we add -gcc-toolchain
to the compiler's flags when the user has specified the LIBCXX_GCC_TOOLCHAIN
variable.

llvm-svn: 260515

8 years agoTeach __hash_table how to handle unordered_map's __hash_value_type.
Eric Fiselier [Thu, 11 Feb 2016 12:25:27 +0000 (12:25 +0000)]
Teach __hash_table how to handle unordered_map's __hash_value_type.

This patch is fairly large and contains a number of changes. The main change
is teaching '__hash_table' how to handle '__hash_value_type'. Unfortunately
this change is a rampant layering violation, but it's required to make
unordered_map conforming without re-writing all of __hash_table.
After this change 'unordered_map' can delegate to '__hash_table' in almost all cases.

The major changes found in this patch are:

  * Teach __hash_table to differentiate between the true container value type
    and the node value type by introducing the "__container_value_type" and
    "__node_value_type" typedefs. In the case of unordered_map '__container_value_type'
    is 'pair<const Key, Value>' and '__node_value_type' is '__hash_value_type'.

  * Switch almost all overloads in '__hash_table' previously taking 'value_type'
    (AKA '__node_value_type) to take  '__container_value_type' instead. Previously
    'pair<K, V>' would be implicitly converted to '__hash_value_type<K, V>' because
    of the function signature.

  * Add '__get_key', '__get_value', '__get_ptr', and '__move' static functions to
    '__key_value_types'. These functions allow '__hash_table' to unwrap
    '__node_value_type' objects into '__container_value_type' and its sub-parts.

  * Pass  '__hash_value_type::__value_'  to 'a.construct(p, ...)' instead of
    '__hash_value_type' itself. The C++14 standard requires that 'a.construct()'
    and 'a.destroy()' are only ever instantiated for the containers value type.

  * Remove '__hash_value_type's constructors and destructors. We should never
    construct an instance of this type.
    (TODO this is UB but we already do it in plenty of places).

  * Add a generic "try-emplace" function to '__hash_table' called
    '__emplace_unique_key_args(Key const&, Args...)'.

The following changes were done as cleanup:

  * Introduce the '_LIBCPP_CXX03_LANG' macro to be used in place of
    '_LIBCPP_HAS_NO_VARIADICS' or '_LIBCPP_HAS_NO_RVALUE_REFERENCE'.

  * Cleanup C++11 only overloads that assume an incomplete C++11 implementation.
    For example this patch removes the __construct_node overloads that do
    manual pack expansion.

  * Forward 'unordered_map::emplace' to '__hash_table' and remove dead code
    resulting from the change. This includes almost all
    'unordered_map::__construct_node' overloads.

The following changes are planed for future revisions:

  * Fix LWG issue #2469 by delegating 'unordered_map::operator[]' to use
    '__emplace_unique_key_args'.

  * Rewrite 'unordered_map::try_emplace' in terms of '__emplace_unique_key_args'.

  * Optimize '__emplace_unique' to call '__emplace_unique_key_args' when possible.
    This prevent unneeded allocations when inserting duplicate entries.

The additional follow up work needed after this patch:

  * Respect the lifetime rules for '__hash_value_type' by actually constructing it.
  * Make '__insert_multi' act similar to '__insert_unique' for objects of type
    'T&' and 'T const &&' with 'T = __container_value_type'.

llvm-svn: 260514

8 years agoTeach __hash_table how to handle unordered_map's __hash_value_type.
Eric Fiselier [Thu, 11 Feb 2016 11:59:44 +0000 (11:59 +0000)]
Teach __hash_table how to handle unordered_map's __hash_value_type.

This patch is fairly large and contains a number of changes. The main change
is teaching '__hash_table' how to handle '__hash_value_type'. Unfortunately
this change is a rampant layering violation, but it's required to make
unordered_map conforming without re-writing all of __hash_table.
After this change 'unordered_map' can delegate to '__hash_table' in almost all cases.

The major changes found in this patch are:

  * Teach __hash_table to differentiate between the true container value type
    and the node value type by introducing the "__container_value_type" and
    "__node_value_type" typedefs. In the case of unordered_map '__container_value_type'
    is 'pair<const Key, Value>' and '__node_value_type' is '__hash_value_type'.

  * Switch almost all overloads in '__hash_table' previously taking 'value_type'
    (AKA '__node_value_type) to take  '__container_value_type' instead. Previously
    'pair<K, V>' would be implicitly converted to '__hash_value_type<K, V>' because
    of the function signature.

  * Add '__get_key', '__get_value', '__get_ptr', and '__move' static functions to
    '__key_value_types'. These functions allow '__hash_table' to unwrap
    '__node_value_type' objects into '__container_value_type' and its sub-parts.

  * Pass  '__hash_value_type::__value_'  to 'a.construct(p, ...)' instead of
    '__hash_value_type' itself. The C++14 standard requires that 'a.construct()'
    and 'a.destroy()' are only ever instantiated for the containers value type.

  * Remove '__hash_value_type's constructors and destructors. We should never
    construct an instance of this type.
    (TODO this is UB but we already do it in plenty of places).

  * Add a generic "try-emplace" function to '__hash_table' called
    '__emplace_unique_key_args(Key const&, Args...)'.

The following changes were done as cleanup:

  * Introduce the '_LIBCPP_CXX03_LANG' macro to be used in place of
    '_LIBCPP_HAS_NO_VARIADICS' or '_LIBCPP_HAS_NO_RVALUE_REFERENCE'.

  * Cleanup C++11 only overloads that assume an incomplete C++11 implementation.
    For example this patch removes the __construct_node overloads that do
    manual pack expansion.

  * Forward 'unordered_map::emplace' to '__hash_table' and remove dead code
    resulting from the change. This includes almost all
    'unordered_map::__construct_node' overloads.

The following changes are planed for future revisions:

  * Fix LWG issue #2469 by delegating 'unordered_map::operator[]' to use
    '__emplace_unique_key_args'.

  * Rewrite 'unordered_map::try_emplace' in terms of '__emplace_unique_key_args'.

  * Optimize '__emplace_unique' to call '__emplace_unique_key_args' when possible.
    This prevent unneeded allocations when inserting duplicate entries.

The additional follow up work needed after this patch:

  * Respect the lifetime rules for '__hash_value_type' by actually constructing it.
  * Make '__insert_multi' act similar to '__insert_unique' for objects of type
    'T&' and 'T const &&' with 'T = __container_value_type'.

llvm-svn: 260513

8 years agoHandle floating-point type homogeneous aggregate return values in ABISysV_arm
Omair Javaid [Thu, 11 Feb 2016 11:41:22 +0000 (11:41 +0000)]
Handle floating-point type homogeneous aggregate return values in ABISysV_arm

For details refer to review link given below.

Differential revision: http://reviews.llvm.org/D16975

llvm-svn: 260512

8 years agoFix MSVC 2013 build after rL260504
Tamas Berghammer [Thu, 11 Feb 2016 11:27:51 +0000 (11:27 +0000)]
Fix MSVC 2013 build after rL260504

llvm-svn: 260511

8 years ago[MCU] Fix assertion failure on function returning empty union.
Denis Zobnin [Thu, 11 Feb 2016 11:26:03 +0000 (11:26 +0000)]
[MCU] Fix assertion failure on function returning empty union.

Treat empty struct/union in return type as void for MCU ABI. PR26438.

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

llvm-svn: 260510

8 years agoDon't propagate dereferenceable attribute through gc.relocate in InstCombine
Artur Pilipenko [Thu, 11 Feb 2016 11:22:46 +0000 (11:22 +0000)]
Don't propagate dereferenceable attribute through gc.relocate in InstCombine

Reviewed By: reames

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

llvm-svn: 260509

8 years ago[ELF] - Remove R_X86_64_GOTTPOFF from static relocation processing
George Rimar [Thu, 11 Feb 2016 11:14:46 +0000 (11:14 +0000)]
[ELF] - Remove R_X86_64_GOTTPOFF from static relocation processing

R_X86_64_TPOFF64 is a dynamic relocation,
it should not appear in static relocation processing.
Patch fixes it.

Differential revision: http://reviews.llvm.org/D16880

llvm-svn: 260508

8 years ago[X86] Enable the LEA optimization pass by default.
Andrey Turetskiy [Thu, 11 Feb 2016 10:51:26 +0000 (10:51 +0000)]
[X86] Enable the LEA optimization pass by default.

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

llvm-svn: 260507

8 years agoUpdate of "GCC extensions not implemented yet" in Clang User's Manual
Andrey Bokhanko [Thu, 11 Feb 2016 10:36:06 +0000 (10:36 +0000)]
Update of "GCC extensions not implemented yet" in Clang User's Manual

#pragma weak, global register variables and static initialization of flexible
array members are supported now, so they are removed from "GCC extensions not
implemented yet" list.

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

llvm-svn: 260506

8 years ago[clang-tidy] Fix an assert failure in 'readability-braces-around-statements' check.
Haojian Wu [Thu, 11 Feb 2016 09:57:55 +0000 (09:57 +0000)]
[clang-tidy] Fix an assert failure in 'readability-braces-around-statements' check.

Summary:
The check will trigger a assert failure("CondEndLoc.isValid") when
checking the IfStmt whose condition expression is not parsed.

In this case, we should ignore that.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 260505

8 years agoFixed typo in comment & coding style for LoopVersioningLICM.
Ashutosh Nema [Thu, 11 Feb 2016 09:23:53 +0000 (09:23 +0000)]
Fixed typo in comment & coding style for LoopVersioningLICM.

llvm-svn: 260504

8 years ago[clang-tidy] Add a check to find unintended semicolons that changes the semantics.
Gabor Horvath [Thu, 11 Feb 2016 09:23:33 +0000 (09:23 +0000)]
[clang-tidy] Add a check to find unintended semicolons that changes the semantics.

Reviewers: hokein, alexfh

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

llvm-svn: 260503

8 years ago[TableGen] Use range-based for loops. NFC
Craig Topper [Thu, 11 Feb 2016 07:39:29 +0000 (07:39 +0000)]
[TableGen] Use range-based for loops. NFC

llvm-svn: 260502

8 years ago[TableGen] Don't call emitSourceFileHeader a second time in the middle of the output...
Craig Topper [Thu, 11 Feb 2016 07:39:27 +0000 (07:39 +0000)]
[TableGen] Don't call emitSourceFileHeader a second time in the middle of the output file.

llvm-svn: 260501

8 years ago[TableGen] Whitespace cleanup in output file. NFC
Craig Topper [Thu, 11 Feb 2016 07:39:25 +0000 (07:39 +0000)]
[TableGen] Whitespace cleanup in output file. NFC

llvm-svn: 260500

8 years ago[TableGen] Simplify code slightly. NFC
Craig Topper [Thu, 11 Feb 2016 07:39:22 +0000 (07:39 +0000)]
[TableGen] Simplify code slightly. NFC

llvm-svn: 260499

8 years ago[MC][ELF] Handle MIPS specific .sdata and .sbss directives
Simon Atanasyan [Thu, 11 Feb 2016 06:45:54 +0000 (06:45 +0000)]
[MC][ELF] Handle MIPS specific .sdata and .sbss directives

MIPS specific .sdata and .sbss directives create corresponding sections
with proper initialized ELF flags including ELF::SHF_MIPS_GPREL.

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

llvm-svn: 260498

8 years agoclang-format: Make it more expensive to break template parameters.
Daniel Jasper [Thu, 11 Feb 2016 06:43:01 +0000 (06:43 +0000)]
clang-format: Make it more expensive to break template parameters.

In particular, make it more expensive than breaking after the return
type of a function definition/declaration.

Before:
  template <typename T>
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa<
      T>::aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);

After:
  template <typename T>
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  aaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);

llvm-svn: 260497

8 years ago[Objective-c] Stop attaching section "datacoal_nt" to global variables.
Akira Hatanaka [Thu, 11 Feb 2016 06:36:35 +0000 (06:36 +0000)]
[Objective-c] Stop attaching section "datacoal_nt" to global variables.

The current macho linker just copies symbols in section datacoal_nt to
section data, so it doesn't really matter whether or not section
"datacoal_nt" is attached to the global variable.

This is a follow-up to r250370, which made changes in llvm to stop
putting functions and data in the *coal* sections.

rdar://problem/24528611

llvm-svn: 260496

8 years agoAMDGPU: Fix constant bus use check with subregisters
Matt Arsenault [Thu, 11 Feb 2016 06:15:39 +0000 (06:15 +0000)]
AMDGPU: Fix constant bus use check with subregisters

If the two operands to an instruction were both
subregisters of the same super register, it would incorrectly
think this counted as the same constant bus use.

This fixes the verifier error in fmin_legacy.ll which
was missing -verify-machineinstrs.

llvm-svn: 260495

8 years agoAMDGPU: Fix passes depending on dominator tree for no reason
Matt Arsenault [Thu, 11 Feb 2016 06:15:34 +0000 (06:15 +0000)]
AMDGPU: Fix passes depending on dominator tree for no reason

llvm-svn: 260494

8 years agoAMDGPU: Remove some old intrinsic uses from tests
Matt Arsenault [Thu, 11 Feb 2016 06:02:01 +0000 (06:02 +0000)]
AMDGPU: Remove some old intrinsic uses from tests

llvm-svn: 260493

8 years ago[OPENMP] Rename OMPCapturedFieldDecl to OMPCapturedExprDecl, NFC.
Alexey Bataev [Thu, 11 Feb 2016 05:35:55 +0000 (05:35 +0000)]
[OPENMP] Rename OMPCapturedFieldDecl to OMPCapturedExprDecl, NFC.
OMPCapturedExprDecl allows caopturing not only of fielddecls, but also
other expressions. It also allows to simplify codegen for several
clauses.

llvm-svn: 260492

8 years agoAMDGPU: Fix not handling new workitem intrinsics in DivergenceAnalysis
Matt Arsenault [Thu, 11 Feb 2016 05:32:51 +0000 (05:32 +0000)]
AMDGPU: Fix not handling new workitem intrinsics in DivergenceAnalysis

llvm-svn: 260491

8 years agoAMDGPU: Split R600 and SI store lowering
Matt Arsenault [Thu, 11 Feb 2016 05:32:46 +0000 (05:32 +0000)]
AMDGPU: Split R600 and SI store lowering

These were only sharing some somewhat incorrect
logic for when to scalarize or split vectors.

llvm-svn: 260490

8 years ago[readobj] Dump DT_JMPREL relocations when outputting dynamic relocations.
Michael J. Spencer [Thu, 11 Feb 2016 04:59:53 +0000 (04:59 +0000)]
[readobj] Dump DT_JMPREL relocations when outputting dynamic relocations.

llvm-svn: 260489

8 years ago[readobj] Handle ELF files with no section table or with no program headers.
Michael J. Spencer [Thu, 11 Feb 2016 04:59:45 +0000 (04:59 +0000)]
[readobj] Handle ELF files with no section table or with no program headers.

This adds support for finding the dynamic table and dynamic symbol table via
the section table or the program header table. If there's no section table an
attempt is made to figure out the length of the dynamic symbol table.

llvm-svn: 260488

8 years ago[readobj] Move dynamic table parsing to a new function. NFC.
Michael J. Spencer [Thu, 11 Feb 2016 04:59:37 +0000 (04:59 +0000)]
[readobj] Move dynamic table parsing to a new function. NFC.

llvm-svn: 260487

8 years ago[readobj] Sort switch by enum value.
Michael J. Spencer [Thu, 11 Feb 2016 04:59:32 +0000 (04:59 +0000)]
[readobj] Sort switch by enum value.

Sort by enum value, but keep related entries adjacent. This makes it
easier to compare against documentation.

llvm-svn: 260486

8 years ago[readobj] Parse sections before dynamic table.
Michael J. Spencer [Thu, 11 Feb 2016 04:59:26 +0000 (04:59 +0000)]
[readobj] Parse sections before dynamic table.

NFC. This code will be expanded to handle dynamic tables that don't have a
PT_DYNAMIC.

llvm-svn: 260485

8 years agoFix const confusion while lambda function usage
Hemant Kulkarni [Thu, 11 Feb 2016 03:41:34 +0000 (03:41 +0000)]
Fix const confusion while lambda function usage

llvm-svn: 260484

8 years ago[AMDGPU] Assembler: Fix VOP3 only instructions
Tom Stellard [Thu, 11 Feb 2016 03:28:15 +0000 (03:28 +0000)]
[AMDGPU] Assembler: Fix VOP3 only instructions

Separate methods to convert parsed instructions to MCInst:

  - VOP3 only instructions (always create modifiers as operands in MCInst)
  - VOP2 instrunctions with modifiers (create modifiers as operands
    in MCInst when e64 encoding is forced or modifiers are parsed)
  - VOP2 instructions without modifiers (do not create modifiers
    as operands in MCInst)
  - Add VOP3Only flag. Pass HasMods flag to VOP3Common.
  - Simplify code that deals with modifiers (-1 is now same as
    0). This is no longer needed.
  - Add few tests (more will be added separately).
    Update error message now correct.

Patch By: Nikolay Haustov

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

llvm-svn: 260483

8 years ago[llvm-nm] Simplify code logic. Rewrite a single function an inline.
Davide Italiano [Thu, 11 Feb 2016 02:56:02 +0000 (02:56 +0000)]
[llvm-nm] Simplify code logic. Rewrite a single function an inline.

llvm-svn: 260482

8 years agoUn-XFAIL a passing test on Windows
Reid Kleckner [Thu, 11 Feb 2016 02:02:56 +0000 (02:02 +0000)]
Un-XFAIL a passing test on Windows

llvm-svn: 260481

8 years agoMove mmap_limit_mp test to Posix
Reid Kleckner [Thu, 11 Feb 2016 02:02:52 +0000 (02:02 +0000)]
Move mmap_limit_mp test to Posix

This test isn't posix specific, but it doesn't pass on Windows and is
XFAILed. I suspect that this test, which is expected to fail, is causing
the hangs I'm seeing on our WinASan builder.  Moving it to Posix seems
to be the cleanest way to avoid running it on Windows.

llvm-svn: 260480

8 years ago[CUDA] Don't crash when trying to printf a non-scalar object.
Justin Lebar [Thu, 11 Feb 2016 02:00:52 +0000 (02:00 +0000)]
[CUDA] Don't crash when trying to printf a non-scalar object.

Summary:
We can't do the right thing, since there's no right thing to do, but at
least we can not crash the compiler.

Reviewers: majnemer, rnk

Subscribers: cfe-commits, jhen, tra

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

llvm-svn: 260479

8 years agoRemove unused ToolChain arg from Driver::ConstructPhaseAction and BuildAction.
Justin Lebar [Thu, 11 Feb 2016 02:00:50 +0000 (02:00 +0000)]
Remove unused ToolChain arg from Driver::ConstructPhaseAction and BuildAction.

Summary:
Actions don't depend on the toolchain; they get bound to a particular
toolchain via BindArch.

No functional changes.

Reviewers: echristo

Subscribers: cfe-commits

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

llvm-svn: 260478

8 years agoELF: Sort .[cd]tors by priority as we do for .{init,fini}_array.
Rui Ueyama [Thu, 11 Feb 2016 01:07:19 +0000 (01:07 +0000)]
ELF: Sort .[cd]tors by priority as we do for .{init,fini}_array.

llvm-svn: 260477

8 years agoReduce code repetition. NFC.
Rui Ueyama [Thu, 11 Feb 2016 01:07:18 +0000 (01:07 +0000)]
Reduce code repetition. NFC.

llvm-svn: 260476

8 years agoSilence MSVC warning about non-void prototypes
Reid Kleckner [Thu, 11 Feb 2016 00:22:43 +0000 (00:22 +0000)]
Silence MSVC warning about non-void prototypes

It thinks that these functions don't match the function pointer type
that they are passed with:

GCDAProfiling.c(578) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'
GCDAProfiling.c(579) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'
GCDAProfiling.c(580) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'

llvm-svn: 260475

8 years ago[GlobalISel][MachineRegisterInfo] Add a method to create generic vregs.
Quentin Colombet [Thu, 11 Feb 2016 00:19:17 +0000 (00:19 +0000)]
[GlobalISel][MachineRegisterInfo] Add a method to create generic vregs.
For now, generic virtual registers will not have a register class. We may want
to change that. For instance, if we want to use all the methods from
TargetRegisterInfo with generic virtual registers, we need to either have some
sort of generic register classes that do what we want, or teach those methods
how to deal with nullptr register class.

Although the latter seems easy enough to do, we may still want to differenciate
generic register classes from nullptr to catch cases where nullptr gets
introduced by a bug of some sort.

Anyway, I will file a PR to keep track of that.

llvm-svn: 260474

8 years ago[asan] Dump adb output on failure.
Evgeniy Stepanov [Thu, 11 Feb 2016 00:16:28 +0000 (00:16 +0000)]
[asan] Dump adb output on failure.

This is an asan/android test harness change aiming to catch
"adb pull" failures on the buildbot.

llvm-svn: 260473

8 years agoFix two tests relying on LLVM -O1 behavior
Reid Kleckner [Thu, 11 Feb 2016 00:14:04 +0000 (00:14 +0000)]
Fix two tests relying on LLVM -O1 behavior

Something changed the inference of nonnull.

llvm-svn: 260472

8 years agoFix build failure caused in r260430
Hemant Kulkarni [Thu, 11 Feb 2016 00:01:47 +0000 (00:01 +0000)]
Fix build failure caused in r260430

llvm-svn: 260471

8 years ago[llvm-nm] Minor style change. Prefer EXIT_SUCCESS over 0.
Davide Italiano [Wed, 10 Feb 2016 23:56:18 +0000 (23:56 +0000)]
[llvm-nm] Minor style change. Prefer EXIT_SUCCESS over 0.

llvm-svn: 260470

8 years agoFix Windows bot failure in Transforms/FunctionImport/funcimport.ll
Teresa Johnson [Wed, 10 Feb 2016 23:47:38 +0000 (23:47 +0000)]
Fix Windows bot failure in Transforms/FunctionImport/funcimport.ll

Make sure we split ":" from the end of the global function id (which
is <path>:<function> for local functions) instead of the beginning to
avoid splitting at the wrong place for Windows file paths that contain
a ":".

llvm-svn: 260469

8 years ago[GlobalISel] Remember the size of generic virtual registers
Quentin Colombet [Wed, 10 Feb 2016 23:43:48 +0000 (23:43 +0000)]
[GlobalISel] Remember the size of generic virtual registers

llvm-svn: 260468

8 years agoReorder code to improve readability. NFC.
Rui Ueyama [Wed, 10 Feb 2016 23:43:16 +0000 (23:43 +0000)]
Reorder code to improve readability. NFC.

llvm-svn: 260467

8 years agoFunctionImport: add a progressive heuristic to limit importing too deep in the callgraph
Mehdi Amini [Wed, 10 Feb 2016 23:31:45 +0000 (23:31 +0000)]
FunctionImport: add a progressive heuristic to limit importing too deep in the callgraph

The current function importer will walk the callgraph, importing
transitively any callee that is below the threshold. This can
lead to import very deep which is costly in compile time and not
necessarily beneficial as most of the inline would happen in
imported function and not necessarilly in user code.

The actual factor has been carefully chosen by flipping a coin ;)
Some tuning need to be done (just at the existing limiting threshold).

Reviewers: tejohnson

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 260466

8 years agoDon't include NOBITS TLS in PT_LOAD.
Rafael Espindola [Wed, 10 Feb 2016 23:29:38 +0000 (23:29 +0000)]
Don't include NOBITS TLS in PT_LOAD.

They don't count for the memory or file size, so this is mostly just a
simplification.

The only noticeable difference should be fewer empty program headers.

llvm-svn: 260465

8 years agoMake llvm-nm test consistent with other tests
Hemant Kulkarni [Wed, 10 Feb 2016 23:28:43 +0000 (23:28 +0000)]
Make llvm-nm test consistent with other tests

llvm-svn: 260464

8 years agoELF: Use stable sort to sort .{init,fini}_array sections.
Rui Ueyama [Wed, 10 Feb 2016 23:26:27 +0000 (23:26 +0000)]
ELF: Use stable sort to sort .{init,fini}_array sections.

Global constructors and destructors are guaranteed to be called
in the order as they appear in a translation unit. So we don't want
to mess up the order if they have the same priority.

llvm-svn: 260463

8 years agoUse a StringSet in Internalize, and allow to create the pass from an existing one...
Mehdi Amini [Wed, 10 Feb 2016 23:24:31 +0000 (23:24 +0000)]
Use a StringSet in Internalize, and allow to create the pass from an existing one (NFC)

There is not reason to pass an array of "char *" to rebuild a set if
the client already has one.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 260462

8 years agoAdd the ability to initialize a StringSet from a pair of iterators (NFC)
Mehdi Amini [Wed, 10 Feb 2016 23:24:21 +0000 (23:24 +0000)]
Add the ability to initialize a StringSet from a pair of iterators (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 260461

8 years agoELF: Implement __attribute__((init_priority(N)) support.
Rui Ueyama [Wed, 10 Feb 2016 23:20:42 +0000 (23:20 +0000)]
ELF: Implement __attribute__((init_priority(N)) support.

llvm-svn: 260460

8 years ago[llvm-nm] Prefer range-based loop over explicit iterator.
Davide Italiano [Wed, 10 Feb 2016 23:16:17 +0000 (23:16 +0000)]
[llvm-nm] Prefer range-based loop over explicit iterator.

llvm-svn: 260459

8 years agoAdd a new insert_as() method to DenseMap and use it for ConstantUniqueMap
Mehdi Amini [Wed, 10 Feb 2016 23:07:29 +0000 (23:07 +0000)]
Add a new insert_as() method to DenseMap and use it for ConstantUniqueMap

Summary:
Just like the existing find_as() method, the new insert_as() accepts
an extra parameter which is used as a key to find the bucket in the
map.
When creating a Constant, we want to check the map before actually
creating the object. In this case we have to perform two queries to
the map, and this extra parameter can save recomputing the hash value
for the second query.

Reviewers: dexonsmith, chandlerc

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 260458

8 years ago[CMake] Add a macro definition to detect if we are building GlobalISel:
Quentin Colombet [Wed, 10 Feb 2016 23:00:57 +0000 (23:00 +0000)]
[CMake] Add a macro definition to detect if we are building GlobalISel:
LLVM_BUILD_GLOBAL_ISEL

llvm-svn: 260457

8 years ago[GlobalISel] More detailed skeleton for the IRTranslator.
Quentin Colombet [Wed, 10 Feb 2016 22:59:27 +0000 (22:59 +0000)]
[GlobalISel] More detailed skeleton for the IRTranslator.

llvm-svn: 260456

8 years agoBitcode reader: replace DecodeChar6() with a lookup table (NFC)
Mehdi Amini [Wed, 10 Feb 2016 22:47:48 +0000 (22:47 +0000)]
Bitcode reader: replace DecodeChar6() with a lookup table (NFC)

Summary: Measured to be more performant when reading bitcode.

Reviewers: rafael, dexonsmith

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 260455

8 years agoSimplify handleOperandChangeImpl() removing last argument (NFC)
Mehdi Amini [Wed, 10 Feb 2016 22:47:15 +0000 (22:47 +0000)]
Simplify handleOperandChangeImpl() removing last argument (NFC)

The Use argument was used to compute the operand number for a fast
path when replacing only one operand. However we always have to go
through all the operands. So the argument number can be recomputed
locally anyway.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 260454

8 years agoSplit the creation of program headers in a few steps.
Rafael Espindola [Wed, 10 Feb 2016 22:43:13 +0000 (22:43 +0000)]
Split the creation of program headers in a few steps.

IMHO this makes the code easier to read and should help with linker
scripts.

This is strongly based on D16575. The main differences are:

We record a range of sections, not every section in a program header.

scanHeaders takes case of deciding what goes in every program header,
including PT_GNU_RELRO

We create dummy sections for the start of the file

With this, program header creation has 3 isolated stages:

Map sections to program headers.
Assign addresses to *sections*
Looking at sections find the address and size of each program header.

Thanks to George Rimar for the initial version.

llvm-svn: 260453