Commit Graph

167997 Commits

Author SHA1 Message Date
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
Ben Langmuir 509fe8fd63 Improve some gtest assertions
As requested during review, compare pointers to NULL explicitly to make what's
going on more clear.

llvm-svn: 202090
2014-02-24 23:44:17 +00:00
David Majnemer 1d4db8f719 AST: Small code cleanup
Move the pointer to be adjacent to the variable instead of the type.

No functional change.

llvm-svn: 202089
2014-02-24 23:43:27 +00:00
David Majnemer 8b6bd571c8 Sema: Make getPreferredTypeAlign respect alignments specified with an aligned attribute on a typedef
When calculating the preferred alignment of a type, consider if a alignment
attribute came from a typedef declaration.  If one did, do not naturally align
the type.

Patch by Stephan Tolksdorf, with a little tweaking and an additional testcase by me.

llvm-svn: 202088
2014-02-24 23:34:17 +00:00
Rafael Espindola aeff8a9c05 Make some DataLayout pointers const.
No functionality change. Just reduces the noise of an upcoming patch.

llvm-svn: 202087
2014-02-24 23:12:18 +00:00
Greg Clayton e68f5d6b69 Fixed the command line LLDB so that "CTRL+C" will interrupt a running process again.
llvm-svn: 202086
2014-02-24 22:50:57 +00:00
Bernard Ogden 301bafed78 Permit CMAKE_INSTALL_RPATH to be set on command line
Commit 201921 overrides setting of CMAKE_INSTALL_RPATH via the
command line. Last time this happened we applied another patch
to only set CMAKE_INSTALL_RPATH if already defined (r197825).
This patch does the same thing again, but only for the UNIX
case - we leave APPLE alone as presumably the original committer
is happy with the non-overriding behaviour.

llvm-svn: 202085
2014-02-24 22:23:43 +00:00
Albrecht Kadlec fbd12d35c8 trivial test commit
llvm-svn: 202084
2014-02-24 22:18:38 +00:00
Simon Atanasyan 2b614e1163 llvm-objdump: Do not attempt to disassemble symbols outside of section
boundaries.

It is possible to create an ELF executable where symbol from say .text
section 'points' to the address outside the section boundaries. It does
not have a sense to disassemble something outside the section.

Without this fix llvm-objdump prints finite or infinite (depends on
the executable file architecture) number of 'invalid instruction
encoding' warnings.

llvm-svn: 202083
2014-02-24 22:12:11 +00:00
Andrew Trick 6a162d850b Disable an MCJIT test on older Darwins until we have a better interface.
See
<rdar://16149106> [MCJIT] provide a platform-independent way to communicate callee-save frame info.
<rdar://16149279> [MCJIT] get the host OS version from a runtime check, not a configure-time check.

llvm-svn: 202082
2014-02-24 21:37:30 +00:00
Tom Stellard 7aee1cfa99 Fix build since r202052
sys::fs_F_Binary has been replaced with sys::fs_F_Text

llvm-svn: 202081
2014-02-24 21:31:56 +00:00
Matt Arsenault a81aee8277 Fix unused variable
llvm-svn: 202080
2014-02-24 21:16:50 +00:00
Nico Rieck b9d84f4d14 [lld] Include reference kind in cycle detector debug output
This restores the debug output to how it was before r197727 broke it. This
went undetected because the corresponding test was never run due to broken
feature detection.

llvm-svn: 202079
2014-02-24 21:14:37 +00:00
Nico Rieck 78f2b48e7d Fix feature detection in lld's lit.cfg
llvm-svn: 202078
2014-02-24 21:13:53 +00:00
Matt Arsenault 41e2f2bacd R600/SI - Add new CI arithmetic instructions.
Does not yet include larger part required
to match v_mad_i64_i32 / v_mad_u64_u32.

llvm-svn: 202077
2014-02-24 21:01:28 +00:00
Matt Arsenault d0ce2bd8e4 R600: Make check clearer.
The check is clearer as southern islands or later,
rather than checking for later than northern islands.

