Commit Graph

7218 Commits

Author SHA1 Message Date
Chris Lattner
98f8ccfad0 Move the fast-path (<=i64) cases of various APInt methods inline
and the slow-path cases out of line.  This speeds up instcombine
a bit in real world cases.  Patch contributed by m-s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55063 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 17:02:31 +00:00
Dan Gohman
a267651b7e Disable DAGCombine's alignment inference in "fast" codegen mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55059 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 16:30:28 +00:00
Dan Gohman
b8d2f550b8 Change the FoldingSetNodeID usage for objects which carry
alignment and volatility information, such as loads and
stores, to reduce the number of integer values added to
the FoldingSetNodeID.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55058 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 15:58:01 +00:00
Dan Gohman
cc8430f742 Fix a leak in the FastISel code that Chris pointed out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55031 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 00:56:17 +00:00
Dan Gohman
bdedd44773 Add FastISel support for several more binary operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55020 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 00:11:48 +00:00
Dan Gohman
d4641a254c Add a TargetLowering hook for creating a FastISel object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55009 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 21:26:29 +00:00
Chris Lattner
242330371b Change WriteTypeSymbolic/WriteAsOperand to return void instead of
an ostream, which is just weird.

Rename SC_DEBUG -> ST_DEBUG

Remove static indentation strangeness from WriteConstantInt.  This makes it 
so that large structs are not broken down and printed on multiple lines.  If
there is demand for this to return, there are better ways to implement this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54981 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 04:47:09 +00:00
Chris Lattner
071acf4279 add raw_ostream method for emitting an unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54972 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 04:23:02 +00:00
Dan Gohman
40610241d0 Fix the FastISel class' doxygen comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54957 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 23:41:46 +00:00
Owen Anderson
d6664311ac Resurrect some ancient code to add spill ranges without attempting folding, remat, or splitting. This code has been updated to current APIs
in so far as it compiles and, in theory, works, but does not take advantage of recent advancements.  For instance, it could be improved by using
MachineRegisterInfo::use_iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54924 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 18:05:32 +00:00
Gordon Henriksen
8715367182 Don't require Registry specializations to define random static variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54902 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 19:08:34 +00:00
Gordon Henriksen
5eca075b74 Rename some GC classes so that their roll will hopefully be clearer.
In particular, Collector was confusing to implementors. Several
thought that this compile-time class was the place to implement
their runtime GC heap. Of course, it doesn't even exist at runtime.
Specifically, the renames are:

  Collector               -> GCStrategy
  CollectorMetadata       -> GCFunctionInfo
  CollectorModuleMetadata -> GCModuleInfo
  CollectorRegistry       -> GCRegistry
  Function::getCollector  -> getGC (setGC, hasGC, clearGC)

