oota-llvm.git
14 years agollvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue.
Daniel Dunbar [Mon, 31 Aug 2009 08:08:38 +0000 (08:08 +0000)]
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

14 years agollvm-mc: Add MCAsmParser::Parse[Paren]Expression forms which return an MCExpr.
Daniel Dunbar [Mon, 31 Aug 2009 08:08:17 +0000 (08:08 +0000)]
llvm-mc: Add MCAsmParser::Parse[Paren]Expression forms which return an MCExpr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80574 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agollvm-mc: Make MCSymbolData symbol member const.
Daniel Dunbar [Mon, 31 Aug 2009 08:08:06 +0000 (08:08 +0000)]
llvm-mc: Make MCSymbolData symbol member const.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80573 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agollvm-mc: Add MCContext to MCAssembler.
Daniel Dunbar [Mon, 31 Aug 2009 08:07:55 +0000 (08:07 +0000)]
llvm-mc: Add MCContext to MCAssembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80572 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agollvm-mc: Add MCAsmParser::getContext.
Daniel Dunbar [Mon, 31 Aug 2009 08:07:44 +0000 (08:07 +0000)]
llvm-mc: Add MCAsmParser::getContext.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80571 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agollvm-mc: Add MCExpr::{dump,print}.
Daniel Dunbar [Mon, 31 Aug 2009 08:07:33 +0000 (08:07 +0000)]
llvm-mc: Add MCExpr::{dump,print}.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80570 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agollvm-mc: Switch MCExpr construction to using static member functions, and taking...
Daniel Dunbar [Mon, 31 Aug 2009 08:07:22 +0000 (08:07 +0000)]
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

14 years agollvm-mc: Add some doxyment markers.
Daniel Dunbar [Mon, 31 Aug 2009 08:07:08 +0000 (08:07 +0000)]
llvm-mc: Add some doxyment markers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80568 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agollvm-mc: Move AsmExpr into MC lib (as MCExpr).
Daniel Dunbar [Mon, 31 Aug 2009 08:06:59 +0000 (08:06 +0000)]
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

14 years agoStep #1 to giving Callgraph some sane invariants. The problems with callgraph
Chris Lattner [Mon, 31 Aug 2009 07:23:46 +0000 (07:23 +0000)]
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

14 years agofix some cases where instcombine would change hte IR but not return true
Chris Lattner [Mon, 31 Aug 2009 06:57:37 +0000 (06:57 +0000)]
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

14 years agocleanups, factor some code out to a helper function
Chris Lattner [Mon, 31 Aug 2009 06:01:21 +0000 (06:01 +0000)]
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

14 years agofix a crash building SPASS by tolerating a callsite that doesn't exist
Chris Lattner [Mon, 31 Aug 2009 05:46:59 +0000 (05:46 +0000)]
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

14 years agocomment and simplify some code.
Chris Lattner [Mon, 31 Aug 2009 05:34:32 +0000 (05:34 +0000)]
comment and simplify some code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80540 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd -debug output
Chris Lattner [Mon, 31 Aug 2009 05:22:48 +0000 (05:22 +0000)]
add -debug output

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80539 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoimprove -debug output, so that -debug is more likely to print when
Chris Lattner [Mon, 31 Aug 2009 05:17:58 +0000 (05:17 +0000)]
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

14 years agofix a bug I introduced with my 'instcombine builder' refactoring
Chris Lattner [Mon, 31 Aug 2009 04:36:22 +0000 (04:36 +0000)]
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

14 years agosimplify some code by making the SCCNodes set contain Function*'s
Chris Lattner [Mon, 31 Aug 2009 04:09:04 +0000 (04:09 +0000)]
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

14 years agoonly print the override triple if it exists!
Chris Lattner [Mon, 31 Aug 2009 03:22:35 +0000 (03:22 +0000)]
only print the override triple if it exists!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80534 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR4834, a tricky case where the inliner would resolve an
Chris Lattner [Mon, 31 Aug 2009 03:15:49 +0000 (03:15 +0000)]
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

14 years agouse an accessor instead of poking internals of a node.
Chris Lattner [Mon, 31 Aug 2009 02:24:20 +0000 (02:24 +0000)]
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

