1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

9895 Commits

Author SHA1 Message Date
Daniel Dunbar
9872eb764c Remove Offset from ExternalSybmol MachineOperands, this is unused (and at least partly unsupported, in X86 encoding at least).
llvm-svn: 80726
2009-09-01 22:06:46 +00:00
Andreas Neustifter
92a4f4d8d3 OptimalEdgeProfiling: Reading in Profiles.
This enables LLVM to read the OptimalEdgeProfiles.

llvm-svn: 80715
2009-09-01 19:08:51 +00:00
Andreas Neustifter
2ca69d2a41 Addedum to r80712, forgot to add files.
llvm-svn: 80713
2009-09-01 19:05:58 +00:00
Andreas Neustifter
683bc5306c OptimalEdgeProfiling: Creation of profiles.
This adds the instrumentation and runtime part of OptimalEdgeProfiling.

llvm-svn: 80712
2009-09-01 19:03:44 +00:00
Chris Lattner
ccbb87c998 remove CallGraphNode::replaceCallSite, it is redundant with other APIs.
llvm-svn: 80708
2009-09-01 18:52:39 +00:00
Dan Gohman
f6fbd474ed Fix a typo in a comment.
llvm-svn: 80697
2009-09-01 18:29:01 +00:00
Andreas Neustifter
dc55b65b4c Preparation for Optimal Edge Profiling:
Optimal edge profiling is only possible when blocks with no predecessors get an
virtual edge (BB,0) that counts the execution frequencies of this
function-exiting blocks.
This patch makes the necessary changes before actually enabling optimal edge profiling.

llvm-svn: 80667
2009-09-01 10:06:05 +00:00
Andreas Neustifter
d2c2f12f1e Preparation for Optimal Edge Profiling:
This adds a pass to verify the current profile against the flow conditions.
This is very helpful when later on trying to perserve the profiling information
during all passes.

llvm-svn: 80666
2009-09-01 08:48:42 +00:00
Chris Lattner
53698d7fd7 Change CallGraphNode to maintain it's Function as an AssertingVH
for sanity.  This didn't turn up any bugs.

Change CallGraphNode to maintain its "callsite" information in the 
call edges list as a WeakVH instead of as an instruction*.  This fixes
a broad class of dangling pointer bugs, and makes CallGraph have a number
of useful invariants again.  This fixes the class of problem indicated
by PR4029 and PR3601.

llvm-svn: 80663
2009-09-01 06:31:31 +00:00
Devang Patel
5674e1177b Add virtual destructor.
llvm-svn: 80660
2009-09-01 05:04:28 +00:00
Daniel Dunbar
fbe8d5891a llvm-mc: Store MCSymbolData value as a pointer (to make MSVC happy).
llvm-svn: 80652
2009-09-01 04:09:03 +00:00
Jim Grosbach
9a220088ac Clean up LSDA name generation and use for SJLJ exception handling. This
makes an eggregious hack somewhat more palatable. Bringing the LSDA forward
and making it a GV available for reference would be even better, but is
beyond the scope of what I'm looking to solve at this point.

Objective C++ code could generate function names that broke the previous
scheme. This fixes that.

llvm-svn: 80649
2009-09-01 01:57:56 +00:00
Devang Patel
9d22015258 Introduce DILocation.
llvm-svn: 80648
2009-09-01 01:14:15 +00:00
Devang Patel
3d94f40541 Add getDirectory() and getFilename() interface to DIScope.
llvm-svn: 80647
2009-09-01 00:53:21 +00:00
Devang Patel
fb8892d0e1 Subprogram is a scope. Derive DISubprogram from DIScope.
llvm-svn: 80637
2009-08-31 22:47:13 +00:00
Devang Patel
4a89fae1fe Rename DIBlock as DILexicalBlock.
llvm-svn: 80633
2009-08-31 22:00:15 +00:00
Devang Patel
a123ee96f4 Derive DICompileUnit from DIScope.
llvm-svn: 80627
2009-08-31 21:34:44 +00:00
Caroline Tice
e49e2d352c Add flag to mark structs for Apple Block "byref" variables; also add code to
modify the type and location debug information for these variables to match the
programmer's expectations.

