platform/upstream/llvm.git
11 years agotsan: move trace header into 0x600000000000 range
Dmitry Vyukov [Wed, 20 Mar 2013 10:31:53 +0000 (10:31 +0000)]
tsan: move trace header into 0x600000000000 range
eliminat thread "dead info" altogether

llvm-svn: 177512

11 years agoUpdate source/DataFormatters/CMakeLists.txt to reflect actual source files.
Andy Gibbs [Wed, 20 Mar 2013 10:30:02 +0000 (10:30 +0000)]
Update source/DataFormatters/CMakeLists.txt to reflect actual source files.

llvm-svn: 177511

11 years agotsan: add internal_unlink() function
Dmitry Vyukov [Wed, 20 Mar 2013 10:28:36 +0000 (10:28 +0000)]
tsan: add internal_unlink() function

llvm-svn: 177510

11 years agoDon't remove all indentation when in #defines.
Daniel Jasper [Wed, 20 Mar 2013 10:23:53 +0000 (10:23 +0000)]
Don't remove all indentation when in #defines.

Otherwise, this can become hard to read.

Before: #define A \
        case 1:
After:  #define A \
           case 1:
llvm-svn: 177509

11 years ago[ASan] Move malloc stats collection away from AsanThreadRegistry class.
Alexey Samsonov [Wed, 20 Mar 2013 10:11:24 +0000 (10:11 +0000)]
[ASan] Move malloc stats collection away from AsanThreadRegistry class.

llvm-svn: 177508

11 years agoFix Makefile.
Daniel Jasper [Wed, 20 Mar 2013 10:02:35 +0000 (10:02 +0000)]
Fix Makefile.

llvm-svn: 177507

11 years agoAdd clang-format binary to cfe.
Daniel Jasper [Wed, 20 Mar 2013 09:53:23 +0000 (09:53 +0000)]
Add clang-format binary to cfe.

llvm-svn: 177506

11 years agoImprove formatting of function types in template parameters.
Daniel Jasper [Wed, 20 Mar 2013 09:53:18 +0000 (09:53 +0000)]
Improve formatting of function types in template parameters.

Before: A<int * (int)>;
After:  A<int *(int)>;
llvm-svn: 177505

11 years agoRemove clang-format from clang-tools-extra.
Daniel Jasper [Wed, 20 Mar 2013 09:52:50 +0000 (09:52 +0000)]
Remove clang-format from clang-tools-extra.

llvm-svn: 177504

11 years agoUpdate source/Expression/CMakeLists.txt to reflect actual source files.
Andy Gibbs [Wed, 20 Mar 2013 09:34:46 +0000 (09:34 +0000)]
Update source/Expression/CMakeLists.txt to reflect actual source files.

llvm-svn: 177503

11 years agoasan/tsan: reduce per-thread memory allocator caches
Dmitry Vyukov [Wed, 20 Mar 2013 09:26:46 +0000 (09:26 +0000)]
asan/tsan: reduce per-thread memory allocator caches
256 blocks (which is 512 in reallity) seems to be too big cache,
reducing the size reduces memory consumption but does not degrade performance.

llvm-svn: 177502

11 years ago[ASan] Move GetCurrentThread/SetCurrentThread from AsanThreadRegistry class into...
Alexey Samsonov [Wed, 20 Mar 2013 09:23:28 +0000 (09:23 +0000)]
[ASan] Move GetCurrentThread/SetCurrentThread from AsanThreadRegistry class into plain functions: they don't actually use registry

llvm-svn: 177501

11 years agotsan: fix flaky test
Dmitry Vyukov [Wed, 20 Mar 2013 09:22:13 +0000 (09:22 +0000)]
tsan: fix flaky test

llvm-svn: 177500

11 years agotsan: fix incorrect test
Dmitry Vyukov [Wed, 20 Mar 2013 09:21:49 +0000 (09:21 +0000)]
tsan: fix incorrect test

llvm-svn: 177499

11 years agoFix a silly search-and-replace goof with r177495 that only broke
Chandler Carruth [Wed, 20 Mar 2013 07:40:56 +0000 (07:40 +0000)]
Fix a silly search-and-replace goof with r177495 that only broke
non-release builds.

llvm-svn: 177498

11 years ago[sanitizer] Enable prctl interceptor on Android.
Evgeniy Stepanov [Wed, 20 Mar 2013 07:35:52 +0000 (07:35 +0000)]
[sanitizer] Enable prctl interceptor on Android.

llvm-svn: 177497

11 years agoFix redundant comparison in gcc::Common::ConstructJob.
Hans Wennborg [Wed, 20 Mar 2013 07:34:27 +0000 (07:34 +0000)]
Fix redundant comparison in gcc::Common::ConstructJob.

We were checking "Arch == llvm::Triple::x86_64 || Arch
== llvm::Triple::x86_64", but the rhs should actually check for
powerpc64.

Found while experimenting with a potential new Clang warning.

llvm-svn: 177496

