1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

351 Commits

Author SHA1 Message Date
Duncan Sands
cd6523c879 Change another reference to the "indirect callgraph node" to
refer to the "external node" instead.

llvm-svn: 105731
2010-06-09 17:39:05 +00:00
Duncan Sands
1585c44a59 Output "external node" rather than "Indirect CallGraph node" when printing
callgraph SCC's.  This makes it match what the node itself would print.  Also,
"indirect callgraph node" doesn't make sense - it has nothing particularly to
do with indirect calls.

llvm-svn: 105730
2010-06-09 17:35:00 +00:00
Dan Gohman
d13e45d0ec Don't special-case stdout in llvm::WriteBitcodeToFile; just consider
it to be the caller's responsibility to provide a stream in binary
mode. This fixes a layering violation and avoids an outs() call.

llvm-svn: 104878
2010-05-27 20:06:51 +00:00
Dan Gohman
5dc7fed6ab Don't create an output stream when output is disabled.
llvm-svn: 104875
2010-05-27 19:52:20 +00:00
Dan Gohman
bf0dac1735 Avoid calling outs() and fouts() when the stream isn't really needed.
llvm-svn: 104873
2010-05-27 19:47:36 +00:00
Dan Gohman
79033132d7 Use regular PassManager instead of FunctionPassManager in opt, since it
isn't doing lazy streaming. This also fixes a missing doFinalization call.

llvm-svn: 103774
2010-05-14 15:36:54 +00:00
Chris Lattner
6a038be777 introduce a new CallGraphSCC class, and pass it around
to CallGraphSCCPass's instead of passing around a
std::vector<CallGraphNode*>.  No functionality change,
but now we have a much tidier interface.

llvm-svn: 101558
2010-04-16 22:42:17 +00:00
Daniel Dunbar
3bf3e0e63a Remove unnecessary uses of <iostream>.
llvm-svn: 101338
2010-04-15 03:47:24 +00:00
Dan Gohman
7f76052c8c Trim #includes.
llvm-svn: 99416
2010-03-24 19:56:17 +00:00
Jeffrey Yasskin
da98ae0163 Avoid leaking the FunctionPassManager from opt.
llvm-svn: 99180
2010-03-22 15:56:04 +00:00
Benjamin Kramer
c855708633 Avoid a dangling pointer dereference, PassManager::add can delete the Pass.
llvm-svn: 96576
2010-02-18 12:57:05 +00:00
Jeffrey Yasskin
fb10587e50 Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
other languages still use the ModuleProvider concept.  It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.

llvm-svn: 94686
2010-01-27 20:34:15 +00:00
Chris Lattner
5a57121631 make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.
llvm-svn: 94378
2010-01-24 20:43:08 +00:00
Chris Lattner
276811b58a Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore.  libvmcore is
currently blocked on bugpoint, which uses EH.  Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.

llvm-svn: 94164
2010-01-22 06:49:46 +00:00
Chris Lattner
c07d7f41e3 elimiante the dynamic_cast's from opt.
llvm-svn: 94160
2010-01-22 06:03:06 +00:00
Chris Lattner
8b02bfe487 simplify code.
llvm-svn: 94159
2010-01-22 05:54:03 +00:00
Eli Friedman
45d605c120 Make opt -O3 act more like clang -O3 etc., by making the inlining thresholds
match.

llvm-svn: 93798
2010-01-18 22:38:31 +00:00
Dan Gohman
5e3b993a86 Don't create a (empty) output file, and don't warn about bitcode output
to a console, when --analyze is used.

Similarly, avoid creating an empty output file when --disable-output is used.

Print a warning when the -o option appears with either --analyze or
--disable-output, to indicate that the option is being ignored.

llvm-svn: 93685
2010-01-17 17:47:24 +00:00
David Greene
4c591a29fd Enable debug buffering.
llvm-svn: 92667
2010-01-05 01:30:32 +00:00
Chris Lattner
26c6e3ba7d when opt crashes, print its command line arguments as a pretty stack trace.
Somehow opt was missed when this was added.

