Commit Graph

169604 Commits

Author SHA1 Message Date
Daniel Jasper a58dd5db29 clang-format: Fix another false positive in the lambda detection.
Before:
  int i = (*b)[a] -> f();

After:
  int i = (*b)[a]->f();

llvm-svn: 203557
2014-03-11 10:03:33 +00:00
Daniel Jasper d3c7ab975f clang-format: Fix incorrect lambda recognition exposed by r203452.
Before:
  int i = a[a][a] -> f();

After:
  int i = a[a][a]->f();

llvm-svn: 203556
2014-03-11 09:59:36 +00:00
Hafiz Abid Qadeer cd7bdbbba2 Removed code that conditionally included pthread.h for mingw.
This header is generally not available on mingw and can cause build errors.
The windows host code does provide timespec definition that can be used for
mingw case.

llvm-svn: 203555
2014-03-11 09:50:36 +00:00
NAKAMURA Takumi 6c336fa5a7 clang::HeaderSearch: Use default constructor even for POD.
Unfortunately, msvc 2012 didn't accept non-static member initializer.

llvm-svn: 203554
2014-03-11 09:37:27 +00:00
Erik Verbruggen e2d437148a GVN: merge overflow intrinsics with non-overflow instructions.
When an overflow intrinsic is followed by a non-overflow instruction,
replace the latter with an extract. For example:

  %sadd = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %a, i32 %b)
  %sadd3 = add i32 %a, %b

Here the add statement will be replaced by an extract.

When an overflow intrinsic follows a non-overflow instruction, a clone
of the intrinsic is inserted before the normal instruction, which makes
it the same as the previous case. Subsequent runs of GVN can then clean
up the duplicate instructions and insert the extract.

This fixes PR8817.

llvm-svn: 203553
2014-03-11 09:36:48 +00:00
Erik Verbruggen 1d95d18edd Fix fixme: remove unused method.
llvm-svn: 203552
2014-03-11 09:32:50 +00:00
Daniel Jasper c580af96fa clang-format: Detect weird macro lambda usage.
Before:
  void f() {
    MACRO((const AA & a) { return 1; });
  }

After:
  void f() {
    MACRO((const AA &a) { return 1; });
  }

llvm-svn: 203551
2014-03-11 09:29:46 +00:00
NAKAMURA Takumi 020b32de0d clang/test/Modules/include-relative.c REQUIRES shell due to chdir.
llvm-svn: 203550
2014-03-11 09:00:49 +00:00
Richard Smith b81b196a58 Tests for DR381-388.
llvm-svn: 203549
2014-03-11 07:49:32 +00:00
Richard Smith 52e3fbaee8 Revert C++11ification in r203534 and r203536. Apparently our toolchains aren't
ready for this yet.

llvm-svn: 203548
2014-03-11 07:17:35 +00:00
Craig Topper 9140dd2fe7 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203547
2014-03-11 06:50:42 +00:00
Justin Bogner ffaa2330b9 test: Regenerate profile data for PGO tests
Some of this data had gotten out of date, so we weren't quite testing
what we thought we were. This also moves the outdated data test to its
own file to simplify regenerating the test data.

llvm-svn: 203546
2014-03-11 06:49:34 +00:00
David Blaikie 0e18ed2eba Fix use of uninitialized variable in ExternalASTSourceTest.cpp (introduced in 203525)
llvm-svn: 203545
2014-03-11 06:49:26 +00:00
Tobias Grosser 4ba60fe9eb ScheduleOptimizer: Fix prevectorization.
In case we are at the innermost band, we try to prepare for vectorization. This
means, we look for the innermost parallel loop and strip mine this loop to the
innermost level using a strip-mine factor corresponding to the number of vector
iterations.

For whatever reason, the code that implemented this feature was broken. We now
added a comment, a test case and obviously also the right code.

llvm-svn: 203544
2014-03-11 06:27:36 +00:00
Craig Topper cbce6e9e63 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203543
2014-03-11 06:22:39 +00:00
Argyrios Kyrtzidis 34fad42003 [HeaderSearch] Fix issue where if a headermap entry maps the filename to a framework import (non-absolute path)
then we fail to find it if it is re-included later on.

rdar://16285490

llvm-svn: 203542
2014-03-11 06:21:28 +00:00
Justin Bogner 52a6a97d70 test: Give instrumentation based profiling tests their own directory
These tests are logically related, but they're spread about several
different CodeGen directories. Consolidate them in one place to make
them easier to manage.

