Commit Graph

11215 Commits

Author SHA1 Message Date
Chris Lattner
2033097b1f add some new methods to adjust this pointers. Not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94013 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 19:26:14 +00:00
Chris Lattner
61186cd3a3 add a helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 19:25:45 +00:00
Jakob Stoklund Olesen
f8526cb711 Move per-function inline threshold calculation to a method.
No functional change except the forgotten test for
InlineLimit.getNumOccurrences() == 0 in the CurrentThreshold2 calculation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94007 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 17:51:28 +00:00
Chris Lattner
ea3cb40fab inline and radically simplify printDataDirective. It will eventually
go completely away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93994 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 07:33:29 +00:00
Chris Lattner
2dd245c469 signficant cleanups to EmitGlobalConstant (including streamerization
of int initializers), change some methods to be static functions,
use raw_ostream::write_hex instead of a smallstring dance with 
APValue::toStringUnsigned(S, 16).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 07:11:32 +00:00
Chris Lattner
1658202529 give createAsmStreamer an 'isLittleEndian' argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 06:39:07 +00:00
Chris Lattner
8eeba35bab revert 93934, removing the MCAsmInfo endianness bit. I can't
stomache MCAsmInfo having this, and I found a better solution to
this layering issue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93985 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 06:34:14 +00:00
Victor Hernandez
8fffff5371 Refactor common parts of MDNode::getFunction() and assertLocalFunction() into getFunctionForValue()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93977 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 04:45:57 +00:00
Dale Johannesen
918f0f0bea Move findDebugLoc somewhere more central. Fix
more cases where debug declarations affect
debug line info.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93953 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-20 00:19:24 +00:00
Dan Gohman
2b98bd23cb Make SCEVAddRecExpr's getType return a pointer type when the add
has a pointer member. This helps reduce unnecessary bitcasting
and uglygeps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 22:53:50 +00:00
Chris Lattner
c7b8814bb4 give MCAsmInfo a 'has little endian' bit. This is unfortunate, but
I really want clients of the streamer to be able to say "emit this
64-bit integer" and have it get broken down right by the streamer.

I may change this in the future, we'll see how it works out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 22:42:28 +00:00
Dan Gohman
1cd9275c8d Give ScalarEvolution access to the DominatorTree. It'll need this
to make more intellegent AddRec folding decisions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93930 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 22:21:27 +00:00
Chris Lattner
32ae3fe0ba add a new EmitIntValue method that MCStreamer impls can optionally define
and that clients can use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93923 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 22:03:38 +00:00
Dan Gohman
bafbbdde38 Add a new helper function to IVUsers for returning the "canonical"
form of an expression. This is the expression without the
post-increment adjustment made, which is useful in determining
which registers will be used by the expansion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93921 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 21:55:32 +00:00
Chris Lattner
6449abfbc8 eliminate AsmPrinter::EmitZeros: just use MCStreamer directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 21:51:22 +00:00
Sean Callanan
18b8323de7 Promoted the getTok() method to MCAsmParser so that
the two token accessor functions are declared consistently.
Modified the clients of MCAsmParser to reflect this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 21:44:56 +00:00
Xerxes Ranby
1c8183df7f Stubs for getHostCPUFeatures API. This implements part of PR5389.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93913 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 21:26:05 +00:00
David Greene
ce6715faa3 Add some new debugging APIs to print out "raw" SelectionDAGs to make
understanding CannotYTetSelect and other errors easier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93901 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 20:37:34 +00:00
Sean Callanan
b9a25b7744 Propagated the parser-side Lex function's declaration to
MCAsmParser, and changed the target-specific AsmParsers
to use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 20:27:46 +00:00
Chris Lattner
aaec205b87 Generalize mcasmstreamer data emission APIs to take an address space
identifier.  There is no way to work around it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93896 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 19:46:13 +00:00
Chris Lattner
91093ecf0f refactor code to be static functions instead of methods on AsmPrinter.
This fixes some bugs handling address spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 19:10:44 +00:00
Chris Lattner
ddf6bdde44 add a "MCStreamer::EmitFill" method, and move the default implementation
(which just iteratively emits bytes) to MCStreamer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 18:45:47 +00:00
Chris Lattner
f03ffd13f8 remove MAI::ZeroDirectiveSuffix, which is only used by MASM,
which we don't support anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93886 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 18:37:01 +00:00
Jim Grosbach
e45ab8a0a9 For aligned load/store instructions, it's only required to know whether a
function can support dynamic stack realignment. That's a much easier question
to answer at instruction selection stage than whether the function actually
will have dynamic alignment prologue. This allows the removal of the
stack alignment heuristic pass, and improves code quality for cases where
the heuristic would result in dynamic alignment code being generated when
it was not strictly necessary.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93885 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 18:31:11 +00:00
Chris Lattner
814819f6ea stop using the .lcomm pseudoop on darwin, instead, directly use the
.zerofill directive.  Streamerize its generation.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 06:25:51 +00:00
Devang Patel
c99fd879c0 Avoid including DebugInfo.h in AsmPrinter.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 06:09:04 +00:00
Chris Lattner
74bfe21b50 Now that we have everything nicely factored (e.g. asmprinter is not
doing global variable classification anymore) and hookized, sink almost
all target targets global variable emission code into AsmPrinter and out
of each target.

Some notes:

1. PIC16 does completely custom and crazy stuff, so it is not changed.
2. XCore has some custom handling for extra directives.  I'll look at it next.
3. This switches linux/ppc to use .globl instead of .global.  If .globl is
   actually wrong, let me know and I'll fix it.
4. This makes linux/ppc get a lot of random cases right which were obviously
   wrong before, it is probably now a bit healthier.
5. Blackfin will probably start getting .comm and other things that it didn't
   before.  If this is undesirable, it should explicitly opt out of these
   things by clearing the relevant fields of MCAsmInfo.

This leads to a nice diffstat:
 14 files changed, 127 insertions(+), 830 deletions(-)




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 05:38:33 +00:00
Chris Lattner
41eb8b4771 hookize the cygwin ".linkonce" directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93855 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 05:08:13 +00:00
Chris Lattner
7517b249ca add a bool for whether .lcomm takes an alignment instead of basing this on "isdarwin".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:48:20 +00:00
Chris Lattner
48d64ba9d8 hoist handling of external globals and special globals up to common code.
This makes a similar code dead in all the other targets, I'll clean it up
in a bit.

This also moves handling of lcomm up before acquisition of a section,
since lcomm never needs a section.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:39:15 +00:00
Chris Lattner
71eae71315 move production of .reference directives for static ctor/dtor list on
darwin into common code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:34:02 +00:00
Chris Lattner
c1ef06ac52 use BSSLocal classifier to identify 'lcomm' data instead of
duplicating the logic (differently) in lots of different targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:21:20 +00:00
Chris Lattner
ce8749e445 make TLOF subclassify BSS based on linkage type into private, external
and everything else (weak).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93846 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 04:15:51 +00:00
Chris Lattner
a3839bc371 introduce a section kind for common linkage. Use this to slightly
simplify and commonize some of the asmprinter logic for globals.

