platform/upstream/llvm.git
10 years agoUse an enum class now that they are available.
Rafael Espindola [Tue, 10 Jun 2014 19:08:21 +0000 (19:08 +0000)]
Use an enum class now that they are available.

llvm-svn: 210566

10 years agoObjective-C. Don't ignore availability attribute when
Fariborz Jahanian [Tue, 10 Jun 2014 19:02:48 +0000 (19:02 +0000)]
Objective-C. Don't ignore availability attribute when
doing Objective-C subscript access. // rdar://16842487
PR19682.

llvm-svn: 210565

10 years agoR600: Handle fcopysign
Matt Arsenault [Tue, 10 Jun 2014 19:00:20 +0000 (19:00 +0000)]
R600: Handle fcopysign

llvm-svn: 210564

10 years agoR600/SI: Handle sign_extend and zero_extend to i64 with patterns.
Matt Arsenault [Tue, 10 Jun 2014 18:54:59 +0000 (18:54 +0000)]
R600/SI: Handle sign_extend and zero_extend to i64 with patterns.

llvm-svn: 210563

10 years agoMark assign to be constepr only in c++14; can't have constexpr fns that return void...
Marshall Clow [Tue, 10 Jun 2014 18:52:57 +0000 (18:52 +0000)]
Mark assign to be constepr only in c++14; can't have constexpr fns that return void in C++11

llvm-svn: 210562

10 years agoMake the helper routines in string really be constexpr. This required a bit of refaco...
Marshall Clow [Tue, 10 Jun 2014 18:51:55 +0000 (18:51 +0000)]
Make the helper routines in string really be constexpr. This required a bit of refacoring in algorithm as well. Give them better names while we're at it. All of these are internal rotines; no visible functionality change.

llvm-svn: 210561

10 years agoA bunch of the char.traits tests were using unicode literals. #ifdef those bits out...
Marshall Clow [Tue, 10 Jun 2014 18:46:59 +0000 (18:46 +0000)]
A bunch of the char.traits tests were using unicode literals. #ifdef those bits out on c++03, since it doesn't support u"" and U "" style strings.

llvm-svn: 210560

10 years agoAdd a FIXME.
Eric Christopher [Tue, 10 Jun 2014 18:31:18 +0000 (18:31 +0000)]
Add a FIXME.

llvm-svn: 210559

10 years agoUpdate Arcanist config to point to reviews.llvm.org
David Blaikie [Tue, 10 Jun 2014 18:29:36 +0000 (18:29 +0000)]
Update Arcanist config to point to reviews.llvm.org

llvm-svn: 210558

10 years agoMove AArch64SelectionDAGInfo down to the subtarget.
Eric Christopher [Tue, 10 Jun 2014 18:21:53 +0000 (18:21 +0000)]
Move AArch64SelectionDAGInfo down to the subtarget.

llvm-svn: 210557

10 years ago[FastISel] Collect statistics about failing intrinsic calls.
Juergen Ributzka [Tue, 10 Jun 2014 18:17:00 +0000 (18:17 +0000)]
[FastISel] Collect statistics about failing intrinsic calls.

Add more instruction-specific statistics about failing intrinsic calls during
FastISel.

llvm-svn: 210556

10 years agoRemove the cached little endian variable. We can get it easily off
Eric Christopher [Tue, 10 Jun 2014 18:11:20 +0000 (18:11 +0000)]
Remove the cached little endian variable. We can get it easily off
of the DataLayout.

llvm-svn: 210555

10 years agoHave AArch64SelectionDAGInfo take a DataLayout parameter rather
Eric Christopher [Tue, 10 Jun 2014 18:06:28 +0000 (18:06 +0000)]
Have AArch64SelectionDAGInfo take a DataLayout parameter rather
than a TargetMachine.

llvm-svn: 210554

10 years agoRemove caching of the subtarget for AArch64SelectionDAGInfo.
Eric Christopher [Tue, 10 Jun 2014 18:06:25 +0000 (18:06 +0000)]
Remove caching of the subtarget for AArch64SelectionDAGInfo.

llvm-svn: 210553

10 years agoMove DataLayout onto the AArch64 subtarget.
Eric Christopher [Tue, 10 Jun 2014 18:06:23 +0000 (18:06 +0000)]
Move DataLayout onto the AArch64 subtarget.

llvm-svn: 210552

10 years agoTest commit, wraps some lines to fit in 80 columns.
Zachary Turner [Tue, 10 Jun 2014 18:03:04 +0000 (18:03 +0000)]
Test commit, wraps some lines to fit in 80 columns.

llvm-svn: 210551

10 years agoDon't inherit dll attributes to deleted methods (PR19988)
Hans Wennborg [Tue, 10 Jun 2014 17:53:23 +0000 (17:53 +0000)]
Don't inherit dll attributes to deleted methods (PR19988)

We would previously end up with an error when instantiating the
following template:

  template <typename> struct __declspec(dllimport) S {
    void foo() = delete;
  };
  S<int> s;

error: attribute 'dllimport' cannot be applied to a deleted function
llvm-svn: 210550

