Commit Graph

4555 Commits

Author SHA1 Message Date
NAKAMURA Takumi
dfe327f749 Whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196654 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-07 11:21:42 +00:00
Lang Hames
a49701db7d Revert r196639 while I investigate a bot failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196641 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-07 04:25:19 +00:00
Lang Hames
e7777cdc64 Add support for archives and object file caching under MCJIT.
Patch by Andy Kaylor, with minor edits to resolve merge conflicts.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196639 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-07 03:05:51 +00:00
Yuchen Wu
298c76540e llvm-cov: Conformed headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196541 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 22:02:29 +00:00
Renato Golin
07d9471bc5 Add #pragma vectorize enable/disable to LLVM
The intended behaviour is to force vectorization on the presence
of the flag (either turn on or off), and to continue the behaviour
as expected in its absence. Tests were added to make sure the all
cases are covered in opt. No tests were added in other tools with
the assumption that they should use the PassManagerBuilder in the
same way.

This patch also removes the outdated -late-vectorize flag, which was
on by default and not helping much.

The pragma metadata is being attached to the same place as other loop
metadata, but nothing forbids one from attaching it to a function
(to enable #pragma optimize) or basic blocks (to hint the basic-block
vectorizers), etc. The logic should be the same all around.

Patches to Clang to produce the metadata will be produced after the
initial implementation is agreed upon and committed. Patches to other
vectorizers (such as SLP and BB) will be added once we're happy with
the pass manager changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196537 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 21:20:02 +00:00
Matt Arsenault
5024536352 Fix minor GCC warnings.
Unused typedefs and unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196526 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 19:37:36 +00:00
Alp Toker
087ab613f4 Correct word hyphenations
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities and contractions in nearby lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196471 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 05:44:44 +00:00
Will Dietz
7437feefbb Export symbols in tools that support loading plugins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196447 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 01:01:58 +00:00
Yuchen Wu
812ad83e58 llvm-cov: Split GCOVFile's read into GCNO and GCDA.
This splits the file-scope read() function into readGCNO() and
readGCDA(). Also broke file format read into functions that first read
the file type, then check the version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196353 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 04:49:23 +00:00
NAKAMURA Takumi
042795734d check-llvm: Ask llvm-config about assertion mode, instead of llc.
Add --assertion-mode to llvm-config. It emits ON or OFF according to NDEBUG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196329 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-03 23:22:25 +00:00
Arnold Schwaighofer
df9c9da884 opt: Mirror vectorization presets of clang
clang enables vectorization at optimization levels > 1 and size level < 2. opt
should behave similarily.

Loop vectorization and SLP vectorization can be disabled with the flags
-disable-(loop/slp)-vectorization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196294 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-03 16:33:06 +00:00
NAKAMURA Takumi
94f5a677f6 llvm-config: With --build-mode, show ${CMAKE_CFG_INTDIR} on multiconfig builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196283 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-03 14:35:17 +00:00
Yuchen Wu
6cd7a3fa79 llvm-cov: Removed output to STDOUT/specified file.
Instead of asking the user to specify a single file to output coverage
info and defaulting to STDOUT, llvm-cov now creates files for each
source file with a naming system of: <source filename> + ".llcov".

This is what gcov does and although it can clutter the working directory
with numerous coverage files, it will be easier to hook the llvm-cov
output to tools which operate on this assumption (such as lcov).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196184 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-03 00:57:11 +00:00
Alp Toker
c7cf4869a7 Cut the gold plugin README down to size
This file hasn't been updated in years. Remove old information and point to
the current documentation at GoldPlugin.rst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196100 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-02 14:17:47 +00:00
Chandler Carruth
df13080481 [PM] Remove the underspecified 'getRoot' method from CallGraph. It's
only user was an ancient SCC printing bit of the opt tool which really
should be walking the call graph the same way the CGSCC pass manager
does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195800 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 01:32:17 +00:00
Chandler Carruth
54fec07ec0 [PM] Split the CallGraph out from the ModulePass which creates the
CallGraph.

This makes the CallGraph a totally generic analysis object that is the
container for the graph data structure and the primary interface for
querying and manipulating it. The pass logic is separated into its own
class. For compatibility reasons, the pass provides wrapper methods for
most of the methods on CallGraph -- they all just forward.

This will allow the new pass manager infrastructure to provide its own
analysis pass that constructs the same CallGraph object and makes it
available. The idea is that in the new pass manager, the analysis pass's
'run' method returns a concrete analysis 'result'. Here, that result is
a 'CallGraph'. The 'run' method will typically do only minimal work,
deferring much of the work into the implementation of the result object
in order to be lazy about computing things, but when (like DomTree)
there is *some* up-front computation, the analysis does it prior to
handing the result back to the querying pass.

