1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

861 Commits

Author SHA1 Message Date
Chandler Carruth
075812f27c [Modules] Move CFG.h to the IR library as it defines graph traits over
IR types.

llvm-svn: 202827
2014-03-04 11:45:46 +00:00
Chandler Carruth
63713e9f95 [Modules] Move ValueMap to the IR library. While this class does not
directly care about the Value class (it is templated so that the key can
be any arbitrary Value subclass), it is in fact concretely tied to the
Value class through the ValueHandle's CallbackVH interface which relies
on the key type being some Value subclass to establish the value handle
chain.

Ironically, the unittest is already in the right library.

llvm-svn: 202824
2014-03-04 11:26:31 +00:00
Rafael Espindola
d89ca7eab7 Replace the F_Binary flag with a F_Text one.
After this I will set the default back to F_None. The advantage is that
before this patch forgetting to set F_Binary would corrupt a file on windows.
Forgetting to set F_Text produces one that cannot be read in notepad, which
is a better failure mode :-)

llvm-svn: 202052
2014-02-24 18:20:12 +00:00
Quentin Colombet
fc711dd23c [CodeGenPrepare] Move CodeGenPrepare into lib/CodeGen.
CodeGenPrepare uses extensively TargetLowering which is part of libLLVMCodeGen.
This is a layer violation which would introduce eventually a dependence on
CodeGen in ScalarOpts.

Move CodeGenPrepare into libLLVMCodeGen to avoid that.

Follow-up of <rdar://problem/15519855>

llvm-svn: 201912
2014-02-22 00:07:45 +00:00
Tobias Grosser
ccc79e1f2b Fix typo
Found by: Duncan P. N. Exon Smith <dexonsmith@apple.com>

llvm-svn: 201726
2014-02-19 22:16:49 +00:00
Tobias Grosser
81ff43601d Do not reference llvm-gcc from bugpoint
Reiterating: llvm-gcc is dead since a long time.
llvm-svn: 200220
2014-01-27 13:44:58 +00:00
NAKAMURA Takumi
aa02be00a1 Whitespace.
llvm-svn: 199305
2014-01-15 08:21:38 +00:00
Chandler Carruth
ee051af6e2 [cleanup] Move the Dominators.h and Verifier.h headers into the IR
directory. These passes are already defined in the IR library, and it
doesn't make any sense to have the headers in Analysis.

Long term, I think there is going to be a much better way to divide
these matters. The dominators code should be fully separated into the
abstract graph algorithm and have that put in Support where it becomes
obvious that evn Clang's CFGBlock's can use it. Then the verifier can
manually construct dominance information from the Support-driven
interface while the Analysis library can provide a pass which both
caches, reconstructs, and supports a nice update API.

But those are very long term, and so I don't want to leave the really
confusing structure until that day arrives.

llvm-svn: 199082
2014-01-13 09:26:24 +00:00
Chandler Carruth
53468087f3 Put the functionality for printing a value to a raw_ostream as an
operand into the Value interface just like the core print method is.
That gives a more conistent organization to the IR printing interfaces
-- they are all attached to the IR objects themselves. Also, update all
the users.

This removes the 'Writer.h' header which contained only a single function
declaration.

llvm-svn: 198836
2014-01-09 02:29:41 +00:00
Chandler Carruth
7aa902a488 Move the LLVM IR asm writer header files into the IR directory, as they
are part of the core IR library in order to support dumping and other
basic functionality.

Rename the 'Assembly' include directory to 'AsmParser' to match the
library name and the only functionality left their -- printing has been
in the core IR library for quite some time.

Update all of the #includes to match.

All of this started because I wanted to have the layering in good shape
before I started adding support for printing LLVM IR using the new pass
infrastructure, and commandline support for the new pass infrastructure.

llvm-svn: 198688
2014-01-07 12:34:26 +00:00
Nico Weber
e7bb9e41e0 Port r198087 and r198089 (strip dead code by default) from make to cmake.
llvm-svn: 198198
2013-12-30 03:36:05 +00:00
Nico Weber
0b5179242e Strip dead code when linking by default with BFD ld (linux, ...) and ld64 (os x).
This reduces the size of clang-format from 22 MB to 1.8 MB, diagtool goes from
21 MB to 2.8 MB, libclang.so goes from 29 MB to 20 MB, etc.  The size of the
bin/ folder shrinks from 270 MB to 200 MB.

Targets that support plugins and don't already use EXPORTED_SYMBOL_FILE
(which libclang and libLTO already do) can set NO_DEAD_STRIP to opt out.