10 years agoMove AArch64FrameLowering into the subtarget.
Eric Christopher [Tue, 10 Jun 2014 17:44:12 +0000 (17:44 +0000)]
Move AArch64FrameLowering into the subtarget.

llvm-svn: 210549

10 years agoRemove the uses of AArch64TargetMachine and AArch64Subtarget from
Eric Christopher [Tue, 10 Jun 2014 17:33:39 +0000 (17:33 +0000)]
Remove the uses of AArch64TargetMachine and AArch64Subtarget from
AArch64FrameLowering.

llvm-svn: 210548

10 years agoObjective-C IRGen. Patch to generate a weak symbol reference when
Fariborz Jahanian [Tue, 10 Jun 2014 17:08:04 +0000 (17:08 +0000)]
Objective-C IRGen. Patch to generate a weak symbol reference when
'super' dispatches a class method in category for OBJC_METACLASS.
This is when class is a weak_import class.
// rdar://16529125

llvm-svn: 210547

10 years agoDo Materialize Floating Point in Mips Fast-Isel
Reed Kotler [Tue, 10 Jun 2014 16:45:44 +0000 (16:45 +0000)]
Do Materialize Floating Point in Mips Fast-Isel

Summary:
Implement materialize of floating point literals in Mips Fast-Isel

Reopened version of D3659

Test Plan: simplestorefp1.ll

Reviewers: dsanders

Reviewed By: dsanders

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

llvm-svn: 210546

10 years ago[X86] Improved target combine rules for selecting horizontal add/sub.
Andrea Di Biagio [Tue, 10 Jun 2014 16:42:57 +0000 (16:42 +0000)]
[X86] Improved target combine rules for selecting horizontal add/sub.

This patch slightly changes the algorithm introduced at revision 210477
to fix a problem where the algorithm was producing incorrect code for
the VEX.256 encoded versions of horizontal add/sub.

For these cases, we now try to split the two 256-bit vectors into
128-bit chunks before emitting horizontal add/sub dag nodes.

Added a new test case into haddsub-2.ll.

llvm-svn: 210545

10 years agoHexagon: Expand i1 SELECT_CC
Tom Stellard [Tue, 10 Jun 2014 16:42:41 +0000 (16:42 +0000)]
Hexagon: Expand i1 SELECT_CC

il is legal for Hexagon, so I should have marked this as Expand for
SELECT_CC when I removed setOperationAction(ISD::SELECT_CC, MVT::Other,
Expand); in r210541.

llvm-svn: 210544

10 years ago[X86] AVX512: Add vmovntdqa
Adam Nemet [Tue, 10 Jun 2014 16:39:53 +0000 (16:39 +0000)]
[X86] AVX512: Add vmovntdqa

Along with the corresponding intrinsic and tests.

llvm-svn: 210543

10 years agoFix a bug in the Thumb1 ARM Load/Store optimizer
Renato Golin [Tue, 10 Jun 2014 16:39:21 +0000 (16:39 +0000)]
Fix a bug in the Thumb1 ARM Load/Store optimizer

Previously, the basic block was searched for future uses of the base register,
and if necessary any writeback to the base register was reset using a SUB
instruction (e.g. before calling a function) just before such a use. However,
this step happened *before* the merged LDM/STM instruction was built. So if
there was (e.g.) a function call directly after the not-yet-formed LDM/STM,
the pass would first insert a SUB instruction to reset the base register,
and then (at the same location, incorrectly) insert the LDM/STM itself.

This patch fixes PR19972. Patch by Moritz Roth.

llvm-svn: 210542

10 years agoSelectionDAG: Don't use MVT::Other to determine legality of ISD::SELECT_CC
Tom Stellard [Tue, 10 Jun 2014 16:01:29 +0000 (16:01 +0000)]
SelectionDAG: Don't use MVT::Other to determine legality of ISD::SELECT_CC

The SelectionDAG bad a special case for ISD::SELECT_CC, where it would
allow targets to specify:

setOperationAction(ISD::SELECT_CC, MVT::Other, Expand);

to indicate that they wanted to expand ISD::SELECT_CC for all types.
This wasn't applied correctly everywhere, and it makes writing new
DAG patterns with ISD::SELECT_CC difficult.

llvm-svn: 210541

10 years agoSelectionDAG: Enable (and (setcc x), (setcc y)) -> (setcc (and x, y)) for vectors
Tom Stellard [Tue, 10 Jun 2014 16:01:25 +0000 (16:01 +0000)]
SelectionDAG: Enable (and (setcc x), (setcc y)) -> (setcc (and x, y)) for vectors

This prevents a future commit from regressing:

test/CodeGen/R600/setcc-equivalent.ll

llvm-svn: 210540

10 years agoSelectionDAG: Expand SELECT_CC to SELECT + SETCC
Tom Stellard [Tue, 10 Jun 2014 16:01:22 +0000 (16:01 +0000)]
SelectionDAG: Expand SELECT_CC to SELECT + SETCC

This consolidates code from the Hexagon, R600, and XCore targets.

No functionality change intended.

llvm-svn: 210539

