Commit Graph

180297 Commits

Author SHA1 Message Date
Daniel Jasper 4718944399 clang-format: Add special comments to disable formatting.
With this patch:
  int ThisWillBeFormatted;
  // clang-format off
  int   ThisWontBeFormatted;
  // clang-format on
  int Formatted;

This is for regions where a significantly nicer code layout can be found
knowing the content of the code.

This fixes llvm.org/PR20463.

llvm-svn: 214966
2014-08-06 13:40:26 +00:00
James Molloy 99917946da [AArch64] Add a testcase for r214957.
llvm-svn: 214965
2014-08-06 13:31:32 +00:00
Daniel Jasper 316ab38ed8 clang-format: Fix indentation in multi-line placement new.
Before:
  auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
      new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))
      typename aaaaaaaaaaaaaaaaaaaaaaaa();

After:
  auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
      new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))
          typename aaaaaaaaaaaaaaaaaaaaaaaa();

llvm-svn: 214964
2014-08-06 13:14:58 +00:00
James Molloy 568da0990e Add a new option -run-slp-after-loop-vectorization.
This swaps the order of the loop vectorizer and the SLP/BB vectorizers. It is disabled by default so we can do performance testing - ideally we want to change to having the loop vectorizer running first, and the SLP vectorizer using its leftovers instead of the other way around.

llvm-svn: 214963
2014-08-06 12:56:19 +00:00
Manuel Klimek d9b4ad6e1f Fix modelling of non-lifetime-extended temporary destructors in the analyzer.
1. Changes to the CFG:
When creating the CFG for temporary destructors, we create a structure
that mirrors the branch structure of the conditionally executed
temporary constructors in a full expression.
The branches we create use a CXXBindTemporaryExpr as terminator which
corresponds to the temporary constructor which must have been executed
to enter the destruction branch.

2. Changes to the Analyzer:
When we visit a CXXBindTemporaryExpr we mark the CXXBindTemporaryExpr as
executed in the state; when we reach a branch that contains the
corresponding CXXBindTemporaryExpr as terminator, we branch out
depending on whether the corresponding CXXBindTemporaryExpr was marked
as executed.

llvm-svn: 214962
2014-08-06 12:45:51 +00:00
Alexander Kornienko b3d331d18d Rename ChecksFilter to GlobList, as there's nothing specific to checks in it.
Summary:
Rename ChecksFilter to GlobList, as there's nothing specific to checks in it.
It's a rather generic way to represent sets of strings (or patterns), so it may
be used for something else in ClangTidy. The new name would not look strange
when used to filter other entities.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 214961
2014-08-06 11:49:10 +00:00
Ed Maste a11da0c8cd Add decorators for tests failing to build on the lab.llvm.org FreeBSD buildbot
llvm.org/pr20548

llvm-svn: 214960
2014-08-06 11:43:54 +00:00
Tim Northover 2a417b96d4 ARM: do not generate BLX instructions on Cortex-M CPUs.
Particularly on MachO, we were generating "blx _dest" instructions on M-class
CPUs, which don't actually exist. They happen to get fixed up by the linker
into valid "bl _dest" instructions (which is why such a massive issue has
remained largely undetected), but we shouldn't rely on that.

llvm-svn: 214959
2014-08-06 11:13:14 +00:00
Tim Northover d4d294dd51 ARM-MachO: materialize callee address correctly on v4t.
llvm-svn: 214958
2014-08-06 11:13:06 +00:00
James Molloy f089ab70f4 [AArch64] Conditional selects are expensive on out-of-order cores.
Specifically Cortex-A57. This probably applies to Cyclone too but I haven't enabled it for that as I can't test it.

This gives ~4% improvement on SPEC 174.vpr, and ~1% in 471.omnetpp.

llvm-svn: 214957
2014-08-06 10:42:18 +00:00
Alexander Kornienko bc9f9928b7 check_clang_tidy_fix.sh: added comments, use set -o errexit instead of '|| exit $?' on each command
llvm-svn: 214956
2014-08-06 10:17:55 +00:00
Viktor Kutuzov a37ad099e8 Segregate FreeBSD-specific parts from sanitizer_procmaps_linux.cc
Differential Revision: http://reviews.llvm.org/D4555

llvm-svn: 214955
2014-08-06 10:16:52 +00:00
Chandler Carruth c3927cd8c9 [x86] Fix two independent miscompiles in the process of getting the same
test case to actually generate correct code.

The primary miscompile fixed here is that we weren't correctly handling
in-place elements in one half of a single-input v8i16 shuffle when
moving a dword of elements from that half to the other half. Some times,
we would clobber the in-place elements in forming the dword to move
across halves.