llvm-svn: 198087
2013-12-27 22:38:59 +00:00
NAKAMURA Takumi
955efe24ce [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.
llvm-svn: 196908
2013-12-10 11:13:32 +00:00
Jakub Staszak
a0334b429e Use startswith_lower() where possible.
llvm-svn: 194007
2013-11-04 19:22:50 +00:00
Daniel Sanders
fa62351fd5 [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

llvm-svn: 193420
2013-10-25 17:41:41 +00:00
Rafael Espindola
a279462828 Remove several unused variables.
Patch by Alp Toker.

llvm-svn: 191757
2013-10-01 13:32:03 +00:00
Dmitri Gribenko
3c784ef695 Added std:: qualifier to find() invocation
Iterator of std::vector may be implemented as a raw pointer. In
this case ADL does not find the find() function in the std namespace.
For example, this is the case with STDCXX implementation of vector.

Patch by Konstantin Tokarev.

llvm-svn: 189733
2013-09-02 01:18:56 +00:00
Michael Gottesman
9c47125a1e [bugpoint] Allow the user to specify the path to opt on the commandline.
llvm-svn: 187739
2013-08-05 21:07:07 +00:00
Hal Finkel
0047fe7d03 Fix invalid function pointers in bugpoint ExtractLoops
The ExtractLoops function tries to reduce the failing test case by extracting
one or more loops from the misoptimized piece of the program. In doing this,
ExtractLoops must keep the MiscompiledFunctions vector up-to-date by ensuring
that the pointers refer to functions in the current failing program.
Unfortunately, this is not trivial because:

 - ExtractLoops is iterative, and there are several early exits (and the
   MiscompiledFunctions vector must be consistent with the current program at
every non-fatal exit point).
 - Several of the utility functions used by ExtractLoops (such as
   TestOptimizer, some of which are called through the TestFn callback
parameter, and Linker::LinkModules) delete their inputs upon success.

This change adds several updates of the MiscompiledFunctions vector at
different points. The first is after the initial call to TestMergedProgram
which checks that the loop-extracted program still works. The second is after
the call to TestFn (TestOptimizer, for example). This function will delete its
inputs (which is why the existing ExtractLoops logic cloned the inputs first).

llvm-svn: 187674
2013-08-02 21:13:42 +00:00
Rafael Espindola
2a9326a78f Add a wrapper for open.
This centralizes the handling of O_BINARY and opens the way for hiding more
differences (like how open behaves with directories).

llvm-svn: 186447
2013-07-16 19:44:17 +00:00
Rafael Espindola
66da97e093 Add a createUniqueFile function and switch llvm's users of unique_file.
This function is complementary to createTemporaryFile. It handles the case were
the unique file is *not* temporary: we will rename it in the end. Since we
will rename it, the file has to be in the same filesystem as the final
destination and we don't prepend the system temporary directory.

This has a small semantic difference from unique_file: the default mode is 0666.
This matches the behavior of most unix tools. For example, with this change
lld now produces files with the same permissions as ld. I will add a test
of this change when I port clang over to createUniqueFile (next commit).

llvm-svn: 185726
2013-07-05 21:01:08 +00:00
Rafael Espindola
d6fa9469ca Use sys::fs::createTemporaryFile.
llvm-svn: 185719
2013-07-05 20:14:52 +00:00
Hal Finkel
461bd33944 Fix bugpoint execution/reference output file name
sys::fs::unique_file will now loop infinitely if provided with a file name
without '%' characters and the input file already exists. As a result, bugpoint
cannot use a fixed file name for the execution output (including the reference
output).

llvm-svn: 185166
2013-06-28 16:37:52 +00:00
Rafael Espindola
50996b2c4d Remove unused includes.
llvm itself is now PathV1 clean.

llvm-svn: 184947
2013-06-26 13:54:34 +00:00
Rafael Espindola
07ffa7d08b Port GetMainExecutable over to PathV2.
I will remove the V1 version as soon as I change clang in the next commit.

llvm-svn: 184914
2013-06-26 05:01:35 +00:00
Rafael Espindola
4ff51c0bcf Move GetEXESuffix to the one place it is used.
llvm-svn: 184853
2013-06-25 14:42:30 +00:00
Rafael Espindola
7f5c2666a5 Convert most uses of PathV1.h in ToolRunner.cpp.
llvm-svn: 184210
2013-06-18 17:20:08 +00:00
Rafael Espindola
18bf1abdc7 Add a version of unique_file that return just the file name.
llvm-svn: 184206
2013-06-18 17:01:00 +00:00
Rafael Espindola
ba9d8abd28 Return a std::string from PrependMainExecutablePath.
llvm-svn: 184204
2013-06-18 16:47:55 +00:00
Rafael Espindola
45e04133bf Remove PathV1.h use from BugDriver.cpp.
llvm-svn: 184203
2013-06-18 16:21:54 +00:00
Rafael Espindola
14b5a763c3 Remove use of PathV1.h from ExecutionDriver.cpp.
llvm-svn: 184202
2013-06-18 16:14:09 +00:00
Rafael Espindola
8e7f40cca7 Remove usage of PathV1.h from OptimizerDriver.cpp.
llvm-svn: 184198
2013-06-18 15:54:13 +00:00
Rafael Espindola
3fc12d72c3 Convert some uses of eraseFromDisk.
llvm-svn: 184196
2013-06-18 15:33:18 +00:00
Rafael Espindola
8cdee56810 Don't use PathV1.h in tools/bugpoint/Miscompilation.cpp.
llvm-svn: 184193
2013-06-18 15:29:32 +00:00
Rafael Espindola
6a07fa8287 Convert two uses of eraseFromDisk.
llvm-svn: 184136
2013-06-17 21:50:28 +00:00
Rafael Espindola
f67941b9b1 Remove usage of PathV1.h in FindBugs.cpp.
llvm-svn: 184122
2013-06-17 20:48:36 +00:00
Rafael Espindola
95d3811592 Don't use PathV1.h in CrashDebugger.cpp.
llvm-svn: 184109
2013-06-17 19:33:18 +00:00
Rafael Espindola
fcae6ace8a Don't use PathV1.h in ToolRunner.h.
llvm-svn: 184107
2013-06-17 19:21:38 +00:00
Rafael Espindola
dc36acbad8 Remove CBE related code.
llvm-svn: 184106
2013-06-17 19:03:02 +00:00
Rafael Espindola
777fff797b Don't use PathV1.h in ExtractFunction.cpp.
llvm-svn: 184102
2013-06-17 18:48:59 +00:00
Rafael Espindola
703b03a992 Move PrependMainExecutablePath next to its only user.
llvm-svn: 183980
2013-06-14 15:12:13 +00:00
Rafael Espindola
6c0ca078e2 Don't use PathV1.h in Signals.h.
llvm-svn: 183947
2013-06-13 21:16:58 +00:00
Rafael Espindola
1cc376fe6a Don't use PathV1.h in FileUtilities.h.
llvm-svn: 183941
2013-06-13 20:41:00 +00:00
Rafael Espindola
ef0d0d8b0b Avoid using PathV1.h in Program.h.
llvm-svn: 183940
2013-06-13 20:25:38 +00:00
Rafael Espindola
332b3ad6f7 Have sys::FindProgramByName return a std::string.
llvm-svn: 183928
2013-06-13 19:25:37 +00:00
Rafael Espindola
c51837d177 Further reduce usage of sys::Path in bugpoint.
llvm-svn: 183912
2013-06-13 16:22:26 +00:00
Rafael Espindola
c4e0e0cdcd Try to fix the build with libstdc++ 4.4.
llvm-svn: 183909
2013-06-13 15:52:54 +00:00
Rafael Espindola
953c89b054 Reduce sys::Path usage in bugpoint.
llvm-svn: 183908
2013-06-13 15:47:11 +00:00
Rafael Espindola
5b921b1aa1 Remove the program class.
It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just
those two functions and make Execute and Wait implementations details.

llvm-svn: 183864
2013-06-12 20:58:35 +00:00
Rafael Espindola
968c6bbebf Include PathV1.h in files that use it.
This is preparation for replacing Path.h with PathV2.h.

llvm-svn: 183782
2013-06-11 20:00:56 +00:00
David Blaikie
898763a097 Use only explicit bool conversion operators
BitVector/SmallBitVector::reference::operator bool remain implicit since
they model more exactly a bool, rather than something else that can be
boolean tested.

The most common (non-buggy) case are where such objects are used as
return expressions in bool-returning functions or as boolean function
arguments. In those cases I've used (& added if necessary) a named
function to provide the equivalent (or sometimes negative, depending on
convenient wording) test.

One behavior change (YAMLParser) was made, though no test case is
included as I'm not sure how to reach that code path. Essentially any
comparison of llvm::yaml::document_iterators would be invalid if neither
iterator was at the end.

This helped uncover a couple of bugs in Clang - test cases provided for
those in a separate commit along with similar changes to `operator bool`
instances in Clang.

llvm-svn: 181868
2013-05-15 07:36:59 +00:00
Andy Gibbs
651d32efb2 Replace uses of the deprecated std::auto_ptr with OwningPtr.
llvm-svn: 179373
2013-04-12 10:56:28 +00:00
Rafael Espindola
bf8dcf15ed Don't export symbols in every binary on linux.
On freebsd this makes sure that symbols are exported on the binaries that need
them. The net result is that we should get symbols in the binaries that need
them on every platform.

On linux x86-64 this reduces the size of the bin directory from 262MB to 250MB.

Patch by Stephen Checkoway.

llvm-svn: 178725
2013-04-04 01:01:32 +00:00
Chandler Carruth
970e41ab77 Manually update the dependencies in the Makefiles. It turns out that all
that work on the LLVMBuild based dependency specification didn't
actually work, we just now maintain dependencies in *3* places instead
of 2. Yay.

There may still be some missing dependencies, I'm still sifting through
the bots and my builds, but this is a step in the right direction.

llvm-svn: 177988
2013-03-26 03:45:47 +00:00
Chandler Carruth
5bf5043e5b Split out the IRReader header and the utility functions it provides into
its own library. These functions are bridging between the bitcode reader
and the ll parser which are in different libraries. Previously we didn't
have any good library to do this, and instead played fast and loose with
a "header only" set of interfaces in the Support library. This really
doesn't work well as evidenced by the recent attempt to add timing logic
to the these routines.

As part of this, make them normal functions rather than weird inline
functions, and sink the implementation into the library. Also clean up
the header to be nice and minimal.

This requires updating lots of build system dependencies to specify that
the IRReader library is needed, and several source files to not
implicitly rely upon the header file to transitively include all manner
of other headers.

If you are using IRReader.h, this commit will break you (the header
moved) and you'll need to also update your library usage to include
'irreader'. I will commit the corresponding change to Clang momentarily.

llvm-svn: 177971
2013-03-26 02:25:37 +00:00
Michael Gottesman
3d8ed99b1f Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer.
llvm-svn: 173647
2013-01-28 01:35:51 +00:00
Saleem Abdulrasool
0e70a9950f [bugpoint] make tool selection messages unique
Change messages to help identify which interpreter was actually selected (safe
vs testing).

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
Reviewed-by: Chandler Carruth <chandlerc@gmail.com>
llvm-svn: 173360
2013-01-24 16:49:14 +00:00
Saleem Abdulrasool
71b0c0fefb [bugpoint] set Message after tool configuration
Set the message returned after the GCC runner has been constructed as otherwise
the message will be overwritten by the construction of the runner, resulting in
misleading messages.

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
Reviewed-by: Chandler Carruth <chandlerc@gmail.com>
llvm-svn: 173359
2013-01-24 16:49:12 +00:00
Chandler Carruth
7c0d682f47 Sort all of the includes. Several files got checked in with mis-sorted
includes.

llvm-svn: 172891
2013-01-19 08:03:47 +00:00
Jakub Staszak
31e75c8016 Fix #includes after my last commit.
llvm-svn: 172114
2013-01-10 21:56:40 +00:00
Chandler Carruth
4c1f3c24db Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

llvm-svn: 171366
2013-01-02 11:36:10 +00:00
Chandler Carruth
800daa7d3d Sort the #include lines for tools/...
Again, tools are trickier to pick the main module header for than
library source files. I've started to follow the pattern of using
LLVMContext.h when it is included as a stub for program source files.

llvm-svn: 169252
2012-12-04 10:44:52 +00:00
Pedro Artigas
a84c753671 One more step towards making doInitialization and doFinalization useful for
start up and clean up module passes, now that ASAN and TSAN are fixed the
tests pass

llvm-svn: 168905
2012-11-29 17:47:05 +00:00
Owen Anderson
ef8881a314 Revert r168635 "Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model".
It appears to have broken at least one buildbot.

llvm-svn: 168654
2012-11-27 00:53:24 +00:00
Owen Anderson
4f32762479 Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model
Patch by Pedro Artigas, with feedback from by Chandler Carruth.

llvm-svn: 168635
2012-11-26 23:54:47 +00:00
Owen Anderson
c7fb54baff Add doInitialization and doFinalization methods to ModulePass's, to allow them to be re-initialized and reused on multiple Module's.
Patch by Pedro Artigas.

llvm-svn: 168008
2012-11-15 00:14:15 +00:00
Micah Villmow
fe3338a7eb Move TargetData to DataLayout.
llvm-svn: 165403
2012-10-08 16:39:34 +00:00
Sylvestre Ledru
b77340e506 Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767
llvm-svn: 164768
2012-09-27 10:14:43 +00:00
Sylvestre Ledru
1c5e7904de Fix a typo 'iff' => 'if'
llvm-svn: 164767
2012-09-27 09:59:43 +00:00
Sylvestre Ledru
bf8acb65ac Fix a typo (the the => the)
llvm-svn: 160621
2012-07-23 08:51:15 +00:00
Chandler Carruth
67c334679c Move the CodeExtractor utility to a dedicated header file / source file,
and expose it as a utility class rather than as free function wrappers.

The simple free-function interface works well for the bugpoint-specific
pass's uses of code extraction, but in an upcoming patch for more
advanced code extraction, they simply don't expose a rich enough
interface. I need to expose various stages of the process of doing the
code extraction and query information to decide whether or not to
actually complete the extraction or give up.

Rather than build up a new predicate model and pass that into these
functions, just take the class that was actually implementing the
functions and lift it up into a proper interface that can be used to
perform code extraction. The interface is cleaned up and re-documented
to work better in a header. It also is now setup to accept the blocks to
be extracted in the constructor rather than in a method.

In passing this essentially reverts my previous commit here exposing
a block-level query for eligibility of extraction. That is no longer
necessary with the more rich interface as clients can query the
extraction object for eligibility directly. This will reduce the number
of walks of the input basic block sequence by quite a bit which is
useful if this enters the normal optimization pipeline.

llvm-svn: 156163
2012-05-04 10:18:49 +00:00
John McCall
4ceb1d12c4 Fix unintentional use of operator bool.
llvm-svn: 155978
2012-05-02 05:39:10 +00:00
Eric Christopher
3839c1ffd3 Remove the C backend.
llvm-svn: 153307
2012-03-23 05:50:46 +00:00
Chris Lattner
e3575252ce Fix two bugpoint bugs:
1) opt is not usually in the same path as the target program. Even for
the bugpoint as a standalone app, it should be more portable to search
in PATH, isn't it?
2) bugpoint driver accounts opt plugins, but does not list them in the
final output command.

