Commit Graph

168031 Commits

Author SHA1 Message Date
Chandler Carruth 25adb7b00c [SROA] Use the original load name with the SROA-prefixed IRB rather than
just "load". This helps avoid pointless de-duping with order-sensitive
numbers as we already have unique names from the original load. It also
makes the resulting IR quite a bit easier to read.

llvm-svn: 202140
2014-02-25 11:21:48 +00:00
Chandler Carruth cb93cd2dc9 [SROA] Thread the ability to add a pointer-specific name prefix through
the pointer adjustment code. This is the primary code path that creates
totally new instructions in SROA and being able to lump them based on
the pointer value's name for which they were created causes
*significantly* fewer name collisions and general noise in the debug
output. This is particularly significant because it is making it much
harder to track down instability in the output of SROA, as name
de-duplication is a totally harmless form of instability that gets in
the way of seeing real problems.

The new fancy naming scheme tries to dig out the root "pre-SROA" name
for pointer values and associate that all the way through the pointer
formation instructions. Digging out the root is important to prevent the
multiple iterative rounds of SROA from just layering too much cruft on
top of cruft here. We already track the layers of SROAs iteration in the
alloca name prefix. We don't need to duplicate it here.

Should have no functionality change, and shouldn't have any really
measurable impact on NDEBUG builds, as most of the complex logic is
debug-only.

llvm-svn: 202139
2014-02-25 11:19:56 +00:00
Tim Northover 3d4575cc1b AArch64 NEON: add 64-bit scalar intrinsics for _f64 mla/mls etc.
These seem to be supported by GCC, and do make sense architecturally so we
should probably have them.

llvm-svn: 202138
2014-02-25 11:13:49 +00:00
Tim Northover 87da936164 ARM NEON: add _f16 support to a couple of vector-shuffling intrinsics.
llvm-svn: 202137
2014-02-25 11:13:42 +00:00
Chandler Carruth 5117553301 [SROA] Rather than copying the logic for building a name prefix into the
PHI-pointer builder, just copy the builder and clobber the obvious
fields.

llvm-svn: 202136
2014-02-25 11:12:04 +00:00
Chandler Carruth 8183a50f9b [SROA] Simplify some of the logic to dig out the old pointer value by
using OldPtr more heavily. Lots of this code was written before the
rewriter had an OldPtr member setup ahead of time. There are already
asserts in place that should ensure this doesn't change any
functionality.

llvm-svn: 202135
2014-02-25 11:08:02 +00:00
Chandler Carruth 7625c54eb4 [SROA] Adjust to new clang-format style.
llvm-svn: 202134
2014-02-25 11:07:58 +00:00
David Majnemer 19d7d5463f IRGen: Remove a stale comment
This comment survived the transition from ForceInline to InlineAlways,
fix it.

llvm-svn: 202133
2014-02-25 10:51:14 +00:00
Kostya Serebryany 01be296dbb [sanitizer] support pthread_rwlock_rd* in deadlock detector
llvm-svn: 202132
2014-02-25 10:33:37 +00:00
David Majnemer 67e541e1c8 Attr: Remove ForceInline
The __forceinline keyword's semantics are now recast as AlwaysInline and
the kw___forceinline token has its language mode set for KEYMS.

This preserves the semantics of the previous implementation but with
less duplication of code.

llvm-svn: 202131
2014-02-25 09:53:29 +00:00
Nico Rieck 01143f9a51 Reuse constants for COFF string table entry offsets
llvm-svn: 202130
2014-02-25 09:50:40 +00:00
Chandler Carruth a8c4cc68f5 [SROA] Fix a *glaring* bug in r202091: you have to actually *write*
the break statement, not just think it to yourself....

No idea how this worked at all, much less survived most bots, my
bootstrap, and some bot bootstraps!

The Polly one didn't survive, and this was filed as PR18959. I don't
have a reduced test case and honestly I'm not seeing the need. What we
probably need here are better asserts / debug-build behavior in
SmallPtrSet so that this madness doesn't make it so far.

llvm-svn: 202129
2014-02-25 09:45:27 +00:00
Kostya Serebryany fd88edfddb [sanitizer] partially support pthread_rwlock_* (no rd* form yet)
llvm-svn: 202128
2014-02-25 09:33:10 +00:00
Renato Golin dd8c801871 Disable old JIT unittests for AARch64
llvm-svn: 202127
2014-02-25 09:31:05 +00:00
Renato Golin 69736692d8 Ignore old JIT tests in AARch64 - CMake style
llvm-svn: 202126
2014-02-25 09:31:00 +00:00
Renato Golin 882e947de7 Add aarch64 to config.guess
llvm-svn: 202125
2014-02-25 09:30:54 +00:00
Kostya Serebryany a1a6391d19 [asan] Fix for size_t in Asan's new and delete operators on x64 FreeBSD in 32-bit mode, only for FreeBSD <= 9.2; patch by Viktor Kutuzov
llvm-svn: 202124
2014-02-25 08:45:59 +00:00
Kostya Serebryany 8f240ec03f [tsan] add deadlock detector tests for pthread_spin_lock
llvm-svn: 202123
2014-02-25 08:42:34 +00:00
Alexey Samsonov 97c22f79e1 Enable UBSan on FreeBSD. Patch by Viktor Kutuzov.
llvm-svn: 202122
2014-02-25 08:29:36 +00:00
David Majnemer ae88b72ac8 AttributeReference: Document __single_inhertiance, __multiple_inheritance, __virtual_inheritance
Add documentation for these attributes, it includes:
- Motivation for their existence.
- Examples on how to use them.
- Examples on how to misuse them.