This also avoids printing the MCSection for .zerofill, which broke
the llvm-gcc build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 02:48:26 +00:00
Chris Lattner
6e3be14be4 change an accessor to a predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93839 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 02:13:06 +00:00
Chris Lattner
aac138e84d Cleanup handling of .zerofill on darwin:
1. TargetLoweringObjectFileMachO should decide if something
   goes in zerofill instead of having every target do it.
2. TargetLoweringObjectFileMachO should assign said symbols to
   the right MCSection, the asmprinters should just emit to the
   right section.
3. Since all zerofill stuff goes through mcstreamer anymore,
   MAI can have a bool "haszerofill" instead of having the textual
   directive to emit.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 02:09:44 +00:00
Chris Lattner
9a7313af77 remove extraneous ;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 01:28:09 +00:00
Victor Hernandez
6cead7879a Add comment that MDNode::getFunction() is not to be used by performance-critical code (currently only used by AsmWriter)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:55:08 +00:00
Bill Wendling
48814681d7 - Add getLSDAEncoding to the PowerPC backend.
- Greatly improve the comments to the getLSDAEncoding method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:36:35 +00:00
Sean Callanan
2122f69c02 Added a newline at the end of SMLoc.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93784 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:16:54 +00:00
Sean Callanan
76d76d5689 Changed the comment in the file header for SMLoc
to something more accurate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93782 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:11:34 +00:00
Sean Callanan
1ae486a4a0 Split SMLoc out in its own header so that it can
be used independently of SourceMgr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93780 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:07:51 +00:00
Victor Hernandez
756462bfbd Make findDbgDeclare/findDbgGlobalDeclare local static functions; avoid Elts array
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93764 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 20:42:09 +00:00
Bill Wendling
a8c18890da - Add a comment to the callback indicating that it's *extremely* not a good
idea, but unfortunately necessary.
- Default to using 4-bytes for the LSDA pointer encoding to agree with the
  encoded value in the CIE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93753 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 19:36:27 +00:00
Benjamin Kramer
971fd79067 Unnamed symbol index should be >= 1. This was lost during the mangler refactoring. Fixes PR6067.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 14:39:20 +00:00
Chris Lattner
aad30363fb switch x86 zerofill emission over to use MCStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93702 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 01:21:08 +00:00
Chris Lattner
5957c84e09 Change CurrentFnSym to be a non-const pointer since asmprinter mutates it
as it emits code.  Switch .globl directives to use OutStreamer instead of
doing it textually (in x86)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93700 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 00:59:24 +00:00
Chris Lattner
8cb9a3b13f remove the MAI argument to MCExpr::print and switch overthing to use << when printing them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 00:37:40 +00:00
Chris Lattner
10b318bcb3 now that MCSymbol::print doesn't use it's MAI argument, we can
remove it and change all the code that prints MCSymbols to use 
<< instead, which is much simpler and cleaner.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93695 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 21:43:43 +00:00
Chris Lattner
0bd58b0e81 stop the CBE from using Mangler::appendMangledName, which is a private function, it is mangling types, which don't matter how they are done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 19:32:29 +00:00
Chris Lattner
753fb624fb fix uninit member, thanks to Benjamin Kramer for identifying the bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 19:24:35 +00:00
Chris Lattner
acd03ae679 Get MCSymbol out of the mangling business, and move all the logic
to Mangler.  Now MCSymbol just decides whether to slap quotes around
a symbol when printing it.

This also fixes some weirdness where two MCSymbols could be created
for the same symbol, if one needed to be mangled and got mangled to
the other one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93690 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 19:23:46 +00:00
Chris Lattner
c0dba723d1 now that mangler is in libtarget, it can use MCAsmInfo instead of clients
having to pass various fields from it in.  Simplify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 18:22:35 +00:00
Benjamin Kramer
1efd4fd56b Switch some functions to take Twines, eliminate uses of StringExtras.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93680 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-17 07:46:39 +00:00
Chris Lattner
45111d160c move the mangler into libtarget from vmcore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 21:57:06 +00:00
Chris Lattner
c9c8931237 fix a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93663 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 21:55:24 +00:00
Chris Lattner
8cfd3ea1c1 this doesn't need to suck in Mangler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93662 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 21:35:09 +00:00
Chris Lattner
c94c825a40 reapply the mangler gutting patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93656 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 21:08:46 +00:00
Rafael Espindola
0f0c97810c Revert 93648.
Mangler::getMangledName is used from lto
Mangler::setUseQuotes is used in the AsmPrinter
Mangler::setSymbolsCanStartWithDigit is used in the AsmPrinter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93652 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 20:27:59 +00:00
Chris Lattner
848d0f37d2 Mangler::getMangledName is now dead, remove it and all the other stuff in Mangler that is now transitively dead. woo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93648 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 19:08:51 +00:00
Chris Lattner
7a2ba94d03 rename GetPrivateGlobalValueSymbolStub -> GetSymbolWithGlobalValueBase,
and add an explicit ForcePrivate argument.

Switch FunctionEHFrameInfo to be MCSymbol based instead of string based.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93646 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 18:37:32 +00:00
Chris Lattner
469340493c switch liblto to use the new getNameWithPrefix() method instead of getMangledName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 18:12:14 +00:00
Chris Lattner
61f160a84e add an inefficient version of getNameWithPrefix that returns an std::string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93641 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 18:06:34 +00:00
Benjamin Kramer
ea37eb55ee Revive dead assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 16:14:55 +00:00
Tobias Grosser
24dcbaf756 Fix PR6047
Nodes that had children outside of the post dominator tree (infinite loops)
where removed from the post dominator tree. This seems to be wrong. Leave them
in the tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 13:38:07 +00:00
Tobias Grosser
23279f18a9 Create Generic DOTGraphTraits Printer/Viewer
Move the DOTGraphTraits dotty printer/viewer templates, that were developed for
the dominance tree into their own header file. This will allow reuse in future
passes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 10:56:41 +00:00
Devang Patel
6b61f5816e Replace DebugLocTuple with DILocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93630 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 06:09:35 +00:00
Bill Wendling
d58e9cb42d Retrying r91337:
The CIE says that the LSDA point in the FDE section is an "sdata4". That's fine,
but we need it to actually be 4-bytes in the FDE for some platforms. Allow
individual platforms to decide for themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93616 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 01:40:55 +00:00
Chris Lattner
412c3a5bc9 CurrentFnName is now dead, remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93612 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 01:24:10 +00:00
Chris Lattner
5c40e694dc remove the string form of printVisibility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 01:17:26 +00:00
Bill Wendling
c5b7b19677 Temporarily revert r93581. It was causing failures in the ExecutionEngine tests
on the build bots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93606 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 01:06:58 +00:00
Chris Lattner
d1947ed2f8 supplement CurrentFnName with CurrentFnSym, which will eventually
replace it.  Upgrade Alpha, Blackfin, and part of CellSPU to not
use mangler anymore.  CellSPU needs more invasive surgery.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 23:55:16 +00:00
Chris Lattner
53d4d78d9a add a version of AsmPrinter::printVisibility that takes an MCSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93587 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 23:38:51 +00:00
Ted Kremenek
67c59826bf BumpPtrAllocator: Have the DefaultSlabAllocator created at runtime, not initialization time. This removes one of the 'init_constructors' reported in <rdar://problem/7545356>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93581 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 23:29:34 +00:00
Dale Johannesen
3f5db85b57 Remove unneeded argument per review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93579 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 23:28:49 +00:00
Chris Lattner
d588b97cc9 add another helper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 23:25:11 +00:00
Chris Lattner
6b04edee11 add a AsmPrinter::GetGlobalValueSymbol and GetExternalSymbolSymbol
helper method, use it to simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 23:18:17 +00:00
Dan Gohman
cb8544fb9e Add comments to the dump() and dumpr() routines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93566 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 22:22:58 +00:00
Dale Johannesen
23cdb0bdcf DEBUG_VALUE is now variable sized, as it has a
target-dependent memory address representation in it.
Restore X86 printing of DEBUG_VALUE; lowering is
done in X86RegisterInfo using the normal algorithm.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93565 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 22:22:35 +00:00
Eric Christopher
606a1d1f59 Remove the InlineHint attribute. There are no current or planned
users.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 21:36:30 +00:00
David Greene
ac931c011f Add some debug routines to SelectionDAG to dump full DAGs.
print/dumpWithDepth allows one to dump a DAG up to N levels deep.
dump/printWithFullDepth prints the whole DAG, subject to a depth limit
on 100 in the default case (to prevent infinite recursion).

