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

31868 Commits

Author SHA1 Message Date
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
b3c318b9d8 Fix compiler warnings
llvm-svn: 80650
2009-09-01 02:05: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
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
Dan Gohman
8e6871aa01 Don't use an iterator which is potentially invalidated.
llvm-svn: 80632
2009-08-31 21:58:28 +00:00
Bob Wilson
afc5184593 Use early exit and reduce indentation.
llvm-svn: 80631
2009-08-31 21:54:55 +00:00
Bob Wilson
0b8a1e2f69 If the tied registers are already the same, there is no need to change
them.  Move the code to make that change inside the conditional.

llvm-svn: 80630
2009-08-31 21:54:16 +00:00
Richard Osborne
5fc832f0a6 Add triple parsing support for XCore.
llvm-svn: 80629
2009-08-31 21:51:36 +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
David Goodwin
0fc3764297 Don't mark a register live at an undef use.
llvm-svn: 80621
2009-08-31 20:47:02 +00:00
Devang Patel
b31cfda0f8 Introduce DIScope.
llvm-svn: 80620
2009-08-31 20:44:45 +00:00
Devang Patel
444d9aee97 Oops. Fix inverted logic in assertion check.
llvm-svn: 80618
2009-08-31 20:27:49 +00:00
Evan Cheng
493eee1fc7 Remove .n suffix for some 16-bit opcodes now that Darwin assembler is fixed.
llvm-svn: 80615
2009-08-31 20:14:07 +00:00
Daniel Dunbar
d4241a4152 X86/exp-asm-printer: Lower MachineOperand::MO_JumpTableIndex to MCOperand.
- Down to 7 failures on 403.gcc.

llvm-svn: 80605
2009-08-31 19:14:05 +00:00
Daniel Dunbar
1953d69113 Stop printing old asm printing code inline with -experimental-asm-printer (this allows diffing and assembling the .s)
llvm-svn: 80604
2009-08-31 19:13:56 +00:00
Daniel Dunbar
a8c6218140 Avoid unnecessary +0 in experimental-asm-printer.
llvm-svn: 80603
2009-08-31 19:13:47 +00:00
Devang Patel
29f14e754f Simplify isDerivedType() and other predicate interface.
llvm-svn: 80602
2009-08-31 18:49:10 +00:00
Bill Wendling
f1610b9af1 Output a hex value, because all of the others are hex.
llvm-svn: 80601
2009-08-31 18:26:48 +00:00
Chris Lattner
91cb0c1aa7 cleanups pointed out by duncan
llvm-svn: 80595
2009-08-31 17:08:30 +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
Torok Edwin
097a206969 Free the constants that have no uses in ~LLVMContext.
This fixes leaks from LLVMContext in multithreaded apps.
Since constants are only deleted if they have no uses, it is safe to not delete
a Module on shutdown, as many single-threaded tools do.
Multithreaded apps should however delete the Module before destroying the
Context to ensure that there are no leaks (assuming they use a different context
for each thread).

llvm-svn: 80590
2009-08-31 16:14:59 +00:00
Torok Edwin
fbeacd1ab7 Fix ExplicitSymbols leak.
llvm-svn: 80589
2009-08-31 16:12:29 +00:00
Benjamin Kramer
61232721d9 Normalize makefile comments and sort cmake file lists.
llvm-svn: 80584
2009-08-31 13:05:24 +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
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
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
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
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
72a767d05f fix some cases where instcombine would change hte IR but not return true
from runOnFunction

llvm-svn: 80562
2009-08-31 06:57:37 +00:00
Chris Lattner
36e941a542 cleanups, factor some code out to a helper function
llvm-svn: 80542
2009-08-31 06:01:21 +00:00
Chris Lattner
368df2bb6f fix a crash building SPASS by tolerating a callsite that doesn't exist
in the callgraph, see the big comment at the top of the testcase.

llvm-svn: 80541
2009-08-31 05:46:59 +00:00
Chris Lattner
ca6ef3aa56 comment and simplify some code.
llvm-svn: 80540
2009-08-31 05:34:32 +00:00
Chris Lattner
09db62ac23 add -debug output
llvm-svn: 80539
2009-08-31 05:22:48 +00:00
Chris Lattner
bec75e8582 improve -debug output, so that -debug is more likely to print when
instcombine is changing stuff.