Patch by Dmitry Mikushin!

llvm-svn: 153066
2012-03-19 23:42:11 +00:00
Eli Friedman
87b4f40d41 Improve handling of blockaddresses in bugpoint when splitting a module. Patch by Daniel Reynaud.
llvm-svn: 151115
2012-02-22 01:43:47 +00:00
Hal Finkel
0bf758d7ea Allow bugpoint to recognize -bb-vectorize
llvm-svn: 150003
2012-02-07 21:11:12 +00:00
Chris Lattner
9782adedd7 reapply the patches reverted in r149470 that reenable ConstantDataArray,
but with a critical fix to the SelectionDAG code that optimizes copies
from strings into immediate stores: the previous code was stopping reading
string data at the first nul.  Address this by adding a new argument to
llvm::getConstantStringInfo, preserving the behavior before the patch.

llvm-svn: 149800
2012-02-05 02:29:43 +00:00
Argyrios Kyrtzidis
492f34016f Revert Chris' commits up to r149348 that started causing VMCoreTests unit test to fail.
These are:

r149348
r149351
r149352
r149354
r149356
r149357
r149361
r149362
r149364
r149365

llvm-svn: 149470
2012-02-01 04:51:17 +00:00
Hal Finkel
8cf5de5774 Add a basic-block autovectorization pass.
This is the initial checkin of the basic-block autovectorization pass along with some supporting vectorization infrastructure.
Special thanks to everyone who helped review this code over the last several months (especially Tobias Grosser).

llvm-svn: 149468
2012-02-01 03:51:43 +00:00
Chris Lattner
a9b3505e9a eliminate the "string" form of ConstantArray::get, using
ConstantDataArray::getString instead.