Have CannotYetSelect to a dumpWithFullDepth so it is clearer exactly
what the non-matching DAG looks like.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:43:23 +00:00
Chris Lattner
54482b472a fix a bug in range information for $42, eliminate an
unneeded argument from ParseExpression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:39:23 +00:00
Chris Lattner
b4307b3370 extend MCAsmParser::ParseExpression and ParseParenExpression
to return range information for subexpressions.  Use this to
provide range info for several new X86Operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:28:38 +00:00
Victor Hernandez
3a32865d58 Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.
It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93531 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:04:09 +00:00
Nate Begeman
3fe980b127 Hook up llc's -filetype=obj to use MCStreamer if an MCCodeEmitter is available.
Remove most of old Mach-O Writer support, it has been replaced by MCMachOStreamer

Further refactoring to completely remove MachOWriter and drive the object file
writer with the AsmPrinter MCInst/MCSection logic is forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:51:18 +00:00
Victor Hernandez
5f03238d62 Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be auto-upgraded
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93515 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 17:36:47 +00:00
Victor Hernandez
283ba2fbb4 Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 03:37:48 +00:00
Dale Johannesen
243a32f96b Remove DEBUG_DECLARE, looks like we don't need it.
Also, DEBUG_VALUE has side effects.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 01:50:44 +00:00
Jeffrey Yasskin
3581d662e9 Make sure include/llvm/MC/MCParsedAsmOperand.h can be compiled alone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 00:41:53 +00:00
Chris Lattner
9d3c755fd6 add virtual methods to get the start/end of a MCParsedAsmOperand,
the default implementation returns "unknown".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 22:29:57 +00:00
Chris Lattner
9898671a74 Split the TargetAsmParser "ParseInstruction" interface in half:
the new ParseInstruction method just parses and returns a list of
target operands.  A new MatchInstruction interface is used to
turn the operand list into an MCInst.

This requires new/deleting all the operands, but it also gives 
targets the ability to use polymorphic operands if they want to. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 22:21:20 +00:00
Chris Lattner
f007e853e2 prune #includes in TargetAsmParser.h
Pass in SMLoc of instr opcode into ParseInstruction.
Make AsmToken be a class, not a struct.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:32:45 +00:00
Chris Lattner
45220a8439 introduce the MCParsedAsmOperand class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 21:20:55 +00:00
Victor Hernandez
c7650b4d19 Add MDNode::getFunction(), which figures out the metadata's function, if it has function that it is local to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93400 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 01:45:14 +00:00
Tobias Grosser
edd1cc78d2 Add getSource() to SuccIterator
Get the source BB of an iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 22:21:43 +00:00
Tobias Grosser
5106140a50 Extend SuccIterator
Implement most of the missing methods to make SuccIterator random access.
operator[] is still missing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 22:21:28 +00:00
Chris Lattner
145438489f makeNameProper is now private!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 21:31:39 +00:00
Chris Lattner
4564ec9ca7 expose a static function as a static method on the MCSymbol class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93350 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 21:09:59 +00:00
Benjamin Kramer
b357e06f67 Introduce Twine::toStringRef, a variant of toVector which avoids the copy if the
twine can be represented as a single StringRef. Use the new methode to simplify
some twine users.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93317 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 12:45:23 +00:00
Chris Lattner
bf86e5df18 add new isSingleStringRef()/getSingleStringRef() methods to twine,
and use them to avoid a copy of a string in getNameWithPrefix in
the common case.  It seems like Value::setName and other places 
should use this as well?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93301 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 07:12:06 +00:00
Chris Lattner
0e7ab8cb07 ugh, my last patch just sped up a method and changed all the clients
that I want to completely eliminate.  Add fixme's so I remember this
in the future, and add the missing helper that they should be upgraded
to use instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 07:01:09 +00:00
Chris Lattner
4813035b72 change Mangler::makeNameProper to return its result in a SmallVector
instead of returning it in an std::string.  Based on this change:

1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef
2. Change a bunch of targets to call makeNameProper with a smallstring,
   making several of them *much* more efficient.
3. Rewrite Mangler::makeNameProper to not build names and then prepend
   prefixes, not use temporary std::strings, and to avoid other crimes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 06:38:18 +00:00
Chris Lattner
36e69ae3c1 my mistake, Mangler::makeNameProper wants to take a twine, not a stringref!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 05:02:57 +00:00
Chris Lattner
1cb75460b6 change makeNameProper to take a stringref instead of std::string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93295 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 04:55:33 +00:00
Chris Lattner
af2a8361e4 give StringRef a const_iterator member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 04:50:20 +00:00
Dale Johannesen
c49a10aca1 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93284 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 01:39:38 +00:00
Evan Cheng
7da9ecf967 Add a quick pass to optimize sign / zero extension instructions. For targets where the pre-extension values are available in the subreg of the result of the extension, replace the uses of the pre-extension value with the result + extract_subreg.
For now, this pass is fairly conservative. It only perform the replacement when both the pre- and post- extension values are used in the block. It will miss cases where the post-extension values are live, but not used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93278 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:30:23 +00:00
Dale Johannesen
5f72a5ebc8 Further progration of metadata operands. The
dumper doesn't really do what I want yet, but
at least it doesn't crash now.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93272 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:00:24 +00:00
Chris Lattner
acb4722856 use consistent tag kinds for ilist_traits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93259 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 22:00:04 +00:00
Chris Lattner
e234a30a28 add a helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93251 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 19:40:54 +00:00
Devang Patel
d77fdba573 Use Twine, instead of StringRef, for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93249 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 18:57:56 +00:00
Devang Patel
26028f27dd Use ilist_tratis to autoinsert and remove NamedMDNode from MDSymbolTable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93247 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 18:34:06 +00:00
Dale Johannesen
68c3def126 Add MO_Metadata as an operand kind. Not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93220 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 02:01:53 +00:00
Evan Cheng
a5a81d7072 Add TargetInstrInfo::isCoalescableInstr. It returns true if the specified
instruction is copy like where the source and destination registers can
overlap. This is to be used by the coalescable to coalesce the source and
destination registers of instructions like X86::MOVSX64rr32. Apparently
some crazy people believe the coalescer is too simple.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 00:09:37 +00:00
Tobias Grosser
d53e42efe9 Remove trailing white spaces in post dominators header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 22:22:46 +00:00
Tobias Grosser
af4421d6ef Add getNode() to post dominators.
Implement the same interface as already available for dominators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93194 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 22:22:32 +00:00
Benjamin Kramer
7dd6107fcc Remove unused string functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93183 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 20:33:12 +00:00
Benjamin Kramer
7462b5dd99 Add StrInStrNoCase, a StringRef version of CStrInCStrNoCase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93174 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 19:45:18 +00:00
Benjamin Kramer
c30837d6c1 Turns out llvm-gcc still uses SplitString with a vector. Add it back until I
have a fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 18:44:35 +00:00
Benjamin Kramer
d4f195999a Reimplement getToken and SplitString as "StringRef helper functions"
- getToken is modeled after StringRef::split but it can split on multiple
  separator chars and skips leading seperators.