11 years ago[SROA] Don't preserve the IR names in release builds.
Chandler Carruth [Wed, 20 Mar 2013 07:30:36 +0000 (07:30 +0000)]
[SROA] Don't preserve the IR names in release builds.

This is espcially important because the new SROA pass goes to great
lengths to provide helpful names for debugging, and as a consequence
they can become very slow to render.

Good for between 5% and 15% of the SROA runtime on some slow test cases
such as the one in PR15412.

llvm-svn: 177495

11 years agoMove the endif to the correct line so we don't have warnings about
Chandler Carruth [Wed, 20 Mar 2013 06:47:00 +0000 (06:47 +0000)]
Move the endif to the correct line so we don't have warnings about
unused statistics variables.

llvm-svn: 177494

11 years agoIntroduce some new statistics to help track the exact behavior of the
Chandler Carruth [Wed, 20 Mar 2013 06:30:46 +0000 (06:30 +0000)]
Introduce some new statistics to help track the exact behavior of the
new SROA pass.

llvm-svn: 177493

11 years agoReorder the DIFile parameter in DINameSpace
David Blaikie [Wed, 20 Mar 2013 06:27:06 +0000 (06:27 +0000)]
Reorder the DIFile parameter in DINameSpace

Moving the DIFile parameter to immediately proceed the tag so that it will be a
common prefix with other DIScopes (once the DIFile is replaced with the raw
file/directory pair).

llvm-svn: 177492

11 years agoWork-in-progress documentation on the experimental modules feature.
Douglas Gregor [Wed, 20 Mar 2013 06:25:14 +0000 (06:25 +0000)]
Work-in-progress documentation on the experimental modules feature.

llvm-svn: 177491

11 years agoRemove some dead code.
John McCall [Wed, 20 Mar 2013 06:22:14 +0000 (06:22 +0000)]
Remove some dead code.

Patch by Stephen Lin!

llvm-svn: 177490

11 years agoAdd a test case for PR15318 fixed in r177472
Hao Liu [Wed, 20 Mar 2013 06:18:06 +0000 (06:18 +0000)]
Add a test case for PR15318 fixed in r177472

llvm-svn: 177489

11 years agoDon't assume the test directory is writable, use %T to find a writable
Nick Lewycky [Wed, 20 Mar 2013 05:59:40 +0000 (05:59 +0000)]
Don't assume the test directory is writable, use %T to find a writable
directory.

llvm-svn: 177488

11 years agoTest DW_TAG_namespace support in the backend
David Blaikie [Wed, 20 Mar 2013 05:15:37 +0000 (05:15 +0000)]
Test DW_TAG_namespace support in the backend

This is the backend portion of a Clang test case
(clang/test/CodeGenCXX/debug-info-namespace.cpp) that was roughly/coarsely
testing LLVM.

llvm-svn: 177487

11 years agoProvide more details for DINameSpace debug info in the IR comment annotations
David Blaikie [Wed, 20 Mar 2013 05:14:14 +0000 (05:14 +0000)]
Provide more details for DINameSpace debug info in the IR comment annotations

Sorry for the version skew - I should've committed this before the
corresponding Clang test case.

llvm-svn: 177486

11 years agoMake front-end debug info namespace test frontend-only & more specific without overco...
David Blaikie [Wed, 20 Mar 2013 05:12:06 +0000 (05:12 +0000)]
Make front-end debug info namespace test frontend-only & more specific without overconstraining it

The backend portion of this test will be committed to LLVM's test suite.

llvm-svn: 177485

11 years ago[ELF][Hexagon] Add Hexagon dynamic relocations
Shankar Easwaran [Wed, 20 Mar 2013 05:10:02 +0000 (05:10 +0000)]
[ELF][Hexagon] Add Hexagon dynamic relocations

llvm-svn: 177484

11 years ago[ELF] Interp section is only needed in dynamic executables
Shankar Easwaran [Wed, 20 Mar 2013 05:06:40 +0000 (05:06 +0000)]
[ELF] Interp section is only needed in dynamic executables

llvm-svn: 177483

11 years ago[ELF] Order .got.plt properly
Shankar Easwaran [Wed, 20 Mar 2013 04:52:08 +0000 (04:52 +0000)]
[ELF] Order .got.plt properly

llvm-svn: 177482

11 years agoMake sure that Module::ConfigMacrosExhaustive gets initialized and deserialized corre...
Douglas Gregor [Wed, 20 Mar 2013 03:59:18 +0000 (03:59 +0000)]
Make sure that Module::ConfigMacrosExhaustive gets initialized and deserialized correctly.

This fixes regressions introduced in r177466 that caused several
module tests to fail sporadically.

llvm-svn: 177481

11 years agoTeach statement / declaration disambiguation about C++11-style generalized initializers.
Richard Smith [Wed, 20 Mar 2013 03:35:02 +0000 (03:35 +0000)]
Teach statement / declaration disambiguation about C++11-style generalized initializers.

llvm-svn: 177480

11 years agoRemove the Tools DensMap from the toolchain.
Rafael Espindola [Wed, 20 Mar 2013 03:05:54 +0000 (03:05 +0000)]
Remove the Tools DensMap from the toolchain.