llvm-svn: 80625
2009-08-31 21:19:37 +00:00
Dan Gohman
297360e2b1 Extend the ValuesAtScope cache to cover all expressions, not just
SCEVUnknowns, as the non-SCEVUnknown cases in the getSCEVAtScope code
can also end up repeatedly climing through the same expression trees,
which can be unusably slow when the trees are very tall.

Also, add a quick check for SCEV pointer equality to the main
SCEV comparison routine, as the full comparison code can be expensive
in the case of large expression trees.

These fix compile-time problems in some pathlogical cases.

llvm-svn: 80623
2009-08-31 21:15:23 +00:00
Gabor Greif
eed8e1e9e5 restore semantics of operator* (removing a FIXME I had to introduce in r80224)
llvm-svn: 80622
2009-08-31 20:54:23 +00:00
Devang Patel
b31cfda0f8 Introduce DIScope.
llvm-svn: 80620
2009-08-31 20:44:45 +00:00
Devang Patel
29f14e754f Simplify isDerivedType() and other predicate interface.
llvm-svn: 80602
2009-08-31 18:49:10 +00:00
Duncan Sands
66fce0befb Revert commit 80428. It completely broke exception
handling on x86-32 linux.

llvm-svn: 80592
2009-08-31 16:45:16 +00:00
Daniel Dunbar
3a44b6da61 llvm-mc: Pass values to MCStreamer as MCExprs, not MCValues.
llvm-svn: 80578
2009-08-31 08:09:28 +00:00
Daniel Dunbar
b897e807c4 llvm-mc: Simplify EmitAssignment ('.set' is identical to '=').
llvm-svn: 80577
2009-08-31 08:09:09 +00:00
Daniel Dunbar
11035eeb11 llvm-mc: Remove MCAsmParser::Parse[Paren]RelocatableExpression.
llvm-svn: 80576
2009-08-31 08:08:50 +00:00
Daniel Dunbar
fcb32716eb llvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue.
Also, use MCInst::print instead of custom code in MCAsmPrinter.

llvm-svn: 80575
2009-08-31 08:08:38 +00:00
Daniel Dunbar
5fbaad8079 llvm-mc: Add MCAsmParser::Parse[Paren]Expression forms which return an MCExpr.
llvm-svn: 80574
2009-08-31 08:08:17 +00:00
Daniel Dunbar
be245a258c llvm-mc: Make MCSymbolData symbol member const.
llvm-svn: 80573
2009-08-31 08:08:06 +00:00
Daniel Dunbar
1689464a71 llvm-mc: Add MCContext to MCAssembler.
llvm-svn: 80572
2009-08-31 08:07:55 +00:00
Daniel Dunbar
22505125c8 llvm-mc: Add MCAsmParser::getContext.
llvm-svn: 80571
2009-08-31 08:07:44 +00:00
Daniel Dunbar
4e5556dbd1 llvm-mc: Add MCExpr::{dump,print}.
llvm-svn: 80570
2009-08-31 08:07:33 +00:00
Daniel Dunbar
053a5f22a0 llvm-mc: Switch MCExpr construction to using static member functions, and taking the MCContext (which now owns all MCExprs).
llvm-svn: 80569
2009-08-31 08:07:22 +00:00
Daniel Dunbar
fb42aebc4f llvm-mc: Add some doxyment markers.
llvm-svn: 80568
2009-08-31 08:07:08 +00:00
Daniel Dunbar
b882c70ff2 llvm-mc: Move AsmExpr into MC lib (as MCExpr).
llvm-svn: 80567
2009-08-31 08:06:59 +00:00
Chris Lattner
acdb45e484 Step #1 to giving Callgraph some sane invariants. The problems with callgraph
stem from the fact that we have two types of passes that need to update it:

1. callgraphscc and module passes that are explicitly aware of it
2. Functionpasses (and loop passes etc) that are interlaced with CGSCC passes
   by the CGSCC Passmgr.

In the case of #1, we can reasonably expect the passes to update the call
graph just like any analysis.  However, functionpasses are not and generally
should not be CG aware.  This has caused us no end of problems, so this takes
a new approach.  Logically, the CGSCC Pass manager can rescan every function 
after it runs a function pass over it to see if the functionpass made any 
updates to the IR that affect the callgraph.  This allows it to catch new calls
introduced by the functionpass.

In practice, doing this would be slow.  This implementation keeps track of
whether or not the current scc is dirtied by a function pass, and, if so, 
delays updating the callgraph until it is actually needed again.  This was
we avoid extraneous rescans, but we still have good invariants when the
callgraph is needed.

Step #2 of the "give Callgraph some sane invariants" is to change CallGraphNode
to use a CallBackVH for the callsite entry of the CallGraphNode.  This way
we can immediately remove entries from the callgraph when a FunctionPass is
active instead of having dangling pointers.  The current pass tries to tolerate
these dangling pointers, but it is just an evil hack.

This is related to PR3601/4835/4029.  This also reverts r80541, a hack working
around the sad lack of invariants.

llvm-svn: 80566
2009-08-31 07:23:46 +00:00
Chris Lattner
5eec095b87 Fix PR4834, a tricky case where the inliner would resolve an
indirect function pointer, inline it, then go to delete the body.
The problem is that the callgraph had other references to the function,
though the inliner had no way to know it, so we got a dangling pointer
and an invalid iterator out of the deal.

The fix to this is pretty simple: stop the inliner from deleting the
function by knowing that there are references to it.  Do this by making
CallGraphNodes contain a refcount.  This requires moving deletion of 
available_externally functions to the module-level cleanup sweep where
it belongs.

llvm-svn: 80533
2009-08-31 03:15:49 +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
Erick Tryzelaar
5d79f870eb Make sure we specify no arguments for context functions.
llvm-svn: 80525
2009-08-30 23:38:06 +00:00
Chris Lattner
ab05dcb602 add a dump() method on callgraph.
llvm-svn: 80524
2009-08-30 22:24:32 +00:00
Daniel Dunbar
30b720266e Tweak comment.
llvm-svn: 80516
2009-08-30 21:14:05 +00:00
Chris Lattner
784e8d9177 add getPointerAddressSpace() to GEP instruction, use the method
in a few scalar xforms to simplify things.

llvm-svn: 80506
2009-08-30 20:06:40 +00:00
Chris Lattner
81c37331cf add a "getPointerAddressSpace" helper method to LoadInst and StoreInst.
llvm-svn: 80503
2009-08-30 19:45:21 +00:00
Chris Lattner
5bb0ee8c70 hopefully unbreak the build by making this-> explicit for dependent
base class lookup.

llvm-svn: 80499
2009-08-30 17:44:10 +00:00
Torok Edwin
21897521c1 Add regular expression matching support, based on OpenBSD regexec()/regcomp()
implementation.

llvm-svn: 80493
2009-08-30 08:24:09 +00:00
Daniel Dunbar
bc61205626 llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now.
- Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency).

llvm-svn: 80484
2009-08-30 06:17:16 +00:00
Chris Lattner
0ba5632cf6 make DenseMap::clear() early exit if there is nothing to do.
llvm-svn: 80480
2009-08-30 05:55:04 +00:00
Chris Lattner
c3deceaf81 some minor cleanups to IRBuilder, factor the insertion
hook out of the main IRBuilder class to allow clients to
override it.