- SplitString is a StringRef::split variant for more than 2 elements with the
  same behaviour as getToken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 18:03:24 +00:00
Victor Hernandez
5b7e48b56c Respond to Chris' review:
Make InsertDbgValueIntrinsic() and get Offset take and recieve a uint64_t.
Get constness correct for getVariable() and getValue().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-11 07:45:19 +00:00
Victor Hernandez
24e64df7ec Compute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnresolved().
Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-10 07:14:18 +00:00
Chris Lattner
10bc755d9f hopefully unbreak the ocaml bindings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 23:25:21 +00:00
Chris Lattner
d686c8e73f "In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for."
Patch by James Y Knight!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93079 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 22:27:07 +00:00
Devang Patel
87df867fd7 Delete NamedMDSymTable while destrucing Module.
Disable  copy ctor and operator= for NamedMDSymTable. Hide typedef that should be public.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93041 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 01:44:59 +00:00
Dale Johannesen
d2035203a0 Add DEBUG_DECLARE. Not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93040 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 01:24:25 +00:00
Devang Patel
8fba578be7 Derive NamedMDNode from Value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-09 00:30:14 +00:00
Dale Johannesen
87563b3937 Add DEBUG_VALUE. Not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93030 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-08 23:51:25 +00:00
Tobias Grosser
fde781b8d6 Add assert to check dominance dfs numbers.
Compare the dominance information calculated using a dominance tree walk to the
information calculated based on DFS numbers, if XDEBUG is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92969 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 23:50:41 +00:00
Tobias Grosser
365ccd3a91 Remove workaround in PostDominators
Remove a FIXME and unify code that was necessary to work around broken
updateDFSNumbers().  Before updateDFSNumbers() did not work correctly for post
dominators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92968 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 23:50:25 +00:00
Tobias Grosser
ecd4694458 Fix DFS number calculation for postdominators
The DFS number calculation for postdominators was broken. In the case of
multiple exits that form the post dominator root nodes, do not iterate over
all exits, but start from the virtual root node. Otherwise bbs, that are not
post dominated by any exit but by the virtual root node, will never be assigned
a DFS number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 23:50:06 +00:00
David Greene
60dd36592f Revert r92939. These intrinsics get matched to LLVM instructions,
so removing at Chris' request.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 21:43:58 +00:00
David Greene
0d2856aa19 Add some "missing" instrinsics to make the SSE intrinsic set a bit more
orthogonal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92939 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:47:43 +00:00
Devang Patel
0386f01e06 Use separate namespace for named metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92931 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 19:39:36 +00:00
Kovarththanan Rajaratnam
3c37bb8dbe Fix occurrence typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92926 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 18:46:52 +00:00
Duncan Sands
452394d812 Correct spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92910 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 09:05:26 +00:00
Jakob Stoklund Olesen
d1862037f0 Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92883 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-07 00:51:04 +00:00
Jakob Stoklund Olesen
30ac0467ce Add Target hook to duplicate machine instructions.
Some instructions refer to unique labels, and so cannot be trivially cloned
with CloneMachineInstr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 23:47:07 +00:00
Evan Cheng
d40d03e1bd Teach dag combine to fold the following transformation more aggressively:
(OP (trunc x), (trunc y)) -> (trunc (OP x, y))

Unfortunately this simple change causes dag combine to infinite looping. The problem is the shrink demanded ops optimization tend to canonicalize expressions in the opposite manner. That is badness. This patch disable those optimizations in dag combine but instead it is done as a late pass in sdisel.

This also exposes some deficiencies in dag combine and x86 setcc / brcond lowering. Teach them to look pass ISD::TRUNCATE in various places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 19:38:29 +00:00
Douglas Gregor
b419a5cfe9 Fix struct/class mismatch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92841 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 17:16:00 +00:00
Duncan Sands
7c422ac216 Partially address a README by having functionattrs consider calls to
memcpy, memset and other intrinsics that only access their arguments
to be readnone if the intrinsic's arguments all point to local memory.
This improves the testcase in the README to readonly, but it could in
theory be made readnone, however this would involve more sophisticated
analysis that looks through the memcpy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 08:45:52 +00:00
Jakob Stoklund Olesen
8efadf94b5 Add <imp-def> and <imp-kill> operands when replacing virtual sub-register defs and kills.
An instruction like this:

  %reg1097:1<def> = VMOVSR %R3<kill>, 14, %reg0

Must be replaced with this when substituting physical registers:

  %S0<def> = VMOVSR %R3<kill>, 14, %reg0, %D0<imp-def>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92812 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 00:29:28 +00:00
Dan Gohman
7c3ecb6838 Don't use the ISD::NodeType enum for SDNode opcodes, as CodeGen
uses several kinds of opcode values which are not declared within
that enum. This fixes PR5946.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 22:26:32 +00:00
Dan Gohman
dda30cd4af Restore dump() methods to Loop and MachineLoop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92772 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 21:08:02 +00:00
Devang Patel
3e30c2a3c5 NamedMDNode is a collection MDNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92761 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 20:41:31 +00:00
Benjamin Kramer
13be48701d Add a new predicate for integer type equality tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 20:04:48 +00:00
Dan Gohman
90fe0bd68c Make RecursivelyDeleteTriviallyDeadInstructions,
RecursivelyDeleteDeadPHINode, and DeleteDeadPHIs return a flag
indicating whether they made any changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92732 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 15:45:31 +00:00
Dan Gohman
ad2cee44e0 Some versions of GCC don't like non-static data members in sizeof
in this context.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 15:28:21 +00:00
Dan Gohman
cb89afc965 Add a SmallBitVector class, which mimics BitVector but uses only
a single pointer (PointerIntPair) member. In "small" mode, the
pointer field is reinterpreted as a set of bits. In "large" mode,
the pointer points to a heap-allocated object.

Also, give BitVector empty and swap functions.

And, add some simple unittests for BitVector and SmallBitVector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 15:04:49 +00:00
Chris Lattner
43fd9017a6 convert various IntrinsicInst's to use class instead of struct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92681 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 05:21:26 +00:00
Devang Patel
614d2ad0af Delete renaming use of dead dbg intrinsics.
Intrinsic::dbg_stoppoint
 Intrinsic::dbg_region_start
 Intrinsic::dbg_region_end
 Intrinsic::dbg_func_start



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92672 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:47:06 +00:00
David Greene
acc935986d Fix a build error by adding a missing commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:36:30 +00:00
Dan Gohman
eeb3a00b84 Change SelectCode's argument from SDValue to SDNode *, to make it more
clear what information these functions are actually using.

