platform/upstream/llvm.git
10 years agoDebug Info: Fix the source range for IfStmt's ConditionScope.
Adrian Prantl [Wed, 28 May 2014 19:10:59 +0000 (19:10 +0000)]
Debug Info: Fix the source range for IfStmt's ConditionScope.
Since the continuation block of the if statement is emitted within the
condition scope this had the undesirable effect of creating a line table
entry at the end of the then or else statement, a line that may have never
been executed.
PR19864 / rdar://problem/17052973

llvm-svn: 209764

10 years agotest check-in: added missing parenthesis in comment
Sanjay Patel [Wed, 28 May 2014 19:03:33 +0000 (19:03 +0000)]
test check-in: added missing parenthesis in comment

llvm-svn: 209763

10 years agoRevert "InstCombine: Improvement to check if signed addition overflows."
Rafael Espindola [Wed, 28 May 2014 18:48:10 +0000 (18:48 +0000)]
Revert "InstCombine: Improvement to check if signed addition overflows."

This reverts commit r209746.

It looks it is causing a crash while building libcxx. I am trying to get a
reduced testcase.

llvm-svn: 209762

10 years agoMove misplaced Documentation note in Attr.td
Reid Kleckner [Wed, 28 May 2014 18:43:46 +0000 (18:43 +0000)]
Move misplaced Documentation note in Attr.td

llvm-svn: 209761

10 years agoFix standard integer definitions for MSVC in DataTypes.h
Reid Kleckner [Wed, 28 May 2014 18:19:55 +0000 (18:19 +0000)]
Fix standard integer definitions for MSVC in DataTypes.h

Previously, DataTypes.h would #define a variety of symbols any time
they weren't already defined.  However, some versions of Visual
Studio do provide the appropriate headers, so if those headers are
included after DataTypes.h, it can lead to macro redefinition
warnings.

The fix is to include the appropriate headers if they exist, and
only #define the symbols if the required header does not exist.

Patch by Zachary Turner!

---

The big change here is that we no longer have our own stdint.h
typedefs because now all supported toolchains have stdint.h.
Hooray!

llvm-svn: 209760

10 years ago[pr19844] Add thread local mode to aliases.
Rafael Espindola [Wed, 28 May 2014 18:15:43 +0000 (18:15 +0000)]
[pr19844] Add thread local mode to aliases.

This matches gcc's behavior. It also seems natural given that aliases
contain other properties that govern how it is accessed (linkage,
visibility, dll storage).

Clang still has to be updated to expose this feature to C.

llvm-svn: 209759

10 years agoObjective-C. Diagnose use of properties in functions nested in,
Fariborz Jahanian [Wed, 28 May 2014 18:12:10 +0000 (18:12 +0000)]
Objective-C. Diagnose use of properties in functions nested in,
now deprecated, ObjC containers instead of crashing.
// rdar://16859666

llvm-svn: 209758

10 years agotsan: refactor suppressions machinery
Dmitry Vyukov [Wed, 28 May 2014 18:03:32 +0000 (18:03 +0000)]
tsan: refactor suppressions machinery
The refactoring makes suppressions more flexible
and allow to suppress based on arbitrary number of stacks.
In particular it fixes:
https://code.google.com/p/thread-sanitizer/issues/detail?id=64
"Make it possible to suppress deadlock reports by any stack (not just first)"

llvm-svn: 209757

10 years agoDisabled warning C4251 on MSVC builds.
Todd Fiala [Wed, 28 May 2014 17:58:29 +0000 (17:58 +0000)]
Disabled warning C4251 on MSVC builds.

See http://reviews.llvm.org/D3934 for more details.
This is only the CMakeLists.txt portion of that change.

Change by Zachary Turner.

llvm-svn: 209756

10 years agoAdd support for combining GEPs across PHI nodes
Louis Gerbarg [Wed, 28 May 2014 17:38:31 +0000 (17:38 +0000)]
Add support for combining GEPs across PHI nodes

Currently LLVM will generally merge GEPs. This allows backends to use more
complex addressing modes. In some cases this is not happening because there
is PHI inbetween the two GEPs:

  GEP1--\
        |-->PHI1-->GEP3
  GEP2--/