llvm-svn: 90912
2009-12-09 00:41:28 +00:00
Tobias Grosser
74c7605daf Remove ShortNames from getNodeLabel in DOTGraphTraits
llvm-svn: 90134
2009-11-30 12:38:47 +00:00
Tobias Grosser
48d8ba7043 Instantiate DefaultDOTGraphTraits
llvm-svn: 90133
2009-11-30 12:38:13 +00:00
Kenneth Uildriks
e711736014 Make opt default to not adding a target data string and update tests that depend on target data to supply it within the test
llvm-svn: 85900
2009-11-03 15:29:06 +00:00
Chris Lattner
824a67ab25 nothing opt uses can throw, remove the try block and -fexceptions when
building opt.

llvm-svn: 84816
2009-10-22 00:46:41 +00:00
Chris Lattner
381a6ff95c Add some command line options for twiddling the default data layout
used by opt when a module doesn't specify one.  Patch from Kenneth Uildriks!

llvm-svn: 84814
2009-10-22 00:44:10 +00:00
Duncan Sands
08d519c2b7 There seems to be no reason for opt's -S option to be hidden.
Make it visible.

llvm-svn: 84127
2009-10-14 20:01:39 +00:00
Dan Gohman
149ac38d37 Fix llvm-extract's "writing bitcode to a terminal" warning, which wasn't
working. To support this, add an is_displayed() function to raw_ostream,
and generalize Process::StandardOutIsDisplayed and friends in order to
support it.

Also, call RemoveFileOnSignal before creating a file instead of after, so
that the file isn't left behind if the program is interrupted between when
the file is created and RemoveFileOnSignal is called.

While here, add a -S to llvm-extract and port it to IRReader so that it
supports assembly input.

llvm-svn: 81568
2009-09-11 20:46:33 +00:00
Daniel Dunbar
9690cc9913 opt: Add -S option to print output as LLVM assembly.
llvm-svn: 81082
2009-09-05 11:34:53 +00:00
Dan Gohman
7a60ef0f45 Use IRReader.h in opt, to support reading of LLVM Assembly files directly.
llvm-svn: 80922
2009-09-03 16:00:08 +00:00
Chris Lattner
085c521fe2 Fix some nasty callgraph dangling pointer problems in
argpromotion and structretpromote.  Basically, when replacing
a function, they used the 'changeFunction' api which changes
the entry in the function map (and steals/reuses the callgraph
node).

This has some interesting effects: first, the problem is that it doesn't
update the "callee" edges in any callees of the function in the call graph.
Second, this covers for a major problem in all the CGSCC pass stuff, which 
is that it is completely broken when functions are deleted if they *don't*
reuse a CGN.  (there is a cute little fixme about this though :).

This patch changes the protocol that CGSCC passes must obey: now the CGSCC 
pass manager copies the SCC and preincrements its iterator to avoid passes
invalidating it.  This allows CGSCC passes to mutate the current SCC.  However
multiple passes may be run on that SCC, so if passes do this, they are now
required to *update* the SCC to be current when they return.

Other less interesting parts of this patch are that it makes passes update
the CG more directly, eliminates changeFunction, and requires clients of
replaceCallSite to specify the new callee CGN if they are changing it.

llvm-svn: 80527
2009-08-31 00:19:58 +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
Dan Gohman
1d440b353e These flushes were only needed when the code was transitioning between
std::cout and outs().

llvm-svn: 79891
2009-08-24 04:13:48 +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
0ac224bf1a use raw_fd_ostream instead of fstream with graphwriter,
flush the right stream in opt.cpp.

llvm-svn: 79837
2009-08-23 07:31:22 +00:00
Chris Lattner
1c0452caeb Change Pass::print to take a raw ostream instead of std::ostream,
update all code that this affects.