This is also a micro-optimization, as passing a SDNode * around is
simpler than passing a { SDNode *, int } by value or reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:24:18 +00:00
Devang Patel
44a29e066a Remove dead debug info intrinsics.
Intrinsic::dbg_stoppoint
 Intrinsic::dbg_region_start 
 Intrinsic::dbg_region_end 
 Intrinsic::dbg_func_start
AutoUpgrade simply ignores these intrinsics now.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92557 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 01:10:40 +00:00
Dan Gohman
26b1b1fd11 Simplify this code; avoid duplicating the low-level implementation code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92554 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 00:42:54 +00:00
Dan Gohman
0f73d3fb09 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92552 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 00:30:22 +00:00
Dan Gohman
537ab90d8d Remove the CPAttrParentAsRoot code, which is unused, and inconvenient
for a refactoring I'm working on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92503 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-04 20:31:55 +00:00
Mikhail Glushenkov
710632d07b Fix the Emacs mode string.
Also trailing whitespace & 80-col violations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92464 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-04 07:16:12 +00:00
Chris Lattner
5fadf17709 remove the random sampling framework, which is not maintained anymore.
If there is interest, it can be resurrected from SVN.  PR4912.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-02 20:07:03 +00:00
Chris Lattner
f2ebc682d1 teach instcombine to optimize pointer difference idioms involving constant
expressions.  This is a step towards comment #4 in PR3351.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92401 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 22:29:12 +00:00
Ted Kremenek
371da99e64 Remove old header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92378 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-01 00:04:49 +00:00
Ted Kremenek
43afbce8ba Remove derelict serialization code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 23:40:17 +00:00
Chris Lattner
210d0febc2 this #include is ok.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92338 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 03:02:42 +00:00
Chris Lattner
f0908a351a fix Analysis/DebugInfo.h to not include Metadata.h. Do this
by moving one method out of line and eliminating redundant checks
from other methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 03:02:08 +00:00
Chris Lattner
183912af79 Remove #include of metadata.h from intrinsicinst.h. The only
method that needs it (DbgValueInst::getValue) has been moved out
of line.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:32:41 +00:00
Chris Lattner
5d0cacdbb6 rename "elements" of metadata to "operands". "Elements" are
things that occur in types.  "operands" are things that occur
in values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:22:29 +00:00
Chris Lattner
b76359e36e Optimize MDNode to coallocate the operand list immediately
after the MDNode in memory.  This eliminates the operands
pointer and saves a new[] per node.

Note that the code in DIDerivedType::replaceAllUsesWith is wrong
and quite scary.  A MDNode should not be RAUW'd with something
else: this changes all uses of the mdnode, which may not be debug
info related!  Debug info should use something non-mdnode for
declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 01:05:46 +00:00
Chris Lattner
54a1f9f9c1 do not bother reuniquing mdnodes whose operands drop to null. Doing
so can be a huge performance issue when tearing down modules and mdnodes
are not guaranteed to be unique anyway.  This speeds up:
$ time ~/llvm/Release/bin/clang gcc.c -w -S -g

from 72 to 35s, where gcc.c is from:
http://people.csail.mit.edu/smcc/projects/single-file-programs/



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92315 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 21:42:11 +00:00
Douglas Gregor
441c8b4ad1 Implement edit distance for StringRef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92309 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 17:23:44 +00:00
Chris Lattner
bf0ca2b477 remove a bunch of unneeded functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92263 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 09:32:19 +00:00
Chris Lattner
784b850e32 one pass of cleanup over DebugInfo.h. Much more is still needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92261 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 09:15:46 +00:00
Chris Lattner
081134741b Final step in the metadata API restructuring: move the
getMDKindID/getMDKindNames methods to LLVMContext (and add
convenience methods to Module), eliminating MetadataContext.
Move the state that it maintains out to LLVMContext.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 09:01:33 +00:00
Chris Lattner
e3e38ea9fb just cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 08:06:56 +00:00
Chris Lattner
b17f65829c privatize another interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92255 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:56:15 +00:00
Chris Lattner
44f3d23b60 the only call to this function (from clang) has been removed, zap it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:50:09 +00:00
Chris Lattner
508b19a5a4 remove some unneeded Metadata interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:44:16 +00:00
Chris Lattner
5a96f93573 sink twine.h down out of Value.h. It is annoying that you need
to #include Twine.h just to give a twine a default value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 07:12:03 +00:00
Chris Lattner
a43a3f2379 When doing v1->RAUW(v2), don't do anything to metadata. We don't know
why one was replaced with the other.  Even in the specific case of 
debug information, it doesn't make sense to transfer the location over,
this will just result in jumbled loc info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 02:53:52 +00:00
Chris Lattner
b2406d9895 sink the Instruction::HasMetadata bit into SubclassData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 02:46:09 +00:00
Chris Lattner
cafe9bba32 add a layer of accessors around the Value::SubClassData member, and use
a convention (shadowing the setter with private forwarding function) to
prevent subclasses from accidentally using it.

This exposed some bogosity in ConstantExprs, which was propaging the
opcode of the constant expr into the NUW/NSW/Exact field in the
getWithOperands/getWithOperandReplaced methods.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 02:14:09 +00:00
Chris Lattner
3990b121cf This is a major cleanup of the instruction metadata interfaces that
I asked Devang to do back on Sep 27.  Instead of going through the
MetadataContext class with methods like getMD() and getMDs(), just
ask the instruction directly for its metadata with getMetadata()
and getAllMetadata().

This includes a variety of other fixes and improvements: previously
all Value*'s were bloated because the HasMetadata bit was thrown into
value, adding a 9th bit to a byte.  Now this is properly sunk down to
the Instruction class (the only place where it makes sense) and it
will be folded away somewhere soon.

This also fixes some confusion in getMDs and its clients about 
whether the returned list is indexed by the MDID or densely packed.
This is now returned sorted and densely packed and the comments make
this clear.