This patch checks to see if GEP1 and GEP2 are similiar enough that they can be
cloned (GEP12) in GEP3's BB, allowing GEP->GEP merging (GEP123):

  GEP1--\                     --\                           --\
        |-->PHI1-->GEP3  ==>    |-->PHI2->GEP12->GEP3 == >    |-->PHI2->GEP123
  GEP2--/                     --/                           --/

This also breaks certain use chains that are preventing GEP->GEP merges that the
the existing instcombine would merge otherwise.

Tests included.

llvm-svn: 209755

10 years agoTrim trailing whitespace in cindex.py
Eli Bendersky [Wed, 28 May 2014 17:35:14 +0000 (17:35 +0000)]
Trim trailing whitespace in cindex.py

llvm-svn: 209754

10 years agoAdded option for n-dimensional rectangular tiling
Johannes Doerfert [Wed, 28 May 2014 17:21:02 +0000 (17:21 +0000)]
Added option for n-dimensional rectangular tiling

+ CL-option --polly-tile-sizes=<int,...,int>
  The i'th value is used as a tile size for dimension i, if
  there is no i'th value, the value of --polly-default-tile-size is
  used

+ CL-option --polly-default-tile-size=int
  Used if no tile size is given for a dimension i

+ 3 Simple testcases

llvm-svn: 209753

10 years agoCmake build changes.
Todd Fiala [Wed, 28 May 2014 17:06:04 +0000 (17:06 +0000)]
Cmake build changes.

Disables exception handling in LLDB, using appropriate compiler
flags depending on the platform. This is consistent with the build
of LLVM, should improve performance, and also removes a substantial number
of warnings from the Windows build.

See http://reviews.llvm.org/D3929 for more details.

Change by Zachary Turner

llvm-svn: 209752