10 years agoTest delinearization of 2D diagonal matrix
Tobias Grosser [Tue, 10 Jun 2014 14:48:17 +0000 (14:48 +0000)]
Test delinearization of 2D diagonal matrix

llvm-svn: 210538

10 years agoclang-format: [JS] Treat dict literals similar to objc method exprs.
Daniel Jasper [Tue, 10 Jun 2014 14:44:02 +0000 (14:44 +0000)]
clang-format: [JS] Treat dict literals similar to objc method exprs.

Before:
  return {
    link:
        function() {
          f();  //
        }
        };
  return {
    a: a,
    link: function() {
      f();  //
    }
  }

After:
  return {
    link: function() {
      f();  //
    }
  };
  return {
    a: a,
    link: function() {
      f();  //
    }
  };

llvm-svn: 210537

10 years ago[PPC64LE] Recognize shufflevector patterns for little endian
Bill Schmidt [Tue, 10 Jun 2014 14:35:01 +0000 (14:35 +0000)]
[PPC64LE] Recognize shufflevector patterns for little endian

Various masks on shufflevector instructions are recognizable as
specific PowerPC instructions (vector pack, vector merge, etc.).
There is existing code in PPCISelLowering.cpp to recognize the correct
patterns for big endian code.  The masks for these instructions are
different for little endian code due to the big-endian numbering
employed by these instructions.  This patch adds the recognition code
for little endian.

I've added a new test case test/CodeGen/PowerPC/vec_shuffle_le.ll for
this.  The existing recognizer test (vec_shuffle.ll) is unnecessarily
verbose and difficult to read, so I felt it was better to add a new
test rather than modify the old one.

llvm-svn: 210536

10 years ago[AArch64] Emit .ident compiler version attribute.
Chad Rosier [Tue, 10 Jun 2014 14:32:08 +0000 (14:32 +0000)]
[AArch64] Emit .ident compiler version attribute.
Patch by Ana Pazos<apazos@codeaurora.org>!

llvm-svn: 210535

10 years agoAdd detection of OS X relocatable SDK to compiler-rt as a lit.util function
Alexander Potapenko [Tue, 10 Jun 2014 14:22:00 +0000 (14:22 +0000)]
Add detection of OS X relocatable SDK to compiler-rt as a lit.util function

Clang's lit cfg already detects the currently selected SDK via
"xcrun --show-sdk-path". The same thing should be done for compiler-rt tests,
to make them work on recent OS X versions. Instead of duplicating the detection
code, this patch extracts the detection function into a lit.util method.

Patch by Kuba Brecka (kuba.brecka@gmail.com),
reviewed at http://reviews.llvm.org/D4072

llvm-svn: 210534

10 years ago[sanitizer] Relax sanity checks in ioctl decoding.
Evgeniy Stepanov [Tue, 10 Jun 2014 13:54:15 +0000 (13:54 +0000)]
[sanitizer] Relax sanity checks in ioctl decoding.

Standard KVM ioctls don't pass currect ioctl_decode().

llvm-svn: 210533

10 years ago[ReaderWriter] Simplify initialization of class fields.
Simon Atanasyan [Tue, 10 Jun 2014 13:43:24 +0000 (13:43 +0000)]
[ReaderWriter] Simplify initialization of class fields.

No functional changes.

llvm-svn: 210532

10 years ago[ELF] Fix typo in the type name of the range-based loop item.
Simon Atanasyan [Tue, 10 Jun 2014 13:43:19 +0000 (13:43 +0000)]
[ELF] Fix typo in the type name of the range-based loop item.

No functional changes.

llvm-svn: 210531

10 years ago[ELF] Fix the bug -- LLD crashes if the --whole-archive option
Simon Atanasyan [Tue, 10 Jun 2014 13:43:13 +0000 (13:43 +0000)]
[ELF] Fix the bug -- LLD crashes if the --whole-archive option
is around non-archive.

llvm-svn: 210530

10 years agoclang-format: Increase penalty for wrapping array subscript expressions
Daniel Jasper [Tue, 10 Jun 2014 13:27:57 +0000 (13:27 +0000)]
clang-format: Increase penalty for wrapping array subscript expressions

Before:
  aaaaaaaaaaa aaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaa->aaaaaaaaa[0].aaaaaaa
                                    [0].aaaaaaaaaaaaaaaaaaaaaa();

After:
  aaaaaaaaaaa aaaaaaaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaa->aaaaaaaaa[0]
                                    .aaaaaaa[0]
                                    .aaaaaaaaaaaaaaaaaaaaaa();

llvm-svn: 210529

10 years agoCondition codes AL and NV are invalid in the aliases that use
Artyom Skrobov [Tue, 10 Jun 2014 13:11:35 +0000 (13:11 +0000)]
Condition codes AL and NV are invalid in the aliases that use
inverted condition codes (CINC, CINV, CNEG, CSET, and CSETM).

Matching aliases based on "immediate classes", when disassembling,
wasn't previously supported, hence adding MCOperandPredicate
into class Operand, and implementing the support for it
in AsmWriterEmitter.

The parsing for those aliases was already custom, so just adding
the missing condition into AArch64AsmParser::parseCondCode.