llvm-svn: 80538
2009-08-31 05:17:58 +00:00
Chris Lattner
73d1e17cec fix a bug I introduced with my 'instcombine builder' refactoring
changes: SimplifyDemandedBits can't use the builder yet because it
has the wrong insertion point.  This fixes a crash building
MultiSource/Benchmarks/PAQ8p

llvm-svn: 80537
2009-08-31 04:36:22 +00:00
Chris Lattner
b045a7f27b simplify some code by making the SCCNodes set contain Function*'s
instead of CallGraphNode*'s.  This also papers over a callgraph
problem where a pass (in this case, MemCpyOpt) introduces a new
function into the module (llvm.memset.i64) but doesn't add it to
the call graph (nor should it, since it is a function pass).

While it might be a good idea for MemCpyOpt to not synthesize 
functions in a runOnFunction(), there is no need for FunctionAttrs
to be boneheaded, so fix it there.  This fixes an assertion building
176.gcc.

llvm-svn: 80535
2009-08-31 04:09:04 +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
c1501183f3 use an accessor instead of poking internals of a node.
llvm-svn: 80532
2009-08-31 02:24:20 +00:00
Jim Grosbach
a09b5ac346 PR4747
Shared landing pads run into trouble with SJLJ, as the dispatch table is
mapped to call sites, and merging the pads will throw that off. There needs
to be a one-to-one mapping of landing pad exception table entries to invoke
call points.

Detecting the shared pad during lowering of SJLJ info insn't sufficient, as
the dispatch function may still need separate destinations to properly
handle phi-nodes.

llvm-svn: 80530
2009-08-31 01:35:03 +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
Chris Lattner
ab05dcb602 add a dump() method on callgraph.
llvm-svn: 80524
2009-08-30 22:24:32 +00:00
Daniel Dunbar
89f43b31cc Fix some possible-use-of-uninitialized warnings.
llvm-svn: 80515
2009-08-30 21:13:58 +00:00
Chris Lattner
d21a94f8d6 Fix PR4748: don't fold gep(bitcast(x)) into bitcast(gep) when x
is itself a bitcast.  Since we have gep(bitcast(bitcast(y))) in this
case, just wait for the two bitcasts to get zapped.  This prevents
instcombine from confusing some aliasing stuff, and allows it to
directly eliminate the load in the testcase.

llvm-svn: 80508
2009-08-30 20:38:21 +00:00
Chris Lattner
474990915a misc cleanup
llvm-svn: 80507
2009-08-30 20:36:46 +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
dc6b5be632 eliminate InsertCastBefore, use the builder instead.
llvm-svn: 80505
2009-08-30 20:01:10 +00:00
Chris Lattner
2a3af9b743 eliminate InsertBitCastBefore, just use the builder instead.
llvm-svn: 80504
2009-08-30 19:47:22 +00:00
Anton Korobeynikov
17529667db Add missed pattern
llvm-svn: 80502
2009-08-30 19:06:39 +00:00
Chris Lattner
bbfe14087f convert a bunch more calls to InsertNewInstBefore to use
the new Instcombine builder.

llvm-svn: 80501
2009-08-30 18:50:58 +00:00
Chris Lattner
444e6e0118 fix typo
llvm-svn: 80500
2009-08-30 17:53:59 +00:00
Anton Korobeynikov
a261afbf14 EXTRACT_VECTOR_ELEMENT can have result type different from element type.
Remove the assertion and generalize the code for ARM NEON stuff.

llvm-svn: 80498
2009-08-30 17:14:54 +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
Chris Lattner
dd71643cf1 give instcombine a custom IRBuilder that adds new instructions to the
workslist and is set to insert new instructions before the current one.
Convert a bunch of stuff that used to call InsertNewInstBefore over to
use it, greatly simplifying code and making it more natural.

There is still a lot more to go, but this is a good start.

llvm-svn: 80492
2009-08-30 07:44:24 +00:00
Chris Lattner
d53d314bd6 add a new InstCombineWorklist::AddValue method that works even
if the operand is not an instruction.

Simplify most uses of AddOperandsToWorkList to use AddValue and
inline it into the one remaining callsite.

llvm-svn: 80488
2009-08-30 06:27:41 +00:00
Chris Lattner
7dfc9cc68f move AddUsersToWorkList to the worklist processing class, make the
argument stronger typed.

llvm-svn: 80487
2009-08-30 06:22:51 +00:00
Chris Lattner
13202514e1 rename AddUsesToWorkList -> AddOperandsToWorkList. The
former looks too much like AddUsersToWorkList and keeps
confusing me.