llvm-svn: 202076
2014-02-24 21:01:23 +00:00
Matt Arsenault 21a3faaf25 Fix DOT4 missing from getTargetOpcodeName
llvm-svn: 202075
2014-02-24 21:01:21 +00:00
Matt Arsenault b598f7b869 Add missing const
llvm-svn: 202074
2014-02-24 21:01:18 +00:00
Matt Arsenault 58a7639698 Trivial code simplification
llvm-svn: 202073
2014-02-24 21:01:15 +00:00
Ben Langmuir 97882e7b7f Pass through context for DiagHandler in VFS
This allows the unit tests to not use global state when checking
diagnostics.

llvm-svn: 202072
2014-02-24 20:56:37 +00:00
Richard Smith 5b2f7c5f60 If preprocessing results in a token with leading whitespace that was expanded
from a macro in column 0, ensure that we print whitespace before it in the -E
output. Patch by Harald van Dijk!

llvm-svn: 202070
2014-02-24 20:50:36 +00:00
Peter Collingbourne dec2c8657e Follow up to r201927: remove the Sema::InFunctionDeclarator field.
llvm-svn: 202069
2014-02-24 20:45:14 +00:00
Richard Smith f2baa70396 If the first token in a macro that appears at the start of a line expands to
nothing, be sure to inform the *next* token expanded from the macro that it is
now at the start of a line. Patch by Harald van Dijk!

llvm-svn: 202068
2014-02-24 20:45:00 +00:00
Arnold Schwaighofer 9611d23d63 SLPVectorizer: Try vectorizing 'splat' stores
Vectorize sequential stores of a broadcasted value.
5% on eon.

radar://16124699

llvm-svn: 202067
2014-02-24 19:52:29 +00:00
Jim Ingham 40083a4326 Don’t process the stop reply packet as a generic signal if we already figured out what it was from other data in the packet.
llvm-svn: 202066
2014-02-24 19:49:46 +00:00
Quentin Colombet ca49851833 [X86][SchedModel] Add missing scheduling model for SSE related instructions.
The patch defines new or refines existing generic scheduling classes to match
the behavior of the SSE instructions.
It also maps those scheduling classes on the related SSE instructions.

<rdar://problem/15607571>

llvm-svn: 202065
2014-02-24 19:33:51 +00:00
Roman Divacky bd01646489 Add a test for r202059.
llvm-svn: 202064
2014-02-24 19:24:15 +00:00
Fariborz Jahanian a7352db7b4 Objective-C. Remove an assertion which asserts
on correctly handled block layout IRGen. 
// rdar://16111839

llvm-svn: 202063
2014-02-24 19:10:37 +00:00
Steve Pucci 3c5d3339be Fix handling of gdbserver binary packets with escape characters.
We were not properly handling the escape character 0x7d ('}') in responses
from gdbserver which used the binary protocol.

llvm-svn: 202062
2014-02-24 19:07:29 +00:00
Greg Clayton 039697513e LLDB now handles DW_TAG_unspecified_parameters nested inside function prototypes and we now mark the function prototypes as being variadic.
<rdar://problem/16149526> 

llvm-svn: 202061
2014-02-24 18:53:11 +00:00
Roman Divacky f02c9944c8 Implement getDwarfEHStackPointer() and initDwarfEHRegSizeTable() for sparcv9.
llvm-svn: 202059
2014-02-24 18:46:27 +00:00
Richard Barton c9b5f35ec1 Implement -fno-short-wchar
llvm-svn: 202058
2014-02-24 18:43:28 +00:00
Roman Divacky e89f310952 Add a dwarf number to the Y register.
llvm-svn: 202057
2014-02-24 18:41:31 +00:00
Rafael Espindola d288d9aa94 Update for llvm api change.
llvm-svn: 202056
2014-02-24 18:21:12 +00:00
Rafael Espindola 26af26255c Update for llvm api change.
llvm-svn: 202055
2014-02-24 18:21:04 +00:00