platform/upstream/llvm.git
10 years ago[asan] Add a few stubs to fix windows build.
Evgeniy Stepanov [Wed, 28 May 2014 08:26:24 +0000 (08:26 +0000)]
[asan] Add a few stubs to fix windows build.

llvm-svn: 209717

10 years ago[OPENMP] Additional checking for local vars in initial values for threadprivate vars
Alexey Bataev [Wed, 28 May 2014 07:40:25 +0000 (07:40 +0000)]
[OPENMP] Additional checking for local vars in initial values for threadprivate vars

llvm-svn: 209716

10 years ago[AArch64] Add store post-index update folding regression tests for the load/store...
Tilmann Scheller [Wed, 28 May 2014 06:43:00 +0000 (06:43 +0000)]
[AArch64] Add store post-index update folding regression tests for the load/store optimizer.

Add regression tests for the following transformation:

  str X, [x20]
   ...
  add x20, x20, #32
   ->
  str X, [x20], #32

with X being either w0, x0, s0, d0 or q0.

llvm-svn: 209715

10 years ago[OPENMP] Reformatting of parsing code for OpenMP constructs.
Alexey Bataev [Wed, 28 May 2014 06:15:33 +0000 (06:15 +0000)]
[OPENMP] Reformatting of parsing code for OpenMP constructs.

llvm-svn: 209714

10 years ago[OPENMP][C++11] Formatting and make more C++11 compliant of OpenMP sema.
Alexey Bataev [Wed, 28 May 2014 05:53:51 +0000 (05:53 +0000)]
[OPENMP][C++11] Formatting and make more C++11 compliant of OpenMP sema.

llvm-svn: 209713

10 years agoutils: Teach lldbDataFormatters to load automatically
Justin Bogner [Wed, 28 May 2014 05:45:17 +0000 (05:45 +0000)]
utils: Teach lldbDataFormatters to load automatically

Add an __lldb_init_module function so that importing the
lldbDataFormatters script automatically adds the formatters.

llvm-svn: 209712

10 years ago[AArch64] Add load post-index update folding regression tests for the load/store...
Tilmann Scheller [Wed, 28 May 2014 05:44:14 +0000 (05:44 +0000)]
[AArch64] Add load post-index update folding regression tests for the load/store optimizer.

Add regression tests for the following transformation:

 ldr X, [x20]
  ...
 add x20, x20, #32
  ->
 ldr X, [x20], #32

 with X being either w0, x0, s0, d0 or q0.

llvm-svn: 209711

10 years agoFix formatting
Tobias Grosser [Wed, 28 May 2014 04:34:58 +0000 (04:34 +0000)]
Fix formatting

llvm-svn: 209710

10 years ago[Mips] Do not mix _gp and _gp_disp symbols in relocation handling.
Simon Atanasyan [Wed, 28 May 2014 04:10:01 +0000 (04:10 +0000)]
[Mips] Do not mix _gp and _gp_disp symbols in relocation handling.

No functional changes.

llvm-svn: 209709

10 years agoMove the logic for testing for namespace std into one location. This check can
Richard Trieu [Wed, 28 May 2014 02:16:01 +0000 (02:16 +0000)]
Move the logic for testing for namespace std into one location.  This check can
be performed by using Decl::isInStdNamespace or DeclContext::isStdNamespace

llvm-svn: 209708

10 years ago[mach-o] Add support for parsing of weak-def symbols
Nick Kledzik [Wed, 28 May 2014 02:04:45 +0000 (02:04 +0000)]
[mach-o] Add support for parsing of weak-def symbols

llvm-svn: 209707

10 years agoDon't dllimport/export destructor variants implemented by thunks.
Hans Wennborg [Wed, 28 May 2014 01:52:23 +0000 (01:52 +0000)]
Don't dllimport/export destructor variants implemented by thunks.

MSVC doesn't export these functions, so trying to import them doesnt' work.
Also, don't let any dll attributes on the CXXDestructorDecl influence the
thunk's linkage -- they should always be linkonce_odr.

This takes care of the FIXME's for this in Nico's tests.

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

llvm-svn: 209706

10 years ago[mach-o] rename test case
Nick Kledzik [Wed, 28 May 2014 01:31:04 +0000 (01:31 +0000)]
[mach-o] rename test case

llvm-svn: 209705

10 years ago[mach-o] Support parsing of non-lazy-pointer sections
Nick Kledzik [Wed, 28 May 2014 01:16:35 +0000 (01:16 +0000)]
[mach-o] Support parsing of non-lazy-pointer sections

llvm-svn: 209704

10 years agoRemove unused variable.
Greg Clayton [Wed, 28 May 2014 00:23:43 +0000 (00:23 +0000)]
Remove unused variable.

llvm-svn: 209703