Remove AddSoonDeadInstToWorklist and change its two callers
to do the same thing in a simpler way.

llvm-svn: 80486
2009-08-30 06:20:05 +00:00
Daniel Dunbar
21f3ac490c llvm-mc/X86: Encode constant MCValue's correctly.
llvm-svn: 80485
2009-08-30 06:17:49 +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
1f8e8caacb inline the trivial AddToWorkList/RemoveFromWorkList methods
into their callers.  simplify ReplaceInstUsesWith.  Make
EraseInstFromFunction only add operands to the worklist if
there aren't too many of them (this was a scalability win
for crazy programs that was only infrequently enforced).
Switch more code to using EraseInstFromFunction instead of
duplicating it inline.  Change some fcmp/icmp optimizations
to modify fcmp/icmp in place instead of creating a new one
and deleting the old one just to change the predicate.

llvm-svn: 80483
2009-08-30 06:13:40 +00:00
Chris Lattner
97d6443c26 fix a bug I introduced in r80478 found by the build bot.
llvm-svn: 80482
2009-08-30 05:56:44 +00:00
Chris Lattner
ca6875bf57 refactor instcombine's worklist processing stuff out to its own class.
llvm-svn: 80481
2009-08-30 05:55:36 +00:00
Chris Lattner
741fcee014 more cleanups: remove some redundant code, and simplify some
other places.

llvm-svn: 80478
2009-08-30 05:30:55 +00:00
Chris Lattner
aecf0100db eliminate the temporary SrcGEPOperands smallvector.
llvm-svn: 80477
2009-08-30 05:08:50 +00:00
Chris Lattner
2051889d14 simplify/detangle some control flow.
llvm-svn: 80476
2009-08-30 05:00:50 +00:00
Chris Lattner
e5c5ff8f49 simplify and cleanup some code, remove some code that just
does constant folding of gep's: this is already handled in
a more general way.

No functionality change.

llvm-svn: 80475
2009-08-30 04:49:01 +00:00
Chris Lattner
df2191a33d default count-aa to -print-all. The whole reason to use count-aa is
to see what queries are being made by a transformation, we might as well
default to printing them.

llvm-svn: 80474
2009-08-30 04:25:40 +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
cc35ffe3df Remove an unnecessary Context argument.
llvm-svn: 80454
2009-08-29 23:39:38 +00:00
Dan Gohman
4fef698b89 Minor logic simplification.
llvm-svn: 80453
2009-08-29 23:37:49 +00:00
Dan Gohman
c9dbe1610e Add some comments.
llvm-svn: 80452
2009-08-29 23:36:57 +00:00
Dan Gohman
e0697de4c6 Cleanup whitespace and indentation.
llvm-svn: 80451
2009-08-29 23:35:16 +00:00
Dan Gohman
e5f1c4a5c2 Remove some unused fields.
llvm-svn: 80450
2009-08-29 23:34:14 +00:00
Dan Gohman
f7b76078bb CMOV_GR8 clobbers EFLAGS when its expansion involves an xor to set
a register to 0. This fixes PR4814.

llvm-svn: 80445
2009-08-29 22:19:15 +00:00
Benjamin Kramer
34020d0ab5 Inline empty destructor.
llvm-svn: 80431
2009-08-29 13:38:21 +00:00
Bill Wendling
095b3c55e8 Fix warning about non-virtual destructor.
llvm-svn: 80429
2009-08-29 12:31:38 +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
Eric Christopher
77fd01a639 Make the augmentation size and next set of bytes agree on size,
and make the reference pointer size as it should be.

Fixes an abort on a testcase derived from libunwind's personality
test in 64-bit.

llvm-svn: 80414
2009-08-29 01:12:46 +00:00
Jeffrey Yasskin
93ed558d9f Fix OProfile support after r80406 changed the DebugInfo interface from
GlobalVariables to MDNodes.