The fix to this involves forcibly marking the in-place inputs even when
there is no need to gather them into a dword, and to much more carefully
re-arrange the elements when grouping them into a dword to move across
halves. With these two changes we would generate correct shuffles for
the test case, but found another miscompile. There are also some random
perturbations of the generated shuffle pattern in SSE2. It looks like
a wash; more instructions in some cases fewer in others.

The second miscompile would corrupt the results into nonsense. This is
a buggy pattern in one of the added DAG combines. Mapping elements
through a PSHUFD when pairing redundant half-shuffles is *much* harder
than this code makes it out to be -- it requires reasoning about *all*
of where the input is used in the PSHUFD, not just one part of where it
is used. Plus, we can't combine a half shuffle *into* a PSHUFD but the
code didn't guard against it. I think this was just a bad idea and I've
just removed that aspect of the combine. No tests regress as
a consequence so seems OK.

llvm-svn: 214954
2014-08-06 10:16:36 +00:00
Chandler Carruth 8f23ba26d2 [x86] Switch to a formulation of a for loop that is much more obviously
not corrupting the mask by mutating it more times than intended. No
functionality changed (the results were non-overlapping so the old
version "worked" but was non-obvious).

llvm-svn: 214953
2014-08-06 10:16:33 +00:00
Benjamin Kramer 6fd227c9ad [clang-tidy] forward arguments of the testing script to clang-tidy.
llvm-svn: 214952
2014-08-06 08:19:30 +00:00
Adam Nemet 5ec912881f [X86] Fixes commit r214890 to match the posted patch
This was another fallout from my local rebase where something went wrong :(

llvm-svn: 214951
2014-08-06 07:13:12 +00:00
Simon Atanasyan 898b8ab5be [Driver] Add missed include header.
llvm-svn: 214950
2014-08-06 06:04:48 +00:00
Simon Atanasyan 9e49e145b1 [Driver] Move information about toolchain specific include directories
from the common driver code to the corresponding `MultilibSet` declarations.

Now the `MultilibSet` can hold an optional callback function which is
responsible to return a set of include directories specific for the toolchain.
That allows to remove MIPS toolchain specific directories from
`Linux::AddClangSystemIncludeArgs` method and simplify adding new directories
in the future.

llvm-svn: 214949
2014-08-06 05:44:47 +00:00
Rui Ueyama ce49b5ba98 [PECOFF] Exported symbols are dead-strip roots.
llvm-svn: 214948
2014-08-06 03:29:17 +00:00
David Majnemer ff9075f054 MS ABI: Mangle lambdas which are given the same mangling number
It is possible for lambdas to get the same mangling number because they
may exist in different mangling contexts.  To handle this correctly,
mangle the context into the name as well.

llvm-svn: 214947
2014-08-06 03:12:47 +00:00
Jim Ingham 862d1bbdf6 When stepping, handle the case where the step leaves us with
the same parent frame, but different current frame - e.g. when
you step past a tail call exit from a function.  Apply the same
"avoid-no-debug" rules to this case as for a "step-in".

<rdar://problem/16189225>

llvm-svn: 214946
2014-08-06 01:49:59 +00:00
Matt Arsenault 515c24b7e0 Correct comment
llvm-svn: 214945
2014-08-06 00:44:25 +00:00
Peter Collingbourne df240b252a [dfsan] Try not to create too many additional basic blocks in functions which
already have a large number of blocks. Works around a performance issue with
the greedy register allocator.

llvm-svn: 214944
2014-08-06 00:33:40 +00:00
Matt Arsenault d5f4de27b6 R600: Increase nearby load scheduling threshold.
This partially fixes weird looking load scheduling
in memcpy test. The load clustering doesn't seem
particularly smart, but this method seems to be partially
deprecated so it might not be worth trying to fix.

llvm-svn: 214943
2014-08-06 00:29:49 +00:00
Matt Arsenault c10853f29f R600/SI: Implement areLoadsFromSameBasePtr
This currently has a noticable effect on the kernel argument loads.
LDS and global loads are more problematic, I think because of how copies
are currently inserted to ensure that the address is a VGPR.

llvm-svn: 214942
2014-08-06 00:29:43 +00:00
Jim Ingham 6d8873f94b Probably should initialize that new ivar while I'm at it...
llvm-svn: 214941
2014-08-06 00:24:38 +00:00
Quentin Colombet 33ea1681ce [X86][SchedModel] Fixed some wrong scheduling model found by code inspection.
Source: Agner Fog's Instruction tables.

Related to <rdar://problem/15607571>

llvm-svn: 214940
2014-08-06 00:22:39 +00:00
David Blaikie fb0412f039 DebugInfo: Assert that any CU for which debug_loc lists are emitted, has at least one range.
This was coming in weird debug info that had variables (and hence
debug_locs) but was in GMLT mode (because it was missing the 13th field
of the compile_unit metadata) so no ranges were constructed. We should
always have at least one range for any CU with a debug_loc in it -
because the range should cover the debug_loc.

The assertion just ensures that the "!= 1" range case inside the
subsequent loop doesn't get entered for the case where there are no
ranges at all, which should never reach here in the first place.

llvm-svn: 214939
2014-08-06 00:21:25 +00:00
Jim Ingham 3b652621a9 Add a variant of the CommandOverrideCallback that takes a
CommandReturnObject.  Otherwise, all the overridden command
can do is say it overrode the command, not say what it did...

Also removed the duplicate definition of CommandOverrideCallback
from the private interfaces.

Now to figure out how to get this through the SB API's...

<rdar://problem/17911629>

llvm-svn: 214938
2014-08-06 00:10:12 +00:00
David Blaikie cabf54a313 DebugInfo: Fix a bunch of tests that, owing to their compile_unit metadata not including a 13th field, had some subtle behavior.
Without the 13th field, the "emission kind" field defaults to 0 (which
is not equal to either of the values of the emission kind enum (1 ==
full debug info, 2 == line tables only)).

In this particular instance, the comparison with "FullDebugInfo" was
done when adding elements to the ranges list - so for these test cases
no values were added to the ranges list.

This got weirder when emitting debug_loc entries as the addresses should
be relative to the range of the CU if the CU has only one range (the
reasonable assumption is that if we're emitting debug_loc lists for a CU
that CU has at least one range - but due to the above situation, it has
zero) so the ranges were emitted relative to the start of the section
rather than relative to the start of the CU's singular range.

Fix these tests by accounting for the difference in the description of
debug_loc entries (in some cases making the test ignorant to these
differences, in others adding the extra label difference expression,
etc) or the presence/absence of high/low_pc on the CU, and add the 13th
field to their CUs to enable proper "full debug info" emission here.

In a future commit I'll fix up a bunch of other test cases that are not
so rigorously depending on this behavior, but still doing similarly
weird things due to the missing 13th field.

llvm-svn: 214937
2014-08-05 23:57:31 +00:00
Matt Arsenault 1070511847 R600/SI: Add definitions for ds_read2st64_ / ds_write2st64_
llvm-svn: 214936
2014-08-05 23:53:20 +00:00
Rui Ueyama cfea160681 Remove trailing whitespaces
llvm-svn: 214935
2014-08-05 23:43:21 +00:00
JF Bastien ac8b66b32c Fix typos in comments and doc
Committing http://reviews.llvm.org/D4798 for Robin Morisset (morisset@google.com)

llvm-svn: 214934
2014-08-05 23:27:34 +00:00
David Blaikie e1a26a624d DebugInfo: Move the reference to the CU from the location list entry to the list itself, since it is constant across an entire list.
This simplifies construction and usage while making the data structure
smaller. It was a holdover from the days when we didn't have a separate
DebugLocList and all we had was a flat list of DebugLocEntries.

llvm-svn: 214933
2014-08-05 23:14:16 +00:00
David Majnemer 57fbc0c35f MS ABI: Mangle empty type parameter packs compatibly
The MS mangling scheme apparently has separate manglings for type and
non-type parameter packs when they are empty.  Match template arguments
with parameters during mangling; check the parameter to see if it was
destined to hold type-ish things or nontype-ish things.

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

llvm-svn: 214932
2014-08-05 22:43:45 +00:00
Reid Kleckner 74a6816b33 Fix Driver tests that I broke on Windows in r214924
llvm-svn: 214931
2014-08-05 22:39:07 +00:00
Eli Bendersky d28bc5e2f2 Expose the name mangling C API to Python bindings.
llvm-svn: 214930
2014-08-05 22:27:50 +00:00
Rafael Espindola b8141d55b9 Remove a virtual function from TargetMachine. NFC.
llvm-svn: 214929
2014-08-05 22:10:21 +00:00
Jonathan Roelofs ef84bda531 Re-apply r214881: Fix return sequence on armv4 thumb
This reverts r214893, re-applying r214881 with the test case relaxed a bit to
satiate the build bots.

POP on armv4t cannot be used to change thumb state (unilke later non-m-class
architectures), therefore we need a different return sequence that uses 'bx'
instead:

  POP {r3}
  ADD sp, #offset
  BX r3

This patch also fixes an issue where the return value in r3 would get clobbered
for functions that return 128 bits of data. In that case, we generate this
sequence instead:

  MOV ip, r3
  POP {r3}
  ADD sp, #offset
  MOV lr, r3
  MOV r3, ip
  BX lr

http://reviews.llvm.org/D4748

llvm-svn: 214928
2014-08-05 21:32:21 +00:00
Lang Hames ae17268a7e [MCJIT] Make llvm-rtdyld check RuntimeDyld's error state when running in -verify
mode.

This will cause -verify mode to report failure when RuntimeDyld encounters an
internal error (e.g. overflows in relocation computations). Previously we had
let these errors slip past unreported.

llvm-svn: 214925
2014-08-05 20:51:46 +00:00
Reid Kleckner 822434da9f Make crash diagnostics on Windows the tiniest bit more useful
This escapes any backslashes in the executable path and fixes an issue
with a trailing quote when the main file name had to be quoted during
printing.

It's impossible to test this without putting backslashes or quotes into
the executable path, so I didn't add automated tests.

The crash diagnostics are still only useful if you're using bash on
Windows, though.  This should probably be writing a batch file instead.

llvm-svn: 214924
2014-08-05 20:49:12 +00:00
Bill Schmidt 42a6936c78 [PowerPC] Swap arguments and adjust shift count for vsldoi on little endian
Commits r213915 and r214718 fix recognition of shuffle masks for vmrg*
and vpku*um instructions for a little-endian target, by swapping the
input arguments.  The vsldoi instruction requires similar treatment,
and also needs its shift count adjusted for little endian.

Reviewed by Ulrich Weigand.

This is a bug fix candidate for release 3.5 (and hopefully the last of
those for PowerPC).

llvm-svn: 214923
2014-08-05 20:47:25 +00:00
Ed Maste 6e496338e6 Force trace on system() failure on FreeBSD while tracking down buildbot issues
llvm-svn: 214922
2014-08-05 20:33:17 +00:00
Sanjay Patel 1954f2e924 Improved test cases that were added with r214892.
1. Added ':' to CHECK-LABELs
2. Added more CHECKs
3. Added CHECK-NEXTs
4. Added verbose hex immediate comments to CHECKs

llvm-svn: 214921
2014-08-05 20:16:35 +00:00
Rafael Espindola f9e52cf015 Don't internalize all but main by default.
This is mostly a cleanup, but it changes a fairly old behavior.

Every "real" LTO user was already disabling the silly internalize pass
and creating the internalize pass itself. The difference with this
patch is for "opt -std-link-opts" and the C api.

Now to get a usable behavior out of opt one doesn't need the funny
looking command line:

opt -internalize -disable-internalize -internalize-public-api-list=foo,bar -std-link-opts

llvm-svn: 214919
2014-08-05 20:10:38 +00:00
Rafael Espindola c03b6e7880 Add a test showing the interaction of linker scripts and plugin.
In particular, the linker script is processed early enough for function g
to be internalized.

llvm-svn: 214916
2014-08-05 19:56:53 +00:00
Chandler Carruth a746239be3 [x86] Fix a crasher due to shuffles which cancel each other out and add
a test case.

We also miscompile this test case which is showing a serious flaw in the
single-input v8i16 shuffle code. I've left the specific instruction
checks FIXME-ed out until I can address the bug in the single-input
code, but I wanted to separate out a significant functionality change to
produce correct code from a very simple and targeted crasher fix.

The miscompile problem stems from keeping track of inputs by value
rather than by index. As a consequence of doing this, we can't reliably
update those inputs because they might swap and we can't detect this
without copying the mask.

The blend code now uses indices for the input lists and this seems
strictly better. It also should make it easier to sort things and do
other cleanups. I think the time has come to simplify The Great Lambda
here.

llvm-svn: 214914
2014-08-05 18:45:49 +00:00
Dmitry Vyukov 70db9d4d72 tsan: allocate vector clocks using slab allocator
Vector clocks is the most actively allocated object in tsan runtime.
Current internal allocator is not scalable enough to handle allocation
of clocks in scalable way (too small caches). This changes transforms
clocks to 2-level array with 512-byte blocks. Since all blocks are of
the same size, it's possible to cache them more efficiently in per-thread caches.

llvm-svn: 214912
2014-08-05 18:45:02 +00:00
Fariborz Jahanian bcd82afad6 Introduce f[no-]max-unknown-pointer-align=[number] option
to instruct the code generator to not enforce a higher alignment 
than the given number (of bytes) when accessing memory via an opaque 
pointer or reference. Patch reviewed by John McCall (with post-commit
review pending). rdar://16254558

llvm-svn: 214911
2014-08-05 18:37:48 +00:00
Anton Yartsev 4e4cb6bc30 [Analyzer] fix for PR19102
Newly-created unconsumed instance is now assumed escaped if an invoked constructor has an argument of a pointer-to-record type.

llvm-svn: 214909
2014-08-05 18:26:05 +00:00