14 years agoCMake: updated library dependencies.
Oscar Fuentes [Mon, 31 Aug 2009 01:58:50 +0000 (01:58 +0000)]
CMake: updated library dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80531 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPR4747
Jim Grosbach [Mon, 31 Aug 2009 01:35:03 +0000 (01:35 +0000)]
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

14 years agoupdate unit test for previous change.
Chris Lattner [Mon, 31 Aug 2009 00:28:46 +0000 (00:28 +0000)]
update unit test for previous change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80528 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix some nasty callgraph dangling pointer problems in
Chris Lattner [Mon, 31 Aug 2009 00:19:58 +0000 (00:19 +0000)]
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

14 years agoFix header comment for bindings/ocaml/llvm/Makefile.
Erick Tryzelaar [Sun, 30 Aug 2009 23:41:20 +0000 (23:41 +0000)]
Fix header comment for bindings/ocaml/llvm/Makefile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80526 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake sure we specify no arguments for context functions.
Erick Tryzelaar [Sun, 30 Aug 2009 23:38:06 +0000 (23:38 +0000)]
Make sure we specify no arguments for context functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80525 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a dump() method on callgraph.
Chris Lattner [Sun, 30 Aug 2009 22:24:32 +0000 (22:24 +0000)]
add a dump() method on callgraph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80524 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorename test
Chris Lattner [Sun, 30 Aug 2009 22:14:17 +0000 (22:14 +0000)]
rename test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80523 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomerge all sinking tests into one and convert them to filecheck.
Chris Lattner [Sun, 30 Aug 2009 22:13:26 +0000 (22:13 +0000)]
merge all sinking tests into one and convert them to filecheck.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80522 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoconvert scalar_promote to filecheck style and merge 2003-12-13-VolatilePromote.ll...
Chris Lattner [Sun, 30 Aug 2009 22:08:19 +0000 (22:08 +0000)]
convert scalar_promote to filecheck style and merge 2003-12-13-VolatilePromote.ll into it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80521 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoeliminate some uses of prcontext. Any help here would be appreciated :)
Chris Lattner [Sun, 30 Aug 2009 21:45:23 +0000 (21:45 +0000)]
eliminate some uses of prcontext.  Any help here would be appreciated :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80520 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorename test so that name reflects what it is testing for.
Chris Lattner [Sun, 30 Aug 2009 21:36:39 +0000 (21:36 +0000)]
rename test so that name reflects what it is testing for.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80519 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoconvert to filecheck format.
Chris Lattner [Sun, 30 Aug 2009 21:36:06 +0000 (21:36 +0000)]
convert to filecheck format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80518 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosuck a bunch more gep tests into getelementptr.ll and filecheckize them all.
Chris Lattner [Sun, 30 Aug 2009 21:31:34 +0000 (21:31 +0000)]
suck a bunch more gep tests into getelementptr.ll and filecheckize them all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80517 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTweak comment.
Daniel Dunbar [Sun, 30 Aug 2009 21:14:05 +0000 (21:14 +0000)]
Tweak comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80516 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix some possible-use-of-uninitialized warnings.
Daniel Dunbar [Sun, 30 Aug 2009 21:13:58 +0000 (21:13 +0000)]
Fix some possible-use-of-uninitialized warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80515 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoconsolodate various GEP tests into getelementptr.ll using filecheck.
Chris Lattner [Sun, 30 Aug 2009 21:02:36 +0000 (21:02 +0000)]
consolodate various GEP tests into getelementptr.ll using filecheck.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80514 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoanother huge testcase, this time from 'gs' in llvm-test.
Chris Lattner [Sun, 30 Aug 2009 21:02:02 +0000 (21:02 +0000)]
another huge testcase, this time from 'gs' in llvm-test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80513 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoremove another poorly-reduced testcase which came from ldecod in llvm-test.
Chris Lattner [Sun, 30 Aug 2009 21:01:14 +0000 (21:01 +0000)]
remove another poorly-reduced testcase which came from ldecod in llvm-test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80512 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agothis testcase is 500 lines long and is distilled from bzip2, just
Chris Lattner [Sun, 30 Aug 2009 21:00:11 +0000 (21:00 +0000)]
this testcase is 500 lines long and is distilled from bzip2, just
remove it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80511 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoconvert to filecheck
Chris Lattner [Sun, 30 Aug 2009 20:48:15 +0000 (20:48 +0000)]
convert to filecheck

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80510 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR4748: don't fold gep(bitcast(x)) into bitcast(gep) when x
Chris Lattner [Sun, 30 Aug 2009 20:38:21 +0000 (20:38 +0000)]
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