llvm-svn: 80411
2009-08-29 00:44:16 +00:00
David Goodwin
db0cb257be Another stab at fixing up register kill flags after post-RA scheduling.
llvm-svn: 80410
2009-08-29 00:11:13 +00:00
Anton Korobeynikov
b2e6f5eed4 Do not assert on too wide splats we don't support.
llvm-svn: 80409
2009-08-29 00:08:18 +00:00
Anton Korobeynikov
9fd6082c10 Add missed extract_element pattern
llvm-svn: 80408
2009-08-28 23:41:26 +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
Evan Cheng
d7a07ab112 Let Darwin linker auto-synthesize stubs and lazy-pointers. This deletes a bunch of nasty code in ARM asm printer.
llvm-svn: 80404
2009-08-28 23:18:09 +00:00
Eric Christopher
f70a6035e0 Nuke trailing whitespace.
llvm-svn: 80401
2009-08-28 22:33:43 +00:00
Anton Korobeynikov
8595d8549f Short-term workaround for frame-related weirdness on win64.
Some other minor win64 fixes as well.

Patch by Michael Beck!

llvm-svn: 80370
2009-08-28 16:06:41 +00:00
Andreas Neustifter
c11b0d7108 Preparation for Optimal Edge Profiling:
This implements the maximum spanning tree algorithm on CFGs according to
weights given by the ProfileEstimator. This is then used to implement Optimal
Edge Profiling.

llvm-svn: 80358
2009-08-28 11:28:24 +00:00
Daniel Dunbar
0fa09bbe95 Fix -Asserts warning, round two.
llvm-svn: 80354
2009-08-28 08:08:22 +00:00
Daniel Dunbar
e3cf39c644 llvm-mc: .lsym is more unsupported than unimplemented, pending a use case appearing.
Also, all one of the file level flags are implemented.

