Commit Graph

7246 Commits

Author SHA1 Message Date
Dan Gohman
e0182ec0e4 Support non-fallthrough unconditional branches in FastISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55191 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 19:21:41 +00:00
Owen Anderson
a794ef7f5d Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55189 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 18:26:07 +00:00
Dale Johannesen
f87d6c02f5 Implement __sync_synchronize on ppc32. Patch by Gary Benson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55186 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 17:20:54 +00:00
Dan Gohman
55beb6ded8 Add an empty() member to FoldingSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55182 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 16:14:23 +00:00
Dan Gohman
1501cdbf63 Fix SmallVector's size calculation so that a size of 0 is
handled correctly, and change a few SmallVector uses to use
size 0 to more clearly reflect their intent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55181 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 16:07:55 +00:00
Nicolas Geoffray
f46dc79ac5 Also overload for char, since the "char" type depends on the host.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55173 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 08:44:47 +00:00
Owen Anderson
1f83b02c62 Overload for both signed and unsigned char.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55171 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 07:42:25 +00:00
Chris Lattner
2dba6a1bdb consolidate DenseMapInfo implementations, and add one for std::pair.
Patch contributed by m-s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55167 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 05:08:25 +00:00
Dan Gohman
22bb31103d Factor out the predicate check code from DAGISelEmitter.cpp
and use it in FastISelEmitter.cpp, and make FastISel
subtarget aware. Among other things, this lets it work
properly on x86 targets that don't have SSE, where it
successfully selects x87 instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55156 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-22 00:20:26 +00:00
Owen Anderson
66b17ba0d2 Move non-trivial methods out of line to avoid code-size bloat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55138 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 20:58:52 +00:00
Dan Gohman
2bb1e3eede Add libcalls for the new rounding opcodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55133 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 18:38:14 +00:00
Dan Gohman
8471ef5f4e Fix a typo that Dale noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55132 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 18:13:12 +00:00
Dan Gohman
509e84fa71 Add libm-oriented ISD opcodes for rounding operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55130 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 17:55:02 +00:00
Dan Gohman
ad3460c3c9 Simplify SelectRoot's interface, and factor out some common code
from all targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55124 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 16:36:34 +00:00
Dan Gohman
815ffa24c4 SelectionDAGISel::SelectRootInit does not need to be virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55122 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 16:06:51 +00:00
Dan Gohman
ec20183c35 Make HandleSDNode::getValue return an SDValue instead of
the full SDUse, which isn't needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55121 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 16:02:46 +00:00
Chris Lattner
55767f69c5 remove redundant include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55116 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 06:41:07 +00:00
Chris Lattner
aac0513ed0 Fix the build with gcc 4.3 as the host, patch by Zhongxing Xu!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55115 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 06:25:28 +00:00
Owen Anderson
89a1a85913 Implement operator<< in terms of basic types rather than [u]int*_t, which is better for portability. There might be some way to factor this all with metaprogramming magic, but I'm not sure how offhand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55114 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 06:20:47 +00:00
Nick Lewycky
cbd56db62b Fix build on GCC 4.3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55110 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 05:36:03 +00:00
Eli Friedman
afc802dc7d Remove size_t operator; this unbreaks the build on Linux. Committing on
the suggestion of resistor.

If this breaks some other platform, please go ahead and back this out.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55106 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 04:28:31 +00:00
Dan Gohman
d5fe57d2f9 Basic fast-isel support for instructions with constant int operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55099 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 01:41:07 +00:00
Dan Gohman
7f92ebddd2 Improve the doxygen comment for SelectInstructions::SelectInstructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55094 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 00:19:43 +00:00
Dan Gohman
c7f72de3b4 Begin making more use of the FastISelEmitter class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55093 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 00:19:05 +00:00
Owen Anderson
cb37188323 Use raw_ostream throughout the AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 00:14:44 +00:00
Evan Cheng
83785c8096 First cut, un-optimized (and untested) fast isel lowering of GetElementPtrInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55085 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 22:45:34 +00:00
Chris Lattner
b054bfd3ea Add a new ConstantExpr::getWithOperands that takes any array of operands
instead of requiring an std::vector.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55084 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 22:27:40 +00:00
Dan Gohman
bb466331e7 Simplify FastISel's constructor argument list, make the FastISel
class hold a MachineRegisterInfo member, and make the
MachineBasicBlock be passed in to SelectInstructions rather
than the FastISel constructor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55076 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 21:05:57 +00:00
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