Commit Graph

32070 Commits

Author SHA1 Message Date
Chris Lattner
da230cb876 remove CallGraphNode::replaceCallSite, it is redundant with other APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:52:39 +00:00
Bob Wilson
8a3198b770 Add support for generating code for vst{234}lane intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:51:56 +00:00
Chris Lattner
7c8c1ba40c cleanup/simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:50:55 +00:00
Jim Grosbach
c40d9f9bae Use raw_ostream instead of sstream
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80704 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:49:12 +00:00
Chris Lattner
81dfb38852 remove a bunch of explicit code previously needed to update the
callgraph.  This is now dead because RAUW does the job.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:44:06 +00:00
David Goodwin
1f15228398 Add hidden flags to allow binary search of post-RA scheduling errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:34:03 +00:00
David Goodwin
ca01a8d4ab RRX reads CPSR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80699 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:32:09 +00:00
Chris Lattner
5a6a363527 doxygenate RefreshCallGraph, add a new 'verification mode', and run it after
CGSCC passes make change to ensure they are updating the callgraph correctly
(when assertions are enabled).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80698 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:32:03 +00:00
Sean Callanan
4a93b71fe7 Added TEST %rAX, $imm instructions to the Intel tables. These are required for the X86 disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:14:18 +00:00
Chris Lattner
17146b867f simpler solution to iterator invalidation "problem" found
by expensive checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:13:40 +00:00
Chris Lattner
f41eaacee4 enhance memcpy opt to turn memmoves into memcpy when the src/dest
don't alias.  Remove an old and poorly reduced testcase that fails
with this transform for reasons unrelated to the original test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 17:56:32 +00:00
Bruno Cardoso Lopes
c517cb0065 Reapply 80278
Add MO flags to simplify the printing of relocations.
Remove the support for printing large code model relocs (which
aren't supported anyway).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 17:27:58 +00:00
Jim Grosbach
33668c0f1a revert inadvertant change from previous commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 17:19:13 +00:00
Chris Lattner
61c6ba8571 random code cleanups, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 17:09:55 +00:00
Ted Kremenek
eed51b04e3 Update CMake files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80680 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 17:01:02 +00:00
Jim Grosbach
a01d34676f Simply LSDA lable emission to use a direct special-case output instead of
EmitLabel()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 16:43:35 +00:00
Duncan Sands
c142bb294b Do not manipulate invalid iterators. This fixes the
llvm-gcc build when expensive checking is turned on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 15:13:02 +00:00
Sanjiv Gupta
72f9ab030e Further refactoring of PIC16 Obj file code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 10:47:31 +00:00
Benjamin Kramer
6818863940 Update CMakeLists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80669 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 10:24:10 +00:00
Andreas Neustifter
62353a8d13 Preparation for Optimal Edge Profiling:
Add statistics for regular edge profiling, this enables the comparation of the
number of edges inserted by regular and optimal edge profiling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80668 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 10:08:39 +00:00
Andreas Neustifter
e885af9fb7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 10:06:05 +00:00
Andreas Neustifter
e7ddcfdebe 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80666 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 08:48:42 +00:00
Chris Lattner
a541b0fde2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80663 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 06:31:31 +00:00
Bob Wilson
243fcc5a69 Generate code for vld{234}_lane intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80656 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 04:26:28 +00:00
Bob Wilson
71124f698b Fix pr4843: When an instruction has multiple destination registers that are
tied to different source registers, the TwoAddressInstructionPass needs to
be smarter.  Change it to check before replacing a source register whether
that source register is tied to a different destination register, and if so,
defer handling it until a subsequent iteration.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 04:18:40 +00:00
Daniel Dunbar
efbb5330b8 llvm-mc: Store MCSymbolData value as a pointer (to make MSVC happy).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 04:09:03 +00:00
Jim Grosbach
27830e39c4 Fix compiler warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80650 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 02:05:03 +00:00
Jim Grosbach
3fb2b1ede3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80649 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 01:57:56 +00:00
Devang Patel
f98d8fee3c Introduce DILocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80648 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 01:14:15 +00:00
Devang Patel
82dfc0cd8c Subprogram is a scope. Derive DISubprogram from DIScope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80637 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 22:47:13 +00:00
Devang Patel
5e005d814f Rename DIBlock as DILexicalBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80633 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 22:00:15 +00:00
Dan Gohman
a5505cb9c9 Don't use an iterator which is potentially invalidated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80632 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:58:28 +00:00
Bob Wilson
4344979ba9 Use early exit and reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80631 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:54:55 +00:00
Bob Wilson
d4034b2825 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:54:16 +00:00
Richard Osborne
768f1dd48f Add triple parsing support for XCore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80629 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:51:36 +00:00
Devang Patel
c9f322d9a6 Derive DICompileUnit from DIScope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80627 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:34:44 +00:00
Caroline Tice
dc8f6049d1 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:19:37 +00:00
Dan Gohman
4221489908 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80623 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 21:15:23 +00:00
David Goodwin
a3251db21a Don't mark a register live at an undef use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 20:47:02 +00:00
Devang Patel
43d98b3c4e Introduce DIScope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 20:44:45 +00:00
Devang Patel
5a68509b17 Oops. Fix inverted logic in assertion check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80618 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 20:27:49 +00:00
Evan Cheng
029599bf01 Remove .n suffix for some 16-bit opcodes now that Darwin assembler is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80615 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 20:14:07 +00:00
Daniel Dunbar
ec2e4679fd X86/exp-asm-printer: Lower MachineOperand::MO_JumpTableIndex to MCOperand.
- Down to 7 failures on 403.gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80605 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 19:14:05 +00:00
Daniel Dunbar
d2a0b272fe Stop printing old asm printing code inline with -experimental-asm-printer (this allows diffing and assembling the .s)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80604 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 19:13:56 +00:00
Daniel Dunbar
64926be847 Avoid unnecessary +0 in experimental-asm-printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80603 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 19:13:47 +00:00
Devang Patel
6ceea33c5e Simplify isDerivedType() and other predicate interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 18:49:10 +00:00
Bill Wendling
049e98d641 Output a hex value, because all of the others are hex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 18:26:48 +00:00
Chris Lattner
2038cf3168 cleanups pointed out by duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 17:08:30 +00:00
Duncan Sands
c69d74a5d4 Revert commit 80428. It completely broke exception
handling on x86-32 linux.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80592 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 16:45:16 +00:00
Torok Edwin
2cd5155c0e 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80590 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 16:14:59 +00:00
Torok Edwin
72ddf7b555 Fix ExplicitSymbols leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80589 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 16:12:29 +00:00
Benjamin Kramer
b4f770b68a Normalize makefile comments and sort cmake file lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 13:05:24 +00:00
Daniel Dunbar
821e3334ed llvm-mc: Pass values to MCStreamer as MCExprs, not MCValues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:09:28 +00:00
Daniel Dunbar
e2ace509fc llvm-mc: Simplify EmitAssignment ('.set' is identical to '=').
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:09:09 +00:00
Daniel Dunbar
8c2eebe407 llvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue.
Also, use MCInst::print instead of custom code in MCAsmPrinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80575 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:08:38 +00:00
Daniel Dunbar
cb579b3338 llvm-mc: Make MCSymbolData symbol member const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80573 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:08:06 +00:00
Daniel Dunbar
a03a368acc llvm-mc: Add MCContext to MCAssembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:07:55 +00:00
Daniel Dunbar
87392fde1f llvm-mc: Add MCExpr::{dump,print}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80570 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:07:33 +00:00
Daniel Dunbar
9643ac5514 llvm-mc: Switch MCExpr construction to using static member functions, and taking the MCContext (which now owns all MCExprs).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:07:22 +00:00
Daniel Dunbar
28c251b54b llvm-mc: Move AsmExpr into MC lib (as MCExpr).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 08:06:59 +00:00
Chris Lattner
be577659d3 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.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80566 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 07:23:46 +00:00
Chris Lattner
b0b822c449 fix some cases where instcombine would change hte IR but not return true
from runOnFunction


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80562 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 06:57:37 +00:00
Chris Lattner
f3a1c15b75 cleanups, factor some code out to a helper function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 06:01:21 +00:00
Chris Lattner
46ca76f6bb 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 05:46:59 +00:00
Chris Lattner
d43d5e832f comment and simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 05:34:32 +00:00
Chris Lattner
a3512bd589 add -debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 05:22:48 +00:00
Chris Lattner
931f8f3d12 improve -debug output, so that -debug is more likely to print when
instcombine is changing stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 05:17:58 +00:00
Chris Lattner
95afdfee82 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 04:36:22 +00:00
Chris Lattner
98a27ce03f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 04:09:04 +00:00
Chris Lattner
b374b90e81 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 03:15:49 +00:00
Chris Lattner
2adb8306e2 use an accessor instead of poking internals of a node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 02:24:20 +00:00
Jim Grosbach
0bb61c56bc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 01:35:03 +00:00
Chris Lattner
5095e3d1d1 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 00:19:58 +00:00
Chris Lattner
23603a61c9 add a dump() method on callgraph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 22:24:32 +00:00
Daniel Dunbar
12420d3a64 Fix some possible-use-of-uninitialized warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80515 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 21:13:58 +00:00
Chris Lattner
2de2319124 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80508 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 20:38:21 +00:00
Chris Lattner
963f4ba826 misc cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80507 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 20:36:46 +00:00
Chris Lattner
8a67ac525e add getPointerAddressSpace() to GEP instruction, use the method
in a few scalar xforms to simplify things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 20:06:40 +00:00
Chris Lattner
2345d1d22e eliminate InsertCastBefore, use the builder instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 20:01:10 +00:00
Chris Lattner
08142f2560 eliminate InsertBitCastBefore, just use the builder instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 19:47:22 +00:00
Anton Korobeynikov
d91aafd005 Add missed pattern
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 19:06:39 +00:00
Chris Lattner
f925cbd7e4 convert a bunch more calls to InsertNewInstBefore to use
the new Instcombine builder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 18:50:58 +00:00
Chris Lattner
75551f748d fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80500 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 17:53:59 +00:00
Anton Korobeynikov
b00c03bb35 EXTRACT_VECTOR_ELEMENT can have result type different from element type.
Remove the assertion and generalize the code for ARM NEON stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 17:14:54 +00:00
Torok Edwin
ce0c81e7dd Add regular expression matching support, based on OpenBSD regexec()/regcomp()
implementation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80493 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 08:24:09 +00:00
Chris Lattner
7438106207 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 07:44:24 +00:00
Chris Lattner
3c4e38e411 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80488 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:27:41 +00:00
Chris Lattner
e5ecdb5a98 move AddUsersToWorkList to the worklist processing class, make the
argument stronger typed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:22:51 +00:00
Chris Lattner
c3a3e3682b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80486 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:20:05 +00:00
Daniel Dunbar
df65eafe5e llvm-mc/X86: Encode constant MCValue's correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80485 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:17:49 +00:00
Daniel Dunbar
7092c7e1dc llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now.
- Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:17:16 +00:00
Chris Lattner
7a1e924b9a 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80483 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 06:13:40 +00:00
Chris Lattner
878daed2aa fix a bug I introduced in r80478 found by the build bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 05:56:44 +00:00
Chris Lattner
873ff0158e refactor instcombine's worklist processing stuff out to its own class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80481 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 05:55:36 +00:00
Chris Lattner
ab984847a8 more cleanups: remove some redundant code, and simplify some
other places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 05:30:55 +00:00
Chris Lattner
f9b91bb5ef eliminate the temporary SrcGEPOperands smallvector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80477 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 05:08:50 +00:00
Chris Lattner
6e24d83167 simplify/detangle some control flow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80476 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 05:00:50 +00:00
Chris Lattner
ccf4b34a08 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80475 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 04:49:01 +00:00
Chris Lattner
0819cfb1e6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80474 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 04:25:40 +00:00
Bill Wendling
8ed211406a Nuke moribund "std::string" version of EOL(..., Encoding).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-30 00:28:57 +00:00
Dan Gohman
14ef4f0a4c Remove an unnecessary Context argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 23:39:38 +00:00
Dan Gohman
419055453c Minor logic simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 23:37:49 +00:00
Dan Gohman
ed77e52dd9 Add some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80452 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 23:36:57 +00:00
Dan Gohman
f8a87e8343 Cleanup whitespace and indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 23:35:16 +00:00
Dan Gohman
c34ee42595 Remove some unused fields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80450 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 23:34:14 +00:00
Dan Gohman
71a258c36b CMOV_GR8 clobbers EFLAGS when its expansion involves an xor to set
a register to 0. This fixes PR4814.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80445 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 22:19:15 +00:00
Benjamin Kramer
ac6f73a2e7 Inline empty destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 13:38:21 +00:00
Bill Wendling
d1e1d39b85 Fix warning about non-virtual destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80429 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 12:31:38 +00:00
Bill Wendling
9b35a09e7e - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 12:20:54 +00:00
Bill Wendling
b5abecded7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80427 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 12:17:53 +00:00
Eric Christopher
6fefcebc4f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 01:12:46 +00:00
Jeffrey Yasskin
91dc33ae8f Fix OProfile support after r80406 changed the DebugInfo interface from
GlobalVariables to MDNodes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80411 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 00:44:16 +00:00
David Goodwin
7886cd85b2 Another stab at fixing up register kill flags after post-RA scheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 00:11:13 +00:00
Anton Korobeynikov
71624cc786 Do not assert on too wide splats we don't support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-29 00:08:18 +00:00
Anton Korobeynikov
2324bdc1ee Add missed extract_element pattern
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 23:41:26 +00:00
Devang Patel
e4b275610a Reapply 79977.
Use MDNodes to encode debug info in llvm IR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 23:24:31 +00:00
Evan Cheng
e4e4ed3b56 Let Darwin linker auto-synthesize stubs and lazy-pointers. This deletes a bunch of nasty code in ARM asm printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 23:18:09 +00:00
Eric Christopher
dbfcdb9763 Nuke trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 22:33:43 +00:00
Anton Korobeynikov
6f9bb6f31b Short-term workaround for frame-related weirdness on win64.
Some other minor win64 fixes as well.

Patch by Michael Beck!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 16:06:41 +00:00
Andreas Neustifter
6ef116d9dc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 11:28:24 +00:00
Daniel Dunbar
19bb87d0f8 Fix -Asserts warning, round two.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80354 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 08:08:22 +00:00
Daniel Dunbar
8c3eaf46a1 llvm-mc: .lsym is more unsupported than unimplemented, pending a use case appearing.
Also, all one of the file level flags are implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80352 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 07:08:47 +00:00
Daniel Dunbar
8f4d146c34 llvm-mc: Support .comm emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80351 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 07:08:35 +00:00
Evan Cheng
d17479e845 Print a nl before pic labels so they start at a new line. This makes assembly more readable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 06:59:37 +00:00
Daniel Dunbar
d5a8e98ef6 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 05:49:21 +00:00
Daniel Dunbar
edc670f3f2 llvm-mc: Tweak section alignment and size computation to match 'as' closer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80345 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 05:49:04 +00:00
Daniel Dunbar
0f5fa69551 llvm-mc: Factor getSectionData out of SwitchSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80344 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 05:48:54 +00:00
Daniel Dunbar
e6cdbf2f92 llvm-mc: Emit .lcomm as .zerofill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 05:48:46 +00:00
Daniel Dunbar
8751b94ffb llvm-mc: Add const to EmitZeroFill section argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80341 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 05:48:22 +00:00
Daniel Dunbar
6c31b0575c llvm-mc: Fix thinko in emitting values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 05:48:10 +00:00
Daniel Dunbar
ca7943226e Fix -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80338 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 05:47:56 +00:00
Chris Lattner
cc0a0299d9 finish a half formed thought :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80334 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 04:48:54 +00:00
Chris Lattner
b80e1abaeb Mark Andersen's as experimental.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80328 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 00:45:47 +00:00
Chris Lattner
de64894dc3 Fix PR3913, patch by Jakub Staszak!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80327 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 00:43:14 +00:00
Evan Cheng
0e87e23f6e v4, v5 does not support sxtb / sxth.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-28 00:31:43 +00:00
Devang Patel
a1ba269a27 Closure is a very generic name. Use AppleBlock instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80307 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 23:51:51 +00:00
Bruno Cardoso Lopes
0c80be59c7 Revert 80278 for now, it caused a lot of MIPS tests to fail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80280 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 19:57:56 +00:00
Bruno Cardoso Lopes
dcace5c620 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 19:40:40 +00:00
Dan Gohman
a4c5c33041 Don't mark CMOV_GR8 as two-address, or commutable, since it's a pseudo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80271 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 18:16:24 +00:00
Dan Gohman
a01a80fa6c Adjust the MachineBasicBlock verifier rules to be more
tolerant of blocks that end with "unreachable".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 18:14:26 +00:00
Eric Christopher
f83a5def43 Add FIXME for when we support more specific XMM registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80269 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 18:08:16 +00:00
Eric Christopher
fd17929b86 Nuke trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80268 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 18:07:15 +00:00
Dan Gohman
aae87cde50 Use stripPointerCasts instead of doing the same manually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 18:02:03 +00:00
Dan Gohman
aac1bfb99a Teach getUnderlyingObject and skipPointerCasts about GlobalAliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80265 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 17:55:13 +00:00
Dan Gohman
5753a4a003 Global Aliases are not identifiable objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80263 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 17:52:56 +00:00
Dan Gohman
846a2f2703 Handle TargetData with const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 17:51:25 +00:00
Anton Korobeynikov
b5fb4282cd Hopefully the final missing part :(
scalar_to_vector is fully legal now

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80251 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 16:25:49 +00:00
Anton Korobeynikov
b5cdf873bc Forgot about actual change :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 16:10:17 +00:00
Devang Patel
8cf476be5b Remove an entry from ValueMap before removing elements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 15:32:38 +00:00
Anton Korobeynikov
fdf189ac97 Transform float scalar_to_vector into subreg accesses.
No idea whether this is profitable or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80245 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 14:38:44 +00:00
Misha Brukman
bf16f1ddc4 STRD and LDRD require ARMv5TE, not just ARMv5T.
See http://llvm.org/PR4687 for more info and links.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80244 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 14:14:21 +00:00
Daniel Dunbar
4fac74950a llvm-mc/Mach-O: Add MCCodeEmitter support, for encoding instructions.
- No relocations yet, of course.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 08:17:51 +00:00
Daniel Dunbar
7168a7dc6d 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! ;)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80234 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 08:12:55 +00:00
Daniel Dunbar
a356aea804 llvm-mc: Print encodings after the instruction, and only when we have an asm
printer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 07:58:57 +00:00
Daniel Dunbar
1ca3a0bf22 X86: Mark EH_RETURN as code-gen-only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 07:58:05 +00:00
Daniel Dunbar
4b770c2077 Add {MCInst,MCOperand}::{print,dump}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 07:57:12 +00:00
Chris Lattner
199ba42cbf 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 06:29:33 +00:00
Chris Lattner
29f42aebd0 unbreak the build, yay for symlinks + makefiles. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80205 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 04:43:05 +00:00
Chris Lattner
12f0babca4 reduce header #include'age
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80204 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 04:32:07 +00:00
Chris Lattner
8f2718fbef enhance InlineFunction to be able to optionally return
a the list of static allocas that it inlined.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80203 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 04:20:52 +00:00
Chris Lattner
ec1bea0d94 smallvectorize the list of returns built by CloneAndPruneFunctionInto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80202 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 04:02:30 +00:00
Chris Lattner
597ef10577 remove CloneTrace, which appears to be dead since 2004.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80201 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 03:56:43 +00:00
Chris Lattner
135755dae4 reduce inlining factor some stuff out to a static helper function,
and other code cleanups.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 03:51:50 +00:00
Bill Wendling
639217cb6a Revert accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 03:32:50 +00:00
Bill Wendling
fffb7266fe --- 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 03:29:26 +00:00
Dan Gohman
27920594b9 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80196 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 02:43:49 +00:00
Daniel Dunbar
7008087b8c Update CMake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80195 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 02:08:37 +00:00
Daniel Dunbar
04baf9094a llvm-mc: Tweak MCCodeEmitter skeleton.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 01:34:22 +00:00
Dan Gohman
5b78d50cad 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80192 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 01:25:57 +00:00
Evan Cheng
cdbb3f5d33 Fix PR4789. Teach eliminateFrameIndex how to handle VLDRQ and VSTRQ which cannot fold any immediate offset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 01:23:50 +00:00
Daniel Dunbar
4a0abd80f1 Sketch TargetRegistry support for MCCodeEmitter abstract interface.
- Of course, nothing actually can provide this interface yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80188 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 00:51:57 +00:00
Daniel Dunbar
81e400092f Try to make MSVC just a little happier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 00:38:04 +00:00
Dan Gohman
7e7f06e70a X86FastISel support for loading and storing values of type i1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 00:31:47 +00:00
Dan Gohman
cbbea0ffc7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 00:14:12 +00:00
Daniel Dunbar
16df208d4e Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 23:12:33 +00:00
Owen Anderson
4eebf0bbfa Make this into a static method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80170 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 22:55:11 +00:00
Daniel Dunbar
959fd88334 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80162 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 22:13:22 +00:00
Eric Christopher
5e365e23f1 Rework getPersonalityIndex slightly - 0 is now a valid and not-NULL
personality function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 21:44:57 +00:00
Eric Christopher
d44fff7849 If we're emitting additional CIEs due to personality functions
don't emit the default one. Explicitly check for the NULL
CIE later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80146 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 21:30:49 +00:00
Eric Christopher
cf29697266 Nuke trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 21:27:09 +00:00
Daniel Dunbar
6009db486e llvm-mc/Mach-O: Set .subsections_via_symbols flag properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 21:22:22 +00:00
Oscar Fuentes
f3ea400830 CMake: Removed outdated TODO.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80124 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 18:37:05 +00:00
Venkatraman Govindaraju
eb2aa096bb Generate section for bss and enable weak symbols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80121 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 18:24:12 +00:00
Dale Johannesen
4e68f8803d Alter 79292 to produce output that actually assembles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 18:10:32 +00:00
Bob Wilson
31fb12f93a Remove unneeded ARM-specific DAG nodes for VLD* and VST* Neon operations.
The instructions can be selected directly from the intrinsics.  We will need
to add some ARM-specific nodes for VLD/VST of 3 and 4 128-bit vectors, but
those are not yet implemented.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 17:39:53 +00:00
Anton Korobeynikov
62c77d33b1 Add extload expansion for f128
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 17:39:40 +00:00
Anton Korobeynikov
efc3f3a570 Unbreak FP128 stuff in cbe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80115 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 17:39:23 +00:00
Douglas Gregor
814910191a Unbreak CMake build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80109 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 16:33:57 +00:00
Anton Korobeynikov
1cb852b0ea Expand scalar_to_vector - we don't have any isel logic for it now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 16:26:09 +00:00
Dan Gohman
6ff5de4b1d Add comments detailing a known bug, so that people writing other
backends don't use it as an example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80105 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 16:06:11 +00:00
Dan Gohman
e29fea4434 -fast is now -O0. -fast-isel is no longer experimental.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80104 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 15:57:57 +00:00
Dan Gohman
4bac4b9899 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80103 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 15:56:38 +00:00
Andreas Neustifter
ff271e1353 Implemented comments from Daniel Dunbar.
(See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090817/084958.html)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80100 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 15:13:44 +00:00
Dan Gohman
af70e5c676 Don't use INSERT_SUBREG to model anyext operations on x86-64, as it
leads to partial-register definitions. To help avoid redundant
zero-extensions, also teach the h-register matching patterns that
use movzbl to match anyext as well as zext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 14:59:13 +00:00
Dan Gohman
2385e0e22c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 14:53:06 +00:00
Dan Gohman
e2cb912039 Fix a missing newline, now that Value's operator<< doesn't add one of its own.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 14:34:12 +00:00
Dan Gohman
a8c711cb23 Use SetVector instead of std::set so that alias relations are tested and
printed in a deterministic order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 14:32:17 +00:00
Daniel Dunbar
3f6a960f9c 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 13:58:10 +00:00
Daniel Dunbar
be96355694 llvm-mc/Mach-O: Move symbol indices into the MCSymbolData structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80088 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 13:57:54 +00:00
Daniel Dunbar
a421de11df llvm-mc: Add symbol entries for undefined symbols used in .fill and .org.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80086 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 13:57:37 +00:00
Anton Korobeynikov
cd76128f18 Add dummy inline asm handling for 'r' constraint. This fixes PR4778
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 13:44:29 +00:00
Andreas Neustifter
3772fb11fe Moved isDeclaration() check further down to allow for function counts for
declarations if necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80084 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 13:33:09 +00:00
Daniel Dunbar
383cbff031 llvm-mc: Change MCContext value table to take const MCSymbol*s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 09:16:57 +00:00
Devang Patel
8245988835 Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 05:01:18 +00:00
Venkatraman Govindaraju
765e08d4d5 test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 04:50:17 +00:00
Daniel Dunbar
6742e34385 llvm-mc/Mach-O: Add section padding where needed (to align the next section).
Also, simplify some of Mach-O writer code which can now use section addresses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 04:13:32 +00:00
Daniel Dunbar
5e835967dd llvm-mc/Mach-O: Set addresses for symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 02:48:04 +00:00
Dale Johannesen
de86d473fc Add an 'inline hint' attribute to represent source
code hints that it would be a good idea to inline
a function ("inline" keyword).  No functional change
yet; FEs do not emit this and inliner does not use it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80063 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 01:08:21 +00:00
Devang Patel
8af76bdb74 Add isClosure() predicate. This is used to add DW_AT_APPLE_block attribute.
Patch by Caroline Tice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80061 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 00:39:50 +00:00
Daniel Dunbar
ad7c3d5593 llvm-mc: Improve indirect symbol support (add the indirect index table).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80059 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 00:18:21 +00:00
Dan Gohman
0084ace949 Remove unused variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-26 00:13:22 +00:00
Dan Gohman
638d853ef0 Fix the InsertAtEnd form of ShuffleVectorInst constructor to use
the correct type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80050 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 23:27:45 +00:00
Dan Gohman
1c8a23c440 Eliminate the unused Context argument on one of the ICmpInst and FCmpInst
constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80049 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 23:17:54 +00:00
Scott Michel
77f452d1a8 Updated i128 sext support for CellSPU backend, contributed by Ken Werner (IBM)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 22:37:34 +00:00
Dan Gohman
30f8091963 Use covariant return types for Instruction::clone, and eliminate
the forms of ExtractElementInst and InsertElementInst that are
equivalent to clone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 22:29:08 +00:00
Owen Anderson
d8110fb726 Get rid of this horrible "benign race" by exploiting ManagedStatic to initialize
the array on its first access.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 22:27:22 +00:00
Dan Gohman
75b0edae72 This should use isIndenticalToWhenDefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80039 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 22:24:20 +00:00
Dan Gohman
58cfa3b137 Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,
and introduce a new Instruction::isIdenticalTo which tests for full
identity, including the SubclassOptionalData flags. Also, fix the
Instruction::clone implementations to preserve the SubclassOptionalData
flags. Finally, teach several optimizations how to handle
SubclassOptionalData correctly, given these changes.

This fixes the counterintuitive behavior of isIdenticalTo not comparing
the full value, and clone not returning an identical clone, as well as
some subtle bugs that could be caused by these.

Thanks to Nick Lewycky for reporting this, and for an initial patch!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80038 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 22:11:20 +00:00
Bill Wendling
415c8cf837 Revert last patch. We need to put this into TargetLowering. There will be a lot
of EH stuff going into there, so we can wait to add them all then.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80036 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 21:31:39 +00:00
Daniel Dunbar
0adcd35f78 llvm-mc: Add statistic for number of fragments emitted by the assembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80033 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 21:10:45 +00:00
Bill Wendling
533534a295 Add the #include here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 21:09:50 +00:00
Bill Wendling
b9e7689c89 Add a target asm info hook to specify that particular bits of data in the FDE
should be forced to 32-bits (.long) even on 64-bit architectures. Darwin wants
these bits to be 64-bits (.quad). However, other platforms may disagree.

This is just the info right now and is part of a work-in-progress which needs
this. We'll add the actual *use* of this soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80024 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 20:21:17 +00:00
Sanjiv Gupta
b9ef7648b8 Start refactoring PIC16 TargetObjectFile code. Eventually, all the stuff from
PIC16Section will move to MCSectionPIC16.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80021 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 19:39:05 +00:00
Dan Gohman
041de42d42 Don't assume that two identical instructions that read from memory
will always return the same value. This isn't currently necessary,
since this code doesn't currently ever get called under circumstances
where it would matter, but it may some day.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80017 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:56:57 +00:00
Bob Wilson
a123239a5f Remove some unused SDNode definitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80015 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:52:39 +00:00
Dan Gohman
26812320b7 Teach ScalarEvolution about GlobalAliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:49:57 +00:00
Dan Gohman
79b765d057 Use X86II::MO_NO_FLAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:47:44 +00:00
Bob Wilson
2a9df47abd Expose the instruction contraint string as an argument to the NLdSt class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:46:06 +00:00
Dan Gohman
76f497a351 Special-case static allocas in IndVarSimplify's loop invariant
sinking code, since they are special. If the loop preheader happens
to be the entry block of a function, don't sink static allocas
out of it. This fixes PR4775.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:42:10 +00:00
Owen Anderson
613bf1ef01 Comment-ify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80009 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:42:07 +00:00
Owen Anderson
55a0f1e41f Switch to SmallVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80007 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:35:37 +00:00
Owen Anderson
60fd8be183 Pull out this predicate loop into a helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:26:32 +00:00
David Goodwin
88a589c4b3 Fixup register kills after scheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:03:05 +00:00
Anton Korobeynikov
379a087cc7 Provide dynamic_stackalloc lowering for MSP430.
This fixes PR4769

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 17:00:23 +00:00
Dan Gohman
63a03cf585 Allocate the basic types inside the LLVMContextImpl instance,
rather than separately with new. Move the members above the
TypeMap members to avoid destruction order issues. This fixes
a leak of these objects, and eliminates an extra level of
indirection in Type::getInt32Ty and friends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79997 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 16:00:35 +00:00
Dan Gohman
baa26395cc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 15:34:52 +00:00
Andreas Neustifter
cf48efcf3d Read profile files as binary as proposed in
http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-August/025020.html.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79983 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 12:53:27 +00:00
Xerxes Ranby
3d47db50b3 Fix PR4772 ARM JIT.GlobalInFuction unittest by explicitly initialize MMI
to 0 during JITEmitter constructor.

Modified:
	lib/ExecutionEngine/JIT/JITEmitter.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79982 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 10:12:55 +00:00
Bill Wendling
7ccda0f2aa - Rename EmitCommonInformationEntry to EmitCIE.
- Rename EmitFunctionDescriptionEntry to EmitFDE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79981 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 08:08:33 +00:00
Devang Patel
2a610c7387 Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.
This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 05:24:07 +00:00
Bill Wendling
4bda11fbda - Emit new line after each FDE.
- Fix comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 02:32:05 +00:00
Bill Wendling
a6f91da8b2 Rename functions to something more descriptive. At the very least mention the
CIE and FDE in their names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 02:27:42 +00:00
Dale Johannesen
5fee49eff9 Allow multiple occurrences of -inline-threshold on
the command line.  This gives llvm-gcc developers
a way to control inlining (documented as "not intended
for end users").



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79966 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 01:13:58 +00:00
Owen Anderson
9db7e91fe8 Handle a corner case when extracing code regions where one of the immediate successor
of an extracted block contains a PHI using a value defined in the extracted region.

With this patch, the partial inliner now passes MultiSource/Applications.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 00:54:39 +00:00
Dale Johannesen
f6163dc856 Fix PR 4751, another difficulty with %a modifier on x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 00:16:14 +00:00
Oscar Fuentes
2e193f80eb CMake: updated list of source files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 00:02:29 +00:00
Scott Michel
f6045fe8c4 - Remove SelectSEXTi128 from SPUISelDAGToDAG.cpp, evidently, this is redundant
code, according to Anton (I'm not totally convinced, but we can always
  resurrect patches if we need to do so.)
- Start moving CellSPU's tests to prefer FileCheck.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79958 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 23:57:35 +00:00
Owen Anderson
9ea9fcdf65 When extracting SEME regions of code, the extractor needs to update the dominator tree for split return blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 23:32:14 +00:00
Scott Michel
f1fa4fd282 128-bit sign extension and vector shift cleanups, contributed by Ken Werner
(IBM).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79949 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 22:28:53 +00:00
Scott Michel
9b2420d2b2 Initialize ShufBytes, as gcc 4.4 can't detect that the entire array is
initialized and a warning about a potentially unintialized variable is
generated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-24 21:53:27 +00:00