llvm-svn: 80352
2009-08-28 07:08:47 +00:00
Daniel Dunbar
eec2764d55 llvm-mc: Support .comm emission.
llvm-svn: 80351
2009-08-28 07:08:35 +00:00
Evan Cheng
d53546a6cd Print a nl before pic labels so they start at a new line. This makes assembly more readable.
llvm-svn: 80350
2009-08-28 06:59:37 +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
8aa87b9f63 llvm-mc: Factor getSectionData out of SwitchSection.
llvm-svn: 80344
2009-08-28 05:48:54 +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
7cf576d72f llvm-mc: Fix thinko in emitting values.
llvm-svn: 80340
2009-08-28 05:48:10 +00:00
Daniel Dunbar
1b35869d3d Fix -Asserts warning.
llvm-svn: 80338
2009-08-28 05:47:56 +00:00
Chris Lattner
4dbe7896a5 finish a half formed thought :)
llvm-svn: 80334
2009-08-28 04:48:54 +00:00
Chris Lattner
04c6dc8fa5 Mark Andersen's as experimental.
llvm-svn: 80328
2009-08-28 00:45:47 +00:00
Chris Lattner
f37893e7a1 Fix PR3913, patch by Jakub Staszak!
llvm-svn: 80327
2009-08-28 00:43:14 +00:00
Evan Cheng
2d5d3700e9 v4, v5 does not support sxtb / sxth.
llvm-svn: 80322
2009-08-28 00:31:43 +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
Bruno Cardoso Lopes
d4c8e64367 Revert 80278 for now, it caused a lot of MIPS tests to fail
llvm-svn: 80280
2009-08-27 19:57:56 +00:00
Bruno Cardoso Lopes
3073478a39 Revamp our friend Mips :)
Add MO flags to simplify the printing of relocations.
Remove the support for printing large code model relocs (which
aren't supported anyway).

llvm-svn: 80278
2009-08-27 19:40:40 +00:00
Dan Gohman
457e656c16 Don't mark CMOV_GR8 as two-address, or commutable, since it's a pseudo.
llvm-svn: 80271
2009-08-27 18:16:24 +00:00
Dan Gohman
3df56c2002 Adjust the MachineBasicBlock verifier rules to be more
tolerant of blocks that end with "unreachable".

llvm-svn: 80270
2009-08-27 18:14:26 +00:00
Eric Christopher
19db6e3a81 Add FIXME for when we support more specific XMM registers.
llvm-svn: 80269
2009-08-27 18:08:16 +00:00
Eric Christopher
2e0a916cbe Nuke trailing whitespace.
llvm-svn: 80268
2009-08-27 18:07:15 +00:00
Dan Gohman
335b36bf14 Use stripPointerCasts instead of doing the same manually.
llvm-svn: 80267
2009-08-27 18:02:03 +00:00
Dan Gohman
fd3cfaae35 Teach getUnderlyingObject and skipPointerCasts about GlobalAliases.
llvm-svn: 80265
2009-08-27 17:55:13 +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
Anton Korobeynikov
c1e6083cb8 Hopefully the final missing part :(
scalar_to_vector is fully legal now

llvm-svn: 80251
2009-08-27 16:25:49 +00:00
Anton Korobeynikov
3aec90b4d6 Forgot about actual change :)
llvm-svn: 80250
2009-08-27 16:10:17 +00:00
Devang Patel
0ac8889288 Remove an entry from ValueMap before removing elements.
llvm-svn: 80247
2009-08-27 15:32:38 +00:00
Anton Korobeynikov
33d151e85e Transform float scalar_to_vector into subreg accesses.
No idea whether this is profitable or not.

llvm-svn: 80245
2009-08-27 14:38:44 +00:00
Misha Brukman
25e2b59ec6 STRD and LDRD require ARMv5TE, not just ARMv5T.
See http://llvm.org/PR4687 for more info and links.

llvm-svn: 80244
2009-08-27 14:14:21 +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
9a8ec155f7 llvm-mc/X86: Implement single instruction encoding interface for MC.
- Note, this is a gigantic hack, with the sole purpose of unblocking further
   work on the assembler (its also possible to test the mathcer more completely
   now).

 - Despite being a hack, its actually good enough to work over all of 403.gcc
   (although some encodings are probably incorrect). This is a testament to the 
   beauty of X86's MachineInstr, no doubt! ;)

llvm-svn: 80234
2009-08-27 08:12:55 +00:00
Daniel Dunbar
b11e3eb82f llvm-mc: Print encodings after the instruction, and only when we have an asm
printer.

llvm-svn: 80233
2009-08-27 07:58:57 +00:00
Daniel Dunbar
87eb328bcf X86: Mark EH_RETURN as code-gen-only.
llvm-svn: 80232
2009-08-27 07:58:05 +00:00
Daniel Dunbar
ed9714d9eb Add {MCInst,MCOperand}::{print,dump}
llvm-svn: 80231
2009-08-27 07:57:12 +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
Chris Lattner
61d49fed23 unbreak the build, yay for symlinks + makefiles. :(
llvm-svn: 80205
2009-08-27 04:43:05 +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
Chris Lattner
71e787d93b reduce inlining factor some stuff out to a static helper function,
and other code cleanups.  No functionality change.

llvm-svn: 80199
2009-08-27 03:51:50 +00:00
Bill Wendling
9d9a3b7f82 Revert accidental commit.
llvm-svn: 80198
2009-08-27 03:32:50 +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
Dan Gohman
ef6a9d4f16 Add some checks for MachineCFG consistency. Use AnalyzeBranch and
do extra checking when it succeeds, as those are cases where
CodeGen will be doing particularly interesting CFG modifications.

llvm-svn: 80196
2009-08-27 02:43:49 +00:00
Daniel Dunbar
abcf0c83cc Update CMake
llvm-svn: 80195
2009-08-27 02:08:37 +00:00
Daniel Dunbar
4316774ac1 llvm-mc: Tweak MCCodeEmitter skeleton.
llvm-svn: 80193
2009-08-27 01:34:22 +00:00
Dan Gohman
1725fdd25d Initialize the PoisonMemory member before initializing
members that call methods that read the PoisonMemory member.
This fixes potential spurious (though probably otherwise
harmless) poising of unused memory, and fixes the
associated valgrind error.

llvm-svn: 80192
2009-08-27 01:25:57 +00:00
Evan Cheng
984f8efcaa Fix PR4789. Teach eliminateFrameIndex how to handle VLDRQ and VSTRQ which cannot fold any immediate offset.
llvm-svn: 80191
2009-08-27 01:23:50 +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
Dan Gohman
60fae1b2a2 X86FastISel support for loading and storing values of type i1.
llvm-svn: 80186
2009-08-27 00:31:47 +00:00
Dan Gohman
613d152216 Expand i8 selects into control flow instead of 16-bit conditional
moves. This avoids the need to promote the operands (or implicitly
extend them, a partial register update condition), and can reduce
i8 register pressure. This substantially speeds up code such as
write_hex in lib/Support/raw_ostream.cpp.

subclass-coalesce.ll is too trivial and no longer tests what it was
originally intended to test.

llvm-svn: 80184
2009-08-27 00:14:12 +00:00
Daniel Dunbar
e3d14c797d Simplify.
llvm-svn: 80176
2009-08-26 23:12:33 +00:00