I know some of this is fairly ugly. I'm happy to change it around if
folks can suggest a cleaner interim state, but there is going to be some
amount of unavoidable ugliness during the transition period. The good
thing is that this is very limited and will naturally go away when the
old pass infrastructure goes away. It won't hang around to bother us
later.

Next up is the initial new-PM-style call graph analysis. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195722 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 04:19:30 +00:00
Hans Wennborg
cdc675d7ba VS integration: use the correct registry key after r195379
I changed the registry key in that commit, but forgot to update
the integration files. This change makes them use the same variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195479 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-22 18:25:43 +00:00
Juergen Ributzka
ba0f991a78 [weak vtables] Place class definitions into anonymous namespaces to prevent weak vtables.
This patch places class definitions in implementation files into anonymous
namespaces to prevent weak vtables. This eliminates the need of providing an
out-of-line definition to pin the vtable explicitly to the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195092 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19 03:08:35 +00:00
Juergen Ributzka
354362524a [weak vtables] Remove a bunch of weak vtables
This patch removes most of the trivial cases of weak vtables by pinning them to
a single object file. The memory leaks in this version have been fixed. Thanks
Alexey for pointing them out.

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

Reviewed by Andy

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195064 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19 00:57:56 +00:00
David Blaikie
26efdc5621 llvm-dwarfdump: support for emitting only the debug_types section using -debug-dump
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195063 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19 00:29:42 +00:00
Alexey Samsonov
b21ab43cfc Revert r194865 and r194874.
This change is incorrect. If you delete virtual destructor of both a base class
and a subclass, then the following code:
  Base *foo = new Child();
  delete foo;
will not cause the destructor for members of Child class. As a result, I observe
plently of memory leaks. Notable examples I investigated are:
ObjectBuffer and ObjectBufferStream, AttributeImpl and StringSAttributeImpl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194997 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-18 09:31:53 +00:00
Juergen Ributzka
5a364c5561 [weak vtables] Remove a bunch of weak vtables
This patch removes most of the trivial cases of weak vtables by pinning them to
a single object file.

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

Reviewed by Andy

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194865 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 22:34:48 +00:00
Benjamin Kramer
d881c1bdd1 llvm-cov: Clean up memory leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194799 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 09:44:17 +00:00
NAKAMURA Takumi
05c837ec24 llvm-cov requires IR and Support as libraries. Instrumentation would be overkill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194695 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-14 11:45:16 +00:00
Simon Atanasyan
fe9ce427d0 Add support for DT_VERxxx and DT_MIPS_xxx .dynamic section entries to the
llvm-readobj.

The patch reviewed by Michael Spencer.
http://llvm-reviews.chandlerc.com/D2113

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194421 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-11 20:51:48 +00:00
Bob Wilson
2531651206 Change libLTO back to linking with @executable_path instead of @rpath.
This partially reverts r187641 until ld64 adopts a change to link with an
rpath setting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194418 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-11 20:08:24 +00:00
NAKAMURA Takumi
6af8781854 llvm-ar: Let opening a directory failed in llvm-ar.
Linux cannot open directories with open(2), although cygwin and *bsd can.

Motivation: The test, Object/directory.ll, had been failing with --target=cygwin on Linux. XFAIL was improper for host issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194257 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-08 12:35:56 +00:00
Alp Toker
4d6b695c95 Suppress OS crash dialog in llvm-rtdyld
All other tools have this -- it's needed to avoid hanging lit on Windows in
case of a crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194060 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-05 09:33:43 +00:00
Yuchen Wu
f44533c65e Revert "llvm-cov: Added command-line option to change dir."
This reverts commit d8acf0078c.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194040 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-05 01:56:29 +00:00
Yuchen Wu
d8acf0078c llvm-cov: Added command-line option to change dir.
This will allow for much easier testing when the input files are in a
different folder from the test script.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194034 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-05 01:20:41 +00:00
Jakub Staszak
42f2a6b41e Use startswith_lower() where possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194007 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-04 19:22:50 +00:00
Rafael Espindola
bc884fd9f7 move getSymbolNMTypeChar to the one program that needs it: nm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193933 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-02 21:16:09 +00:00
Yuchen Wu
daaa8b720b Added command-line option to output llvm-cov to file.
Added -o option to llvm-cov. If no output file is specified, it defaults
to STDOUT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193899 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-02 00:09:17 +00:00
Rafael Espindola
7e667c56cf Use LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN instead of the "dso list".
There are two ways one could implement hiding of linkonce_odr symbols in LTO:
* LLVM tells the linker which symbols can be hidden if not used from native
  files.
* The linker tells LLVM which symbols are not used from other object files,
  but will be put in the dso symbol table if present.

GOLD's API is the second option. It was implemented almost 1:1 in llvm by
passing the list down to internalize.

LLVM already had partial support for the first option. It is also very similar
to how ld64 handles hiding these symbols when *not* doing LTO.