14 years agomisc cleanup
Chris Lattner [Sun, 30 Aug 2009 20:36:46 +0000 (20:36 +0000)]
misc cleanup

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80507 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd getPointerAddressSpace() to GEP instruction, use the method
Chris Lattner [Sun, 30 Aug 2009 20:06:40 +0000 (20:06 +0000)]
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

14 years agoeliminate InsertCastBefore, use the builder instead.
Chris Lattner [Sun, 30 Aug 2009 20:01:10 +0000 (20:01 +0000)]
eliminate InsertCastBefore, use the builder instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80505 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoeliminate InsertBitCastBefore, just use the builder instead.
Chris Lattner [Sun, 30 Aug 2009 19:47:22 +0000 (19:47 +0000)]
eliminate InsertBitCastBefore, just use the builder instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80504 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a "getPointerAddressSpace" helper method to LoadInst and StoreInst.
Chris Lattner [Sun, 30 Aug 2009 19:45:21 +0000 (19:45 +0000)]
add a "getPointerAddressSpace" helper method to LoadInst and StoreInst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80503 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd missed pattern
Anton Korobeynikov [Sun, 30 Aug 2009 19:06:39 +0000 (19:06 +0000)]
Add missed pattern

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80502 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoconvert a bunch more calls to InsertNewInstBefore to use
Chris Lattner [Sun, 30 Aug 2009 18:50:58 +0000 (18:50 +0000)]
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

14 years agofix typo
Chris Lattner [Sun, 30 Aug 2009 17:53:59 +0000 (17:53 +0000)]
fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80500 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agohopefully unbreak the build by making this-> explicit for dependent
Chris Lattner [Sun, 30 Aug 2009 17:44:10 +0000 (17:44 +0000)]
hopefully unbreak the build by making this-> explicit for dependent
base class lookup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80499 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEXTRACT_VECTOR_ELEMENT can have result type different from element type.
Anton Korobeynikov [Sun, 30 Aug 2009 17:14:54 +0000 (17:14 +0000)]
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

14 years agoAdd regular expression matching support, based on OpenBSD regexec()/regcomp()
Torok Edwin [Sun, 30 Aug 2009 08:24:09 +0000 (08:24 +0000)]
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

14 years agogive instcombine a custom IRBuilder that adds new instructions to the
Chris Lattner [Sun, 30 Aug 2009 07:44:24 +0000 (07:44 +0000)]
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

14 years agoUpdate test.
Daniel Dunbar [Sun, 30 Aug 2009 07:01:09 +0000 (07:01 +0000)]
Update test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80490 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a new InstCombineWorklist::AddValue method that works even
Chris Lattner [Sun, 30 Aug 2009 06:27:41 +0000 (06:27 +0000)]
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

14 years agomove AddUsersToWorkList to the worklist processing class, make the
Chris Lattner [Sun, 30 Aug 2009 06:22:51 +0000 (06:22 +0000)]
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

14 years agorename AddUsesToWorkList -> AddOperandsToWorkList. The
Chris Lattner [Sun, 30 Aug 2009 06:20:05 +0000 (06:20 +0000)]
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

14 years agollvm-mc/X86: Encode constant MCValue's correctly.
Daniel Dunbar [Sun, 30 Aug 2009 06:17:49 +0000 (06:17 +0000)]
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

14 years agollvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now.
Daniel Dunbar [Sun, 30 Aug 2009 06:17:16 +0000 (06:17 +0000)]
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

14 years agoinline the trivial AddToWorkList/RemoveFromWorkList methods
Chris Lattner [Sun, 30 Aug 2009 06:13:40 +0000 (06:13 +0000)]
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

14 years agofix a bug I introduced in r80478 found by the build bot.
Chris Lattner [Sun, 30 Aug 2009 05:56:44 +0000 (05:56 +0000)]
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