llvm-svn: 210528

10 years agoRefactoring in AsmWriterEmitter::EmitPrintAliasInstruction()
Artyom Skrobov [Tue, 10 Jun 2014 12:47:23 +0000 (12:47 +0000)]
Refactoring in AsmWriterEmitter::EmitPrintAliasInstruction()

llvm-svn: 210527

10 years agoAnonymous definitions in foreach blocks triggered a 'def already exists'
Artyom Skrobov [Tue, 10 Jun 2014 12:41:14 +0000 (12:41 +0000)]
Anonymous definitions in foreach blocks triggered a 'def already exists'

llvm-svn: 210526

10 years agoAArch64: disallow x30 & x29 as the destination for indirect tail calls
Tim Northover [Tue, 10 Jun 2014 10:50:24 +0000 (10:50 +0000)]
AArch64: disallow x30 & x29 as the destination for indirect tail calls

As Ana Pazos pointed out, these have to be restored to their incoming values
before a function returns; i.e. before the tail call. So they can't be used
correctly as the destination register.

llvm-svn: 210525

10 years agoRevert "X86: elide comparisons after cmpxchg instructions."
Tim Northover [Tue, 10 Jun 2014 10:50:11 +0000 (10:50 +0000)]
Revert "X86: elide comparisons after cmpxchg instructions."

This reverts commit r210523. It was committed prematurely without waiting for
review.

llvm-svn: 210524

10 years agoX86: elide comparisons after cmpxchg instructions.
Tim Northover [Tue, 10 Jun 2014 10:49:07 +0000 (10:49 +0000)]
X86: elide comparisons after cmpxchg instructions.

The C++ and C semantics of the compare_and_swap operations actually
require us to return a boolean "success" value. In LLVM terms this
means a second comparison of the output of "cmpxchg" against the input
desired value.

However, x86's "cmpxchg" instruction sets all flags for the comparison
formed, so we can skip any secondary comparison. (N.b. this isn't true
for cmpxchg8b/16b, which only set ZF).

rdar://problem/13201607

llvm-svn: 210523

10 years agoclang-format: Fix enum formatting with specific comment.
Daniel Jasper [Tue, 10 Jun 2014 10:42:26 +0000 (10:42 +0000)]
clang-format: Fix enum formatting with specific comment.

Before:
  enum Fruit {  //
    APPLE,
    PEAR };

After:
  enum Fruit {  //
    APPLE,
    PEAR
  };

llvm-svn: 210522

10 years agoProspective build fix following clang r210518
Alp Toker [Tue, 10 Jun 2014 09:58:45 +0000 (09:58 +0000)]
Prospective build fix following clang r210518

llvm-svn: 210521

10 years agoAArch64: teach FastISel how to handle offset FrameIndices
Tim Northover [Tue, 10 Jun 2014 09:52:44 +0000 (09:52 +0000)]
AArch64: teach FastISel how to handle offset FrameIndices

Previously we were abandonning the attempt, leading to some combination of
extra work (when selection of a load/store fails completely) and inferior code
(when this leads to a real memcpy call instead of inlining).

rdar://problem/17187463

llvm-svn: 210520

10 years agoAArch64: make FastISel memcpy emission more robust.
Tim Northover [Tue, 10 Jun 2014 09:52:40 +0000 (09:52 +0000)]
AArch64: make FastISel memcpy emission more robust.

We were hitting an assert if FastISel couldn't create the load or store we
requested. Currently this happens for large frame-local addresses, though
CodeGen could be improved there.

rdar://problem/17187463

llvm-svn: 210519

10 years agoImprove diagnostic mapping terminology
Alp Toker [Tue, 10 Jun 2014 09:31:37 +0000 (09:31 +0000)]
Improve diagnostic mapping terminology

Diagnostic mappings are used to calculate the final severity of diagnostic
instances.

Detangle the implementation to reflect the terminology used in documentation
and bindings.

No change in functionality.

llvm-svn: 210518

10 years ago[asan] Disable a flaky test.
Evgeniy Stepanov [Tue, 10 Jun 2014 08:32:01 +0000 (08:32 +0000)]
[asan] Disable a flaky test.

llvm-svn: 210517

10 years agoDelete X86JITInfo in the subtarget destructor.
Eric Christopher [Tue, 10 Jun 2014 08:03:42 +0000 (08:03 +0000)]
Delete X86JITInfo in the subtarget destructor.

llvm-svn: 210516

10 years agoDon't suppress backend diagnostics in system headers
Alp Toker [Tue, 10 Jun 2014 07:03:25 +0000 (07:03 +0000)]
Don't suppress backend diagnostics in system headers

Doing so would be inconsistent with the common fallback case where backend
diagnostics without source locations are emitted unconditionally.

llvm-svn: 210515

10 years agoclang-format: Support variadic lambda captures.
Daniel Jasper [Tue, 10 Jun 2014 06:39:03 +0000 (06:39 +0000)]
clang-format: Support variadic lambda captures.

Before:
  return [ i, args... ]{};

After:
  return [i, args...] {};

llvm-svn: 210514