This introduces a number of fixme's which I'll follow up on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 23:41:32 +00:00
Chris Lattner
f309880ad8 rearrange some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92234 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:56:07 +00:00
Chris Lattner
66e89df188 remove #include that comes in from ConstantFolder.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:52:06 +00:00
Chris Lattner
2ad32752b9 remove #include of Function.h from IRBuilder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:50:56 +00:00
Chris Lattner
43469b6957 move debug info stuff out of line, allowing two #includes
to go away from IRBuilder.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:45:40 +00:00
Chris Lattner
a53cfd16f0 split code that doesn't need to be templated out of IRBuilder into a new
non-templated IRBuilderBase class.  Move that large CreateGlobalString
out of line, eliminating the need to #include GlobalVariable.h in IRBuilder.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:28:46 +00:00
Chris Lattner
aca8d54c4f rename ivar to be more descriptive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 21:12:29 +00:00
Chris Lattner
0eb419800a rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
doesn't exist already, eliminate registerMDKind.  Tidy up a bunch
of random stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 20:45:51 +00:00
Chris Lattner
7d05c46d60 rename getHandlerNames to getMDKindNames, simplify its interface
and simplify all the clients that use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92224 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 20:10:43 +00:00
Chris Lattner
df58389ef1 avoid a completely unneeded linear walk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 09:32:10 +00:00
Chris Lattner
b241b37031 Rewrite the function-local validation logic for MDNodes (most of r91708).
Among other benefits, this doesn't leak the SmallPtrSet, has the verifier
code in the verifier pass, actually does the verification at the end,
and is considerably simpler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92217 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 09:07:21 +00:00
Chris Lattner
dfdb5dcf56 rename MDNode instance variables to something meaningful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92216 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:48:12 +00:00
Chris Lattner
5e9cd43423 snip one more #include from Metadata.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92214 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:30:43 +00:00
Chris Lattner
fc252dae10 prune #includes more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:26:43 +00:00
Chris Lattner
5660846f15 Metadata.h doesn't need to include ValueHandle.h anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92211 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:20:46 +00:00
Chris Lattner
bcb18538c2 change the strange MetadataContext::getMDs function to expose less
irrelevant internal implementation details to clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:14:54 +00:00
Chris Lattner
5710969728 change NamedMDNode to use a pimpl for its operand list instead
of making it a declared part of the value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:07:14 +00:00
Chris Lattner
a327524b69 eliminate the elem_* iterator stuff from NamedMDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 07:57:01 +00:00
Chris Lattner
c5e08a9639 move ElementVH out of the MDNode class into the MDNode.cpp file. Among
other things, this avoids vtable and rtti data for it being splatted in 
every translation unit that uses it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 07:41:54 +00:00
Sanjiv Gupta
8f17a36d31 Allow targets to specify the return type of libcalls that are generated for floating point comparisons, rather than hard-coding them as i32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 02:40:33 +00:00
Bill Wendling
079b6f5ee5 Add an "ATTRIBUTE_UNUSED" macro (and use it). It's for variables which are
mainly used in debugging and/or assert situations. It should make the compiler
and the static analyzer stop nagging us about them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 01:20:29 +00:00
John McCall
6a09affdf6 Implement support for converting to string at "natural precision", and fix some
major bugs in long-precision conversion.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 23:18:09 +00:00
John McCall
00e65de9d8 Add accessors for the largest-magnitude, smallest-magnitude, and
smallest-normalized-magnitude values in a given FP semantics.
Provide an APFloat-to-string conversion which I am quite ready to admit could
be much more efficient.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-24 08:56:26 +00:00
David Greene
001762bb25 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92082 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 23:19:43 +00:00
David Greene
63c9463c62 Remove dump routine and the associated Debug.h from a header. Patch up
other files to compensate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92075 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 22:58:38 +00:00
David Greene
0ff129f061 Convert debug messages to use dbgs(). Generally this means
s/errs/dbgs/g except for certain special cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 18:25:37 +00:00
David Greene
49f253315d Convert debug messages to use dbgs(). Generally this means
s/errs/dbgs/g except for certain special cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92013 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 17:55:11 +00:00
David Greene
3fb10ac22f Convert debug messages to use dbgs(). Generally this means
s/errs/dbgs/g except for certain special cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 17:24:22 +00:00
David Greene
64d3973169 Convert debug messages to use dbgs(). Generally this means
s/errs/dbgs/g except for certain special cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 17:18:22 +00:00
David Greene
b5d568cc70 Provide dbgs(), a circular-buffering debug output stream. By default it
simply passes output to errs().  If -debug-buffer-size=N is set N > 0,
dbgs() buffers its output until program termination and dumps the last N
characters sent to it.  This is handy when debugging very large inputs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 16:39:06 +00:00
David Greene
e59011e7d9 Add circular_raw_ostream, which buffers its output in a circular queue
and outputs it when explicitly flushed.  The intent is to use it in
situations such as debug output logging where a signal handler can take
care of flushing the buffer at program termination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 16:08:15 +00:00
Eric Christopher
d060b2576a Update objectsize intrinsic and associated dependencies. Fix
lowering code and update testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-23 02:51:48 +00:00
Anton Korobeynikov
4935a02101 Restore snprintf weirdness for VCPP only
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91918 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 20:11:00 +00:00
Chris Lattner
508355c982 don't run GVN at -O1, GCC doesn't do it's equivalent at that optimization level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91886 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 04:47:41 +00:00
Chris Lattner
0ee443d169 The phi translated pointer can be computed when returning a partially cached result
instead of stored.  This reduces memdep memory usage, and also eliminates a bunch of
weakvh's.  This speeds up gvn on gcc.c-torture/20001226-1.c from 23.9s to 8.45s (2.8x)
on a different machine than earlier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91885 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 04:25:02 +00:00
Bill Wendling
3ea3c24619 Add more plumbing. This time in the LowerArguments and "get" functions which
return partial registers. This affected the back-end lowering code some.

Also patch up some places I missed before in the "get" functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91880 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 02:10:19 +00:00
Chris Lattner
336e06bd0f fix unit test that I broke.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 01:38:23 +00:00
Chris Lattner
8a8f818595 types don't need atomic inc/dec, they are local to an llvmcontext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 01:17:43 +00:00
Chris Lattner
a25bc44663 comment fix: weakvh -> tracking vh
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91867 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 00:51:57 +00:00
Lang Hames
74ab5eeffb Changed slot index ranges for MachineBasicBlocks to be exclusive of endpoint.
This fixes an in-place update bug where code inserted at the end of basic blocks may not be covered by existing intervals which were live across the entire block. It is also consistent with the way ranges are specified for live intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-22 00:11:50 +00:00
Bill Wendling
0777e92721 - Add a bit more plumbing assigning an order to SDNodes.
- Modify the "dump" method to emit the order of an SDNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 21:59:52 +00:00
Anton Korobeynikov
7b1eb8a409 Remove uber-gross hack. The define _snprintf to snprintf is invalid due to two reasons: 1. Accroding to C++ standard snprintf should be available in std namespace (and __gnu_cxx in case of GCC to). Such ifdef will change all snprintf's to _snprintf's, but won't bring snprintf to all necessary namespaces. Thus e.g. any locale-using code on mingw will yield an error (include this file + string to see the result) 2. MSVCRT's _snprintf does not comply with C99 standard. Standard one is snprintf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91842 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 20:19:37 +00:00
Bill Wendling
e36025ec18 Place SDNodeOrdering.h in the directory it's used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 19:34:59 +00:00
Eric Christopher
f4f43cb501 Fix setting and default setting of code model for jit. Do this
by allowing backends to override routines that will default
the JIT and Static code generation to an appropriate code model
for the architecture.