llvm-svn: 149365
2012-01-31 06:18:43 +00:00
David Blaikie
8d47bb30e3 Remove unnecessary default cases in switches that cover all enum values.
llvm-svn: 147855
2012-01-10 16:47:17 +00:00
Bill Wendling
82ca4569b9 Add braces to remove silly warning.
llvm-svn: 147264
2011-12-25 06:56:22 +00:00
David Blaikie
576aba04f1 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
llvm-svn: 146960
2011-12-20 02:50:00 +00:00
Daniel Dunbar
30d6a45140 LLVMBuild: Remove trailing newline, which irked me.
llvm-svn: 146409
2011-12-12 19:48:00 +00:00
Benjamin Kramer
a2f57dee6d Remove all remaining uses of Value::getNameStr().
llvm-svn: 144648
2011-11-15 16:27:03 +00:00
Daniel Dunbar
efa02a0c3d LLVMBuild: Add description files for the LLVM tools.
llvm-svn: 144417
2011-11-11 22:59:39 +00:00
Sebastian Pop
f72a853709 rename getHostTriple into getDefaultTargetTriple
llvm-svn: 143502
2011-11-01 21:32:20 +00:00
Eli Friedman
038abbd863 A couple misc fixes so that bugpoint doesn't explode reducing code containing landingpads.
llvm-svn: 143435
2011-11-01 04:40:56 +00:00
Dan Gohman
892b86e74c Remove the Alpha backend.
llvm-svn: 143164
2011-10-27 22:56:32 +00:00
Daniel Dunbar
81780d9982 build: Tidy up a bunch of tool Makefiles, and simplify where possible using the
new all-targets pseudo-component.

llvm-svn: 142401
2011-10-18 19:27:24 +00:00
Chris Lattner
321335142c Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang does. Enhance
the X86 asmparser to produce ranges in the one case that was annoying me, for example:

test.s:10:15: error: invalid operand for instruction
movl 0(%rax), 0(%edx)
              ^~~~~~~

It should be straight-forward to enhance filecheck, tblgen, and/or the .ll parser to use 
ranges where appropriate if someone is interested.

llvm-svn: 142106
2011-10-16 04:47:35 +00:00
Tanya Lattner
0ae574fe2b Make it possible to use the linker without destroying the source module. This is so the source module can be linked to multiple other destination modules. For all that used LinkModules() before, they will continue to destroy the source module as before.
This line, and those below, will be ignored--

M    include/llvm/Linker.h
M    tools/bugpoint/Miscompilation.cpp
M    tools/bugpoint/BugDriver.cpp
M    tools/llvm-link/llvm-link.cpp
M    lib/Linker/LinkModules.cpp

llvm-svn: 141606
2011-10-11 00:24:54 +00:00
Nick Lewycky
4d55409980 Fix bugpoint fallout from the new type system.
llvm-svn: 137467
2011-08-12 17:25:45 +00:00
Rafael Espindola
2b0d064f3b Move methods in PassManagerBuilder offline.
llvm-svn: 136727
2011-08-02 21:50:27 +00:00
Rafael Espindola
73efcf56f6 move PassManagerBuilder.h to IPO. This is a non intuitive place to put it,
but it solves a layering violation since things in Support are not supposed to
use things in Transforms.

llvm-svn: 136726
2011-08-02 21:50:24 +00:00
Jay Foad
d4458dd707 Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.

llvm-svn: 135673
2011-07-21 14:31:17 +00:00
Chris Lattner
e1fe7061ce land David Blaikie's patch to de-constify Type, with a few tweaks.
llvm-svn: 135375
2011-07-18 04:54:35 +00:00
Jay Foad
c826df8fb7 Convert CallInst and InvokeInst APIs to use ArrayRef.
llvm-svn: 135265
2011-07-15 08:37:34 +00:00
Jay Foad
cbe48cd2ac Second attempt at de-constifying LLVM Types in FunctionType::get(),
StructType::get() and TargetData::getIntPtrType().

llvm-svn: 134982
2011-07-12 14:06:48 +00:00
Bill Wendling
6bcdd65b95 Revert r134893 and r134888 (and related patches in other trees). It was causing
an assert on Darwin llvm-gcc builds.

Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\
ne 2067.
etc.

http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354

--- Reverse-merging r134893 into '.':
U    include/llvm/Target/TargetData.h
U    include/llvm/DerivedTypes.h
U    tools/bugpoint/ExtractFunction.cpp
U    unittests/Support/TypeBuilderTest.cpp
U    lib/Target/ARM/ARMGlobalMerge.cpp
U    lib/Target/TargetData.cpp
U    lib/VMCore/Constants.cpp
U    lib/VMCore/Type.cpp
U    lib/VMCore/Core.cpp
U    lib/Transforms/Utils/CodeExtractor.cpp
U    lib/Transforms/Instrumentation/ProfilingUtils.cpp
U    lib/Transforms/IPO/DeadArgumentElimination.cpp
U    lib/CodeGen/SjLjEHPrepare.cpp
--- Reverse-merging r134888 into '.':
G    include/llvm/DerivedTypes.h
U    include/llvm/Support/TypeBuilder.h
U    include/llvm/Intrinsics.h
U    unittests/Analysis/ScalarEvolutionTest.cpp
U    unittests/ExecutionEngine/JIT/JITTest.cpp
U    unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
U    unittests/VMCore/PassManagerTest.cpp
G    unittests/Support/TypeBuilderTest.cpp
U    lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp
U    lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
U    lib/VMCore/IRBuilder.cpp
G    lib/VMCore/Type.cpp
U    lib/VMCore/Function.cpp
G    lib/VMCore/Core.cpp
U    lib/VMCore/Module.cpp
U    lib/AsmParser/LLParser.cpp
U    lib/Transforms/Utils/CloneFunction.cpp
G    lib/Transforms/Utils/CodeExtractor.cpp
U    lib/Transforms/Utils/InlineFunction.cpp
U    lib/Transforms/Instrumentation/GCOVProfiling.cpp
U    lib/Transforms/Scalar/ObjCARC.cpp
U    lib/Transforms/Scalar/SimplifyLibCalls.cpp
U    lib/Transforms/Scalar/MemCpyOptimizer.cpp
G    lib/Transforms/IPO/DeadArgumentElimination.cpp
U    lib/Transforms/IPO/ArgumentPromotion.cpp
U    lib/Transforms/InstCombine/InstCombineCompares.cpp
U    lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
U    lib/Transforms/InstCombine/InstCombineCalls.cpp
U    lib/CodeGen/DwarfEHPrepare.cpp
U    lib/CodeGen/IntrinsicLowering.cpp
U    lib/Bitcode/Reader/BitcodeReader.cpp

llvm-svn: 134949
2011-07-12 01:15:52 +00:00
Jay Foad
0ec904296e De-constify Types in StructType::get() and TargetData::getIntPtrType().
llvm-svn: 134893
2011-07-11 09:56:20 +00:00
Chris Lattner
a106725fc5 Land the long talked about "type system rewrite" patch. This
patch brings numerous advantages to LLVM.  One way to look at it
is through diffstat:
 109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing.  Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
   union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
   uniques them.  This means that the compiler doesn't merge them structurally
   which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
   struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
   in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead 
   "const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.  
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.

llvm-svn: 134829
2011-07-09 17:41:24 +00:00
Chris Lattner
d456ff35d1 Revamp the "ConstantStruct::get" methods. Previously, these were scattered
all over the place in different styles and variants.  Standardize on two
preferred entrypoints: one that takes a StructType and ArrayRef, and one that
takes StructType and varargs.

In cases where there isn't a struct type convenient, we now add a
ConstantStruct::getAnon method (whose name will make more sense after a few
more patches land).  

It would be "really really nice" if the ConstantStruct::get and 
ConstantVector::get methods didn't make temporary std::vectors.

llvm-svn: 133412
2011-06-20 04:01:31 +00:00
Eli Friedman
f6e72fc114 Add -O1/2/3 to bugpoint, so when you conclude opt -O2 reproduces an issue, you can just run bugpoint -O2. :) My implementation isn't precisely equivalent to what opt does, but as far as I can tell, it's close enough.
llvm-svn: 132695
2011-06-06 22:45:46 +00:00
Chris Lattner
89036e6501 switch bugpoint and liblto to PassManagerBuilder.
llvm-svn: 131821
2011-05-22 00:20:07 +00:00
Andrew Trick
9f867fd2dc Have Program::Wait return -2 for crashed and timeouts instead of embedding
info in the error message. Per Dan's request.