Each toolchain has a set of tools, but they are all of known types. It can
have a linker, an assembler, a "clang" (compile, analyze, ...) a non-clang
compiler, etc.

Instead of keeping a map, just have member variable for each type of tool.

llvm-svn: 177479

11 years agoFix PR15296
Michael Liao [Wed, 20 Mar 2013 02:33:21 +0000 (02:33 +0000)]
Fix PR15296

- Move SRA/SRL/SHL lowering support from DAG combination to DAG lowering
  to support extended 256-bit integer in AVX but not AVX2.

llvm-svn: 177478

11 years agoMark all variable shifts needing customizing
Michael Liao [Wed, 20 Mar 2013 02:28:20 +0000 (02:28 +0000)]
Mark all variable shifts needing customizing

- Prepare moving logic from DAG combining into DAG lowering. There's no
  functionality change.

llvm-svn: 177477

11 years agoMove scalar immediate shift lowering into a dedicated func
Michael Liao [Wed, 20 Mar 2013 02:20:36 +0000 (02:20 +0000)]
Move scalar immediate shift lowering into a dedicated func

- no functionality change

llvm-svn: 177476

11 years agoThe flag "-coverage-function-names-in-data" is actually backwards -- we do
Nick Lewycky [Wed, 20 Mar 2013 02:14:38 +0000 (02:14 +0000)]
The flag "-coverage-function-names-in-data" is actually backwards -- we do
emit function names in .gcda files by default, and the flag turns that off!
Rename the flag to make it match what it actually does. This keeps the default
format compatible with gcc 4.2.

Also add a test for this flag.

llvm-svn: 177475

11 years agoFix test case regression on ARM & PPC introduced r177239
David Blaikie [Wed, 20 Mar 2013 01:55:11 +0000 (01:55 +0000)]
Fix test case regression on ARM & PPC introduced r177239

llvm-svn: 177474

11 years agoDon't look outside the innermost enclosing namespace when
John McCall [Wed, 20 Mar 2013 01:53:00 +0000 (01:53 +0000)]
Don't look outside the innermost enclosing namespace when
performing unqualified lookup for a friend class declaration.

rdar://13393749

llvm-svn: 177473

11 years agoFix AsmPrinter crashes with assertion. Bug 15318 in Bugzilla
Hao Liu [Wed, 20 Mar 2013 01:46:36 +0000 (01:46 +0000)]
Fix AsmPrinter crashes with assertion. Bug 15318 in Bugzilla

llvm-svn: 177472

11 years ago[ms-cxxabi] Fix assertion on unhandled function template arg types
Reid Kleckner [Wed, 20 Mar 2013 01:40:23 +0000 (01:40 +0000)]
[ms-cxxabi] Fix assertion on unhandled function template arg types

This code was changed in r158376 to get template argument source info
for better diagnostics, but the current code asserts for any kind of
unsupported template argument before it can issue a diagnostic.  This change
goes back to the Itanium implementation of isTemplate() and puts the argument
index into the diagnostic instead of a source location.

Review URL: http://llvm-reviews.chandlerc.com/D553

llvm-svn: 177471

11 years agoMake clang emit linkage names in debug info for subprograms when coverage info
Nick Lewycky [Wed, 20 Mar 2013 01:38:16 +0000 (01:38 +0000)]
Make clang emit linkage names in debug info for subprograms when coverage info
is enabled. Also add a new -test-coverage cc1 flag which makes testing coverage
possible and add our first clang-side coverage test.

llvm-svn: 177470

11 years ago[analyzer] Re-apply "Do part of the work to find shortest bug paths up front".
Jordan Rose [Wed, 20 Mar 2013 00:35:37 +0000 (00:35 +0000)]
[analyzer] Re-apply "Do part of the work to find shortest bug paths up front".

With the assurance that the trimmed graph does not contain cycles,
this patch is safe (with a few tweaks), and provides the performance
boost it was intended to.

Part of performance work for <rdar://problem/13433687>.

llvm-svn: 177469

11 years ago[analyzer] Break cycles (optionally) when trimming an ExplodedGraph.
Jordan Rose [Wed, 20 Mar 2013 00:35:31 +0000 (00:35 +0000)]
[analyzer] Break cycles (optionally) when trimming an ExplodedGraph.

Having a trimmed graph with no cycles (a DAG) is much more convenient for
trying to find shortest paths, which is exactly what BugReporter needs to do.

Part of the performance work for <rdar://problem/13433687>.

llvm-svn: 177468

11 years agoRefactor the DIFile (2nd) parameter to DITypes to be an MDNode reference to a raw...
David Blaikie [Wed, 20 Mar 2013 00:26:26 +0000 (00:26 +0000)]
Refactor the DIFile (2nd) parameter to DITypes to be an MDNode reference to a raw directory/file pair

This makes DIType's first non-tag parameter the same as DIFile's, allowing them
to both share the common implementation of getFilename/getDirectory in DIScope.

llvm-svn: 177467