10 years agoAllow classes to be intialized using current lldb::SB objects. This can help to impor...
Greg Clayton [Wed, 28 May 2014 00:21:15 +0000 (00:21 +0000)]
Allow classes to be intialized using current lldb::SB objects. This can help to import/export the current process state.

llvm-svn: 209702

10 years ago[mach-o] Add support for initializers and terminators in object files
Nick Kledzik [Tue, 27 May 2014 23:20:52 +0000 (23:20 +0000)]
[mach-o] Add support for initializers and terminators in object files

llvm-svn: 209700

10 years ago[asan] use relative line numbers in tests
Greg Fitzgerald [Tue, 27 May 2014 23:13:52 +0000 (23:13 +0000)]
[asan] use relative line numbers in tests

llvm-svn: 209699

10 years agoChange representation of instruction ranges where variable is accessible.
Alexey Samsonov [Tue, 27 May 2014 23:09:50 +0000 (23:09 +0000)]
Change representation of instruction ranges where variable is accessible.

Use more straightforward way to represent the set of instruction
ranges where the location of a user variable is defined - vector of pairs
of instructions (defining start/end of each range),
instead of a flattened vector of instructions where some instructions
are supposed to start the range, and the rest are supposed to "clobber" it.

Simplify the code which generates actual .debug_loc entries.

No functionality change.

llvm-svn: 209698

10 years agoFactor out looking for prologue end into a function
Alexey Samsonov [Tue, 27 May 2014 22:47:41 +0000 (22:47 +0000)]
Factor out looking for prologue end into a function

llvm-svn: 209697

10 years agodelinearize does not return a remainder
Sebastian Pop [Tue, 27 May 2014 22:42:11 +0000 (22:42 +0000)]
delinearize does not return a remainder

llvm-svn: 209696

10 years agopass element size to delinearization
Sebastian Pop [Tue, 27 May 2014 22:42:09 +0000 (22:42 +0000)]
pass element size to delinearization

Instead of relying on the delinearization to infer the size of an element,
compute the element size from the base address type. This is a much more precise
way of computing the element size than before, as we would have mixed together
the size of an element with the strides of the innermost dimension.

llvm-svn: 209695

10 years agoavoid type mismatch when building SCEVs
Sebastian Pop [Tue, 27 May 2014 22:42:00 +0000 (22:42 +0000)]
avoid type mismatch when building SCEVs

This is a corner case I have stumbled upon when dealing with ARM64 type
conversions. I was not able to extract a testcase for the community codebase to
fail on. The patch conservatively discards a division that would have ended up
in an ICE due to a type mismatch when building a multiply expression. I have
also added code to a place that builds add expressions and in which we should be
careful not to pass in operands of different types.

llvm-svn: 209694

10 years agodo not use the GCD to compute the delinearization strides
Sebastian Pop [Tue, 27 May 2014 22:41:56 +0000 (22:41 +0000)]
do not use the GCD to compute the delinearization strides

We do not need to compute the GCD anymore after we removed the constant
coefficients from the terms: the terms are now all parametric expressions and
there is no need to recognize constant terms that divide only a subset of the
terms. We only rely on the size of the terms, i.e., the number of operands in
the multiply expressions, to sort the terms and recognize the parametric
dimensions.

llvm-svn: 209693

10 years agoremove BasePointer before delinearizing
Sebastian Pop [Tue, 27 May 2014 22:41:51 +0000 (22:41 +0000)]
remove BasePointer before delinearizing

No functional change is intended: instead of relying on the delinearization to
come up with the base pointer as a remainder of the divisions in the
delinearization, we just compute it from the array access and use that value.
We substract the base pointer from the SCEV to be delinearized and that
simplifies the work of the delinearizer.

llvm-svn: 209692

10 years agoremove constant terms
Sebastian Pop [Tue, 27 May 2014 22:41:45 +0000 (22:41 +0000)]
remove constant terms

The delinearization is needed only to remove the non linearity induced by
expressions involving multiplications of parameters and induction variables.
There is no problem in dealing with constant times parameters, or constant times
an induction variable.

For this reason, the current patch discards all constant terms and multipliers
before running the delinearization algorithm on the terms. The only thing
remaining in the term expressions are parameters and multiply expressions of
parameters: these simplified term expressions are passed to the array shape
recognizer that will not recognize constant dimensions anymore: these will be
recognized as different strides in parametric subscripts.

The only important special case of a constant dimension is the size of elements.
Instead of relying on the delinearization to infer the size of an element,
compute the element size from the base address type. This is a much more precise
way of computing the element size than before, as we would have mixed together
the size of an element with the strides of the innermost dimension.

llvm-svn: 209691

10 years agoDon't pre-populate the set of keys in the map with variable locations history.
Alexey Samsonov [Tue, 27 May 2014 22:35:00 +0000 (22:35 +0000)]
Don't pre-populate the set of keys in the map with variable locations history.