14 years agorefactor instcombine's worklist processing stuff out to its own class.
Chris Lattner [Sun, 30 Aug 2009 05:55:36 +0000 (05:55 +0000)]
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

14 years agomake DenseMap::clear() early exit if there is nothing to do.
Chris Lattner [Sun, 30 Aug 2009 05:55:04 +0000 (05:55 +0000)]
make DenseMap::clear() early exit if there is nothing to do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80480 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosome minor cleanups to IRBuilder, factor the insertion
Chris Lattner [Sun, 30 Aug 2009 05:42:59 +0000 (05:42 +0000)]
some minor cleanups to IRBuilder, factor the insertion
hook out of the main IRBuilder class to allow clients to
override it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80479 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomore cleanups: remove some redundant code, and simplify some
Chris Lattner [Sun, 30 Aug 2009 05:30:55 +0000 (05:30 +0000)]
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

14 years agoeliminate the temporary SrcGEPOperands smallvector.
Chris Lattner [Sun, 30 Aug 2009 05:08:50 +0000 (05:08 +0000)]
eliminate the temporary SrcGEPOperands smallvector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80477 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosimplify/detangle some control flow.
Chris Lattner [Sun, 30 Aug 2009 05:00:50 +0000 (05:00 +0000)]
simplify/detangle some control flow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80476 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agosimplify and cleanup some code, remove some code that just
Chris Lattner [Sun, 30 Aug 2009 04:49:01 +0000 (04:49 +0000)]
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

14 years agodefault count-aa to -print-all. The whole reason to use count-aa is
Chris Lattner [Sun, 30 Aug 2009 04:25:40 +0000 (04:25 +0000)]
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

14 years agoNuke moribund "std::string" version of EOL(..., Encoding).
Bill Wendling [Sun, 30 Aug 2009 00:28:57 +0000 (00:28 +0000)]
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

14 years agoAdd AutoGenerated.inc to svn:ignore.
Dan Gohman [Sat, 29 Aug 2009 23:54:26 +0000 (23:54 +0000)]
Add AutoGenerated.inc to svn:ignore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80455 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove an unnecessary Context argument.
Dan Gohman [Sat, 29 Aug 2009 23:39:38 +0000 (23:39 +0000)]
Remove an unnecessary Context argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80454 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMinor logic simplification.
Dan Gohman [Sat, 29 Aug 2009 23:37:49 +0000 (23:37 +0000)]
Minor logic simplification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80453 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd some comments.
Dan Gohman [Sat, 29 Aug 2009 23:36:57 +0000 (23:36 +0000)]
Add some comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80452 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCleanup whitespace and indentation.
Dan Gohman [Sat, 29 Aug 2009 23:35:16 +0000 (23:35 +0000)]
Cleanup whitespace and indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80451 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove some unused fields.
Dan Gohman [Sat, 29 Aug 2009 23:34:14 +0000 (23:34 +0000)]
Remove some unused fields.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80450 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCMOV_GR8 clobbers EFLAGS when its expansion involves an xor to set
Dan Gohman [Sat, 29 Aug 2009 22:19:15 +0000 (22:19 +0000)]
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

14 years agoInline empty destructor.
Benjamin Kramer [Sat, 29 Aug 2009 13:38:21 +0000 (13:38 +0000)]
Inline empty destructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80431 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix warning about non-virtual destructor.
Bill Wendling [Sat, 29 Aug 2009 12:31:38 +0000 (12:31 +0000)]
Fix warning about non-virtual destructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80429 91177308-0d34-0410-b5e6-96231b3b80d8

14 years ago- Add target lowering methods to get the preferred format for the FDE and LSDA
Bill Wendling [Sat, 29 Aug 2009 12:20:54 +0000 (12:20 +0000)]
- 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

14 years agoAdd a form of EOL which emits the text version of a DWARF format encoding. This
Bill Wendling [Sat, 29 Aug 2009 12:17:53 +0000 (12:17 +0000)]
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

14 years agoPR4795: Remove EEVT::isFP, isInt and isVec types used by TableGen's type
Bob Wilson [Sat, 29 Aug 2009 05:53:25 +0000 (05:53 +0000)]
PR4795: Remove EEVT::isFP, isInt and isVec types used by TableGen's type
inferencing.  As far as I can tell, these are equivalent to the existing
MVT::fAny, iAny and vAny types, and having both of them makes it harder
to reason about and modify the type inferencing code.