11 years ago<rdar://problem/10796651> Introduce configuration macros into module maps.
Douglas Gregor [Wed, 20 Mar 2013 00:22:05 +0000 (00:22 +0000)]
<rdar://problem/10796651> Introduce configuration macros into module maps.

Configuration macros are macros that are intended to alter how a
module works, such that we need to build different module variants
for different values of these macros. A module can declare its
configuration macros, in which case we will complain if the definition
of a configation macro on the command line (or lack thereof) differs
from the current preprocessor state at the point where the module is
imported. This should eliminate some surprises when enabling modules,
because "#define CONFIG_MACRO ..." followed by "#include
<module/header.h>" would silently ignore the CONFIG_MACRO setting. At
least it will no longer be silent about it.

Configuration macros are eventually intended to help reduce the number
of module variants that need to be built. When the list of
configuration macros for a module is exhaustive, we only need to
consider the settings for those macros when building/finding the
module, which can help isolate modules for various project-specific -D
flags that should never affect how modules are build (but currently do).

llvm-svn: 177466

11 years agoPropagate DAG node ordering during type legalization and instruction selection
Justin Holewinski [Wed, 20 Mar 2013 00:10:32 +0000 (00:10 +0000)]
Propagate DAG node ordering during type legalization and instruction selection

A node's ordering is only propagated during legalization if (a) the new node does
not have an ordering (is not a CSE'd node), or (b) the new node has an ordering
that is higher than the node being legalized.

llvm-svn: 177465

11 years agoFix bug in test; found by AddressSanitizer
Marshall Clow [Wed, 20 Mar 2013 00:01:48 +0000 (00:01 +0000)]
Fix bug in test; found by AddressSanitizer

llvm-svn: 177464

11 years agoFix pr13145 - Naming a function like a register name confuses the asm parser.
Chad Rosier [Tue, 19 Mar 2013 23:44:03 +0000 (23:44 +0000)]
Fix pr13145 - Naming a function like a register name confuses the asm parser.
Patch by Stepan Dyatkovskiy <stpworld@narod.ru>
rdar://13457826

llvm-svn: 177463

11 years agoMove the DIFile operand to DITypes from the 4th operand to the 2nd.
David Blaikie [Tue, 19 Mar 2013 23:25:22 +0000 (23:25 +0000)]
Move the DIFile operand to DITypes from the 4th operand to the 2nd.

This is another step along the way to making all DIScopes have a common prefix
which can be added to in a general manner to support using directives
(DW_TAG_imported_module).

llvm-svn: 177462

11 years agoAnnotate various null idioms with SchedRW lists.
Jakob Stoklund Olesen [Tue, 19 Mar 2013 23:23:31 +0000 (23:23 +0000)]
Annotate various null idioms with SchedRW lists.

llvm-svn: 177461

11 years agoAnnotate SSE float conversions with SchedRW lists.
Jakob Stoklund Olesen [Tue, 19 Mar 2013 23:23:29 +0000 (23:23 +0000)]
Annotate SSE float conversions with SchedRW lists.

llvm-svn: 177460

11 years agoAnnotate X86InstrCMovSetCC.td with SchedRW lists.
Jakob Stoklund Olesen [Tue, 19 Mar 2013 23:23:26 +0000 (23:23 +0000)]
Annotate X86InstrCMovSetCC.td with SchedRW lists.

llvm-svn: 177459

11 years agoFormatting fixups.
Eric Christopher [Tue, 19 Mar 2013 23:10:26 +0000 (23:10 +0000)]
Formatting fixups.

llvm-svn: 177458

11 years agoSimplify/generalize some debug info test cases
David Blaikie [Tue, 19 Mar 2013 23:10:14 +0000 (23:10 +0000)]
Simplify/generalize some debug info test cases

Mostly, try to depend on the annotation comments more so these tests are more
legible, brief, and agnostic to schema changes in the future (sure, they're not
agnostic to changes to the comment annotations but since they're easier to read
they should be easier to update if that happens).

llvm-svn: 177457

11 years agoUpdated the IRExecutionUnit to keep local copies
Sean Callanan [Tue, 19 Mar 2013 23:03:21 +0000 (23:03 +0000)]
Updated the IRExecutionUnit to keep local copies
of the data it writes down into the process even
if the process doesn't exist.  This will allow
the IR interpreter to access static data allocated
on the expression's behalf.

Also cleaned up object ownership in the
IRExecutionUnit so that allocations are created
into the allocations vector.  This avoids needless
data copies.

<rdar://problem/13424594>

llvm-svn: 177456

11 years ago[analyzer] Add an integer version of the Circle tests in uninit-vals.m.
Jordan Rose [Tue, 19 Mar 2013 23:01:57 +0000 (23:01 +0000)]
[analyzer] Add an integer version of the Circle tests in uninit-vals.m.

A floating-point version is nice for testing unknown values, but it's
good to be able to check all parts of the structure as well.

Test change only, no functionality change.

llvm-svn: 177455

11 years agoThe formatters for std::shared_ptr, std::weak_ptr, std::list, std::vector and std...
Enrico Granata [Tue, 19 Mar 2013 22:58:48 +0000 (22:58 +0000)]
The formatters for std::shared_ptr, std::weak_ptr, std::list, std::vector and std::map as provided by libc++ are now written in C++ instead of Python
std::deque is still in Python but is much less commonly used

llvm-svn: 177454

11 years ago[analyzer] Do not believe lazy binding when symbolic region types do not match
Anna Zaks [Tue, 19 Mar 2013 22:38:09 +0000 (22:38 +0000)]
[analyzer] Do not believe lazy binding when symbolic region types do not match

This fixes a crash when analyzing LLVM that was exposed by r177220 (modeling of
trivial copy/move assignment operators).

When we look up a lazy binding for “Builder”, we see the direct binding of Loc at offset 0.
Previously, we believed the binding, which led to a crash. Now, we do not believe it as
the types do not match.

llvm-svn: 177453

11 years agoMarshall Clow found this memory problem in strstream using -fsanitize=address on...
Howard Hinnant [Tue, 19 Mar 2013 22:16:57 +0000 (22:16 +0000)]
Marshall Clow found this memory problem in strstream using -fsanitize=address on the test suite.

llvm-svn: 177452

11 years agoDead code.
Chad Rosier [Tue, 19 Mar 2013 22:13:05 +0000 (22:13 +0000)]
Dead code.

llvm-svn: 177451

11 years agoDead code.
Chad Rosier [Tue, 19 Mar 2013 22:12:47 +0000 (22:12 +0000)]
Dead code.

llvm-svn: 177450

11 years ago[analyzer] Add a test case for diagnostic suppression on a graph with cycles.
Jordan Rose [Tue, 19 Mar 2013 22:10:44 +0000 (22:10 +0000)]
[analyzer] Add a test case for diagnostic suppression on a graph with cycles.

(see previous commit)

llvm-svn: 177449

11 years agoRevert "[analyzer] Do part of the work to find shortest bug paths up front."
Jordan Rose [Tue, 19 Mar 2013 22:10:35 +0000 (22:10 +0000)]
Revert "[analyzer] Do part of the work to find shortest bug paths up front."

The whole reason we were doing a BFS in the first place is because an
ExplodedGraph can have cycles. Unfortunately, my removeErrorNode "update"
doesn't work at all if there are cycles.

I'd still like to be able to avoid doing the BFS every time, but I'll come
back to it later.

This reverts r177353 / 481fa5071c203bc8ba4f88d929780f8d0f8837ba.

llvm-svn: 177448

11 years agoMark TestChangeValueAPI.py as expected fail with gcc as it still reproduces.
Matt Kopec [Tue, 19 Mar 2013 22:00:10 +0000 (22:00 +0000)]
Mark TestChangeValueAPI.py as expected fail with gcc as it still reproduces.

llvm-svn: 177447

11 years ago[ms-inline asm] Move the immediate asm rewrite into the target specific
Chad Rosier [Tue, 19 Mar 2013 21:58:18 +0000 (21:58 +0000)]
[ms-inline asm] Move the immediate asm rewrite into the target specific
logic as a QOI cleanup.  No functional change.  Tests already in place.
rdar://13456414

llvm-svn: 177446

11 years agoUpdate global merge pass according to Duncan's advices:
Quentin Colombet [Tue, 19 Mar 2013 21:46:49 +0000 (21:46 +0000)]
Update global merge pass according to Duncan's advices:
- Remove useless includes
- Change misleading comments
- Move code into doFinalization

llvm-svn: 177445

11 years agoScopDetect: Remove some redundant semicolons
Tobias Grosser [Tue, 19 Mar 2013 21:44:07 +0000 (21:44 +0000)]
ScopDetect: Remove some redundant semicolons

llvm-svn: 177444

11 years agoThis is an optimization which produces improved launching time. There should be...
Howard Hinnant [Tue, 19 Mar 2013 21:34:48 +0000 (21:34 +0000)]
This is an optimization which produces improved launching time.  There should be no functionality change.  Clients should see no ABI differences.

llvm-svn: 177443

11 years agoAnnotate X86InstrCompiler.td with SchedRW lists.
Jakob Stoklund Olesen [Tue, 19 Mar 2013 21:16:56 +0000 (21:16 +0000)]
Annotate X86InstrCompiler.td with SchedRW lists.

Add a new WriteZero SchedWrite type for the common dependency-breaking
instructions that clear a register.

llvm-svn: 177442

11 years agoTest case for r177439 and r177440.
Chad Rosier [Tue, 19 Mar 2013 21:12:57 +0000 (21:12 +0000)]
Test case for r177439 and r177440.

llvm-svn: 177441

11 years ago[ms-inline asm] Remove the brackets from X86Operand in the IR. These will be
Chad Rosier [Tue, 19 Mar 2013 21:12:14 +0000 (21:12 +0000)]
[ms-inline asm] Remove the brackets from X86Operand in the IR. These will be
added back in by X86AsmPrinter::printIntelMemReference() during codegen.
Previously, this following example

  void t() {
    int i;
    __asm mov eax, [i]
  }

would generate the below assembly

  mov eax, dword ptr [[eax]]

which resulted in a fatal error when compiling.  Test case coming on the
clang side.
rdar://13444264

llvm-svn: 177440

11 years ago[ms-inline asm] Create a helper function, CreateMemForInlineAsm, that creates
Chad Rosier [Tue, 19 Mar 2013 21:11:56 +0000 (21:11 +0000)]
[ms-inline asm] Create a helper function, CreateMemForInlineAsm, that creates
an X86Operand, but also performs a Sema lookup and adds the sizing directive
when appropriate.  Use this when parsing a bracketed statement.  This is
necessary to get the instruction matching correct as well.  Test case coming
on clang side.
rdar://13455408

llvm-svn: 177439

11 years agoIndependentBlocks: Add a couple of test cases.
Tobias Grosser [Tue, 19 Mar 2013 21:11:25 +0000 (21:11 +0000)]
IndependentBlocks: Add a couple of test cases.

llvm-svn: 177438

11 years agoRegister the GCOV writeout functions so that they're emitted serially.
Bill Wendling [Tue, 19 Mar 2013 21:03:22 +0000 (21:03 +0000)]
Register the GCOV writeout functions so that they're emitted serially.

We don't want to write out >1000 files at the same time. That could make things
prohibitively expensive. Instead, register the "writeout" function so that it's
emitted serially.
<rdar://problem/12439551>

llvm-svn: 177437

11 years agoAdd a way to register and execute "writeout" functions.
Bill Wendling [Tue, 19 Mar 2013 21:01:19 +0000 (21:01 +0000)]
Add a way to register and execute "writeout" functions.

It may be prohibitively expensive to write out >1000 files at the same time. So
we would rather emit them serially. These functions allow the GCOV
implementation to register the functions that writeout the GCOV information per
compile unit. At exit, they are written.
<rdar://problem/12439551>

llvm-svn: 177436

11 years agoObjective-C [qoi]: Provide improved parse diagnostics when
Fariborz Jahanian [Tue, 19 Mar 2013 20:27:40 +0000 (20:27 +0000)]
Objective-C [qoi]: Provide improved parse diagnostics when
closing rbrace is missing in an ObjC class declaration.
Can do beter than this, but it involves addition of
overhead which will be present in correct code.
// rdar://6854840

llvm-svn: 177435

11 years agoAdd a comment to the CodeGen/PowerPC/asym-regclass-copy.ll test
Hal Finkel [Tue, 19 Mar 2013 20:22:32 +0000 (20:22 +0000)]
Add a comment to the CodeGen/PowerPC/asym-regclass-copy.ll test

llvm-svn: 177434

11 years agoScopDetection: Add a couple of test cases
Tobias Grosser [Tue, 19 Mar 2013 20:15:19 +0000 (20:15 +0000)]
ScopDetection: Add a couple of test cases

llvm-svn: 177433

11 years agoIndVarSimplify: do not recompute an IV value outside of the loop if :
Arnaud A. de Grandmaison [Tue, 19 Mar 2013 20:00:22 +0000 (20:00 +0000)]
IndVarSimplify: do not recompute an IV value outside of the loop if :

- it is trivially known to be used inside the loop in a way that can not be optimized away
- there is no use outside of the loop which can take advantage of the computation hoisting

llvm-svn: 177432

11 years agoAdd missing mayLoad flag to LHAUX8 and LWAUX.
Ulrich Weigand [Tue, 19 Mar 2013 19:53:27 +0000 (19:53 +0000)]
Add missing mayLoad flag to LHAUX8 and LWAUX.

All pre-increment load patterns need to set the mayLoad flag (since
they don't provide a DAG pattern).

This was missing for LHAUX8 and LWAUX, which is added by this patch.

llvm-svn: 177431

11 years agoRewrite LHAU8 pattern to use standard memory operand.
Ulrich Weigand [Tue, 19 Mar 2013 19:52:30 +0000 (19:52 +0000)]
Rewrite LHAU8 pattern to use standard memory operand.

As opposed to to pre-increment store patterns, the pre-increment
load patterns were already using standard memory operands, with
the sole exception of LHAU8.

As there's no real reason why LHAU8 should be different here,
this patch simply rewrites the pattern to also use a memri
operand, just like all the other patterns.

llvm-svn: 177430

11 years agoRewrite pre-increment store patterns to use standard memory operands.
Ulrich Weigand [Tue, 19 Mar 2013 19:52:04 +0000 (19:52 +0000)]
Rewrite pre-increment store patterns to use standard memory operands.

Currently, pre-increment store patterns are written to use two separate
operands to represent address base and displacement:

  stwu $rS, $ptroff($ptrreg)

This causes problems when implementing the assembler parser, so this
commit changes the patterns to use standard (complex) memory operands
like in all other memory access instruction patterns:

  stwu $rS, $dst

To still match those instructions against the appropriate pre_store
SelectionDAG nodes, the patch uses the new feature that allows a Pat
to match multiple DAG operands against a single (complex) instruction
operand.

Approved by Hal Finkel.

llvm-svn: 177429

11 years agoExtend TableGen instruction selection matcher to improve handling
Ulrich Weigand [Tue, 19 Mar 2013 19:51:09 +0000 (19:51 +0000)]
Extend TableGen instruction selection matcher to improve handling
of complex instruction operands (e.g. address modes).

Currently, if a Pat pattern creates an instruction that has a complex
operand (i.e. one that consists of multiple sub-operands at the MI
level), this operand must match a ComplexPattern DAG pattern with the
correct number of output operands.

This commit extends TableGen to alternatively allow match a complex
operands against multiple separate operands at the DAG level.

This allows using Pat patterns to match pre-increment nodes like
pre_store (which must have separate operands at the DAG level) onto
an instruction pattern that uses a multi-operand memory operand,
like the following example on PowerPC (will be committed as a
follow-on patch):

  def STWU  : DForm_1<37, (outs ptr_rc:$ea_res), (ins GPRC:$rS, memri:$dst),
                    "stwu $rS, $dst", LdStStoreUpd, []>,
                    RegConstraint<"$dst.reg = $ea_res">, NoEncode<"$ea_res">;

  def : Pat<(pre_store GPRC:$rS, ptr_rc:$ptrreg, iaddroff:$ptroff),
            (STWU GPRC:$rS, iaddroff:$ptroff, ptr_rc:$ptrreg)>;

Here, the pair of "ptroff" and "ptrreg" operands is matched onto the
complex operand "dst" of class "memri" in the "STWU" instruction.

Approved by Jakob Stoklund Olesen.

llvm-svn: 177428

11 years agoFix sub-operand size mismatch in tocentry operands.
Ulrich Weigand [Tue, 19 Mar 2013 19:50:30 +0000 (19:50 +0000)]
Fix sub-operand size mismatch in tocentry operands.

The tocentry operand class refers to 64-bit values (it is only used in 64-bit,
where iPTR is a 64-bit type), but its sole suboperand is designated as 32-bit
type.  This causes a mismatch to be detected at compile-time with the TableGen
patch I'll check in shortly.

To fix this, this commit changes the suboperand to a 64-bit type as well.

llvm-svn: 177427

11 years agoRemove an invalid and unnecessary Pat pattern from the X86 backend:
Ulrich Weigand [Tue, 19 Mar 2013 19:49:52 +0000 (19:49 +0000)]
Remove an invalid and unnecessary Pat pattern from the X86 backend:

  def : Pat<(load (i64 (X86Wrapper tglobaltlsaddr :$dst))),
            (MOV64rm tglobaltlsaddr :$dst)>;

This pattern is invalid because the MOV64rm instruction expects a
source operand of type "i64mem", which is a subclass of X86MemOperand
and thus actually consists of five MI operands, but the Pat provides
only a single MI operand ("tglobaltlsaddr" matches an SDnode of
type ISD::TargetGlobalTLSAddress and provides a single output).

Thus, if the pattern were ever matched, subsequent uses of the MOV64rm
instruction pattern would access uninitialized memory.  In addition,
with the TableGen patch I'm about to check in, this would actually be
reported as a build-time error.

Fortunately, the pattern does in fact never match, for at least two
independent reasons.

First, the code generator actually never generates a pattern of the
form (load (X86Wrapper (tglobaltlsaddr))).  For most combinations of
TLS and code models, (tglobaltlsaddr) represents just an offset that
needs to be added to some base register, so it is never directly
dereferenced.  The only exception is the initial-exec model, where
(tglobaltlsaddr) refers to the (pc-relative) address of a GOT slot,
which *is* in fact directly dereferenced: but in that case, the
X86WrapperRIP node is used, not X86Wrapper, so the Pat doesn't match.

Second, even if some patterns along those lines *were* ever generated,
we should not need an extra Pat pattern to match it.  Instead, the
original MOV64rm instruction pattern ought to match directly, since
it uses an "addr" operand, which is implemented via the SelectAddr
C++ routine; this routine is supposed to accept the full range of
input DAGs that may be implemented by a single mov instruction,
including those cases involving ISD::TargetGlobalTLSAddress (and
actually does so e.g. in the initial-exec case as above).

To avoid build breaks (due to the above-mentioned error) after the
TableGen patch is checked in, I'm removing this Pat here.

llvm-svn: 177426

11 years agoUpdate Sketch test case to capture this and use accessors for debugger, target, proce...
Greg Clayton [Tue, 19 Mar 2013 19:30:33 +0000 (19:30 +0000)]
Update Sketch test case to capture this and use accessors for debugger, target, process and thread.

llvm-svn: 177425

11 years agoFix "control reaches end of non-void function" compiling lld on gcc.
Andy Gibbs [Tue, 19 Mar 2013 19:13:36 +0000 (19:13 +0000)]
Fix "control reaches end of non-void function" compiling lld on gcc.

llvm-svn: 177424

11 years agoPrepare to make r0 an allocatable register on PPC
Hal Finkel [Tue, 19 Mar 2013 18:51:05 +0000 (18:51 +0000)]
Prepare to make r0 an allocatable register on PPC

Currently the PPC r0 register is unconditionally reserved. There are two reasons
for this:

 1. r0 is treated specially (as the constant 0) by certain instructions, and so
    cannot be used with those instructions as a regular register.

 2. r0 is used as a temporary register in the CR-register spilling process
    (where, under some circumstances, we require two GPRs).

This change addresses the first reason by introducing a restricted register
class (without r0) for use by those instructions that treat r0 specially. These
register classes have a new pseudo-register, ZERO, which represents the r0-as-0
use. This has the side benefit of making the existing target code simpler (and
easier to understand), and will make it clear to the register allocator that
uses of r0 as 0 don't conflict will real uses of the r0 register.

Once the CR spilling code is improved, we'll be able to allocate r0.

Adding these extra register classes, for some reason unclear to me, causes
requests to the target to copy 32-bit registers to 64-bit registers. The
resulting code seems correct (and causes no test-suite failures), and the new
test case covers this new kind of asymmetric copy.

As r0 is still reserved, no functionality change intended.

llvm-svn: 177423

11 years agoDon't replace macro usage if macro body has NULL
Edwin Vane [Tue, 19 Mar 2013 18:47:03 +0000 (18:47 +0000)]
Don't replace macro usage if macro body has NULL

In case of macro body expansion, check to see if the macro is named NULL and
don't replace inside the macro body. This fixes the case when NULL appears
inside the macro body and the transform replaces the usage of the macro with
nullptr. This is an easy fix for the problem for now and we should analyze the
macro body to see if it expands to only NullToPointer in the future for a more
robust solution that takes care of user defined macros that behaves like NULL.

Other changes:
- Moved complex macro tests to macros.cpp
- Added new test cases.
- Added checks to make sure that the macro bodies are not modified by the tool.

Fixes: PR15396

Author: Tareq A Siraj <tareq.a.siraj@intel.com>
llvm-svn: 177422

11 years agoOptimize sext <4 x i8> and <4 x i16> to <4 x i64>.
Nadav Rotem [Tue, 19 Mar 2013 18:38:27 +0000 (18:38 +0000)]
Optimize sext <4 x i8> and <4 x i16> to <4 x i64>.
Patch by Ahmad, Muhammad T <muhammad.t.ahmad@intel.com>

llvm-svn: 177421

11 years agoFix indentation for case: // comment.
Daniel Jasper [Tue, 19 Mar 2013 18:33:58 +0000 (18:33 +0000)]
Fix indentation for case: // comment.

Before:
switch (x) {
case 1:
    // Do amazing stuff
    {
  g();
  f();
}
}

After:
switch (x) {
case 1:
  // Do amazing stuff
  {
    g();
    f();
  }
}

llvm-svn: 177420

11 years agoRelax test to allow for attributes on other architectures. Caught by powerpc64-unknow...
Adrian Prantl [Tue, 19 Mar 2013 18:20:35 +0000 (18:20 +0000)]
Relax test to allow for attributes on other architectures. Caught by powerpc64-unknown-linux-gnu buildbot.

llvm-svn: 177419

11 years agoAnnotate X86InstrExtension.td with SchedRW lists.
Jakob Stoklund Olesen [Tue, 19 Mar 2013 18:03:58 +0000 (18:03 +0000)]
Annotate X86InstrExtension.td with SchedRW lists.

llvm-svn: 177418

11 years agoAnnotate a lot of X86InstrInfo.td with SchedRW lists.
Jakob Stoklund Olesen [Tue, 19 Mar 2013 18:03:55 +0000 (18:03 +0000)]
Annotate a lot of X86InstrInfo.td with SchedRW lists.

llvm-svn: 177417

11 years agoFixed incorrect python that was trying to validate that we got a valid lldb.SBThread...
Greg Clayton [Tue, 19 Mar 2013 17:59:30 +0000 (17:59 +0000)]
Fixed incorrect python that was trying to validate that we got a valid lldb.SBThread object by checking to see if it is equal to "None".

This test is incorrect as functions that return lldb.SBThread objects never return None, they just return lldb.SBThread objects that contain invalid opaque classes.

llvm-svn: 177416

11 years agoSplit long lines in multi-line comments.
Alexander Kornienko [Tue, 19 Mar 2013 17:41:36 +0000 (17:41 +0000)]
Split long lines in multi-line comments.

Summary: This is implementation for /* */ comments only.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D547

llvm-svn: 177415

11 years agoUpdate test for r177413.
Chad Rosier [Tue, 19 Mar 2013 17:32:36 +0000 (17:32 +0000)]
Update test for r177413.

llvm-svn: 177414

11 years ago[ms-inline asm] Move the size directive asm rewrite into the target specific
Chad Rosier [Tue, 19 Mar 2013 17:32:17 +0000 (17:32 +0000)]
[ms-inline asm] Move the size directive asm rewrite into the target specific
logic as a QOI cleanup.
rdar://13445327

llvm-svn: 177413