10 years agoclang-format: Handle multiline strings inside ternary expressions.
Daniel Jasper [Tue, 10 Jun 2014 06:27:23 +0000 (06:27 +0000)]
clang-format: Handle multiline strings inside ternary expressions.

With AlwaysSplitBeforeMultilineStrings, clang-format would not find any
valid solution.

llvm-svn: 210513

10 years agoShow -Wdate-time in system headers
Alp Toker [Tue, 10 Jun 2014 06:09:00 +0000 (06:09 +0000)]
Show -Wdate-time in system headers

Anyone enabling this warning would expect to hear about all occurrences
including those in system headers that can cause non-reproducible builds.

To achieve this, rework ShowInSystemHeader to remove broken unused mapping code
that didn't make sense with a simpler and correct scheme.

llvm-svn: 210512

10 years agoImplement -Wdate-time preprocessor warning
Alp Toker [Tue, 10 Jun 2014 06:08:51 +0000 (06:08 +0000)]
Implement -Wdate-time preprocessor warning

This GCC warning is useful for validating reproducible builds
and might help when tracking down issues with modules too.

llvm-svn: 210511

10 years agoImprove specificity in the diag-mapping2.c test
Alp Toker [Tue, 10 Jun 2014 06:08:41 +0000 (06:08 +0000)]
Improve specificity in the diag-mapping2.c test

Make sure grep catches the correct diagnostic, otherwise this test fails to
detect broken functionality.

llvm-svn: 210510

10 years ago[llvm-readobj][ELF] Factor out the code retrieve ELF symbol information
Simon Atanasyan [Tue, 10 Jun 2014 05:59:15 +0000 (05:59 +0000)]
[llvm-readobj][ELF] Factor out the code retrieve ELF symbol information
(section name, section index, full name) into the separate functions.

No functional changes.

llvm-svn: 210509

10 years agoSimplify code. No functional change.
Craig Topper [Tue, 10 Jun 2014 04:50:50 +0000 (04:50 +0000)]
Simplify code. No functional change.

llvm-svn: 210508

10 years agoSmallVectorTest.cpp: Use LLVM_DELETED_FUNCTION.
NAKAMURA Takumi [Tue, 10 Jun 2014 04:06:56 +0000 (04:06 +0000)]
SmallVectorTest.cpp: Use LLVM_DELETED_FUNCTION.

llvm-svn: 210507

10 years ago[mach-o] refactor mach-o output section selection to be table driven.
Nick Kledzik [Tue, 10 Jun 2014 01:50:00 +0000 (01:50 +0000)]
[mach-o] refactor mach-o output section selection to be table driven.

In -r mode the sections use the table used to parse .o files.  Otherwise
use final exectuable table.  No functionality change.

llvm-svn: 210506

10 years agoImprove checking for dynamic initializers of dllimport fields in template instantiation
Hans Wennborg [Tue, 10 Jun 2014 00:55:51 +0000 (00:55 +0000)]
Improve checking for dynamic initializers of dllimport fields in template instantiation

We would previously assert if the initializer was dependent. I also think that
checking isConstantInitializer is more correct here than checkInitIsICE.

llvm-svn: 210505

10 years ago[ConstantHoisting][X86] Improve the cost model for small constants with large types...
Juergen Ributzka [Tue, 10 Jun 2014 00:32:29 +0000 (00:32 +0000)]
[ConstantHoisting][X86] Improve the cost model for small constants with large types (i64 and above).

This improves the X86 cost model for small constants with large types. Before
this commit we would even hoist trivial constants such as i96 2.

This is related to <rdar://problem/17070936>

llvm-svn: 210504

10 years agoMake '-Werror=frame-larger-than=' and associated diagnostic pragmas GCC-compatible
Alp Toker [Mon, 9 Jun 2014 23:59:38 +0000 (23:59 +0000)]
Make '-Werror=frame-larger-than=' and associated diagnostic pragmas GCC-compatible

It turns out the trailing '=' really is part of the option name spelling and
treating it as such gets us compatible with GCC's -Werror= and pragmas.