Should fix PR 5773.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 08:15:29 +00:00
Chris Lattner
b6219ba3d6 improve compatibility with SWIG, patch by James Knight!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 07:52:40 +00:00
Chris Lattner
6a363782fe add a helper ctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91819 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 07:15:15 +00:00
Eli Friedman
d5b1f8a842 Change StringRef::startswith and StringRef::endswith to versions which are a
bit more verbose, but optimize to much shorter code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91817 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-21 06:49:24 +00:00
Lang Hames
0d9c12539a Fixed use of phi param in SlotIndex constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 23:32:32 +00:00
Douglas Gregor
cabdd7425d Fix a bunch of little errors that Clang complains about when its being pedantic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 07:05:23 +00:00
Douglas Gregor
f8ca42ff59 Remove spurious semicolon. Thanks, Clang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 03:21:36 +00:00
Dan Gohman
1fef0c4962 Delete unused code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 01:47:13 +00:00
Chris Lattner
cd0129f5a6 Make some methods const. The only interesting change here is that
it changes raw_fd_ostream::preferred_buffer_size to return zero on
a scary stat failure instead of setting the stream to an error state.
This method really should not mutate the stream.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91740 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 01:38:42 +00:00
Bill Wendling
29b49fc6aa Forgot forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91732 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-19 00:05:07 +00:00
Dan Gohman
43ea505fb0 Eliminate unnecessary LLVMContexts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 23:42:08 +00:00
Bill Wendling
b4e6a5df5d Changes from review:
- Move DisableScheduling flag into TargetOption.h
- Move SDNodeOrdering into its own header file. Give it a minimal interface that
  doesn't conflate construction with storage.
- Move assigning the ordering into the SelectionDAGBuilder.

This isn't used yet, so there should be no functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 23:32:53 +00:00
Victor Hernandez
5d30162150 Formalize MDNode's function-localness:
- an MDNode is designated as function-local when created, and continues to be even if its operands are modified not to refer to function-local IR
- function-localness is designated via lowest bit in SubclassData
- getLocalFunction() descends MDNode tree to see if it is consistently function-local

Add verification of MDNodes to checks that MDNodes are consistently function-local.
Update AsmWriter to use isFunctionLocal().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 20:09:14 +00:00
Dan Gohman
411984810e Add utility routines for NSW multiply.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 03:10:26 +00:00
Dan Gohman
bdc46c6af5 Add utility routines for creating integer negation operators with NSW set.
Integer negation only overflows with INT_MIN, but that's an important case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 02:58:50 +00:00
Dan Gohman
d281ed2d03 Preserve NSW information in more places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91656 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 02:09:29 +00:00
Dan Gohman
92329c7fbe Add Loop contains utility methods for testing whether a loop
contains another loop, or an instruction. The loop form is
substantially more efficient on large loops than the typical
code it replaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 01:24:09 +00:00
Dan Gohman
6bec5bb344 Reapply LoopStrengthReduce and IVUsers cleanups, excluding the part
of 91296 that caused trouble -- the Processed list needs to be
preserved for the livetime of the pass, as AddUsersIfInteresting
is called from other passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 00:06:20 +00:00
John McCall
a692313103 Sundry dependent-name fixes flagged by clang++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 23:49:16 +00:00
Chris Lattner
b63bb1615b tabs -> spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91622 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 21:23:46 +00:00
Jeffrey Yasskin
88cd3582b6 Make Path use StringRef instead of std::string where possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 21:02:39 +00:00
Steve Naroff
b2273d50bc Fix Windows build breakage...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 20:39:34 +00:00
Ken Dyck
bceddbdc91 Introduce EVT::getHalfSizedIntegerVT() for use in ExpandUnalignedStore() in
LegalizeDAG.cpp. Unlike the code it replaces, which simply decrements the simple
type by one, getHalfSizedIntegerVT() searches for the smallest simple integer
type that is at least half the size of the type it is called on. This approach
has the advantage that it will continue working if a new value type (such as
i24) is added to MVT.

Also, in preparation for new value types, remove the assertions that
non-power-of-2 8-bit-mutiple types are Extended when legalizing extload and
truncstore operations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 20:09:43 +00:00
Jeffrey Yasskin
ad715f86c9 This fixes a memory leak in OpaqueType found by Google's internal heapchecker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91611 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 19:55:06 +00:00
Eric Christopher
af15ffb912 Fix unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91609 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 19:07:19 +00:00
Evan Cheng
04149f7ffd Revert 91280-91283, 91286-91289, 91291, 91293, 91295-91296. It apparently introduced a non-deterministic behavior in the optimizer somewhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91598 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 09:39:49 +00:00
Mikhail Glushenkov
994dbe0073 Add a 'set_option' action for use in OptionPreprocessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 07:49:16 +00:00
Bob Wilson
b24890b520 BIT_CONVERT nodes are used for vector types, too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-17 05:05:36 +00:00
Daniel Dunbar
819309efec Reapply r91392, it was only unmasking the bug, and since TOT is still broken having it reverted does no good.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91560 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 20:10:05 +00:00
Jim Grosbach
06801722a4 Add @earlyclobber TableGen constraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 19:43:02 +00:00
Daniel Dunbar
4eeeb4767c Fix one more missing this-> to placate that picky clang++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91536 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 11:38:03 +00:00
Daniel Dunbar
222518d0bb Revert "Initial work on disabling the scheduler. This is a work in progress, and
this", this broke llvm-gcc bootstrap for release builds on
x86_64-apple-darwin10.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 10:56:02 +00:00
Chris Lattner
acf8723b8e fix more missing this->'s to placate clang++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91531 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 09:17:12 +00:00
Chris Lattner
2e376a87de Fix a missing this-> that clang++ notices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 09:09:54 +00:00
Chris Lattner
b3649db102 now that libsystem no longer uses SmallVector, we can move
SmallVectorBase::grow_pod out of line, finally satisfying PR3758.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 08:44:24 +00:00
Chris Lattner
99ea87a48a factor out the grow() method for all pod implementations into one
common function.  It is still an inline method, which will be fixed next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91526 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 08:34:40 +00:00
Victor Hernandez
6bc2b8b215 Use different name for argument and field
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 08:10:57 +00:00
Chris Lattner
2676f18312 pull destroy_range and uninitialized_copy up to the
SmallVectorTemplateBase class, which allows us to statically
dispatch on isPodLike instead of dynamically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 08:09:23 +00:00
Chris Lattner
e6e55d7959 sink most of the meat in smallvector back from SmallVectorTemplateCommon
down into SmallVectorImpl.  This requires sprinking a ton of this->'s in,
but gives us a place to factor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 08:05:48 +00:00
Chris Lattner
de576fa579 substantial refactoring of SmallVector, now most code is in SmallVectorTemplateCommon,
and there is a new SmallVectorTemplateBase class in between it and SmallVectorImpl.
SmallVectorTemplateBase can be specialized based on isPodLike.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91518 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 06:55:45 +00:00
Victor Hernandez
57c0f20601 MDNodes that refer to an instruction are local to a function; in that case, explicitly keep track of the function they are local to
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 02:52:09 +00:00
Jeffrey Yasskin
32d7e6ebde Change indirect-globals to use a dedicated allocIndirectGV. This lets us
remove start/finishGVStub and the BufferState helper class from the
MachineCodeEmitter interface.  It has the side-effect of not setting the
indirect global writable and then executable on ARM, but that shouldn't be
necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 22:42:46 +00:00
Devang Patel
6404e4e795 Add support to emit debug info for C++ namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 19:16:48 +00:00
Chris Lattner
4a5129c700 a few improvements:
1. Use std::equal instead of reinventing it.
2. don't run dtors in destroy_range if element is pod-like.
3. Use isPodLike to decide between memcpy/uninitialized_copy 
   instead of is_class.  isPodLike is more generous in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91427 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 08:34:01 +00:00