llvm-svn: 202121
2014-02-25 08:28:55 +00:00
Kostya Serebryany 11f4f30fa7 [sanitizer] add support for try_lock in deadlock detector
llvm-svn: 202120
2014-02-25 08:24:15 +00:00
Alexey Samsonov 26af6f7f1b Silence GCC warning
llvm-svn: 202119
2014-02-25 07:56:00 +00:00
Kostya Serebryany 6d54611fd4 [sanitizer] fix epoch handling in deadlock detector (before the fix, we could have had edges from locks in the previous epoch to locks in the current epoch)
llvm-svn: 202118
2014-02-25 07:34:41 +00:00
David Majnemer 27d8b20ee5 Modules: Fix malformed reStructuredText
llvm-svn: 202117
2014-02-25 06:22:25 +00:00
Alp Toker ba7eab09d6 Fix typo in the td source too
r202112 fixed the generated output which will hopefully go away soon.

llvm-svn: 202116
2014-02-25 06:02:42 +00:00
Ted Kremenek db07694102 Remove dead assignment reported by Gautier DI FOLCO.
llvm-svn: 202115
2014-02-25 05:58:54 +00:00
Ted Kremenek bce562be03 Remove the FormatSecurity diagnostic group from the FormatNonLiteral warning group.
The FormatSecurity warning group does not need to be a sub-group
of the FormatNonLiteral group.

Patch by Zach Davis!

llvm-svn: 202114
2014-02-25 05:42:31 +00:00
Rui Ueyama d08472f6c3 [COFF] Refactor .drectve section handling. No functionality change.
llvm-svn: 202113
2014-02-25 05:37:47 +00:00
David Majnemer 6fe8a7fe8a AttributeReference: Fix a typo
llvm-svn: 202112
2014-02-25 05:33:01 +00:00
Shankar Easwaran 2ea5148eff [LinkerScript] OUTPUT_FORMAT: Parse Quoted Strings
llvm-svn: 202111
2014-02-25 05:17:24 +00:00
Jim Ingham 5881318c88 Allow debugserver to detach from the target if the connection is
unexpectedly closed.

llvm-svn: 202110
2014-02-25 04:53:13 +00:00
Ben Langmuir 47ff9ab1be Allow multi-component paths in VFS file nodes
This allows the 'name' field to contain a path, like

{ 'type': 'directory',
  'name': '/path/to/dir',
  'contents': [ ... ] }

which not only simplifies reading and writing these files (for humans),
but makes it possible to easily modify locations via textual
replacement, which would not have worked in the old scheme.

E.g. sed s:<ROOT>:<NEW ROOT>

llvm-svn: 202109
2014-02-25 04:34:14 +00:00
Alp Toker f45fa3dca5 Fix typos
llvm-svn: 202108
2014-02-25 04:21:44 +00:00
Alp Toker 70b36995e4 Fix typos
llvm-svn: 202107
2014-02-25 04:21:15 +00:00
Chandler Carruth 83cee7722d [SROA] Add a debugging tool which shuffles the slices sequence prior to
sorting it. This helps uncover latent reliance on the original ordering
which aren't guaranteed to be preserved by std::sort (but often are),
and which are based on the use-def chain orderings which also aren't
(technically) guaranteed.

Only available in C++11 debug builds, and behind a flag to prevent noise
at the moment, but this is generally useful so figured I'd put it in the
tree rather than keeping it out-of-tree.

llvm-svn: 202106
2014-02-25 03:59:29 +00:00
Argyrios Kyrtzidis 0b9682efa4 [libclang] Introduce libclang APIs for creating a buffer with a JSON virtual file overlay description.
The current API only supports adding 'virtual file path' -> 'real file path' mappings.

rdar://15986708

llvm-svn: 202105
2014-02-25 03:59:23 +00:00
Argyrios Kyrtzidis 09a439d313 [libclang] Include "BuildSystem.h" along with "Index.h"
llvm-svn: 202104
2014-02-25 03:59:16 +00:00
Chandler Carruth bb2a93241d [SROA] Use a more direct way of determining whether we are processing
the destination operand or source operand of a memmove.