10 years agoObjective-C. Deprecate use of function definitions
Fariborz Jahanian [Wed, 28 May 2014 17:02:35 +0000 (17:02 +0000)]
Objective-C. Deprecate use of function definitions
in Objective-C container declarations (but not
in their definitions. // rdar://10414277

llvm-svn: 209751

10 years agoReorder cmake include folders (polly source first)
Johannes Doerfert [Wed, 28 May 2014 16:54:42 +0000 (16:54 +0000)]
Reorder cmake include folders (polly source first)

llvm-svn: 209750

10 years agoFix Windows warnings.
Todd Fiala [Wed, 28 May 2014 16:43:26 +0000 (16:43 +0000)]
Fix Windows warnings.

This fixes a number of trivial warnings in the Windows build. This is part of a larger effort to make the Windows build warning-free.

See http://reviews.llvm.org/D3914 for more details.

Change by Zachary Turner

llvm-svn: 209749

10 years agoRevert "[DAGCombiner] Split up an indexed load if only the base pointer value is...
Hal Finkel [Wed, 28 May 2014 15:33:19 +0000 (15:33 +0000)]
Revert "[DAGCombiner] Split up an indexed load if only the base pointer value is live"

This reverts r208640 (I've just XFAILed the test) because it broke ppc64/Linux
self-hosting. Because nearly every regression test triggers a segfault, I hope
this will be easy to fix.

llvm-svn: 209747

10 years agoInstCombine: Improvement to check if signed addition overflows.
Rafael Espindola [Wed, 28 May 2014 15:30:40 +0000 (15:30 +0000)]
InstCombine: Improvement to check if signed addition overflows.

This patch implements two things:

1. If we know one number is positive and another is negative, we return true as
   signed addition of two opposite signed numbers will never overflow.

2. Implemented TODO : If one of the operands only has one non-zero bit, and if
   the other operand has a known-zero bit in a more significant place than it
   (not including the sign bit) the ripple may go up to and fill the zero, but
   won't change the sign. e.x -  (x & ~4) + 1

We make sure that we are ignoring 0 at MSB.

Patch by Suyog Sarda.

llvm-svn: 209746

10 years agoRevert "[PPC] Use alias symbols in address computation."
Hal Finkel [Wed, 28 May 2014 15:25:06 +0000 (15:25 +0000)]
Revert "[PPC] Use alias symbols in address computation."

This reverts commit r209638 because it broke self-hosting on ppc64/Linux. (the
Clang-compiled TableGen would segfault because it jumped to an invalid address
from within _ZNK4llvm17ManagedStaticBase21RegisterManagedStaticEPFPvvEPFvS1_E
(which is within the command-line parameter registration process)).

llvm-svn: 209745

10 years agotsan: do not use 64-bit atomics in allocator code
Dmitry Vyukov [Wed, 28 May 2014 15:22:12 +0000 (15:22 +0000)]
tsan: do not use 64-bit atomics in allocator code
64-bit atomics make porting of asan to 32-bits platforms problematic.

llvm-svn: 209744

10 years agoRenamed runClangTidy argument Ranges to InputFiles, removed a TODO comment.
Alexander Kornienko [Wed, 28 May 2014 15:21:14 +0000 (15:21 +0000)]
Renamed runClangTidy argument Ranges to InputFiles, removed a TODO comment.
No functional changes.

llvm-svn: 209743

10 years agoDon't hard-code ld when extracting host linker version, use ${LD} if
Joerg Sonnenberger [Wed, 28 May 2014 15:12:55 +0000 (15:12 +0000)]
Don't hard-code ld when extracting host linker version, use ${LD} if
it is set.

llvm-svn: 209742

10 years agoRefactor muldf3 and mulsf3.
Joerg Sonnenberger [Wed, 28 May 2014 15:08:05 +0000 (15:08 +0000)]
Refactor muldf3 and mulsf3.

Patch from: GuanHong Liu
Differential Revision: http://reviews.llvm.org/D3886

llvm-svn: 209741

10 years agoRefactor addsf3.c and adddf3.c.
Joerg Sonnenberger [Wed, 28 May 2014 15:06:25 +0000 (15:06 +0000)]
Refactor addsf3.c and adddf3.c.

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

llvm-svn: 209740

10 years agoAvoid passing null signal name for Log %s argument
Ed Maste [Wed, 28 May 2014 14:11:20 +0000 (14:11 +0000)]
Avoid passing null signal name for Log %s argument

llvm-svn: 209739

10 years ago[DOC] Documentation for #pragma clang optimize on/off
Dario Domizioli [Wed, 28 May 2014 14:06:38 +0000 (14:06 +0000)]
[DOC] Documentation for #pragma clang optimize on/off

llvm-svn: 209738

10 years agoFix whitespace / formatting
Ed Maste [Wed, 28 May 2014 14:05:43 +0000 (14:05 +0000)]
Fix whitespace / formatting

llvm-svn: 209737

10 years ago[asan] Mass-xfail 17 tests on Android.
Evgeniy Stepanov [Wed, 28 May 2014 13:45:18 +0000 (13:45 +0000)]
[asan] Mass-xfail 17 tests on Android.

This makes check-asan pass on Android, which should help prevent future
regressions.

https://code.google.com/p/address-sanitizer/issues/detail?id=316

llvm-svn: 209736

10 years ago[sanitizer] Replace -lpthread with -pthread in tests.
Evgeniy Stepanov [Wed, 28 May 2014 13:13:30 +0000 (13:13 +0000)]
[sanitizer] Replace -lpthread with -pthread in tests.

-lpthread does not work on Android.

llvm-svn: 209735

10 years ago[asan] XFAIL:android several tests.
Evgeniy Stepanov [Wed, 28 May 2014 13:07:39 +0000 (13:07 +0000)]
[asan] XFAIL:android several tests.

llvm-svn: 209734

10 years ago[ASan tests] Exclude some tests from Windows runs
Timur Iskhodzhanov [Wed, 28 May 2014 13:06:14 +0000 (13:06 +0000)]
[ASan tests] Exclude some tests from Windows runs

Some features are not supported yet and some are not planned to be fixed soon

llvm-svn: 209733

10 years ago-pthread does not translate to -lpthread on Android.
Evgeniy Stepanov [Wed, 28 May 2014 12:53:34 +0000 (12:53 +0000)]
-pthread does not translate to -lpthread on Android.

There is no libpthread.so, and pthread interface is implemented in libc.so.
This mirrors gcc behavior.

llvm-svn: 209731

10 years agoAdd a PR reference for XFAILed test
Alp Toker [Wed, 28 May 2014 12:26:32 +0000 (12:26 +0000)]
Add a PR reference for XFAILed test

llvm-svn: 209730

10 years agoTest requires exceptions
Alp Toker [Wed, 28 May 2014 12:20:23 +0000 (12:20 +0000)]
Test requires exceptions

It's still XFAIL, but slightly closer to passing.

llvm-svn: 209729

10 years agoConsolidate some note diagnostics
Alp Toker [Wed, 28 May 2014 12:20:14 +0000 (12:20 +0000)]
Consolidate some note diagnostics

These note diags have the same message and can be unified further but for now
let's just bring them together.

Incidental change: Display a source range in the final attr diagnostic.

llvm-svn: 209728

10 years agoFix line endings.
Nikola Smiljanic [Wed, 28 May 2014 11:19:43 +0000 (11:19 +0000)]
Fix line endings.

llvm-svn: 209727

10 years agoLet clang/test/CodeGen/pr19841.cpp tolerant of MS mangler.
NAKAMURA Takumi [Wed, 28 May 2014 10:53:06 +0000 (10:53 +0000)]
Let clang/test/CodeGen/pr19841.cpp tolerant of MS mangler.

llvm-svn: 209726

10 years agoclang-format: Don't break before a case's colon.
Daniel Jasper [Wed, 28 May 2014 10:09:11 +0000 (10:09 +0000)]
clang-format: Don't break before a case's colon.

Before (with just the right line length:
  switch (a) {
  case some_namespace::some_constant
      :
    return;
  }

After:
  switch (a) {
  case some_namespace::
      some_constant:
    return;
  }

llvm-svn: 209725

10 years ago[asan] Fix android test setup.
Evgeniy Stepanov [Wed, 28 May 2014 09:58:58 +0000 (09:58 +0000)]
[asan] Fix android test setup.

llvm-svn: 209724

10 years agoAdd 'nonnull' parameter or return attribute when producing an llvm pointer type in...
Nick Lewycky [Wed, 28 May 2014 09:56:42 +0000 (09:56 +0000)]
Add 'nonnull' parameter or return attribute when producing an llvm pointer type in a function type where the C++ type is a reference. Update the tests.

llvm-svn: 209723

10 years ago[ASan tests] Move one more test to POSIX-only directory
Timur Iskhodzhanov [Wed, 28 May 2014 09:38:51 +0000 (09:38 +0000)]
[ASan tests] Move one more test to POSIX-only directory

llvm-svn: 209722

10 years ago[asancov] Don't emit extra runtime calls when compiling without coverage.
Evgeniy Stepanov [Wed, 28 May 2014 09:26:46 +0000 (09:26 +0000)]
[asancov] Don't emit extra runtime calls when compiling without coverage.

llvm-svn: 209721

10 years agoclang-format: Format array and dict literals similar to blocks.
Daniel Jasper [Wed, 28 May 2014 09:11:53 +0000 (09:11 +0000)]
clang-format: Format array and dict literals similar to blocks.

Especially, reduce the amount of indentation if it doesn't increase
readability.

Before:
  NSMutableDictionary* dictionary = [NSMutableDictionary
      dictionaryWithDictionary:@{
                                 aaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaa,
                                 bbbbbbbbbbbbbbbbbb : bbbbb,
                                 cccccccccccccccc : ccccccccccccccc
                               }];

After:
  NSMutableDictionary* dictionary =
      [NSMutableDictionary dictionaryWithDictionary:@{
        aaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaa,
        bbbbbbbbbbbbbbbbbb : bbbbb,
        cccccccccccccccc : ccccccccccccccc
      }];

llvm-svn: 209720

10 years ago[ASan/Win] Use clang rather than clang-cl by default for lit tests. Make Windows...
Timur Iskhodzhanov [Wed, 28 May 2014 08:38:13 +0000 (08:38 +0000)]
[ASan/Win] Use clang rather than clang-cl by default for lit tests. Make Windows-only tests explicitly use clang-cl.

Reviewed at http://reviews.llvm.org/D3893

llvm-svn: 209719

10 years ago[asan] Add a dll thunk for __sanitizer_cov_module_init.
Evgeniy Stepanov [Wed, 28 May 2014 08:34:53 +0000 (08:34 +0000)]
[asan] Add a dll thunk for __sanitizer_cov_module_init.

llvm-svn: 209718

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