llvm-svn: 131780
2011-05-21 00:56:46 +00:00
Andrew Trick
9d2b107117 Typo and missing checkin from r131186.
llvm-svn: 131187
2011-05-11 16:44:08 +00:00
Andrew Trick
25d4fce092 Bugpoint support for miscompilations that result in a crash.
This change allows bugpoint to pinpoint the "opt" pass and bitcode
segment responsible for a crash caused by miscompilation. At least it
works well for me now, without having to create any custom execution
wrappers.

llvm-svn: 131186
2011-05-11 16:31:24 +00:00
Daniel Dunbar
1c0a0fde5c ADT/Triple: Move a variety of clients to using isOSDarwin() and isOSWindows()
predicates.

llvm-svn: 129816
2011-04-19 21:14:45 +00:00
Michael J. Spencer
b127b18668 Fix whitespace.
llvm-svn: 128631
2011-03-31 13:06:39 +00:00
Michael J. Spencer
c96db7725b Switch FileRemover from PathV1 to V2.
llvm-svn: 128630
2011-03-31 13:04:19 +00:00
Jay Foad
53632b7c03 Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

llvm-svn: 128537
2011-03-30 11:28:46 +00:00
Jay Foad
dc5a008237 (Almost) always call reserveOperandSpace() on newly created PHINodes.
llvm-svn: 128535
2011-03-30 11:19:20 +00:00
Chris Lattner
2f6f4a4788 fit in 80 cols.
llvm-svn: 126399
2011-02-24 18:59:38 +00:00
Andrew Trick
0cc8ef1ec9 Added bugpoint options: -compile-custom and -compile-command=...
I've been using this mode to narrow down llc unit tests. Example
custom compile script:
llc "$@"
not pygrep.py 'mul\s+r([0-9]), r\1,' < bugpoint-test-program.s

llvm-svn: 125096
2011-02-08 18:20:48 +00:00
Andrew Trick
6be6c71d81 whitespace
llvm-svn: 125095
2011-02-08 18:07:10 +00:00
Devang Patel
e9e4346064 Disable debug mode.
llvm-svn: 123443
2011-01-14 15:55:50 +00:00
Devang Patel
b2899fce10 Little help to debug the bugpoint itself.
Patch by Bob Wilson.

llvm-svn: 123390
2011-01-13 19:48:54 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Dan Gohman
7df4b826a1 Fix some places where error messages were being swallowed.
llvm-svn: 118464
2010-11-09 01:13:31 +00:00
Mikhail Glushenkov
991857f132 Rename FindExecutable to PrependMainExecutablePath.
Makes it more clear that it is just a path manipulation function.

llvm-svn: 118174
2010-11-03 16:14:16 +00:00
Mikhail Glushenkov
5cbf236c6a 80-col violations, trailing whitespace.
llvm-svn: 118173
2010-11-03 16:14:07 +00:00
Dan Gohman
3419ae24eb Check for (unlikely) errors from FindExecutable.
llvm-svn: 117658
2010-10-29 16:18:26 +00:00
Dan Gohman
e9b4001854 Fix these error messages to not mention PATH in cases where
PATH isn't actually searched, and to not mention the executable
directory when it isn't actually searched.

llvm-svn: 117657
2010-10-29 16:15:23 +00:00
Dan Gohman
90ced5a2ee Delete this obsolete comment.
llvm-svn: 117655
2010-10-29 16:03:34 +00:00
Owen Anderson
46990c17f7 Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
registration/creation, please send the testcase to me directly.

llvm-svn: 116820
2010-10-19 17:21:58 +00:00
Rafael Espindola
aa5448f520 Be more consistent in using ValueToValueMapTy.
llvm-svn: 116387
2010-10-13 01:36:30 +00:00
Dan Gohman
6645ce3f75 Move tool_output_file into its own file.
llvm-svn: 115973
2010-10-07 20:32:40 +00:00
Michael J. Spencer
90f807fda5 Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
This reverts commit r113632

Conflicts:

	cmake/modules/AddLLVM.cmake

llvm-svn: 113819
2010-09-13 23:59:48 +00:00
Michael J. Spencer
98ad3f2ea7 CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
llvm-svn: 113632
2010-09-10 21:14:25 +00:00
Dan Gohman
f9e09104f1 Make tool_output_file's raw_ostream instance a member variable instead
of a base class.

This makes it possible to unregister the file from FilesToRemove when
the file is done. Also, this eliminates the need for
formatted_tool_output_file.

llvm-svn: 112706
2010-09-01 14:20:41 +00:00
Duncan Sands
604b706b87 Straighten out any triple strings passed on the command line before
they hit the rest of the system.

llvm-svn: 112344
2010-08-28 01:30:02 +00:00
Chris Lattner
a97cbccf90 Apply "Win32's Hybrid path separator in argv[0] should be accepted to bugpoint",
patch by NAKAMURA Takumi!

llvm-svn: 111929
2010-08-24 17:44:07 +00:00
Dan Gohman
d8be4c4aca Convert tools to use tool_output_file, and introduce error
checking to places which previously lacked it.

llvm-svn: 111651
2010-08-20 16:59:15 +00:00
Rafael Espindola
c90e97f163 Use RunPassesOn as in the rest of bugpoint.
llvm-svn: 110682
2010-08-10 15:46:11 +00:00
Rafael Espindola
d25e9dbc11 Add a opt-args option that can be used to pass arguments to every opt
invocation. Fixes PR7793:

bugpoint -debug test.ll --opt-args -unroll-count=4

llvm-svn: 110555
2010-08-08 22:14:20 +00:00
Rafael Espindola
a2e8c6383e Most of bugpoint now only needs to know the pass names.
llvm-svn: 110534
2010-08-08 03:55:08 +00:00
Rafael Espindola
48fc63ad76 Try to fix cmake build.
llvm-svn: 110528
2010-08-08 00:50:57 +00:00
Rafael Espindola
0236b41a5e Run opt instead of bugpoint itself.
llvm-svn: 110524
2010-08-07 23:03:21 +00:00
Rafael Espindola
5579525578 Move the bugpoint test passes to a plugin in preparation for having bugpoint
use opt.

llvm-svn: 110520
2010-08-07 21:48:09 +00:00
Owen Anderson
f2fea95f2f Reapply r110396, with fixes to appease the Linux buildbot gods.
llvm-svn: 110460
2010-08-06 18:33:48 +00:00
Owen Anderson
aadd8a89ca Revert r110396 to fix buildbots.
llvm-svn: 110410
2010-08-06 00:23:35 +00:00
Owen Anderson
b9762c07cb Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier.  Clean up APIs related to this change.

llvm-svn: 110396
2010-08-05 23:42:04 +00:00
Bob Wilson
74157ac156 Revert bugpoint change due to buildbot breakage.
--- Reverse-merging r110333 into '.':
U    tools/bugpoint/BugDriver.h
U    tools/bugpoint/OptimizerDriver.cpp
U    tools/bugpoint/bugpoint.cpp
U    tools/bugpoint/BugDriver.cpp

llvm-svn: 110341
2010-08-05 16:26:32 +00:00
Rafael Espindola
3ef1be0f0a Run opt instead of bugpoint itself.
Fixes PR753.