Several accessors and nested types have also been renamed to be
consistent. These changes should be obvious.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54899 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 18:44:35 +00:00
Cedric Venet
94fb5f2a70 Make it compile on VC2005:
- update VC projects.
- Add an overload to llvm::Stream for <<, since std::hex and std::dec have type std::ios_base& (*)(std::ios_base&) in VC++. (templating the function don't work, due to ambiguities)
- add ../ on several include in X86/AsmPrinter/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54898 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 18:24:26 +00:00
Anton Korobeynikov
2b11004d56 Link GC metadata printers by default to llc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 14:33:01 +00:00
Anton Korobeynikov
4a8978b61c Fix merge error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 13:56:03 +00:00
Gordon Henriksen
5a29c9eed1 Factor GC metadata table assembly generation out of Collector in preparation for splitting AsmPrinter into its own library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54881 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 12:56:54 +00:00
Gordon Henriksen
c317a60c27 Factor GC metadata table assembly generation out of Collector in preparation for splitting AsmPrinter into its own library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54880 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 12:08:44 +00:00
Chris Lattner
fad86b003a Rework the routines that convert AP[S]Int into a string. Now, instead of
returning an std::string by value, it fills in a SmallString/SmallVector
passed in.  This significantly reduces string thrashing in some cases.

More specifically, this:
 - Adds an operator<< and a print method for APInt that allows you to 
   directly send them to an ostream.
 - Reimplements APInt::toString to be much simpler and more efficient
   algorithmically in addition to not thrashing strings quite as much.

This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the
asmprinter.  This also fixes a bug I introduced into the asmwriter in a
previous patch w.r.t. alias printing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 07:19:36 +00:00
Nick Lewycky
b6c8a4098f Fix build on GCC 4.3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54870 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 06:40:16 +00:00
Chris Lattner
9f17eb0b79 remove a dead APInt ctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54869 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 04:58:58 +00:00
Chris Lattner
07f51f788e add support for a cout/cerr analog (outs()/errs()) as well as
a simple adaptor class to give raw output capabilities to 
something that wants to write to an ostream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54865 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 04:13:37 +00:00
Chris Lattner
d497df5cf5 rename OutputData to 'write' to match ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54857 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 01:46:05 +00:00
Chris Lattner
66a6b8be97 remove accidental comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54856 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 01:35:54 +00:00
Chris Lattner
60d3962624 add a new raw_ostream class which is an extremely high performance ostream that
can *only* output data (no seeking, reading, etc).  This is adapted from the
clang "-E outputter", and is roughly 10% faster than stdio on darwin and 30%
(or more) faster than std::ostream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54855 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 01:35:29 +00:00
Anton Korobeynikov
328da65bd1 Add interface for section override. Use this for Sparc, since it should use named BSS section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54844 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 12:58:12 +00:00
Anton Korobeynikov
ffe31d7bf1 Move SLEB/ULEB size calculation routines from AsmPrinter to TargetAsmInfo. This makes JIT asmprinter-free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54843 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 12:57:46 +00:00
Anton Korobeynikov
d0c1e29aec Reduce heap trashing due to std::string construction / concatenation via caching of section flags string representations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54842 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 12:57:07 +00:00
Owen Anderson
3688f268cb Remove GCSE, ValueNumbering, and LoadValueNumbering. These have been deprecated for almost a year; it's finally time for them to go away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54822 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-15 21:31:02 +00:00
Owen Anderson
0c5a560b03 Add a value_type typedef to SmallVector, to make it more compatible with STL adapters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54819 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-15 18:45:51 +00:00
Chris Lattner
3b12ab4519 Inline the fastpath of PATypeHolder::get(). This is a small speedup in
instcombine among other things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54814 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-15 15:16:50 +00:00
Owen Anderson
79e6ed9d47 Move MachineInstr::getOpcode inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54807 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 23:25:30 +00:00
Owen Anderson
44eb65cf58 Convert uses of std::vector in TargetInstrInfo to SmallVector. This change had to be propoagated down into all the targets and up into all clients of this API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54802 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 22:49:33 +00:00
Dan Gohman
e285a74f7c Make FastISel's constructor protected, and give it a destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54793 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 21:51:29 +00:00
Ted Kremenek
183cc32e49 Removed redundant ctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54789 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 21:17:07 +00:00
Dan Gohman
a8c763b307 Use empty() instead of begin() == end().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54780 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 18:13:49 +00:00
Owen Anderson
289983123b Expunge the last uses of std::map from LiveIntervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 22:28:50 +00:00
Owen Anderson
20e2839cb9 Move r2iMap_ over to DenseMap from std::map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54765 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 22:08:30 +00:00
Owen Anderson
03857b29d8 Make the allocation of LiveIntervals explicit, rather than holding them in the r2iMap_ by value. This will prevent references to them from being invalidated
if the map is changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54763 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 21:49:13 +00:00
Owen Anderson
49bfdd63f4 Switch this from std::map to DenseMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54761 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 21:24:24 +00:00
Daniel Dunbar
7fb842420a Add default constructor to APSInt
- Creates uninitialized APInt. 
 - Prevents need for embedding arbitrary constants when used as an out
   parameter, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54757 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 20:53:17 +00:00
Dan Gohman
b0cf29c5cf Initial checkin of the new "fast" instruction selection support. See
the comments in FastISelEmitter.cpp for details on what this is.
This is currently experimental and unusable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54751 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 20:19:35 +00:00
Dan Gohman
925a7e8ed6 Rename SelectionDAGISel's FastISel to Fast, to begin to make
room for the new FastISel instruction selection code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54749 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 19:47:40 +00:00
Duncan Sands
9d8658a129 Rename this, in case people think that NullFolder
has something to do with folding null values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54725 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 08:56:48 +00:00
Duncan Sands
fe24bd3a89 Add a NullFolder class that doesn't fold constants.
This may be used as the second IRBuilder template
parameter, the idea being that people learning LLVM
may find it helpful (several people asked on IRC
if it was possible to turn off constant folding
because it made it hard for them to see what was
going on).  Compiles, but otherwise completely
untested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54698 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 20:39:27 +00:00
Devang Patel
78766ff67c Use SmallVector instead of std::vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54685 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 15:44:31 +00:00
Duncan Sands
20df07ba22 Point people to ConstantExpr and ConstantFolding,
in case they get the wrong idea.  Fit in 80 columns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54676 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 09:43:15 +00:00
Devang Patel
721e59cfb2 Use DenseMap to keep track of last users.
Use inversed map for faster queries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54662 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 00:26:16 +00:00
Chris Lattner
0eab5e2efa add a helper method to sys::Path for clang, patch by
Kovarththanan Rajaratnam!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54655 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 23:39:47 +00:00
Devang Patel
3b8a90686a Keep track of analysis usage information for passes. Avoid invoking
getAnalysisUsage() repeatedly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54650 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 21:13:39 +00:00
Duncan Sands
1e7f7865eb Make it possible to use different constant
folding policies with IRBuilder.  The default,
provided by ConstantFolder, is to do minimal
folding like now: what ConstantExpr provides.
An alternative is to use TargetFolder, which
uses target information to fold constants more.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54640 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 15:29:30 +00:00