Current implementation of calculateDbgValueHistory already creates the
keys in the expected order (user variables are listed in order of appearance),
and should do so later by contract.

No functionality change.

llvm-svn: 209690

10 years agoNo need for those tests to go thru llvm-as and/or llvm-dis.
Arnaud A. de Grandmaison [Tue, 27 May 2014 22:03:28 +0000 (22:03 +0000)]
No need for those tests to go thru llvm-as and/or llvm-dis.

opt can handle them by itself.

llvm-svn: 209689

10 years agoFactor out comparison of Instruction "special" states.
Arnaud A. de Grandmaison [Tue, 27 May 2014 21:35:46 +0000 (21:35 +0000)]
Factor out comparison of Instruction "special" states.

No functional change.

llvm-svn: 209688

10 years agoWording fix for llvm.global_dtors docs.
Reid Kleckner [Tue, 27 May 2014 21:35:17 +0000 (21:35 +0000)]
Wording fix for llvm.global_dtors docs.

llvm-svn: 209687

10 years agoRetain isImplicit flag for local variable declarations when instantiating
Alexander Kornienko [Tue, 27 May 2014 21:29:22 +0000 (21:29 +0000)]
Retain isImplicit flag for local variable declarations when instantiating
templates.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 209686

10 years ago[mach-o] Add checks that string literals in object files are zero terminated
Nick Kledzik [Tue, 27 May 2014 20:37:08 +0000 (20:37 +0000)]
[mach-o] Add checks that string literals in object files are zero terminated

llvm-svn: 209685

10 years ago[mach-o] Add support for reading utf16 string literal sections
Nick Kledzik [Tue, 27 May 2014 20:25:06 +0000 (20:25 +0000)]
[mach-o] Add support for reading utf16 string literal sections

llvm-svn: 209684

10 years agoDebugInfo: partially revert cleanup committed in r209680
David Blaikie [Tue, 27 May 2014 20:20:43 +0000 (20:20 +0000)]
DebugInfo: partially revert cleanup committed in r209680

I'm not sure exactly where/how we end up with an abstract DbgVariable
with a null DIE, but we do... looking into it & will add a test and/or
fix when I figure it out.

Currently shows up in selfhost or compiler-rt builds.

llvm-svn: 209683

10 years agoAdd a test that we don't store stale modtime in modules
Ben Langmuir [Tue, 27 May 2014 19:57:48 +0000 (19:57 +0000)]
Add a test that we don't store stale modtime in modules

The change from r209195 turned out to be important to avoid saving stale
modification time/expected size information in a module file when there
are 3 or more modules in a dependency chain and the bottom one is
rebuilt. So add a test for that.

rdar://problem/17038180

llvm-svn: 209682

10 years agoAdd make_dynamic_error_code().
Nick Kledzik [Tue, 27 May 2014 19:35:41 +0000 (19:35 +0000)]
Add make_dynamic_error_code().

This is a short-term fix to allow lld Readers to return error messages
with dynamic content.

The long term fix will be to enhance ErrorOr<> to work with errors other
than error_code.  Or to change the interface to Readers to pass down a
diagnostics object through which all error messages are written.

llvm-svn: 209681

10 years agoDebugInfo: Simplify solution to avoid DW_AT_artificial on inlined parameters.
David Blaikie [Tue, 27 May 2014 19:34:32 +0000 (19:34 +0000)]
DebugInfo: Simplify solution to avoid DW_AT_artificial on inlined parameters.

Originally committed in r207717, I clearly didn't look very closely at
the code to understand how existing things were working...

llvm-svn: 209680

10 years agoAdd range accessors for captures of a LambdaExpr.
James Dennett [Tue, 27 May 2014 19:13:04 +0000 (19:13 +0000)]
Add range accessors for captures of a LambdaExpr.