(GCC doesn't appear to support any -Wno- form for this diagnostic but we do.)

llvm-svn: 210503

10 years ago[mach-o] parse multiple symbols on same address into aliases
Nick Kledzik [Mon, 9 Jun 2014 23:35:37 +0000 (23:35 +0000)]
[mach-o] parse multiple symbols on same address into aliases

llvm-svn: 210502

10 years agoReorder Value and User fields to save 8 bytes of padding on 64-bit
Reid Kleckner [Mon, 9 Jun 2014 23:32:20 +0000 (23:32 +0000)]
Reorder Value and User fields to save 8 bytes of padding on 64-bit

Reviewered by: rafael

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

llvm-svn: 210501

10 years agoFixed damaged row in issues table; thanks to STL for the catch
Marshall Clow [Mon, 9 Jun 2014 23:27:27 +0000 (23:27 +0000)]
Fixed damaged row in issues table; thanks to STL for the catch

llvm-svn: 210500

10 years agoReduce indentation in ActOnIdExpression, NFC
Reid Kleckner [Mon, 9 Jun 2014 23:16:24 +0000 (23:16 +0000)]
Reduce indentation in ActOnIdExpression, NFC

llvm-svn: 210499

10 years agoRemoving an "if (this == nullptr)" check from two print methods. The condition
Richard Trieu [Mon, 9 Jun 2014 22:53:25 +0000 (22:53 +0000)]
Removing an "if (this == nullptr)" check from two print methods.  The condition
will never be true in a well-defined context.  The checking for null pointers
has been moved into the caller logic so it does not rely on undefined behavior.

llvm-svn: 210498

10 years agoRemoving an "if (!this)" check from two print methods. The condition will
Richard Trieu [Mon, 9 Jun 2014 22:53:16 +0000 (22:53 +0000)]
Removing an "if (!this)" check from two print methods.  The condition will
never be true in a well-defined context.  The checking for null pointers
has been moved into the caller logic so it does not rely on undefined behavior.

llvm-svn: 210497

10 years agoReduce verbiage of lit.local.cfg files
Alp Toker [Mon, 9 Jun 2014 22:42:55 +0000 (22:42 +0000)]
Reduce verbiage of lit.local.cfg files

We can just split targets_to_build in one place and make it immutable.

llvm-svn: 210496

10 years agoSmallVector: support resize(N) with move-only types
David Blaikie [Mon, 9 Jun 2014 22:26:20 +0000 (22:26 +0000)]
SmallVector: support resize(N) with move-only types

Unfortunately there's no way to elegantly do this with pre-canned
algorithms. Using a generating iterator doesn't work because you default
construct for each element, then move construct into the actual slot
(bad for copy but non-movable types, and a little unneeded overhead even
in the move-only case), so just write it out manually.

This solution isn't exception safe (if one of the element's ctors calls
we don't fall back, destroy the constructed elements, and throw on -
which std::uninitialized_fill does do) but SmallVector (and LLVM) isn't
exception safe anyway.

llvm-svn: 210495

10 years ago[TSan] Exclude blacklist tests from manual test runner
Alexey Samsonov [Mon, 9 Jun 2014 22:02:14 +0000 (22:02 +0000)]
[TSan] Exclude blacklist tests from manual test runner

llvm-svn: 210494

10 years ago[PPC64LE] Generate correct code for unaligned little-endian vector loads
Bill Schmidt [Mon, 9 Jun 2014 22:00:52 +0000 (22:00 +0000)]
[PPC64LE] Generate correct code for unaligned little-endian vector loads

The code in PPCTargetLowering::PerformDAGCombine() that handles
unaligned Altivec vector loads generates a lvsl followed by a vperm.
As we've seen in numerous other places, the vperm instruction has a
big-endian bias, and this is fixed for little endian by complementing
the permute control vector and swapping the input operands.  In this
case the lvsl is providing the permute control vector.  Rather than
generating an lvsl and a complement operation, it is sufficient to
generate an lvsr instruction instead.  Thus for LE code generation we
will generate an lvsr rather than an lvsl, and swap the other input
arguments on the vperm.

The existing test/CodeGen/PowerPC/vec_misalign.ll is updated to test
the code generation for PPC64 and PPC64LE, in addition to the existing
PPC32/G5 testing.

llvm-svn: 210493

10 years agoGenerate better location ranges for some register-described variables.
Alexey Samsonov [Mon, 9 Jun 2014 21:53:47 +0000 (21:53 +0000)]
Generate better location ranges for some register-described variables.

Don't terminate location ranges for register-described variables
at the end of machine basic block if this register is never modified
in the function body, except for the prologue and epilogue. Prologue
location is guessed by FrameSetup flags on MachineInstructions, while
epilogue location is deduced from debug locations of instructions
in the basic blocks ending with return instructions.

This patch is mostly targeted to fix non-trivial debug locations for
variables addressed via stack and frame pointers.

It is not really a generic fix. We can still produce poor debug info
for register-described variables if this register *is* modified somewhere
in the function, but in unrelated places. This might be the case for the debug
info in optimized binaries (e.g. for local variables in inlined functions).
LiveDebugVariables pass in CodeGen attempts to fix this problem by adjusting
DBG_VALUE instructions, but this pass is tied to greedy register allocator,
which is used in optimized builds only. Proper fix would likely involve
generalizing LiveDebugVariables to all register allocators. See more discussion
in http://reviews.llvm.org/D3933 review thread.

I'm proceeding with this patch to fix immediate severe problems and
important cases, e.g. fix completely broken debug info with AddressSanitizer
and fix PR19307 (missing debug info for by-value std::string arguments).

llvm-svn: 210492

10 years agoObjective-C. Consider block pointer as NSObject as well as conforming to
Fariborz Jahanian [Mon, 9 Jun 2014 21:42:01 +0000 (21:42 +0000)]
Objective-C. Consider block pointer as NSObject as well as conforming to
'NSCopying' protocol when diagnosing block to ObjC pointer conversion.
// rdar://16739120

llvm-svn: 210491

10 years agoUpdate langref for unnamed_addr being allowed in aliases.
Rafael Espindola [Mon, 9 Jun 2014 21:21:33 +0000 (21:21 +0000)]
Update langref for unnamed_addr being allowed in aliases.