llvm-svn: 79830
2009-08-23 06:03:38 +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
Eric Christopher
d24c28aef3 Make unit-at-a-time on by default to match the behavior of llvm-gcc.
llvm-svn: 79698
2009-08-21 23:30:30 +00:00
Eric Christopher
63ce9dc3a8 Kill trailing whitespace.
llvm-svn: 79696
2009-08-21 23:29:40 +00:00
Daniel Dunbar
3119e6a609 Switch some clients to Value::getName(), and other getName() user
simplification.
 - NFC

llvm-svn: 76789
2009-07-22 21:33:09 +00:00
Bob Wilson
7c323a8936 Fix a crash in SROA. The FunctionPass::doInitialization method was never
being called so that Context was never initialized.  I'm not sure if this
is the right fix but at least it keeps opt from crashing.

llvm-svn: 76220
2009-07-17 19:05:13 +00:00
Daniel Dunbar
d4143bc1d8 opt: Add -std-link-opts argument, matches llvm-ld's optimizations.
llvm-svn: 76199
2009-07-17 18:09:39 +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
Owen Anderson
cf112e59c3 Hold the LLVMContext by reference rather than by pointer.
llvm-svn: 74640
2009-07-01 21:22:36 +00:00
Owen Anderson
81b8dabb53 Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools.

Patches for Clang and LLVM-GCC to follow.

llvm-svn: 74614
2009-07-01 16:58:40 +00:00
Owen Anderson
90f7655f57 Get rid of the global CFGOnly flag by threading a ShortNames parameters through the GraphViz rendering code.
Update other uses in the codebase for this change.

llvm-svn: 74084
2009-06-24 17:37:09 +00:00
Daniel Dunbar
fe1e04f85a Switch opt to using StandardPasses.h
- No functionality change, but please check if you don't believe me.

llvm-svn: 72789
2009-06-03 18:22:15 +00:00
Misha Brukman
dd9c6eb7ba Fixed file header comment.
llvm-svn: 68250
2009-04-01 21:37:19 +00:00
Dan Gohman
0e73582689 Eliminate several more unnecessary intptr_t casts.
llvm-svn: 64888
2009-02-18 05:09:16 +00:00
Duncan Sands
36db5853cb Rename AddReadAttrs to FunctionAttrs, and teach it how
to work out (in a very simplistic way) which function
arguments (pointer arguments only) are only dereferenced
and so do not escape.  Mark such arguments 'nocapture'.

llvm-svn: 61525
2008-12-31 16:14:43 +00:00
Devang Patel
508dc0b548 Enable LoopIndexSplit pass.
llvm-svn: 60555
2008-12-04 21:40:31 +00:00
Devang Patel
c17a1f06f3 Disable -loop-index-split for now.
llvm-svn: 60087
2008-11-26 04:58:14 +00:00
Zhongxing Xu
985967aa25 Adjust indent.
llvm-svn: 60081
2008-11-26 02:57:24 +00:00
Nuno Lopes
a5d766c285 fix memory leak in pass manager when adding an analysis pass that already existed. as pass manager takes ownership of the added passes, it has to delete the pass if it isnt added to the pass list
tweak the opt tool so that it doesnt access a Pass after the ownership was taken by the pass manager

llvm-svn: 58730
2008-11-04 23:03:58 +00:00
Daniel Dunbar
d1169ccaf2 Move Print*Pass to use raw_ostream.
llvm-svn: 57946
2008-10-22 03:25:22 +00:00
Daniel Dunbar
919ce3c16a Privatize PrintModulePass and PrintFunctionPass and add
createPrintModulePass and createPrintFunctionPass.
 - So clients who compile w/o RTTI can use them.