llvm-svn: 80479
2009-08-30 05:42:59 +00:00
Bill Wendling
ccb2d3a3b8 Nuke moribund "std::string" version of EOL(..., Encoding).
llvm-svn: 80466
2009-08-30 00:28:57 +00:00
Dan Gohman
e5f1c4a5c2 Remove some unused fields.
llvm-svn: 80450
2009-08-29 23:34:14 +00:00
Bill Wendling
9dddea2ec3 - Add target lowering methods to get the preferred format for the FDE and LSDA
encodings.
- Make some of the values emitted by the FDEs dependent upon the pointer
  size. This is in line with how GCC does things. And it has the benefit of
  working for Darwin in 64-bit mode now.

llvm-svn: 80428
2009-08-29 12:20:54 +00:00
Bill Wendling
08c68ad0a9 Add a form of EOL which emits the text version of a DWARF format encoding. This
doesn't handle all values of the formatting. Those can be added as needed.

llvm-svn: 80427
2009-08-29 12:17:53 +00:00
Devang Patel
fbaeda732e Reapply 79977.
Use MDNodes to encode debug info in llvm IR.

llvm-svn: 80406
2009-08-28 23:24:31 +00:00
Daniel Dunbar
eec2764d55 llvm-mc: Support .comm emission.
llvm-svn: 80351
2009-08-28 07:08:35 +00:00
Daniel Dunbar
5749caa698 llvm-mc: Support .zerofill emission.
- I'm still trying to figure out the cleanest way to implement this and match the assembler, currently there are some substantial differences.

llvm-svn: 80347
2009-08-28 05:49:21 +00:00
Daniel Dunbar
1935aed414 llvm-mc: Tweak section alignment and size computation to match 'as' closer.
llvm-svn: 80345
2009-08-28 05:49:04 +00:00
Daniel Dunbar
09ed9fabde llvm-mc: Emit .lcomm as .zerofill.
llvm-svn: 80343
2009-08-28 05:48:46 +00:00
Daniel Dunbar
aace3b9577 llvm-mc: Add const to EmitZeroFill section argument.
llvm-svn: 80341
2009-08-28 05:48:22 +00:00
Daniel Dunbar
300b88539d Add MathExtras.h OffsetToAlignment, like RoundUpToAlignment but returns the
offset to the next aligned integer.

llvm-svn: 80339
2009-08-28 05:48:04 +00:00
Devang Patel
c1fe40a1b3 Closure is a very generic name. Use AppleBlock instead.
llvm-svn: 80307
2009-08-27 23:51:51 +00:00
Gabor Greif
0d4f085232 eliminate all 80-col violations that I have introduced in my recent checkins (and some others more)
llvm-svn: 80304
2009-08-27 23:44:33 +00:00
Dan Gohman
69ced456fa Minor code simplification.
llvm-svn: 80266
2009-08-27 17:59:08 +00:00
Dan Gohman
ebfea6a655 Be somewhat more consistent about const qualifiers.
llvm-svn: 80264
2009-08-27 17:54:15 +00:00
Dan Gohman
a318ec22f2 Global Aliases are not identifiable objects.
llvm-svn: 80263
2009-08-27 17:52:56 +00:00
Dan Gohman
d3d03c966f Handle TargetData with const.
llvm-svn: 80262
2009-08-27 17:51:25 +00:00
Dan Gohman
e4b0f12a19 Strip trailing whitespace from blank lines.
llvm-svn: 80259
2009-08-27 17:29:49 +00:00
Gabor Greif
6cd12a9f7f re-apply r80197, now that iterator.h is not mentioned any more
llvm-svn: 80254
2009-08-27 17:07:35 +00:00
Daniel Dunbar
e30a44267c llvm-mc/Mach-O: Add MCCodeEmitter support, for encoding instructions.
- No relocations yet, of course.