Thanks to Duncan P. N. Exon Smith and Owen Anderson for noticing.

llvm-svn: 210490

10 years agoARM: add VLA extension for WoA Itanium ABI
Saleem Abdulrasool [Mon, 9 Jun 2014 20:18:42 +0000 (20:18 +0000)]
ARM: add VLA extension for WoA Itanium ABI

The armv7-windows-itanium environment is nearly identical to the MSVC ABI. It
has a few divergences, mostly revolving around the use of the Itanium ABI for
C++. VLA support is one of the extensions that are amongst the set of the
extensions.

This adds support for proper VLA emission for this environment. This is
somewhat similar to the handling for __chkstk emission on X86 and the large
stack frame emission for ARM. The invocation style for chkstk is still
controlled via the -mcmodel flag to clang.

Make an explicit note that this is an extension.

llvm-svn: 210489

10 years agoLook through addrspacecasts when turning ptr comparisons into
Matt Arsenault [Mon, 9 Jun 2014 19:20:29 +0000 (19:20 +0000)]
Look through addrspacecasts when turning ptr comparisons into
index comparisons.

llvm-svn: 210488

10 years agoDisallow multiple inclusion of clang/Config/config.h
Alp Toker [Mon, 9 Jun 2014 19:09:28 +0000 (19:09 +0000)]
Disallow multiple inclusion of clang/Config/config.h

Internal config.h headers are only meant to be included from the main file.

llvm-svn: 210487

10 years agoAdded functions cross-reference test.
Stepan Dyatkovskiy [Mon, 9 Jun 2014 19:03:02 +0000 (19:03 +0000)]
Added functions cross-reference test.
Originally this similar was initiated by Björn Steinbrink here:
http://reviews.llvm.org/D3437

Bug itself has been fixed by principal changes in MergeFunctions. Though
special checks for functions merging are still actual. And the test has
been accepted with slight modifications.

llvm-svn: 210486

10 years agoRemove old fenv.h workaround for a historic clang driver bug
Alp Toker [Mon, 9 Jun 2014 19:00:52 +0000 (19:00 +0000)]
Remove old fenv.h workaround for a historic clang driver bug

Tested and works fine with clang using libstdc++.

All indications are that this was fixed some time ago and isn't a problem with
any clang version we support.

I've added a note in PR6907 which is still open for some reason.

llvm-svn: 210485

10 years agoAllow definition of dllimport static fields in partial specializations (PR19956)
Hans Wennborg [Mon, 9 Jun 2014 18:30:28 +0000 (18:30 +0000)]
Allow definition of dllimport static fields in partial specializations (PR19956)

This expands the logic from r210141 to cover partial specializations too.

llvm-svn: 210484

10 years agoFold FEnv.h into the implementation
Alp Toker [Mon, 9 Jun 2014 18:28:53 +0000 (18:28 +0000)]
Fold FEnv.h into the implementation

Support headers shouldn't use config.h definitions, and they should never be
undefined like this.

ConstantFolding.cpp was the only user of this facility and already includes
config.h for other math features, so it makes sense to move the checks there at
point of use.

(The implicit config.h was also quite dangerous -- removing the FEnv.h include
would have silently disabled math constant folding without causing any tests to
fail. Need to investigate -Wundef once the cleanup is done.)

This eliminates the last config.h include from LLVM headers, paving the way for
more consistent configuration checks.

llvm-svn: 210483

10 years ago[OCaml] Add more Llvm_target tests
Peter Zotov [Mon, 9 Jun 2014 18:28:47 +0000 (18:28 +0000)]
[OCaml] Add more Llvm_target tests

Patch by Jacques-Pascal Deplaix

llvm-svn: 210482

10 years agoAdded gdb-remote test for s packet, single stepping.
Todd Fiala [Mon, 9 Jun 2014 17:46:37 +0000 (17:46 +0000)]
Added gdb-remote test for s packet, single stepping.

llvm-svn: 210481

10 years ago[OCaml] Unbreak Llvm_target.TargetMachine.set_verbose_asm
Peter Zotov [Mon, 9 Jun 2014 17:34:34 +0000 (17:34 +0000)]
[OCaml] Unbreak Llvm_target.TargetMachine.set_verbose_asm

Patch by Jacques-Pascal Deplaix

llvm-svn: 210480

10 years agoMove all of the x86 subtarget initialized variables down into the x86 subtarget
Eric Christopher [Mon, 9 Jun 2014 17:08:19 +0000 (17:08 +0000)]
Move all of the x86 subtarget initialized variables down into the x86 subtarget
from the x86 target machine. Should be no functional change.

llvm-svn: 210479

10 years agoR600/SI: Rename VOP3 helper class to be more general
Matt Arsenault [Mon, 9 Jun 2014 17:00:46 +0000 (17:00 +0000)]
R600/SI: Rename VOP3 helper class to be more general

It has other uses besides shift instructions.

llvm-svn: 210478

10 years ago[X86] Add target combine rules for horizontal add/sub.
Andrea Di Biagio [Mon, 9 Jun 2014 16:54:41 +0000 (16:54 +0000)]
[X86] Add target combine rules for horizontal add/sub.