llvm-svn: 57933
2008-10-21 23:33:38 +00:00
Duncan Sands
2c9f6ab06d Rationalize the names of passes that print information:
-callgraph => print-callgraph
    -callscc   => print-callgraph-sccs
    -cfgscc    => print-cfg-sccs
    -externalfnconstants => print-externalfnconstants
    -print               => print-function
    -print-alias-sets (no change)
    -print-callgraph     => dot-callgraph
    -print-cfg           => dot-cfg
    -print-cfg-only      => dot-cfg-only
    -print-dom-info (no change)
    -printm              => print-module
    -printusedtypes      => print-used-types

llvm-svn: 56487
2008-09-23 12:47:39 +00:00
Oscar Fuentes
0f25988689 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Duncan Sands
317cef874d Turn on the AddReadAttrs pass.
llvm-svn: 56345
2008-09-19 14:34:36 +00:00
Duncan Sands
aaa27f4261 Teach -callgraph to always print the callgraph (as the
description says it does), not just when -analyze is
used as well.  This means printing to stderr, so adjust
some tests.

llvm-svn: 56337
2008-09-19 07:57:09 +00:00
Devang Patel
f08b10b15d Fix comments, help messages.
llvm-svn: 56282
2008-09-17 16:01:39 +00:00
Devang Patel
65b85f3049 Fix cut-n-pasto.
llvm-svn: 56265
2008-09-17 00:01:04 +00:00
Devang Patel
e2702c8994 Add -O1, -O2 and -O3 that matches llvm-gcc's -O1, -O2 and -O3 respectively.
llvm-svn: 56255
2008-09-16 22:25:14 +00:00
Duncan Sands
1f456b0b4a End of the GlobalsModRef experiment.
llvm-svn: 56222
2008-09-15 18:42:38 +00:00
Duncan Sands
05a3e3ea40 Give GlobalsModRef a whirl in the nightly testers.
I placed it just before GVN because that it is the
pass most likely to benefit from it.  Some quick
and dirty testing confirms that this is a decent
place for it.

llvm-svn: 56144
2008-09-12 08:23:37 +00:00
Devang Patel
c4040a69b7 Backout 55429
llvm-svn: 55432
2008-08-27 20:51:49 +00:00
Devang Patel
369cc38542 Add facility to create a target.
llvm-svn: 55429
2008-08-27 20:00:27 +00:00
Evan Cheng
91029f36ff Goodbye tail duplication (for good this time).
llvm-svn: 53574
2008-07-14 22:29:15 +00:00
Duncan Sands
2513505573 Fix comment.
llvm-svn: 53525
2008-07-13 20:14:38 +00:00
Chris Lattner
540afcff82 Fix PR2231 - opt -internalize -std-compile-opts should run internalize first
llvm-svn: 53523
2008-07-13 19:35:21 +00:00
Devang Patel
5b8e75e2fe Move dominator info printer into tool/opt/GraphPrinters.cpp
llvm-svn: 52907
2008-06-30 17:32:58 +00:00
Owen Anderson
15538467ae Re-enable the newly simplified ADCE. This fixes a regression on
Dhrystone introduced by its removal.

llvm-svn: 51669
2008-05-29 08:48:21 +00:00
Owen Anderson
9a9030f206 Remove ADCE from the optimization pipeline.
llvm-svn: 51581
2008-05-27 04:27:27 +00:00
Evan Cheng
2ad66b343d Re-enable tail duplication pass (now with default threshold down to 1 instruction).
llvm-svn: 51184
2008-05-16 07:57:10 +00:00
Evan Cheng
0a854f3b63 Remove tail duplication pass.
llvm-svn: 51139
2008-05-15 07:43:15 +00:00
Devang Patel
61c4c1d7a1 Recover nestedloop regression reported by nightly tester.
llvm-svn: 51110
2008-05-14 18:04:30 +00:00
Devang Patel
06f96f31ce Do not run instruction combiner in middle of loop optimization passes.
llvm-svn: 51084
2008-05-14 00:26:11 +00:00
Owen Anderson
e34787f5c0 Re-enable loop deletion by default.
llvm-svn: 50941
2008-05-10 07:10:24 +00:00
Owen Anderson
3743bcf042 Disable loop deletion until the release branch.
llvm-svn: 50787
2008-05-06 23:56:34 +00:00
Owen Anderson
6f1d91a6c5 Enable dead loop elimination.
llvm-svn: 50682
2008-05-05 23:38:07 +00:00
Chris Lattner
7b9b1fe01a move libcalls to the same place llvm-gcc has it.
llvm-svn: 50593
2008-05-02 22:05:06 +00:00
Chris Lattner
c9547a13e5 enable jump threading pass by default. This causes no miscompilations
and can significantly shrinkify some code, particularly from C++ land.