llvm-svn: 110333
2010-08-05 15:25:38 +00:00
Rafael Espindola
ca885492ab Add const to compileProgram and to the various test functions in CrashDebugger.
llvm-svn: 110306
2010-08-05 03:00:22 +00:00
Rafael Espindola
0755ad0602 Add a Module argument to the remaining runPasses methods and mark getContext
const.

llvm-svn: 110300
2010-08-05 02:16:32 +00:00
Rafael Espindola
e580313f9e Make EmitProgressBitcode const and add a Module argument to runPasses. Use
that argument to simplify runPassesOn.

llvm-svn: 110291
2010-08-05 00:29:04 +00:00
Rafael Espindola
b74919778f Add const to some methods and change TestMergedProgram to return the merged
module and take a const BugDriver.

llvm-svn: 109951
2010-07-31 14:34:49 +00:00
Rafael Espindola
75734bc143 The BlockExtractorPass() constructor was not reading the BlockFile and that was
exactly what bugpoint expected it to do.

There was also only one user of
BlockExtractorPass(const std::vector<BasicBlock*> &B), so just remove it and
make BlockExtractorPass read BlockFile.

This fixes bugpoint's block extraction.

Nick, please review.

llvm-svn: 109936
2010-07-31 00:32:17 +00:00
Rafael Espindola
ba90b65153 Add a Program argument to diffProgram to avoid a use of swapProgramIn.
llvm-svn: 109859
2010-07-30 14:19:00 +00:00
Duncan Sands
07cc85fd7c Do not pass a copy of the value map, pass a reference to it.
llvm-svn: 109852
2010-07-30 05:50:45 +00:00
Rafael Espindola
6401c853ee Make the test while reducing blocks functional. This avoids accessing freed
memory when one of the original BB is destroyed.

llvm-svn: 109747
2010-07-29 14:20:59 +00:00
Jakob Stoklund Olesen
6a7ab2405c Use the right gcc tool args for IsARMArchitecture.
llvm-svn: 109714
2010-07-29 00:52:16 +00:00
Rafael Espindola
a618c1e4ec Instead of abusing swapProgramIn, just add a Module argument to
EmitProgressBitcode.

llvm-svn: 109602
2010-07-28 18:12:30 +00:00
Rafael Espindola
3a92982732 Clone and restore the module being reduced in
ReduceMiscompilingFunctions::TestFuncs. This makes the test functional
(i.e., no side effects).

Before we would end up using dead functions if a pass decided to remove them
(inline for example) and we would also keep broken functions and conclude that
that a single function was enough to reproduce the bug.

llvm-svn: 109387
2010-07-26 00:07:51 +00:00
Rafael Espindola
0b77450ebf Revert unintended white space change.
llvm-svn: 109364
2010-07-24 23:05:45 +00:00
Rafael Espindola
f380957779 Fix a trivial use after free.
llvm-svn: 109363
2010-07-24 23:02:11 +00:00
Owen Anderson
5f218b8612 Speculatively revert r108813, in an attempt to get the self-host buildbots working again. I don't see why this patch
would cause them to fail the way they are, but none of the other intervening patches seem likely either.

llvm-svn: 108818
2010-07-20 08:26:15 +00:00
Owen Anderson
cf625d0179 Reapply r108794, a fix for the failing test from last time.
llvm-svn: 108813
2010-07-20 06:52:42 +00:00
Daniel Dunbar
3280e3aebf Revert r108794, "Separate PassInfo into two classes: a constructor-free
superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).", it is
breaking teh everything.

llvm-svn: 108805
2010-07-20 03:06:07 +00:00
Owen Anderson
3502f9a91b Separate PassInfo into two classes: a constructor-free superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).
llvm-svn: 108794
2010-07-20 01:19:58 +00:00
Duncan Sands
f7b98e2b1e Convert some tab stops into spaces.
llvm-svn: 108130
2010-07-12 08:16:59 +00:00
Devang Patel
0c927a80fe Use ValueMap instead of DenseMap.
The ValueMapper used by various cloning utility maps MDNodes also.

llvm-svn: 106706
2010-06-24 00:33:28 +00:00
Rafael Espindola
cf8f391d49 Save more temps with -save-temps.
llvm-svn: 106409
2010-06-21 02:17:36 +00:00
Dan Gohman
96649dea39 Run dead type elimination after dead argument elimination.
llvm-svn: 105552
2010-06-07 20:28:37 +00:00
Dan Gohman
94bc7c650c Use ->isVoidTy().
llvm-svn: 105550
2010-06-07 20:19:26 +00:00
Dan Gohman
a4614e30ec No need to special-case structs here; structs are first-class now.
llvm-svn: 105513
2010-06-05 00:42:29 +00:00
Dan Gohman
b03730d276 No need to special-case structs here; structs are first-class now.
llvm-svn: 105442
2010-06-04 00:18:06 +00:00
Dan Gohman
6163340daf Eliminate some unnessary Path::exists() calls.
llvm-svn: 104888
2010-05-27 20:51:54 +00:00
Duncan Sands
f2bec8edf6 Apply timeouts and memory limits in more places. In particular, when
bugpoint does "Running the code generator to test for a crash" this
gets you a crash if llc goes into an infinite loop or uses up vast
amounts of memory.

llvm-svn: 104485
2010-05-24 07:49:55 +00:00
Jakob Stoklund Olesen
ed8dd53c85 Fix complete badness in bugpoint's IsARMArchitecture() function.
The revision history for this function is interesting, with multiple layers of
wrongness being introduced one at a time.

This fixes a weird issue where bugpoint -run-llc would suddenly exit 13 half way
through isolating a miscompilation.

llvm-svn: 103721
2010-05-13 17:58:15 +00:00
Jeffrey Yasskin
6768d483a0 Fix PR6951 by fixing Module leaks in bugpoint.
llvm-svn: 103523
2010-05-11 23:25:16 +00:00
Kalle Raiskila
482cc7f93a Add command line option --gcc to bugpoint.
Remove sending duplicate of the --gcc-tool-args parameters to gcc.

llvm-svn: 103397
2010-05-10 07:38:37 +00:00
Nick Lewycky
31e338dba8 The llc -f flag was removed.
llvm-svn: 102670
2010-04-29 23:37:44 +00:00
Nick Lewycky
3720e3e45f Don't forget cmake!
llvm-svn: 101234
2010-04-14 05:35:20 +00:00
Nick Lewycky
2874312841 Remove accidentally committed cruft.
llvm-svn: 101230
2010-04-14 04:46:11 +00:00
Nick Lewycky
396b2fc686 Bugpoint no longer uses exceptions.
llvm-svn: 101228
2010-04-14 04:40:31 +00:00
Benjamin Kramer
033019690a Boolify.
llvm-svn: 101035
2010-04-12 12:22:19 +00:00
Nick Lewycky
096fd1e0a6 Remove use of exceptions from bugpoint. No deliberate functionality change!
llvm-svn: 101013
2010-04-12 05:08:25 +00:00
Nick Lewycky
87bd8ff991 Remove dead argument and clean whitespace. No functionality change.
llvm-svn: 100954
2010-04-10 23:18:13 +00:00
Dan Gohman
7f76052c8c Trim #includes.
llvm-svn: 99416
2010-03-24 19:56:17 +00:00
Jeffrey Yasskin
94ecd53a3a Free all Constants in ~LLVMConstantImpl. We avoid assertion failures
by dropping all references from all constants that can use other
constants before trying to destroy any of them.

I also had to free bugpoint's Module in ~BugDriver().