Summary:
This adds LambdaExpr::captures(), LambdaExpr::explicit_captures()
and LambdaExpr::implicit_captures() as simple wrappers over the underlying
*_begin()/*_end() functions.

Reviewers: aaron.ballman

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

llvm-svn: 209679

10 years ago[mips] Optimize long branch for MIPS64 by removing %higher and %highest.
Sasa Stankovic [Tue, 27 May 2014 18:53:06 +0000 (18:53 +0000)]
[mips] Optimize long branch for MIPS64 by removing %higher and %highest.
%higher and %highest can have non-zero values only for offsets greater
than 2GB, which is highly unlikely, if not impossible when compiling a
single function. This makes long branch for MIPS64 3 instructions smaller.

Differential Revision: http://llvm-reviews.chandlerc.com/D3281.diff

llvm-svn: 209678

10 years agoDebugInfo: Create abstract function definitions even when concrete definitions precee...
David Blaikie [Tue, 27 May 2014 18:37:55 +0000 (18:37 +0000)]
DebugInfo: Create abstract function definitions even when concrete definitions preceed inline definitions.

After much puppetry, here's the major piece of the work to ensure that
even when a concrete definition preceeds all inline definitions, an
abstract definition is still created and referenced from both concrete
and inline definitions.

Variables are still broken in this case (see comment in
dbg-value-inlined-parameter.ll test case) and will be addressed in
follow up work.

llvm-svn: 209677

10 years agoDebugInfo: Avoid an extra map lookup when finding abstract subprogram DIEs.
David Blaikie [Tue, 27 May 2014 18:37:51 +0000 (18:37 +0000)]
DebugInfo: Avoid an extra map lookup when finding abstract subprogram DIEs.

llvm-svn: 209676

10 years agoDebugInfo: Lazily construct subprogram definition DIEs.
David Blaikie [Tue, 27 May 2014 18:37:48 +0000 (18:37 +0000)]
DebugInfo: Lazily construct subprogram definition DIEs.

A further step to correctly emitting concrete out of line definitions
preceeding inlined instances of the same program.

To do this, emission of subprograms must be delayed until required since
we don't know which (abstract only (if there's no out of line
definition), concrete only (if there are no inlined instances), or both)
DIEs are required at the start of the module.

To reduce the test churn in the following commit that actually fixes the
bug, this commit introduces the lazy DIE construction and cleans up test
cases that are impacted by the changes in the resulting DIE ordering.

llvm-svn: 209675

10 years agoDebugInfo: Lazily attach definition attributes to definitions.
David Blaikie [Tue, 27 May 2014 18:37:43 +0000 (18:37 +0000)]
DebugInfo: Lazily attach definition attributes to definitions.

This is a precursor to fixing inlined debug info where the concrete,
out-of-line definition may preceed any inlined usage. To cope with this,
the attributes that may appear on the concrete definition or the
abstract definition are delayed until the end of the module. Then, if an
abstract definition was created, it is referenced (and no other
attributes are added to the out-of-line definition), otherwise the
attributes are added directly to the out-of-line definition.

In a couple of cases this causes not just reordering of attributes, but
reordering of types. When the creation of the attribute is delayed, if
that creation would create a type (such as for a DW_AT_type attribute)
then other top level DIEs may've been constructed during the delay,
causing the referenced type to be created and added after those
intervening DIEs. In the extreme case, in cross-cu-inlining.ll, this
actually causes the DW_TAG_basic_type for "int" to move from one CU to
another.

llvm-svn: 209674

10 years agoDebugInfo: Separate out the addition of subprogram attribute additions so that they...
David Blaikie [Tue, 27 May 2014 18:37:38 +0000 (18:37 +0000)]
DebugInfo: Separate out the addition of subprogram attribute additions so that they can be added later depending on whether or not the function is inlined.

llvm-svn: 209673

10 years agoObjective-C. Fixes an obscuer crash caused by multiple inclusion of
Fariborz Jahanian [Tue, 27 May 2014 18:26:09 +0000 (18:26 +0000)]
Objective-C. Fixes an obscuer crash caused by multiple inclusion of
same framework after complaining about duplicate class definition.
// rdar://17024681

llvm-svn: 209672

10 years agoFixed a test in r209670
Jingyue Wu [Tue, 27 May 2014 18:12:55 +0000 (18:12 +0000)]
Fixed a test in r209670

The test was outdated with r209537.

llvm-svn: 209671

10 years agoDistribute sext/zext to the operands of and/or/xor
Jingyue Wu [Tue, 27 May 2014 18:00:00 +0000 (18:00 +0000)]
Distribute sext/zext to the operands of and/or/xor

This is an enhancement to SeparateConstOffsetFromGEP. With this patch, we can
extract a constant offset from "s/zext and/or/xor A, B".

Added a new test @ext_or to verify this enhancement.

Refactoring the code, I also extracted some common logic to function
Distributable.

llvm-svn: 209670

10 years agoDebugInfo: Fix argument ordering in test by adding argument numbering.
David Blaikie [Tue, 27 May 2014 17:57:14 +0000 (17:57 +0000)]
DebugInfo: Fix argument ordering in test by adding argument numbering.

This old test didn't have the argument numbering that's now squirelled
away in the high bits of the line number in the DW_TAG_arg_variable
metadata.

Add the numbering and update the test to ensure arguments are in-order.

llvm-svn: 209669

10 years agoFix pr19841, bb are also unnamed
Renato Golin [Tue, 27 May 2014 17:01:21 +0000 (17:01 +0000)]
Fix pr19841, bb are also unnamed

llvm-svn: 209668

10 years agoPost-commit fixes for r209643
Filipe Cabecinhas [Tue, 27 May 2014 16:54:33 +0000 (16:54 +0000)]
Post-commit fixes for r209643

Detected by Daniel Jasper, Ilia Filippov, and Andrea Di Biagio
Fixed the argument order to select (the mask semantics to blendv* are the
inverse of select) and fixed the tests
Added parenthesis to the assert condition
Ran clang-format

llvm-svn: 209667

10 years agoFix pr19841.cpp on release mode
Renato Golin [Tue, 27 May 2014 16:51:36 +0000 (16:51 +0000)]
Fix pr19841.cpp on release mode

llvm-svn: 209666

10 years agoAArch64: add test for NZCV cross-copy save.
Tim Northover [Tue, 27 May 2014 16:50:09 +0000 (16:50 +0000)]
AArch64: add test for NZCV cross-copy save.

llvm-svn: 209665

10 years agoAArch64: add AArch64-specific test for 'c' and 'n'.
Tim Northover [Tue, 27 May 2014 16:50:03 +0000 (16:50 +0000)]
AArch64: add AArch64-specific test for 'c' and 'n'.

llvm-svn: 209664

10 years agoRevert small change to EmitDeclRefLValue
Renato Golin [Tue, 27 May 2014 16:46:27 +0000 (16:46 +0000)]
Revert small change to EmitDeclRefLValue

That small change, although it looked harmless, it made emitting the LValue
on the PHI node without the proper cast. Reverting it fixes PR19841.

llvm-svn: 209663

10 years ago[PATCH] Correct type used for VADD_SPLAT optimization on PowerPC
Bill Schmidt [Tue, 27 May 2014 15:57:51 +0000 (15:57 +0000)]
[PATCH] Correct type used for VADD_SPLAT optimization on PowerPC

In PPCISelLowering.cpp: PPCTargetLowering::LowerBUILD_VECTOR(), there
is an optimization for certain patterns to generate one or two vector
splats followed by a vector add or subtract.  This operation is
represented by a VADD_SPLAT in the selection DAG.  Prior to this
patch, it was possible for the VADD_SPLAT to be assigned the wrong
data type, causing incorrect code generation.  This patch corrects the
problem.

Specifically, the code previously assigned the value type of the
BUILD_VECTOR node to the newly generated VADD_SPLAT node.  This is
correct much of the time, but not always.  The problem is that the
call to isConstantSplat() may return a SplatBitSize that is not the
same as the number of bits in the original element vector type.  The
correct type to assign is a vector type with the same element bit size
as SplatBitSize.

The included test case shows an example of this, where the
BUILD_VECTOR node has a type of v16i8.  The vector to be built is {0,
16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16}.  isConstantSplat
detects that we can generate a splat of 16 for type v8i16, which is
the type we must assign to the VADD_SPLAT node.  If we do not, we
generate a vspltisb of 8 and a vaddubm, which generates the incorrect
result {16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16}.  The correct code generation is a vspltish of 8 and a vadduhm.

This patch also corrected code generation for
CodeGen/PowerPC/2008-07-10-SplatMiscompile.ll, which had been marked
as an XFAIL, so we can remove the XFAIL from the test case.

llvm-svn: 209662

10 years agoASTMatchers.h: Appease msc17.
NAKAMURA Takumi [Tue, 27 May 2014 15:13:51 +0000 (15:13 +0000)]
ASTMatchers.h: Appease msc17.

llvm-svn: 209661

10 years agoParsing/Sema for OMPCollapseClause.
Alexander Musman [Tue, 27 May 2014 15:12:19 +0000 (15:12 +0000)]
Parsing/Sema for OMPCollapseClause.
Actual usage in Sema for collapsing loops will in some future patch.

llvm-svn: 209660

10 years ago[mips][mips64r6] Add Relocations R_MIPS_PCHI16, R_MIPS_PCLO16
Zoran Jovanovic [Tue, 27 May 2014 14:58:51 +0000 (14:58 +0000)]
[mips][mips64r6] Add Relocations R_MIPS_PCHI16, R_MIPS_PCLO16
Differential Revision: http://reviews.llvm.org/D3860

llvm-svn: 209659

10 years ago[tsan] Fix tsango build.
Evgeniy Stepanov [Tue, 27 May 2014 14:18:43 +0000 (14:18 +0000)]
[tsan] Fix tsango build.

llvm-svn: 209658

10 years ago[asan] Disable dlopen interceptor on Android.
Evgeniy Stepanov [Tue, 27 May 2014 14:14:03 +0000 (14:14 +0000)]
[asan] Disable dlopen interceptor on Android.

It can not work, as libdl is always first in the lookup order,
even ahead of LD_PRELOAD-ed libraries.

llvm-svn: 209657

10 years ago[ARM] Emit correct build attributes for the relocation models.
Amara Emerson [Tue, 27 May 2014 13:30:21 +0000 (13:30 +0000)]
[ARM] Emit correct build attributes for the relocation models.

Patch by Asiri Rathnayake.

llvm-svn: 209656

10 years ago[mips][mips64r6] Add relocations R_MIPS_PC21_S2, R_MIPS_PC26_S2
Zoran Jovanovic [Tue, 27 May 2014 12:55:40 +0000 (12:55 +0000)]
[mips][mips64r6] Add relocations R_MIPS_PC21_S2, R_MIPS_PC26_S2
Differential Revision: http://reviews.llvm.org/D3824

llvm-svn: 209655

10 years ago[asancov] Emit an initializer passing number of coverage code locations in each module.
Evgeniy Stepanov [Tue, 27 May 2014 12:39:31 +0000 (12:39 +0000)]
[asancov] Emit an initializer passing number of coverage code locations in each module.

llvm-svn: 209654

10 years ago[asancov] Write coverage directly to a memory-mapped file.
Evgeniy Stepanov [Tue, 27 May 2014 12:37:52 +0000 (12:37 +0000)]
[asancov] Write coverage directly to a memory-mapped file.

This way does not require a __sanitizer_cov_dump() call. That's
important on Android, where apps can be killed at arbitrary time.

We write raw PCs to disk instead of module offsets; we also write
memory layout to a separate file. This increases dump size by the
factor of 2 on 64-bit systems.

llvm-svn: 209653

10 years agoMake equalsNode work with pointers to subtypes.
Manuel Klimek [Tue, 27 May 2014 12:31:10 +0000 (12:31 +0000)]
Make equalsNode work with pointers to subtypes.

llvm-svn: 209652

10 years agoAArch64: implement copies to/from NZCV as a last ditch effort.
Tim Northover [Tue, 27 May 2014 12:16:02 +0000 (12:16 +0000)]
AArch64: implement copies to/from NZCV as a last ditch effort.

A test in test/Generic creates a DAG where the NZCV output of an ADCS is used
by multiple nodes. This makes LLVM want to save a copy of NZCV for later, which
it couldn't do before.

This should be the last fix required for the aarch64 buildbot.

llvm-svn: 209651

10 years agoARM: teach AAPCS-VFP to deal with Cortex-M4.
Tim Northover [Tue, 27 May 2014 10:43:38 +0000 (10:43 +0000)]
ARM: teach AAPCS-VFP to deal with Cortex-M4.

Cortex-M4 only has single-precision floating point support, so any LLVM
"double" type will have been split into 2 i32s by now. Fortunately, the
consecutive-register framework turns out to be precisely what's needed to
reconstruct the double and follow AAPCS-VFP correctly!

rdar://problem/17012966

llvm-svn: 209650

10 years agoAdds child traversal matchers for IfStmt's then and else branches.
Manuel Klimek [Tue, 27 May 2014 10:04:12 +0000 (10:04 +0000)]
Adds child traversal matchers for IfStmt's then and else branches.

llvm-svn: 209649

10 years agoFix bad assert.
Daniel Jasper [Tue, 27 May 2014 09:55:37 +0000 (09:55 +0000)]
Fix bad assert.

llvm-svn: 209648

10 years agoAllow hasBody on CXXForRangeStmt nodes and update the docs.
Manuel Klimek [Tue, 27 May 2014 07:45:18 +0000 (07:45 +0000)]
Allow hasBody on CXXForRangeStmt nodes and update the docs.

llvm-svn: 209647

10 years agoAArch64: support 'c' and 'n' inline asm modifiers.
Tim Northover [Tue, 27 May 2014 07:37:21 +0000 (07:37 +0000)]
AArch64: support 'c' and 'n' inline asm modifiers.

These are tested by test/CodeGen/Generic, so we should probably know
how to deal with them. Fortunately generic code does it if asked.

llvm-svn: 209646

10 years agoAdding testcase for PR18886.
Dinesh Dwivedi [Tue, 27 May 2014 06:44:25 +0000 (06:44 +0000)]
Adding testcase for PR18886.

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

llvm-svn: 209645

10 years ago[Mips] Handle relocations against __gnu_local_gp symbol.
Simon Atanasyan [Tue, 27 May 2014 05:23:16 +0000 (05:23 +0000)]
[Mips] Handle relocations against __gnu_local_gp symbol.

llvm-svn: 209644

10 years agoConvert some X86 blendv* intrinsics into IR.
Filipe Cabecinhas [Tue, 27 May 2014 03:42:20 +0000 (03:42 +0000)]
Convert some X86 blendv* intrinsics into IR.

Summary:
Implemented an InstCombine transformation that takes a blendv* intrinsic
call and translates it into an IR select, if the mask is constant.

This will eventually get lowered into blends with immediates if possible,
or pblendvb (with an option to further optimize if we can transform the
pblendvb into a blend+immediate instruction, depending on the selector).
It will also enable optimizations by the IR passes, which give up on
sight of the intrinsic.

Both the transformation and the lowering of its result to asm got shiny
new tests.

The transformation is a bit convoluted because of blendvp[sd]'s
definition:

Its mask is a floating point value! This forces us to convert it and get
the highest bit. I suppose this happened because the mask has type
__m128 in Intel's intrinsic and v4sf (for blendps) in gcc's builtin.

I will send an email to llvm-dev to discuss if we want to change this or
not.

Reviewers: grosbach, delena, nadav

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

llvm-svn: 209643

10 years ago[C++11] Use 'nullptr'. StaticAnalyzer edition.
Craig Topper [Tue, 27 May 2014 02:45:47 +0000 (02:45 +0000)]
[C++11] Use 'nullptr'. StaticAnalyzer edition.

llvm-svn: 209642

10 years agoOn AArch64, use clone() instead of fork()
Greg Fitzgerald [Mon, 26 May 2014 23:44:55 +0000 (23:44 +0000)]
On AArch64, use clone() instead of fork()

Patch by Gideon Billings.

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

llvm-svn: 209641

10 years agoFix link.
Rafael Espindola [Mon, 26 May 2014 21:30:40 +0000 (21:30 +0000)]
Fix link.

llvm-svn: 209640

10 years agoUse existing helper function.
Rafael Espindola [Mon, 26 May 2014 19:57:55 +0000 (19:57 +0000)]
Use existing helper function.

No functionality change.

llvm-svn: 209639

10 years ago[PPC] Use alias symbols in address computation.
Rafael Espindola [Mon, 26 May 2014 19:08:19 +0000 (19:08 +0000)]
[PPC] Use alias symbols in address computation.

This seems to match what gcc does for ppc and what every other llvm
backend does.

llvm-svn: 209638

10 years agoAArch64: force i1 to be zero-extended at an ABI boundary.
Tim Northover [Mon, 26 May 2014 17:22:07 +0000 (17:22 +0000)]
AArch64: force i1 to be zero-extended at an ABI boundary.

This commit is debatable. There are two possible approaches, neither
of which is really satisfactory:

1. Use "@foo(i1 zeroext)" to mean an extension to 32-bits on Darwin,
   and 8 bits otherwise.
2. Redefine "@foo(i1)" to mean that the i1 is extended by the caller
   to 8 bits. This goes against the spirit of "zeroext" I think, but
   it's a bit of a vague construct anyway (by definition you're going
   to extend to the amount required by the ABI, that's why it's the
   ABI!).

This implements option 2. The DAG machinery really isn't setup for the
first (there's a fairly strong assumption that "zeroext" goes to at
least the smallest register size), and even if it was the resulting
DAG looks like it would be inferior in many cases.

Theoretically we could add AssertZext nodes in the consumers of
ABI-passed values too now, but this actually seems to make the code
worse in practice by making truncation proceed in two steps. The code
produced is equally valid if we continue to assume only the low bit is
defined.

Should fix PR19850

llvm-svn: 209637

10 years agoAArch64: simplify calling conventions slightly.
Tim Northover [Mon, 26 May 2014 17:21:53 +0000 (17:21 +0000)]
AArch64: simplify calling conventions slightly.

We can eliminate the custom C++ code in favour of some TableGen to
check the same things. Functionality should be identical, except for a
buffer overrun that was present in the C++ code and meant webkit
failed if any small argument needed to be passed on the stack.

llvm-svn: 209636

10 years agoRejecting the mutable specifier on a freestanding type declaration, instead of suppor...
Aaron Ballman [Mon, 26 May 2014 17:03:54 +0000 (17:03 +0000)]
Rejecting the mutable specifier on a freestanding type declaration, instead of supporting it as a "extension" (which serves no purpose). Un-XFAILing the test for mutable specifiers.

llvm-svn: 209635

10 years agoSome cleanup for r209568.
Michael Zolotukhin [Mon, 26 May 2014 14:49:46 +0000 (14:49 +0000)]
Some cleanup for r209568.

llvm-svn: 209634

10 years agoAdd stdlib.h for malloc and friends
Ed Maste [Mon, 26 May 2014 14:07:26 +0000 (14:07 +0000)]
Add stdlib.h for malloc and friends

llvm-svn: 209633

10 years agoRemove include of obsolete stropts.h header
Ed Maste [Mon, 26 May 2014 14:04:29 +0000 (14:04 +0000)]
Remove include of obsolete stropts.h header

The header is for POSIX streams functionality, and does not exist on
FreeBSD, OS X, or contemporary Linux distributions.

llvm-svn: 209632

10 years agoUse MIUtilSystemLinux on FreeBSD as well
Ed Maste [Mon, 26 May 2014 13:57:15 +0000 (13:57 +0000)]
Use MIUtilSystemLinux on FreeBSD as well

We should later rename this file (probably MIUtilSystemPOSIX), but
more clean-up is still needed here, and we can wait until we better
understand how this code may be shared between FreeBSD, Linux, and OS X.

llvm-svn: 209631

10 years agoAdd missing header
Ed Maste [Mon, 26 May 2014 13:48:38 +0000 (13:48 +0000)]
Add missing header

Presumably included by header leakage on other platforms.

llvm-svn: 209630

10 years ago[ASan tests] Use ASAN_OPTIONS in a portable way
Timur Iskhodzhanov [Mon, 26 May 2014 13:44:57 +0000 (13:44 +0000)]
[ASan tests] Use ASAN_OPTIONS in a portable way

llvm-svn: 209629

10 years agoConvert a few loops to use ranges.
Rafael Espindola [Mon, 26 May 2014 13:38:51 +0000 (13:38 +0000)]
Convert a few loops to use ranges.

llvm-svn: 209628

10 years ago[AArch64] Add store + add folding regression tests for the load/store optimization...
Tilmann Scheller [Mon, 26 May 2014 13:36:47 +0000 (13:36 +0000)]
[AArch64] Add store + add folding regression tests for the load/store optimization pass.

Add tests for the following transform:

 str X, [x0, #32]
  ...
 add x0, x0, #32
  ->
 str X, [x0, #32]!

with X being either w1, x1, s0, d0 or q0.

llvm-svn: 209627

10 years agoclang-format: Split up moveStateToNextToken.
Daniel Jasper [Mon, 26 May 2014 13:10:39 +0000 (13:10 +0000)]
clang-format: Split up moveStateToNextToken.

No functional changes intended.

llvm-svn: 209626

10 years ago[MSan] Implement __sanitizer_print_stack_trace().
Sergey Matveev [Mon, 26 May 2014 13:08:08 +0000 (13:08 +0000)]
[MSan] Implement __sanitizer_print_stack_trace().

llvm-svn: 209625

10 years ago[AArch64] Add more regression tests for the load/store optimization pass.
Tilmann Scheller [Mon, 26 May 2014 12:15:51 +0000 (12:15 +0000)]
[AArch64] Add more regression tests for the load/store optimization pass.

Cover the following cases:

  ldr X, [x0, #32]
   ...
  add x0, x0, #32
   ->
  ldr X, [x0, #32]!

with X being either w1, x1, s0, d0 or q0.

llvm-svn: 209624

10 years ago[asan] decrease asan-instrumentation-with-call-threshold from 10000 to 7000, see...
Kostya Serebryany [Mon, 26 May 2014 11:57:16 +0000 (11:57 +0000)]
[asan] decrease asan-instrumentation-with-call-threshold from 10000 to 7000, see PR17409

llvm-svn: 209623

10 years ago[ASan/Win tests] Remove the extra 'cat' in front of FileCheck now that it's clear...
Timur Iskhodzhanov [Mon, 26 May 2014 11:54:20 +0000 (11:54 +0000)]
[ASan/Win tests] Remove the extra 'cat' in front of FileCheck now that it's clear we should use GnuWin32 rather than Cygwin on the PATH on Windows (see PR19744)

llvm-svn: 209622

10 years agoAArch64: remove empty ARM64 directories from svn.
Tim Northover [Mon, 26 May 2014 11:25:33 +0000 (11:25 +0000)]
AArch64: remove empty ARM64 directories from svn.

llvm-svn: 209621

10 years ago[ASan/Win tests] Use the env keyword in the SUAR tests to work with gnuwin/lit correctly
Timur Iskhodzhanov [Mon, 26 May 2014 11:25:32 +0000 (11:25 +0000)]
[ASan/Win tests] Use the env keyword in the SUAR tests to work with gnuwin/lit correctly

llvm-svn: 209620

10 years agoRemove accidentally committed whitespace.
Tilmann Scheller [Mon, 26 May 2014 09:40:40 +0000 (09:40 +0000)]
Remove accidentally committed whitespace.

llvm-svn: 209619

10 years ago[AArch64] Add a regression test for the load store optimizer.
Tilmann Scheller [Mon, 26 May 2014 09:37:19 +0000 (09:37 +0000)]
[AArch64] Add a regression test for the load store optimizer.

We have a couple of regression tests for load/store pairing, but (to my knowledge) there are no regression tests for the load/store + add/sub folding.

As a first step towards increased test coverage of this area, this commit adds a test for one instance of a load + add to pre-indexed load transformation.

llvm-svn: 209618

10 years agoMake the LoopRotate pass's maximum header size configurable both programmatically
Owen Anderson [Mon, 26 May 2014 08:58:51 +0000 (08:58 +0000)]
Make the LoopRotate pass's maximum header size configurable both programmatically
and via the command line, mirroring similar functionality in LoopUnroll.  In
situations where clients used custom unrolling thresholds, their intent could
previously be foiled by LoopRotate having a hardcoded threshold.

llvm-svn: 209617