Commit Graph

175343 Commits

Author SHA1 Message Date
Evgeniy Stepanov 567e516015 [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
2014-05-27 12:37:52 +00:00
Manuel Klimek a2c2a4faa0 Make equalsNode work with pointers to subtypes.
llvm-svn: 209652
2014-05-27 12:31:10 +00:00
Tim Northover 1bed9afd30 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
2014-05-27 12:16:02 +00:00
Tim Northover 4f1909f1da 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
2014-05-27 10:43:38 +00:00
Manuel Klimek 909b5c94c0 Adds child traversal matchers for IfStmt's then and else branches.
llvm-svn: 209649
2014-05-27 10:04:12 +00:00
Daniel Jasper 73458c95ac Fix bad assert.
llvm-svn: 209648
2014-05-27 09:55:37 +00:00
Manuel Klimek 2af0a91cc4 Allow hasBody on CXXForRangeStmt nodes and update the docs.
llvm-svn: 209647
2014-05-27 07:45:18 +00:00
Tim Northover 4719041db7 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
2014-05-27 07:37:21 +00:00
Dinesh Dwivedi c0e6703360 Adding testcase for PR18886.
Differential Revision: http://reviews.llvm.org/D3837

llvm-svn: 209645
2014-05-27 06:44:25 +00:00
Simon Atanasyan 1c04babce3 [Mips] Handle relocations against __gnu_local_gp symbol.
llvm-svn: 209644
2014-05-27 05:23:16 +00:00
Filipe Cabecinhas 82ac07c283 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
2014-05-27 03:42:20 +00:00
Craig Topper 0dbb783c7b [C++11] Use 'nullptr'. StaticAnalyzer edition.
llvm-svn: 209642
2014-05-27 02:45:47 +00:00
Greg Fitzgerald 7b15cf8884 On AArch64, use clone() instead of fork()
Patch by Gideon Billings.

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

llvm-svn: 209641
2014-05-26 23:44:55 +00:00
Rafael Espindola 3bc64d54a9 Fix link.
llvm-svn: 209640
2014-05-26 21:30:40 +00:00
Rafael Espindola 19913ee160 Use existing helper function.
No functionality change.

llvm-svn: 209639
2014-05-26 19:57:55 +00:00
Rafael Espindola ac69cee6a2 [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
2014-05-26 19:08:19 +00:00
Tim Northover 68ae503de9 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
2014-05-26 17:22:07 +00:00
Tim Northover 47e003c65d 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
2014-05-26 17:21:53 +00:00
Aaron Ballman 5a1ef6b411 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
2014-05-26 17:03:54 +00:00
Michael Zolotukhin 265dfa411c Some cleanup for r209568.
llvm-svn: 209634
2014-05-26 14:49:46 +00:00
Ed Maste 1ae28dd793 Add stdlib.h for malloc and friends
llvm-svn: 209633
2014-05-26 14:07:26 +00:00
Ed Maste 8c43ed45ef 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
2014-05-26 14:04:29 +00:00
Ed Maste 4c433e5206 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
2014-05-26 13:57:15 +00:00
Ed Maste d60480f7b6 Add missing header
Presumably included by header leakage on other platforms.

llvm-svn: 209630
2014-05-26 13:48:38 +00:00
Timur Iskhodzhanov d67df369cf [ASan tests] Use ASAN_OPTIONS in a portable way
llvm-svn: 209629
2014-05-26 13:44:57 +00:00
Rafael Espindola acef6c776b Convert a few loops to use ranges.
llvm-svn: 209628
2014-05-26 13:38:51 +00:00
Tilmann Scheller cc3ebc8a98 [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
2014-05-26 13:36:47 +00:00
Daniel Jasper 60553be5fd clang-format: Split up moveStateToNextToken.
No functional changes intended.

llvm-svn: 209626
2014-05-26 13:10:39 +00:00
Sergey Matveev a531058d2b [MSan] Implement __sanitizer_print_stack_trace().
llvm-svn: 209625
2014-05-26 13:08:08 +00:00
Tilmann Scheller 112ada831f [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
2014-05-26 12:15:51 +00:00
Kostya Serebryany 4d237a8503 [asan] decrease asan-instrumentation-with-call-threshold from 10000 to 7000, see PR17409
llvm-svn: 209623
2014-05-26 11:57:16 +00:00
Timur Iskhodzhanov 9011eb81cf [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
2014-05-26 11:54:20 +00:00
Tim Northover effb876f4e AArch64: remove empty ARM64 directories from svn.
llvm-svn: 209621
2014-05-26 11:25:33 +00:00
Timur Iskhodzhanov 5873419af7 [ASan/Win tests] Use the env keyword in the SUAR tests to work with gnuwin/lit correctly
llvm-svn: 209620
2014-05-26 11:25:32 +00:00
Tilmann Scheller 968d599dc4 Remove accidentally committed whitespace.
llvm-svn: 209619
2014-05-26 09:40:40 +00:00
Tilmann Scheller 2d746bcda3 [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
2014-05-26 09:37:19 +00:00
Owen Anderson 115aa160e6 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
2014-05-26 08:58:51 +00:00
Simon Atanasyan e145a7da87 [Mips] Do not count global GOT entries using the separate variable. Use
size of global GOT entries map for that.

llvm-svn: 209616
2014-05-26 08:32:38 +00:00
Daniel Jasper ba1b6bb667 clang-format: Keep '{' of dict literals on the same line in Allman style
Before:
  void f()
  {
    [object
        someMethod:@
        { @"a" : @"b" }];
  }

After:
  void f()
  {
    [object someMethod:@{ @"a" : @"b" }];
  }

This fixes llvm.org/PR19854.

llvm-svn: 209615
2014-05-26 07:24:34 +00:00
David Blaikie 10743a9e6d DebugInfo: Test linkonce-odr functions under LTO.
This was previously regressed/broken by r192749 (reverted due to this
issue in r192938) and I was about to break it again by accident with
some more invasive changes that deal with the subprogram lists. So to
avoid that and further issues - here's a test.

It's a pretty basic test - in both r192749 and my impending case, this
test would crash, but checking the basics (that we put a subprogram in
just one of the two CUs) seems like a good start.

We still get this wrong in weird ways if the linkonce-odr function
happens to not be identical in the metadata (because it's defined in two
different files (hence the # line directives in this test), etc) even
though it meets the language requirements (identical token stream) for
such a thing. That results in two subprogram DIEs, but only one of them
gets the parameter and high/low pc information, etc. We probably need to
use the DIRef infrastructure to deduplicate functions as we do types to
address this issue - or perhaps teach the BC linker to remove the
duplicate entries in subprogram lists?

llvm-svn: 209614
2014-05-26 06:44:52 +00:00
Craig Topper c3ec149bb2 [C++11] Use 'nullptr'. Sema edition.
llvm-svn: 209613
2014-05-26 06:22:03 +00:00
Craig Topper 236bde3d6f [C++11] Use 'nullptr'.
llvm-svn: 209612
2014-05-26 06:21:51 +00:00
David Blaikie ab53c91010 DwarfUnit: Remove some misleading no-op code introduced in r204162.
Post commit review feedback from Manman called this out, but it looks
like it slipped through the cracks.

llvm-svn: 209611
2014-05-26 05:32:21 +00:00
Rafael Espindola f557536f56 Just check the entire string.
Thanks to David Blaikie for the suggestion.

llvm-svn: 209610
2014-05-26 04:08:51 +00:00
NAKAMURA Takumi f1b81c6e04 Reformat linefeeds.
llvm-svn: 209609
2014-05-26 00:25:26 +00:00
NAKAMURA Takumi 2667c3eac5 Trailing whitespace.
llvm-svn: 209608
2014-05-26 00:25:09 +00:00
Saleem Abdulrasool 65dbbb5dd6 tools: avoid use of std::function
Remove the use of the std::function and replace the capturing lambda with a
non-capturing one, opting to pass the user data down to the context.  This is
needed as std::function is not yet available on all hosted platforms (it
requires RTTI, which breaks on Windows).

Thanks to Nico Rieck for pointing this out!

llvm-svn: 209607
2014-05-25 21:37:59 +00:00
Saleem Abdulrasool e8839a755a tools: split out Win64EHDumper from COFFDumper
Move the implementation of the Win64 EH printer from the COFFDumper into its own
class.  This is in preparation for adding support to print ARM EH information.
The only real change here is in printUnwindInfo where we now lambda lift the
implicit this parameter for the resolveFunction.  Also setup the printing to
handle ARM.  This now has set the stage to introduce ARM EH printing.

llvm-svn: 209606
2014-05-25 20:26:45 +00:00
Saleem Abdulrasool 4e08f62775 tools: inline simple single-use function
This inlines the single use function in preparation for splitting the Win64EH
printing out of the COFFDumper into its own entity.

llvm-svn: 209605
2014-05-25 20:26:40 +00:00
Saleem Abdulrasool 5dd27f42f9 tools: refactor COFFDumper symbol resolution logic
Make the use of the cache more transparent to the users.  There is no reason
that the cached entries really need to be passed along.  The overhead for doing
so is minimal: a single extra parameter.  This requires that some standalone
functions be brought into the COFFDumper class so that they may access the
cache.

llvm-svn: 209604
2014-05-25 20:26:37 +00:00