llvm-svn: 80235
2009-08-27 08:17:51 +00:00
Daniel Dunbar
ed9714d9eb Add {MCInst,MCOperand}::{print,dump}
llvm-svn: 80231
2009-08-27 07:57:12 +00:00
Gabor Greif
44a0da31b3 the buildbots revealed one more breakage. fix. (why didn't I see this?)
llvm-svn: 80227
2009-08-27 06:59:20 +00:00
Gabor Greif
cc8681cea3 Clean up the minor mess I caused with removing iterator.h. I shall take care of 80-col violations and the FIXME later. (Thanks goodness that I live in another continent, so the monkeypox did not strike me :-)
llvm-svn: 80224
2009-08-27 06:41:46 +00:00
Chris Lattner
7785b6000e Implement a new optimization in the inliner: if inlining multiple
calls into a function and if the calls bring in arrays, try to merge
them together to reduce stack size.  For example, in the testcase
we'd previously end up with 4 allocas, now we end up with 2 allocas.

As described in the comments, this is not really the ideal solution
to this problem, but it is surprisingly effective.  For example, on
176.gcc, we end up eliminating 67 arrays at "gccas" time and another
24 at "llvm-ld" time.

One piece of concern that I didn't look into: at -O0 -g with
forced inlining this will almost certainly result in worse debug
info.  I think this is acceptable though given that this is a case
of "debugging optimized code", and we don't want debug info to
prevent the optimizer from doing things anyway.

llvm-svn: 80215
2009-08-27 06:29:33 +00:00
Bill Wendling
cb8a4a6abb Revert accidental commit.
llvm-svn: 80208
2009-08-27 05:35:28 +00:00
Chris Lattner
358f90e5b1 reduce header #include'age
llvm-svn: 80204
2009-08-27 04:32:07 +00:00
Chris Lattner
becb2e9534 enhance InlineFunction to be able to optionally return
a the list of static allocas that it inlined.

llvm-svn: 80203
2009-08-27 04:20:52 +00:00
Chris Lattner
7fbde3dedf smallvectorize the list of returns built by CloneAndPruneFunctionInto.
llvm-svn: 80202
2009-08-27 04:02:30 +00:00
Chris Lattner
8b277ab324 remove CloneTrace, which appears to be dead since 2004.
llvm-svn: 80201
2009-08-27 03:56:43 +00:00
Bill Wendling
5f74a3e3b9 --- Reverse-merging r80147 into '.':
A    include/llvm/ADT/iterator.cmake
U    autoconf/configure.ac
--- Reverse-merging r80161 into '.':
U    cmake/config-ix.cmake
--- Reverse-merging r80171 into '.':
U    Makefile
--- Reverse-merging r80173 into '.':
U    configure
U    include/llvm/Config/config.h.in
--- Reverse-merging r80180 into '.':
A    include/llvm/ADT/iterator.h.in

Despite common miscomceptions, iterator.h is alive and well. It broke the build
bots for several hours. And yet no one bothered to look at them.

Gabor and Doug, please review your changes and make sure that they actually
build before resubmitting them.

llvm-svn: 80197
2009-08-27 03:29:26 +00:00
Daniel Dunbar
4316774ac1 llvm-mc: Tweak MCCodeEmitter skeleton.
llvm-svn: 80193
2009-08-27 01:34:22 +00:00
Daniel Dunbar
28c0eed122 Add missing declarations.
llvm-svn: 80190
2009-08-27 01:15:54 +00:00
Daniel Dunbar
fd042a5019 Sketch TargetRegistry support for MCCodeEmitter abstract interface.
- Of course, nothing actually can provide this interface yet.

llvm-svn: 80188
2009-08-27 00:51:57 +00:00
Daniel Dunbar
efbcc2daf9 Try to make MSVC just a little happier.
llvm-svn: 80187
2009-08-27 00:38:04 +00:00
Gabor Greif
4270411be1 now that include/llvm/ADT/iterator.h.in is not attempted to be built, its prerequisite can go away too
llvm-svn: 80180
2009-08-26 23:35:33 +00:00
Douglas Gregor
004f9203a7 Regenerate configure
llvm-svn: 80173
2009-08-26 22:59:05 +00:00
Daniel Dunbar
1f70368155 llvm-mc/Mach-O: Don't put assembler temporary labels in the symbol table.
- I moved section creation back into AsmParser. I think policy decisions like
   this should be pushed higher, not lower, when possible (in addition the
   assembler has flags which change this behavior, for example).

llvm-svn: 80162
2009-08-26 22:13:22 +00:00
Gabor Greif
796628c1d8 nobody includes llvm/ADT/iterator.h any more,
so get rid of this monstrosity. iterator.h.in is scheduled for deletion in my working copy,
but I wait till I see that configure gets regenerated, as it depends on it. I'll commit
then.
There are still some AC_* tests in the configure.ac dealing with iterators, those can
be zapped probably too.

llvm-svn: 80147
2009-08-26 21:36:59 +00:00
Daniel Dunbar
5e9b7483b7 llvm-mc/Mach-O: Set .subsections_via_symbols flag properly.
llvm-svn: 80144
2009-08-26 21:22:22 +00:00
Gabor Greif
830005b778 Remove all the LLVM_COMPACTIFY_SENTINELS-related macro magic as discussed with Chris on IRC. Anybody wanting to debug sentinel dereferencing problems must revert this patch and perform the indicated modifications.
llvm-svn: 80128
2009-08-26 19:16:32 +00:00
Mike Stump
294213c735 Allow unsigned long long DenseMapInfo.
llvm-svn: 80118
2009-08-26 18:02:19 +00:00
Dan Gohman
bd9174cad0 Move ProfileInfo::Edge's operator<< out of line. Among other benefits,
this eliminates the ATTRIBUTE_USED, which wasn't being used in a manner
acceptable to some GCC versions, according to the buildbots.

llvm-svn: 80103
2009-08-26 15:56:38 +00:00
Andreas Neustifter
13640d4582 Bugfix for r80100, forgot include. Sorry.
llvm-svn: 80101
2009-08-26 15:18:38 +00:00
Andreas Neustifter
219665e07c Implemented comments from Daniel Dunbar.
(See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090817/084958.html)

llvm-svn: 80100
2009-08-26 15:13:44 +00:00
Dan Gohman
cfb6234d13 Create a ScalarEvolution-based AliasAnalysis implementation.
This is a simple AliasAnalysis implementation which works by making
ScalarEvolution queries. ScalarEvolution has a more complete understanding
of arithmetic than BasicAA's collection of ad-hoc checks, so it handles
some cases that BasicAA misses, for example p[i] and p[i+1] within the
same iteration of a loop.

This is currently experimental. It may be that the main use for this pass
will be to help find cases where BasicAA can be profitably extended, or
to help in the development of the overall AliasAnalysis infrastructure,
however it's also possible that it could grow up to become a directly
useful pass.

llvm-svn: 80098
2009-08-26 14:53:06 +00:00
Daniel Dunbar
8c38017009 llvm-mc/Mach-O: Add support for relocations.
- I haven't really tried to find the "right" way to store the fixups or apply
   them, yet. This works, but isn't particularly elegant or fast.

 - Still no evaluation support, so we don't actually ever not turn a fixup into
   a relocation entry.

llvm-svn: 80089
2009-08-26 13:58:10 +00:00
Daniel Dunbar
45d03f2bbb llvm-mc/Mach-O: Move symbol indices into the MCSymbolData structure.
llvm-svn: 80088
2009-08-26 13:57:54 +00:00
Daniel Dunbar
168f849552 llvm-mc: Change MCContext value table to take const MCSymbol*s.
llvm-svn: 80079
2009-08-26 09:16:57 +00:00
Daniel Dunbar
e1f51a4fed llvm-mc: Make MCValue take const MCSymbol*s.
llvm-svn: 80078
2009-08-26 09:16:46 +00:00
Devang Patel
10c075a316 Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.
llvm-svn: 80073
2009-08-26 05:01:18 +00:00
Chris Lattner
7e0ab348a7 some mips and some sparc compilers apparently
predefine mips and sparc respectively.  Just overrule them :)

llvm-svn: 80072
2009-08-26 05:00:16 +00:00
Chris Lattner
52948143d2 fix some funky indentation
llvm-svn: 80068
2009-08-26 04:21:30 +00:00