llvm-svn: 50025
2008-04-21 04:22:09 +00:00
Duncan Sands
55efcf86e9 Run SimplifyLibCalls near the beginning, not at
the end.  It is now run at the same moment as in
llvm-gcc.  Also, run StripDeadPrototypes at the
end, just before running DeadTypeElimination.
This may be useful when doing LTO.  Note that
llvm-gcc runs StripDeadPrototypes but not
DeadTypeElimination.

llvm-svn: 49848
2008-04-17 12:03:38 +00:00
Evan Cheng
c0aac87374 Move memcpy / memset optimization pass after GVN.
llvm-svn: 49457
2008-04-10 01:33:05 +00:00
Owen Anderson
ca7e0e21f3 Factor a bunch of functionality related to memcpy and memset transforms out of
GVN and into its own pass.

llvm-svn: 49419
2008-04-09 08:23:16 +00:00
Chris Lattner
309aeb140b remove attributions from tools.
llvm-svn: 45421
2007-12-29 20:44:31 +00:00
Chris Lattner
11718ad357 remove attributions from tools/utils makefiles.
llvm-svn: 45414
2007-12-29 20:07:17 +00:00
Dan Gohman
2e8245a376 Move the space in overview output for commands out of each of the
commands and into the common code.

llvm-svn: 42752
2007-10-08 15:45:12 +00:00
Owen Anderson
b1388b7afb Turn GVN on by default.
llvm-svn: 41787
2007-09-08 22:23:52 +00:00
Devang Patel
db7970eac9 Enable loop index split pass.
llvm-svn: 41714
2007-09-04 20:46:58 +00:00
Owen Anderson
58e64df595 Rename FastDSE to just DSE.
llvm-svn: 40668
2007-08-01 06:36:51 +00:00
Dan Gohman
db1974dd16 Remove a FIXME comment that wasn't removed when the code it accompanied
was removed.

llvm-svn: 40591
2007-07-30 15:01:09 +00:00
Owen Anderson
3a6871f519 Turn on FastDSE by default.
Note: FastDSE now equals or exceeds the results of old DSE on all of SPEC2000 and SPEC2006. Unless major problems
show up in the testers, it will likely completely replace old DSE in the near future.

llvm-svn: 39986
2007-07-17 21:59:21 +00:00
Evan Cheng
b01b386dd4 Change sroa threshold back.
llvm-svn: 39980
2007-07-17 20:07:21 +00:00
Evan Cheng
49c8647315 Temporarily set SROA threshold to 512.
llvm-svn: 39950
2007-07-17 01:52:05 +00:00
Gabor Greif
5f705671e4 Here is the bulk of the sanitizing.
Almost all occurrences of "bytecode" in the sources have been eliminated.

llvm-svn: 37913
2007-07-05 17:07:56 +00:00
Devang Patel
aba2f3de85 Fix PR1539. Add LoopPassPrinter.
llvm-svn: 37909
2007-07-05 15:32:03 +00:00
Devang Patel
9eeed9a5bd Fix PR 1526.
llvm-svn: 37780
2007-06-28 23:09:25 +00:00