llvm-svn: 99160
2010-03-22 05:23:37 +00:00
Jeffrey Yasskin
16289314f6 Bugpoint's default memory limit (100MB) was too low for valgrind, so
this patch raises the default to 800MB when valgrind's active.  800
was chosen semi-arbitrarily.

llvm-svn: 98905
2010-03-19 00:09:28 +00:00
Chris Lattner
75c1269e40 add support for bugpointing the integrated assembler. Something like this
works for me: bugpoint Output/bisort.llvm.bc -run-llc-ia -safe-run-llc

This uses llc with the integrated assembler as the test compiler and llc
without it as the safe compiler.

llvm-svn: 98618
2010-03-16 06:41:47 +00:00
Duncan Sands
1b33dd3c83 There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy().  Convert most instances of the first form to the second form.
Requested by Chris.

llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Benjamin Kramer
3b01285b76 Replace strcpy with memcpy when we have the length around anyway.
llvm-svn: 94746
2010-01-28 18:04:38 +00:00
Chris Lattner
6a28d54192 remove obsolete comment.
llvm-svn: 93661
2010-01-16 21:34:51 +00:00
Chris Lattner
98a02fecdc bugpoint doesn't need the mangler at all. DisambiguateGlobalSymbols
dates to a time when two different LLVM values could have the same
name but different types.  Simplify it to just assign names to unnamed
things and let the core symtab resolve duplicates.

llvm-svn: 93660
2010-01-16 21:34:01 +00:00
Chris Lattner
b8765fdca1 switch liblto to use the new getNameWithPrefix() method instead of getMangledName.
llvm-svn: 93643
2010-01-16 18:12:14 +00:00
Duncan Sands
bfb85b9a67 Make bugpoint pass -load arguments to LLI. This lets one use bugpoint with
programs that depend on native shared libraries.  Patch by Timo Lindfors.

llvm-svn: 89087
2009-11-17 10:20:22 +00:00
Benjamin Kramer
da70783da7 Add compare_lower and equals_lower methods to StringRef. Switch all users of
StringsEqualNoCase (from StringExtras.h) to it.

llvm-svn: 87020
2009-11-12 20:36:59 +00:00
Duncan Sands
2400ad7236 Introduce and use convenience methods for getting pointer types
where the element is of a basic builtin type.  For example, to get
an i8* use getInt8PtrTy.

llvm-svn: 83379
2009-10-06 15:40:36 +00:00
Nick Lewycky
3b7df4bbd5 Remove the default value for ConstantStruct::get's isPacked parameter and
update the code which was broken by this.

llvm-svn: 82327
2009-09-19 20:30:26 +00:00
Daniel Dunbar
072b03693f Add -output-prefix option to bugpoint (to change the default output name).
llvm-svn: 81154
2009-09-07 19:26:11 +00:00
Dan Gohman
3727dda74f Make bugpoint use ParseIRFile instead of doing the same thing manually.
llvm-svn: 80927
2009-09-03 16:32:58 +00:00
Chris Lattner
2081eaa21d only print the override triple if it exists!
llvm-svn: 80534
2009-08-31 03:22:35 +00:00
Dan Gohman
53f0d68f87 Make LLVM command-line tools overwrite their output files without -f.
This is conventional command-line tool behavior. -f now just means
"enable binary output on terminals".

Add a -f option to llvm-extract and llvm-link, for consistency.

Remove F_Force from raw_fd_ostream and enable overwriting and
truncating by default. Introduce an F_Excl flag to permit users to
enable a failure when the file already exists. This flag is
currently unused.

Update Makefiles and documentation accordingly.

llvm-svn: 79990
2009-08-25 15:34:52 +00:00
Chris Lattner
39262eb119 prune the #includes in raw_ostream.h by moving a
member out of line. ftostr is not particularly speedy,
so that method is presumably not perf sensitive.

llvm-svn: 79885
2009-08-24 03:52:50 +00:00
Chris Lattner
3203639c35 Prune #includes from llvm/Linker.h and llvm/System/Path.h,
forcing them down into various .cpp files.

This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
   for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
   clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
   instead.
4. Weans llvm-db off <iostream>

sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.

llvm-svn: 79869
2009-08-23 22:45:37 +00:00
Chris Lattner
d6a9cc484b eliminate the ostream version of CheckBitcodeOutputToConsole,
change the raw_ostream one to take the raw_ostream byref instead
of byptr.  Prune #includes, eliminate a use of Streams.h

llvm-svn: 79863
2009-08-23 21:36:09 +00:00
Chris Lattner
b0478019b4 eliminate the std::ostream forms of the bitcode writing APIs.
llvm-svn: 79840
2009-08-23 07:49:08 +00:00
Chris Lattner
f16d8ade4f Change raw_fd_ostream to take flags as an optional bitmask
instead of as two bools.  Use this to add a F_Append flag
which has the obvious behavior.

Other unrelated changes conflated into this patch:

1. REmove EH stuff from llvm-dis and llvm-as, the try blocks
   are dead.
2. Simplify the filename inference code in llvm-as/llvm-dis,
   because raw_fd_ostream does the right thing with '-'.
3. Switch machine verifier to use raw_ostream instead of ostream
   (Which is the thing that needed append in the first place).

llvm-svn: 79807
2009-08-23 02:51:22 +00:00
Benjamin Kramer
edbfae6370 Proper MSVC build fix (and remove my hack again). Patch by Yonggang Luo.
llvm-svn: 79418
2009-08-19 12:38:51 +00:00
Benjamin Kramer
deadf72086 Add a hack to unbreak MSVC builds. str(n)casecmp are POSIX functions and aren't available on windows (mingw defines them though).
llvm-svn: 79417
2009-08-19 12:16:17 +00:00
Nick Lewycky
6e6623b451 Include valgrind in the steps to reproduce if valgrind was used to reproduce
the problem.

llvm-svn: 79322
2009-08-18 06:08:01 +00:00
Daniel Dunbar
fd368c900e Change bugpoint to use Triple to make runtime decisions.
- This is cleaner, and makes bugpoint match the host instead of the build
   architecture.

 - Patch by Sandeep Patel!

llvm-svn: 79309
2009-08-18 03:35:57 +00:00
Owen Anderson
9df206d02d Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Benjamin Kramer
9a590500ea Make LLVMContext and LLVMContextImpl classes instead of structs.
llvm-svn: 78690
2009-08-11 17:45:13 +00:00
Daniel Dunbar
3123a37b69 MSVC warning fixes; patch by Stein Roger!
llvm-svn: 78405
2009-08-07 20:50:09 +00:00
Owen Anderson
3d0e1b855d Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.
llvm-svn: 78258
2009-08-05 23:16:16 +00:00
Dan Gohman
7cc0d1906c Use (void *)(intptr_t) to cast function addresses to void*
for use with sys::Path::GetMainExecutable, to avoid warnings
with -pedantic.

llvm-svn: 78245
2009-08-05 21:03:39 +00:00
Dan Gohman
ba72f59923 Fix FindExecutable to use sys::Path::GetMainExecutable instead of
just argv[0]. And remove the code for searching the current
working directory and for searching PATH; the point of FindExecutable
is not to find whatever version of the executable can be found by
searching around, but to find an executable that accompanies the
current executable.

Update the tools to use sys::Program::FindProgramByName when they
want PATH searching.

llvm-svn: 78240
2009-08-05 20:21:17 +00:00
Anton Korobeynikov
2a248f19bf Pass user only if it's non-empty. Patch by Sandeep.
llvm-svn: 78184
2009-08-05 09:32:53 +00:00
Anton Korobeynikov
49930d2542 Add save-temps option to bugpoint to keep temporary stuff.
Patch by Sandeep Patel