The specific problem in PR4795 occurs when updating a vAny type to be fAny
or iAny, or vice versa.  Both iAny and fAny include vector types -- they
intersect with the set of types represented by vAny.  When merging them,
choose fAny/iAny to represent the intersection.  This is not perfect, since
fAny/iAny also include scalar types, but it is good enough for TableGen's
type inferencing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80423 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake the augmentation size and next set of bytes agree on size,
Eric Christopher [Sat, 29 Aug 2009 01:12:46 +0000 (01:12 +0000)]
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

14 years agoFix OProfile support after r80406 changed the DebugInfo interface from
Jeffrey Yasskin [Sat, 29 Aug 2009 00:44:16 +0000 (00:44 +0000)]
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

14 years agoAnother stab at fixing up register kill flags after post-RA scheduling.
David Goodwin [Sat, 29 Aug 2009 00:11:13 +0000 (00:11 +0000)]
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

14 years agoDo not assert on too wide splats we don't support.
Anton Korobeynikov [Sat, 29 Aug 2009 00:08:18 +0000 (00:08 +0000)]
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

14 years agoAdd missed extract_element pattern
Anton Korobeynikov [Fri, 28 Aug 2009 23:41:26 +0000 (23:41 +0000)]
Add missed extract_element pattern

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80408 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReapply 79977.
Devang Patel [Fri, 28 Aug 2009 23:24:31 +0000 (23:24 +0000)]
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

14 years agoLet Darwin linker auto-synthesize stubs and lazy-pointers. This deletes a bunch of...
Evan Cheng [Fri, 28 Aug 2009 23:18:09 +0000 (23:18 +0000)]
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

14 years agoNuke trailing whitespace.
Eric Christopher [Fri, 28 Aug 2009 22:33:43 +0000 (22:33 +0000)]
Nuke trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80401 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix creation of .bca libraries with EXPORTED_SYMBOLS_LIST, this was putting the
Daniel Dunbar [Fri, 28 Aug 2009 16:14:46 +0000 (16:14 +0000)]
Fix creation of .bca libraries with EXPORTED_SYMBOLS_LIST, this was putting the
llvm-ld shell wrapper script in the archive, not the relinked object!

Also, rename the temp file to avoid conflicts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80373 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRead Makefile.config before using LLVMGCC.
Andreas Neustifter [Fri, 28 Aug 2009 16:13:45 +0000 (16:13 +0000)]
Read Makefile.config before using LLVMGCC.
See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090824/085828.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80372 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoinstall-sh chmods to 0755 by default, and this causes 'git diff' to show
Torok Edwin [Fri, 28 Aug 2009 16:12:48 +0000 (16:12 +0000)]
install-sh chmods to 0755 by default, and this causes 'git diff' to show
that all the Makefiles changed mode.
Fix this by tellint install-sh to chmod
only to 0644, these are not executable files after all!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80371 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoShort-term workaround for frame-related weirdness on win64.
Anton Korobeynikov [Fri, 28 Aug 2009 16:06:41 +0000 (16:06 +0000)]
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

14 years agorm needs -f
Torok Edwin [Fri, 28 Aug 2009 14:05:07 +0000 (14:05 +0000)]
rm needs -f

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80363 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove the llvmprof.out from the test output, otherwise running
Torok Edwin [Fri, 28 Aug 2009 13:35:44 +0000 (13:35 +0000)]
Remove the llvmprof.out from the test output, otherwise running
make check in a non-clean directory causes it to fail (for example when running
make check twice), since execution counts will differ.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80362 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPreparation for Optimal Edge Profiling:
Andreas Neustifter [Fri, 28 Aug 2009 11:28:24 +0000 (11:28 +0000)]
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

14 years agoRemove profiling output file because two consecutive runs of make check give
Andreas Neustifter [Fri, 28 Aug 2009 10:38:26 +0000 (10:38 +0000)]
Remove profiling output file because two consecutive runs of make check give
error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80357 91177308-0d34-0410-b5e6-96231b3b80d8