llvm-svn: 203541
2014-03-11 04:37:49 +00:00
Justin Bogner a4fb799d00 test: Fix feature test for "native" in lit.cfg
Checking if the host arch is in the triple isn't quite correct. Change
the feature test to match llvm's, which made the same change in r193459.

llvm-svn: 203540
2014-03-11 04:34:17 +00:00
Marshall Clow b33d838bcf Final bit for LWG #2263; test different allocator pointer types. Note that libc++ already does the right thing here; I've just added tests to ensure that it stays this way.
llvm-svn: 203539
2014-03-11 04:32:12 +00:00
Craig Topper e6f17d0cac De-virtualize a method since it doesn't override anything and isn't overridden itself.
llvm-svn: 203538
2014-03-11 04:07:52 +00:00
Craig Topper 3164f33f8f [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203537
2014-03-11 03:39:26 +00:00
Richard Smith cf91493176 Speculative workaround for apparent libstdc++ bug exposed by r203534.
llvm-svn: 203536
2014-03-11 03:30:30 +00:00
Richard Trieu 99e1c9515a Move the warning about unused relational comparison from -Wunused-value to
-Wunused-comparison.  Also, newly warn on unused result from overloaded
relational comparisons, now also in -Wunused-comparison.

llvm-svn: 203535
2014-03-11 03:11:08 +00:00
Richard Smith d91747980a If a visibility update record is found for a DeclContext after that Decl has
already been loaded, apply that update record to the Decl immediately, rather
than adding it to a pending list and never applying it.

llvm-svn: 203534
2014-03-11 03:10:46 +00:00
Saleem Abdulrasool 1108cb3682 update for renaming in LLVM
llvm-svn: 203533
2014-03-11 03:09:08 +00:00
Saleem Abdulrasool efbf8367e6 build: use LLVM build routines
Check if the compiler actually supports the flags that are being added.
Previously, the compiler flags would be used improperly push the flags to the
compiler.  Particularly, on Darwin, the option would be pushed to the compiler
even if it does not support it.

llvm-svn: 203532
2014-03-11 03:08:53 +00:00
Saleem Abdulrasool 12390847fb build: fix bleeding whitespace
llvm-svn: 203531
2014-03-11 03:08:47 +00:00
Saleem Abdulrasool 5e1780e228 Object: rename ARMV7 to ARMNT
The official specifications state the name to be ARMNT (as per the Microsoft
Portable Executable and Common Object Format Specification v8.3).

llvm-svn: 203530
2014-03-11 03:08:37 +00:00
Duncan P. N. Exon Smith cec1c2486a Cleanup whitespace
llvm-svn: 203529
2014-03-11 02:44:45 +00:00
Richard Smith 723928c7dc If a module map is found in a relative -I path, convert the filenames within it
to absolute paths when building the includes file for the module. Without this,
the module build would fail, because the relative paths we were using are not
necessarily relative to a directory in our include path.

llvm-svn: 203528
2014-03-11 02:02:47 +00:00
Matt Arsenault 0211714ecb R600: Calculate store mask instead of using switch.
llvm-svn: 203527
2014-03-11 01:38:53 +00:00
Matt Arsenault 3d99402131 Add helpers for getting scalar sizes of vector value types.
llvm-svn: 203526
2014-03-11 01:38:48 +00:00
Richard Smith 023d2ca451 Add a unittest for the ExternalASTSource.
llvm-svn: 203525
2014-03-11 01:18:47 +00:00
Jim Grosbach c94d993adf X86: Enable ISel of 16-bit MOVBE instructions.
When the MOVBE instructions are available, use them for 16-bit endian
swapping as well as for 32 and 64 bit.

The patterns were already present on the instructions, but weren't being
matched because the operation was unconditionally marked to 'Expand.'
Change that to be conditional on whether the MOVBE instructions are
available. Use 'rolw' to implement the in-register version (32 and 64
bit have the dedicated 'bswap' instruction for that).

Patch by Louis Gerbarg <lgg@apple.com>.

rdar://15479984

llvm-svn: 203524
2014-03-11 00:44:14 +00:00
NAKAMURA Takumi 8800becdd1 MultiJITTest.cpp: Tweak getPointerToNamedFunction() to be aware of also Windows x64.
In import thunk, jmp is:
  - On x86, 0xFF 0x25 [disp32].
  - On x64, 0xFF 0x25 [pcrel32].

See also my r144178.

llvm-svn: 203523
2014-03-11 00:34:38 +00:00
David Majnemer 2f1f1818bf Basic: Add -Wswitch-bool to control warn_bool_switch_condition
This warning was missing a flag, add one.

test/Misc/warning-flags.c has one fewer entry.

llvm-svn: 203522
2014-03-11 00:26:28 +00:00
Fariborz Jahanian f322f2fb61 Objective-C IRGen. Fixes several regressions caused by changes made
to setting of ObjC linkages. //rdar://16206443

llvm-svn: 203521
2014-03-11 00:25:05 +00:00
Evan Cheng bf371db951 Follow up to r203488. Code clean up to eliminate a lot of copy+paste.
llvm-svn: 203520
2014-03-11 00:24:20 +00:00
Matt Arsenault 532db69984 Fix undefined behavior in vector shift tests.
These were all shifting the same amount as the bitwidth.

llvm-svn: 203519
2014-03-11 00:01:41 +00:00
Matt Arsenault faa297e89e Remove incomplete comment
llvm-svn: 203518
2014-03-11 00:01:37 +00:00
Matt Arsenault 6dde30354a Move trivial getter into header.
llvm-svn: 203517
2014-03-11 00:01:34 +00:00
Matt Arsenault 9504d2f269 Use .data() instead of &x[0]
llvm-svn: 203516
2014-03-11 00:01:31 +00:00
Matt Arsenault e1f1da30f4 Fix indentation
llvm-svn: 203515
2014-03-11 00:01:27 +00:00
Matt Arsenault 95b714c749 Fix non 2-space indentation.
llvm-svn: 203514
2014-03-11 00:01:25 +00:00
Duncan P. N. Exon Smith 56cc990480 Module: Don't rename in getOrInsertFunction()
During LTO, user-supplied definitions of C library functions often
exist.  -instcombine uses Module::getOrInsertFunction() to get a handle
on library functions (e.g., @puts, when optimizing @printf).

Previously, Module::getOrInsertFunction() would rename any matching
functions with local linkage, and create a new declaration.  In LTO,
this is the opposite of desired behaviour, as it skips by the
user-supplied version of the library function and creates a new
undefined reference which the linker often cannot resolve.

After some discussing with Rafael on the list, it looks like it's
undesired behaviour.  If a consumer actually *needs* this behaviour, we
should add new API with a more explicit name.

I added two testcases: one specifically for the -instcombine behaviour
and one for the LTO flow.

<rdar://problem/16165191>

llvm-svn: 203513
2014-03-10 23:42:28 +00:00
Jason Molenda 2528631f12 Minor fix for a logging message.
llvm-svn: 203512
2014-03-10 23:18:34 +00:00
Ben Langmuir 101390e116 Add -fmodules-cache-path to test/Headers/c11.c
This started failing for me the last time someone modified the AST file
format. It would be nice if we could just have lit take care of the
module cache used during testing for us, but this helps in the meantime.

llvm-svn: 203511
2014-03-10 23:17:14 +00:00
DeLesley Hutchins d1c9b37db9 Thread safety analysis: move smart pointer checks from -Wthread-safety-beta
to -Wthread-safety.

llvm-svn: 203510
2014-03-10 23:03:49 +00:00
Raul E. Silvera ce376c0fcb When analyzing vectors of element type that require legalization,
the legalization cost must be included to get an accurate
estimation of the total cost of the scalarized vector.
The inaccurate cost triggered unprofitable SLP vectorization on
32-bit X86.

Summary:
Include legalization overhead when computing scalarization cost

Reviewers: hfinkel, nadav

CC: chandlerc, rnk, llvm-commits

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

llvm-svn: 203509
2014-03-10 22:59:13 +00:00
Diego Novillo 92aa8c220a Use discriminator information in sample profiles.
Summary:
When the sample profiles include discriminator information,
use the discriminator values to distinguish instruction weights
in different basic blocks.

This modifies the BodySamples mapping to map <line, discriminator> pairs
to weights. Instructions on the same line but different blocks, will
use different discriminator values. This, in turn, means that the blocks
may have different weights.

Other changes in this patch:

- Add tests for positive values of line offset, discriminator and samples.
- Change data types from uint32_t to unsigned and int and do additional
  validation.

Reviewers: chandlerc

CC: llvm-commits

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

llvm-svn: 203508
2014-03-10 22:41:28 +00:00