This patch adds new target specific combine rules to identify horizontal
add/sub idioms from BUILD_VECTOR dag nodes.

This patch also teaches the DAGCombiner how to canonicalize sequences of
insert_vector_elt dag nodes according to the following rule:

  (insert_vector_elt (insert_vector_elt A, I0), I1) ->
    (insert_vecto_elt (insert_vector_elt A, I1), I0)

This new canonicalization rule only triggers if the inner insert_vector
dag node has exactly one use; also, both indices must be known constants,
and I1 < I0.
This last rule made it possible to write a simpler algorithm to identify
horizontal add/sub patterns because now we don't have to worry about the
ordering of insert_vector_elt dag nodes.

llvm-svn: 210477

10 years agoR600/SI: Keep 64-bit not on SALU
Matt Arsenault [Mon, 9 Jun 2014 16:36:31 +0000 (16:36 +0000)]
R600/SI: Keep 64-bit not on SALU

llvm-svn: 210476

10 years agoR600: Fix selection failure for vector bswap
Matt Arsenault [Mon, 9 Jun 2014 16:20:25 +0000 (16:20 +0000)]
R600: Fix selection failure for vector bswap

llvm-svn: 210475

10 years ago[PPC64LE] Generate correct little-endian code for v16i8 multiply
Bill Schmidt [Mon, 9 Jun 2014 16:06:29 +0000 (16:06 +0000)]
[PPC64LE] Generate correct little-endian code for v16i8 multiply

The existing code in PPCTargetLowering::LowerMUL() for multiplying two
v16i8 values assumes that vector elements are numbered in big-endian
order.  For little-endian targets, the vector element numbering is
reversed, but the vmuleub, vmuloub, and vperm instructions still
assume big-endian numbering.  To account for this, we must adjust the
permute control vector and reverse the order of the input registers on
the vperm instruction.

The existing test/CodeGen/PowerPC/vec_mul.ll is updated to be executed
on powerpc64 and powerpc64le targets as well as the original powerpc
(32-bit) target.

llvm-svn: 210474

10 years agoFix test in r210472.
Evgeniy Stepanov [Mon, 9 Jun 2014 14:48:53 +0000 (14:48 +0000)]
Fix test in r210472.

llvm-svn: 210473

10 years ago[msan] Workaround for invalid origins in shufflevector.
Evgeniy Stepanov [Mon, 9 Jun 2014 14:29:34 +0000 (14:29 +0000)]
[msan] Workaround for invalid origins in shufflevector.

Makes origin propagation ignore literal undef operands, and,
in general, any operand we don't have origin for.

https://code.google.com/p/memory-sanitizer/issues/detail?id=56

llvm-svn: 210472

10 years agollvm/test/CodeGen/X86/2014-05-29-factorial.ll: Relax an expression to match Win32...
NAKAMURA Takumi [Mon, 9 Jun 2014 14:20:23 +0000 (14:20 +0000)]
llvm/test/CodeGen/X86/2014-05-29-factorial.ll: Relax an expression to match Win32 x64.

llvm-svn: 210471

10 years ago[mips] Fix a bug for NaCl target - Don't report the error when non-dangerous
Sasa Stankovic [Mon, 9 Jun 2014 14:09:28 +0000 (14:09 +0000)]
[mips] Fix a bug for NaCl target - Don't report the error when non-dangerous
load/store is in branch delay slot.

Differential Revision: http://llvm-reviews.chandlerc.com/D4048

llvm-svn: 210470

10 years ago[Mips] Make dt-textrel.test test case independent from external input files.
Simon Atanasyan [Mon, 9 Jun 2014 13:45:58 +0000 (13:45 +0000)]
[Mips] Make dt-textrel.test test case independent from external input files.

llvm-svn: 210469

10 years ago[X86] Avoid emitting unnecessary test instructions.
Andrea Di Biagio [Mon, 9 Jun 2014 12:34:50 +0000 (12:34 +0000)]
[X86] Avoid emitting unnecessary test instructions.

This patch teaches the backend how to check for the 'NoSignedWrap' flag on
binary operations to improve the emission of 'test' instructions.

If the result of a binary operation is known not to overflow we know that
resetting the Overflow flag is unnecessary and so we can avoid emitting
the test instruction.

Patch by Marcello Maggioni.

llvm-svn: 210468

10 years ago[DAG] Expose NoSignedWrap, NoUnsignedWrap and Exact flags to SelectionDAG.
Andrea Di Biagio [Mon, 9 Jun 2014 12:32:53 +0000 (12:32 +0000)]
[DAG] Expose NoSignedWrap, NoUnsignedWrap and Exact flags to SelectionDAG.

This patch modifies SelectionDAGBuilder to construct SDNodes with associated
NoSignedWrap, NoUnsignedWrap and Exact flags coming from IR BinaryOperator
instructions.

Added a new SDNode type called 'BinaryWithFlagsSDNode' to allow accessing
nsw/nuw/exact flags during codegen.

Patch by Marcello Maggioni.

llvm-svn: 210467