llvm-svn: 78183
2009-08-05 09:32:10 +00:00
Owen Anderson
cf2c39dc30 Factor some of the constants+context related code out into a separate header, to make LLVMContextImpl.h
not hideous.  Also, fix some MSVC compile errors.

llvm-svn: 78115
2009-08-04 22:41:48 +00:00
Owen Anderson
1dc40e205b Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.

llvm-svn: 77721
2009-07-31 20:28:14 +00:00
Owen Anderson
93ccaf5c60 Move more code back to 2.5 APIs.
llvm-svn: 77635
2009-07-30 23:03:37 +00:00
Owen Anderson
881d928f9b Move types back to the 2.5 API.
llvm-svn: 77516
2009-07-29 22:17:13 +00:00
Owen Anderson
0ce2151b36 Move ConstantExpr to 2.5 API.
llvm-svn: 77494
2009-07-29 18:55:55 +00:00
David Goodwin
c51f0caa9d Add a bugpoint flag to disable block extraction.
llvm-svn: 77389
2009-07-28 23:08:36 +00:00
Owen Anderson
aa8c94b051 Change ConstantArray to 2.5 API.
llvm-svn: 77347
2009-07-28 18:32:17 +00:00
Dan Gohman
839f148e82 Pass true to the Internalize parameter of createStandardLTOPasses,
to match llvm-ld's default behavior.

llvm-svn: 77273
2009-07-27 23:23:47 +00:00
Owen Anderson
d729f993b8 Move ConstantStruct back to 2.5 API.
llvm-svn: 77266
2009-07-27 22:29:26 +00:00
Daniel Dunbar
3e85b410ab Remove Value::setName(const char*, unsigned).
llvm-svn: 77100
2009-07-26 00:34:27 +00:00
Owen Anderson
cc33e89571 Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
llvm-svn: 77011
2009-07-24 23:12:02 +00:00
Daniel Dunbar
e3fea713f1 Switch to getNameStr().
llvm-svn: 76962
2009-07-24 08:24:36 +00:00
Owen Anderson
cc287b28c9 Get rid of the Pass+Context magic.
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Evan Cheng
64b75885a0 80 col violation.
llvm-svn: 76629
2009-07-21 19:25:09 +00:00
David Goodwin
b7182681cf For remote execution, must cd to the executable directory since the exe expects to find a dylib in the CWD ('.').
llvm-svn: 76432
2009-07-20 17:15:03 +00:00
Daniel Dunbar
ab985a16e1 Add -std-{compile,link}-opts to bugpoint.
- Sheesh.

llvm-svn: 76402
2009-07-20 07:01:01 +00:00
Chris Lattner
740ed72291 fix test
llvm-svn: 76378
2009-07-19 20:19:25 +00:00
Chris Lattner
c9d89253a4 DisambiguateGlobalSymbols should not mangle intrinsics.
llvm-svn: 76377
2009-07-19 20:19:04 +00:00
Viktor Kutuzov
9a224562e5 Require a remote command to exit with the exit status of the test program or with 255 if an error occurred.
llvm-svn: 76323
2009-07-18 18:39:24 +00:00
Dan Gohman
6abbc537f4 Convert more tools code from cerr and cout to errs() and outs().
llvm-svn: 76070
2009-07-16 15:30:09 +00:00
Owen Anderson
5c64fb5a80 To simplify the upcoming context-on-type change, switch all command line tools to using the default global context for now.
This will let us to hardwire stuff to the global context in the short term while the API is sorted out.

llvm-svn: 75846
2009-07-15 22:16:10 +00:00
Dan Gohman
9ced780576 Add a Force option to raw_fd_ostream to specify whether opening
an existing file is considered an error. Convert several tools
to use raw_fd_ostream instead of std::ostream, and to use this
new option instead of doing a manual check.

llvm-svn: 75801
2009-07-15 17:29:42 +00:00
Dan Gohman
60dce4c56b Use errs() instead of std::cerr.
llvm-svn: 75791
2009-07-15 16:35:29 +00:00
Chris Lattner
48e30f6d1f eliminate the Mangler::PreserveAsmNames bit, the sole client of this
can do it perfectly well itself.

llvm-svn: 75743
2009-07-15 04:50:47 +00:00
Evan Cheng
ec2df6b4f5 control reaches end of non-void function.
llvm-svn: 75714
2009-07-14 23:55:32 +00:00
Owen Anderson
8c85061ee6 Move EVER MORE stuff over to LLVMContext.
llvm-svn: 75703
2009-07-14 23:09:55 +00:00
Viktor Kutuzov
8171eaada3 Fix for bugpoint -remote-client
llvm-svn: 75665
2009-07-14 19:10:55 +00:00
Chris Lattner
6ec578688d Reapply my previous asmprinter changes now with more testing and two
additional bug fixes:

1. The bug that everyone hit was a problem in the asmprinter where it
   would remove $stub but keep the L prefix on a name when emitting the
   indirect symbol.  This is easy to fix by keeping the name of the stub
   and the name of the symbol in a StringMap instead of just keeping a
   StringSet and trying to reconstruct it late.

2. There was a problem printing the personality function.  The current
   logic to print out the personality function from the DWARF information
   is a bit of a cesspool right now that duplicates a bunch of other 
   logic in the asm printer.  The short version of it is that it depends
   on emitting both the L and _ prefix for symbols (at least on darwin)
   and until I can untangle it, it is best to switch the mangler back to
   emitting both prefixes.

llvm-svn: 75646
2009-07-14 18:17:16 +00:00
Daniel Dunbar
dbbc49bb29 Revert r7561{9,8,7,6}, which depend on r75610.
--- Reverse-merging r75619 into '.':
U    lib/Target/DarwinTargetAsmInfo.cpp
U    lib/CodeGen/AsmPrinter/AsmPrinter.cpp
--- Reverse-merging r75618 into '.':
U    lib/CodeGen/ELFWriter.cpp
U    lib/CodeGen/MachOCodeEmitter.cpp
U    lib/CodeGen/MachOWriter.cpp
--- Reverse-merging r75617 into '.':
U    lib/Target/CBackend/CBackend.cpp
--- Reverse-merging r75616 into '.':
U    tools/bugpoint/Miscompilation.cpp
U    tools/lto/LTOCodeGenerator.cpp
U    tools/lto/LTOModule.cpp

llvm-svn: 75638
2009-07-14 16:25:11 +00:00
Chris Lattner
a90ef5eb4a rename getValueName -> getMangledName
llvm-svn: 75616
2009-07-14 06:19:07 +00:00
Dan Gohman
7d880c801b #include "llvm/Assembly/Writer.h" to get the declaration for WriteAsOperand.
llvm-svn: 75542
2009-07-13 22:56:37 +00:00
Owen Anderson
1169a91099 Fix the build.
llvm-svn: 75536
2009-07-13 22:40:32 +00:00
Owen Anderson
393d8b0a0c Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
This involves temporarily hard wiring some parts to use the global context.  This isn't ideal, but it's
the only way I could figure out to make this process vaguely incremental.

llvm-svn: 75445
2009-07-13 04:09:18 +00:00
Daniel Dunbar
054effb8e8 Fix unused function warning.
llvm-svn: 75386
2009-07-11 21:24:52 +00:00
David Goodwin
85da1c6622 Support remote execute for ARM.
llvm-svn: 75292
2009-07-10 21:39:28 +00:00