It so happens that it was impossible for SROA to try to rewrite
self-memmove where the operands are *identical*, because either such
a think is volatile (and we don't rewrite) or it is non-volatile, and we
don't even register it as a use of the alloca.

However, making the 'IsDest' test *rely* on this subtle fact is... Very
confusing for the reader. We should use the direct and readily available
test of the Use* which gives us concrete information about which operand
is being rewritten.

No functionality changed, I hope! ;]

llvm-svn: 202103
2014-02-25 03:50:14 +00:00
Chandler Carruth fbe7dc3309 Add some convenience accessors for the underlying Use of an operand.
These complement many of the existing accessors and make it
significantly easier to write code which needs to poke at the underlying
Use without hard coding the operand number at which it resides for
a particular instruction. No functionality changed of course.

llvm-svn: 202102
2014-02-25 03:34:17 +00:00
Shankar Easwaran 7a0818dd4a [test] use llvm-config to drive testing in assert mode/debug mode
llvm-svn: 202101
2014-02-25 02:29:17 +00:00
Shankar Easwaran 822ea4f9a3 [LinkerScript] parse OUTPUT_ARCH.
llvm-svn: 202100
2014-02-25 01:55:13 +00:00
David Majnemer 5090d9a732 AST: Simplify CharUnits::alignmentAtOffset
CharUnits::alignmentAtOffset is equivalent to llvm::MinAlign but
slightly less efficient.  Use it's implementation instead.

llvm-svn: 202099
2014-02-25 01:47:33 +00:00
David Majnemer e385d89ce6 IRGen: Simplify alignment calculation in setBitFieldInfo
Take advantage of CharUnits::alignmentAtOffset instead of calculating it
by hand.

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

llvm-svn: 202098
2014-02-25 01:20:15 +00:00
Reid Kleckner fab1e89de9 MS ABI: Return sret parameters when using inalloca
Previously the X86 backend would look for the sret attribute and handle
this for us.  inalloca takes that all away, so we have to do the return
ourselves now.

llvm-svn: 202097
2014-02-25 00:59:14 +00:00
Nick Lewycky 1ce017e8cb Indent this continued line.
llvm-svn: 202096
2014-02-25 00:43:21 +00:00
Alp Toker d71f168602 Silence -Wdeprecated-register warnings with clang
llvm-svn: 202095
2014-02-25 00:38:58 +00:00
NAKAMURA Takumi 210fbcdd5a clang/test/Preprocessor/init.c: Split conditions to win32 and non-win32.
FIXME: Implement and check x86_64-cygwin.
llvm-svn: 202094
2014-02-25 00:30:14 +00:00
NAKAMURA Takumi 051b40c1cb Suppress clang/test/Driver/clang_f_opts.c for targeting cygming since r202058 is incompatible to gcc driver.
llvm-svn: 202093
2014-02-25 00:30:04 +00:00
Chandler Carruth 3bf18ed5e3 [SROA] Fix another instability in SROA with respect to the slice
ordering.

The fundamental problem that we're hitting here is that the use-def
chain ordering is *itself* not a stable thing to be relying on in the
rewriting for SROA. Further, we use a non-stable sort over the slices to
arrange them based on the section of the alloca they're operating on.
With a debugging STL implementation (or different implementations in
stage2 and stage3) this can cause stage2 != stage3.

The specific aspect of this problem fixed in this commit deals with the
rewriting and load-speculation around PHIs and Selects. This, like many
other aspects of the use-rewriting in SROA, is really part of the
"strong SSA-formation" that is doen by SROA where it works very hard to
canonicalize loads and stores in *just* the right way to satisfy the
needs of mem2reg[1]. When we have a select (or a PHI) with 2 uses of the
same alloca, we test that loads downstream of the select are
speculatable around it twice. If only one of the operands to the select
needs to be rewritten, then if we get lucky we rewrite that one first
and the select is immediately speculatable. This can cause the order of
operand visitation, and thus the order of slices to be rewritten, to
change an alloca from promotable to non-promotable and vice versa.

The fix is to defer all of the speculation until *after* the rewrite
phase is done. Once we've rewritten everything, we can accurately test
for whether speculation will work (once, instead of twice!) and the
order ceases to matter.

This also happens to simplify the other subtlety of speculation -- we
need to *not* speculate anything unless the result of speculating will
make the alloca fully promotable by mem2reg. I had a previous attempt at
simplifying this, but it was still pretty horrible.

There is actually already a *really* nice test case for this in
basictest.ll, but on multiple STL implementations and inputs, we just
got "lucky". Fortunately, the test case is very small and we can
essentially build it in exactly the opposite way to get reasonable
coverage in both directions even from normal STL implementations.

llvm-svn: 202092
2014-02-25 00:07:09 +00:00
David Blaikie 1d4736e0b1 llvm-dwarfdump: Support for debug_line.dwo section for file names for type units under fission.
llvm-svn: 202091
2014-02-24 23:58:54 +00:00