Chris Lattner
10aaf05c30 hoist the begin/end/capacity members and a few trivial methods
up into the non-templated SmallVectorBase class.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 08:29:22 +00:00
Chris Lattner
dc2e570411 improve isPodLike to know that all non-class types are pod.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 07:40:44 +00:00
Chris Lattner
729a8acc9f Lang verified that SlotIndex is "pod like" even though it isn't a pod.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91423 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 07:27:58 +00:00
Chris Lattner
4bbf4ee149 Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait.  This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 07:26:43 +00:00
Chris Lattner
96c7ae5e97 add an ALWAYS_INLINE macro, which does the obvious thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 06:14:33 +00:00
John McCall
eb751d8c2d Names from dependent base classes are not found by unqualified lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 03:10:26 +00:00
Mikhail Glushenkov
e4ac23a0ff Validate the generated C++ code in llvmc tests.
Checks that the code generated by 'tblgen --emit-llvmc' can be actually
compiled. Also fixes two bugs found in this way:

- forward_transformed_value didn't work with non-list arguments
- cl::ZeroOrOne is now called cl::Optional

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 03:04:52 +00:00
Bill Wendling
614407a9d2 Initial work on disabling the scheduler. This is a work in progress, and this
stuff isn't used just yet.

We want to model the GCC `-fno-schedule-insns' and `-fno-schedule-insns2'
flags. The hypothesis is that the people who use these flags know what they are
doing, and have hand-optimized the C code to reduce latencies and other
conflicts.

The idea behind our scheme to turn off scheduling is to create a map "on the
side" during DAG generation. It will order the nodes by how they appeared in the
code. This map is then used during scheduling to get the ordering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 01:54:51 +00:00
Bill Wendling
43cf6c3939 Revert these. They may have been causing 483_xalancbmk to fail:
$ svn merge -c -91161 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91161 into '.':
U    lib/CodeGen/BranchFolding.cpp
U    lib/CodeGen/MachineBasicBlock.cpp
$ svn merge -c -91113 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91113 into '.':
G    lib/CodeGen/MachineBasicBlock.cpp
$ svn merge -c -91101 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91101 into '.':
U    include/llvm/CodeGen/MachineBasicBlock.h
G    lib/CodeGen/MachineBasicBlock.cpp
$ svn merge -c -91092 https://llvm.org/svn/llvm-project/llvm/trunk
--- Reverse-merging r91092 into '.':
G    include/llvm/CodeGen/MachineBasicBlock.h
G    lib/CodeGen/MachineBasicBlock.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 00:39:24 +00:00
Dan Gohman
e3040e4ae5 Move Flag and isVoid after the vector types, since bit arithmetic with
those enum values is less common.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 23:36:03 +00:00
Dan Gohman
83644f6b6d Fix these asserts to check the invariant that the code actually
depends on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 23:34:36 +00:00
Dan Gohman
80d8930d28 Update this comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 23:13:31 +00:00
Dan Gohman
eda23faedb Move several function bodies which are rarely inlined out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 19:43:09 +00:00
Dan Gohman
a4f8ecd85d Micro-optimize these functions in the case where they are not inlined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91316 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 19:32:31 +00:00
Dan Gohman
35d913e6f3 Make the IVUses member private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91291 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 17:14:32 +00:00
Dan Gohman
440b40d865 Drop Loop::isNotAlreadyContainedIn in favor of Loop::contains. The
former was just exposing a LoopInfoBase implementation detail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91286 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 17:06:50 +00:00
Bill Wendling
85de1e5bad Whitespace changes, comment clarification. No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 06:51:19 +00:00
Lang Hames
a937f220e1 Moved spill weight calculation out of SimpleRegisterCoalescing and into its own pass: CalculateSpillWeights.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91273 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-14 06:49:42 +00:00
Anton Korobeynikov
60283f9bc9 Fix weird typo which leads to unallocated memory access for nodes with 4 results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91233 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-13 01:00:59 +00:00
Jeffrey Yasskin
66b856683f Make it easier to use the llvm_unreachable and DEBUG macros without "using
namespace llvm" by qualifying their implementations with ::llvm::.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91206 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 04:08:32 +00:00
Dan Gohman
87862e77bb Implement vector widening, splitting, and scalarizing for SIGN_EXTEND_INREG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 21:31:27 +00:00
Dan Gohman
050959cd08 Make getUniqueExitBlocks's precondition assert more precise, to
avoid spurious failures. This fixes PR5758.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 20:05:23 +00:00
Gabor Greif
d01518630a Simplify this class by removing the result cache.
This change removes the DefaultConstructible
and CopyAssignable constraints on the template
parameter T (the first one).

The second template parameter (R) is defaulted to be
identical to the first and controls the result type.
By specifying it to be (const T&) additionally the
CopyConstructible constraint on T can be removed.

This allows to use StringSwitch e.g. for llvm::Constant
instances.

Regarding the other review feedback regarding performance
because of taking pointers, this class should be completely
optimizable like before, since all methods are inline and
the pointer dereferencing and result value caching should be
possible behind the scenes by the "as-if" rule.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91123 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 15:30:07 +00:00
Duncan Sands
be1ce0a867 Add utility method for determining whether a function argument
has the 'nest' attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91109 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 08:36:17 +00:00
Bill Wendling
64bdde2093 Address comments on last patch:
- Loosen the restrictions when checking of it branches to a landing pad.
- Make the loop more efficient by checking the '.insert' return value.
- Do cheaper checks first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 03:14:18 +00:00
Bill Wendling
4bde1ab82d A machine basic block may end in an unconditional branch, however it may have
more than one successor. Normally, these extra successors are dead. However,
some of them may branch to exception handling landing pads. If we remove those
successors, then the landing pads could go away if all predecessors to it are
removed. Before, it was checking if the direct successor was the landing
pad. But it could be the result of jumping through multiple basic blocks to get
to it. If we were to only check for the existence of an EH_LABEL in the basic
block and not remove successors if it's in there, then it could stop actually
dead basic blocks from being removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 01:49:14 +00:00
Anders Carlsson
da920fa4f9 Add qualifiers for calls to member functions in dependent bases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 01:04:42 +00:00
Douglas Gregor
e4a70cd19c Remove a broken, unused header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 19:52:22 +00:00
Jakob Stoklund Olesen
cf97036675 Also attempt trivial coalescing for live intervals that end in a copy.
The coalescer is supposed to clean these up, but when setting up parameters
for a function call, there may be copies to physregs. If the defining
instruction has been LICM'ed far away, the coalescer won't touch it.

The register allocation hint does not always work - when the register
allocator is backtracking, it clears the hints.

This patch is more conservative than r90502, and does not break
483.xalancbmk/i686. It still breaks the PowerPC bootstrap, so it is disabled
by default, and can be enabled with the -trivial-coalesce-ends option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91049 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 17:48:32 +00:00
Eric Christopher
1e8c6934f2 Silence conversion warning from 64 to 32-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 08:29:32 +00:00
Chris Lattner
dad451cb7c enhance NonLocalDepEntry to keep the per-block phi translated address
of the query.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90958 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:31:04 +00:00
Daniel Dunbar
022840e960 DeltaAlgorithm: Add a virtual destructor and home.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:19:48 +00:00
Chris Lattner
e18b97121c change NonLocalDepEntry from being a typedef for an std::pair to be its
own small class.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90956 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 07:08:01 +00:00