This patch then
* removes the APIs for the DSO list.
* marks LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN all linkonce_odr unnamed_addr
  global values and other linkonce_odr whose address is not used.
* makes the gold plugin responsible for handling the API mismatch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193800 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 20:51:58 +00:00
Rafael Espindola
90f9b8a7bc Rules adjustments in order to build on DragonFly BSD.
Patch by Robin Hahling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193750 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 14:35:00 +00:00
Yuchen Wu
93324a6793 Updated llvm-cov's OVERVIEW description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193732 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 02:01:24 +00:00
Rafael Espindola
54818dc746 Support names like llvm-ar-3.4 and llvm-ranlib-3.4.
They are used in some packages. For example:
http://packages.ubuntu.com/saucy/i386/llvm-3.4/filelist

This fixes pr17721.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193612 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 14:25:43 +00:00
Andrew Kaylor
5f7a5773e6 Cleaning up comments in lli
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193571 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 01:33:14 +00:00
Andrew Kaylor
47b7fd5448 Adding a workaround for __main linking with remote lli and Cygwin/MinGW
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193570 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 01:29:56 +00:00
Alp Toker
730e3c6995 Fix the lli --extra-module value_desc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193552 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-28 22:51:25 +00:00
Andrew Kaylor
61abf1550f Standardizing lli's extra module command line option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193544 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-28 21:58:15 +00:00
NAKAMURA Takumi
f61049b2d8 MCJIT-remote: __main should be resolved in child context.
- Mark tests as XFAIL:cygming in test/ExecutionEngine/MCJIT/remote.
    Rather to suppress them, I'd like to leave them running as XFAIL.
  - Revert r193472. RecordMemoryManager no longer resolves __main on cygming.

There are a couple of issues.

  - X86 Codegen emits "call __main" in @main for targeting cygming.
    It is useless in JIT. FYI, tests are passing when emitting __main is disabled.
  - Current remote JIT does not resolve any symbols in child context.

FIXME: __main should be disabled, or remote JIT should resolve __main.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193498 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-27 10:22:52 +00:00
NAKAMURA Takumi
2d60c09451 lli/RemoteMemoryManager.cpp: Resurrect __main stuff removed in r192504 to unbreak mingw32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193472 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-26 13:52:31 +00:00
Daniel Sanders
69f4280b54 [bugpoint] Increase the default memory limit for subprocesses to 300MB.
Summary:
Currently shared library builds (BUILD_SHARED_LIBS=ON in cmake) fail three
bugpoint tests (BugPoint/remove_arguments_test.ll,
BugPoint/crash-narrowfunctiontest.ll, and BugPoint/metadata.ll).

If I run the bugpoint commands that llvm-lit runs with without -silence-passes
I see errors such as this:
    opt: error while loading shared libraries: libLLVMSystemZInfo.so: failed to
    map segment from shared object: Cannot allocate memory

It seems that the increased size of the binaries in a shared library build is
causing the subprocess to exceed the 100MB memory limit. This patch therefore
increases the default limit to a level at which these tests pass.

Reviewers: dsanders

Reviewed By: dsanders

CC: llvm-commits, rafael

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193420 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-25 17:41:41 +00:00
Benjamin Kramer
50c5b4680d llvm-c-test: Don't leak memory buffers.
Detected by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193416 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-25 15:58:58 +00:00
Reid Kleckner
07d5aef305 lto.h: Use lto_bool_t instead of int to restore the ABI
This reverts commit r193255 and instead creates an lto_bool_t typedef
that points to bool, _Bool, or unsigned char depending on what is
available.  Only recent versions of MSVC provide a stdbool.h header.

Reviewers: rafael.espindola

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193377 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-24 22:26:04 +00:00
NAKAMURA Takumi
44c23939cf llvm/tools/llvm-c-test should be built also on msvc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193257 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23 17:56:59 +00:00
NAKAMURA Takumi
266acb9fee llvm-c/lto.h: Avoid use of bool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193255 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23 17:56:46 +00:00
NAKAMURA Takumi
90fd79a222 llvm-c-test: Make them C89-compliant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193254 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23 17:56:37 +00:00
Anders Waldenborg
2bef1a6b25 Add llvm-c-test tool for testing llvm-c
This provides rudimentary testing of the llvm-c api.

The following commands are implemented:

  * --module-dump
    Read bytecode from stdin - print ir

  * --module-list-functions
    Read bytecode from stdin - list summary of functions

  * --module-list-globals
    Read bytecode from stdin - list summary of globals

  * --targets-list
    List available targets

  * --object-list-sections
    Read object file from stdin - list sections

  * --object-list-symbols
    Read object file from stdin - list symbols (like nm)

  * --disassemble
    Read lines of triple, hex ascii machine code from stdin - print disassembly

  * --calc
    Read lines of name, rpn from stdin - print generated module ir

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193233 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23 08:10:20 +00:00