Commit Graph

2176 Commits

Author SHA1 Message Date
Misha Brukman f68f121dd3 Add ability to extract a single basic block into a new function.
llvm-svn: 12052
2004-03-01 18:27:13 +00:00
Brian Gaeke 427cec1395 TargetCacheInfo has been removed; its only uses were to propagate a constant
(16) into certain areas of the SPARC V9 back-end. I'm fairly sure the US IIIi's
dcache has 32-byte lines, so I'm not sure where the 16 came from. However, in
the interest of not breaking things any more than they already are, I'm going
to leave the constant alone.

llvm-svn: 12043
2004-03-01 06:43:29 +00:00
Chris Lattner 482cf01a1e Fix the "partial pool allocator" on em3d and others. The problem is that
DSNodes, unlike other GraphTraits nodes, can have null outgoing edges, and
df_iterator doesn't take this into consideration.  As a workaround, the
successor iterator now handles null nodes and 'indicates' that null has
no successors.

llvm-svn: 12025
2004-03-01 01:42:26 +00:00
Chris Lattner b4c203ce67 Make Module annotable. Reid has a bunch of code that depends on this, and
we really don't win that much by eliminating this (not many Modules are
allocated), so it's not worth it.  When we can, we should revisit this in
the future.

llvm-svn: 12023
2004-03-01 01:25:37 +00:00
Misha Brukman 2a4c5b050e Doxygenify comments.
llvm-svn: 12015
2004-02-29 23:55:11 +00:00
Chris Lattner f2bb31c5fd Module does not need to be annotatable aka annotable
llvm-svn: 12005
2004-02-29 19:27:55 +00:00
Chris Lattner fcb4f9d00b Remove public header. It's been moved to lib/Target/SparcV9
llvm-svn: 12004
2004-02-29 19:13:20 +00:00
Chris Lattner 23840c7db5 Do not use explicit casts that hide the dependence on Instruction being
annotable

llvm-svn: 12000
2004-02-29 19:02:26 +00:00
Chris Lattner 79b8d467da Ugh, the old sparc backend attaches MachineCodeForInstruction annotations on
LLVM instructions.  Because it contains an explicit cast, we didn't catch it.
I guess instruction's will be annotable for the duration of the sparcv9's
existence.

llvm-svn: 11999
2004-02-29 18:54:23 +00:00
Brian Gaeke 2f80d586b8 Remove dead member variables of SparcV9SchedInfo and TargetSchedInfo
llvm-svn: 11994
2004-02-29 08:40:03 +00:00
Brian Gaeke d470a0f042 Update comment at head of file. Also fix C 'typedef struct' nonsense I
inadvertently left in here.

llvm-svn: 11988
2004-02-29 06:33:28 +00:00
Chris Lattner f20abac9bc Eliminate the distinction between "real" and "unreal" instructions
llvm-svn: 11986
2004-02-29 06:31:16 +00:00
Brian Gaeke e65125dcdf Add more architectures, and ELF64 stuff.
llvm-svn: 11985
2004-02-29 06:30:25 +00:00
Chris Lattner f611ca055c Scrap a huge layer of cruft out of this interface.
llvm-svn: 11980
2004-02-29 05:57:21 +00:00
Chris Lattner 5e7b3180e5 Remove unneeded #include
llvm-svn: 11978
2004-02-29 05:15:56 +00:00
Chris Lattner a33f2b3731 Continue Alkis's int64_t cleanup. This makes all of the immediate related
methods take an int or unsigned value instead of int64_t.

Also, add an 'addImm' method to the MachineInstrBuilder class, because the
fact that the hardware sign or zero extends it does not/should not matter
to the code generator.  Once the old sparc backend is removed the difference
can be eliminated.

llvm-svn: 11976
2004-02-29 05:06:49 +00:00
Chris Lattner 349b8c928d Add BuildMI variants that take a MBB::iterator
llvm-svn: 11975
2004-02-29 04:55:28 +00:00
Brian Gaeke c0f3741a16 Fix my sloppiness
llvm-svn: 11968
2004-02-28 22:06:03 +00:00
Chris Lattner fc5232ba3a Add hook for V8 target
llvm-svn: 11961
2004-02-28 19:54:16 +00:00
Brian Gaeke 18577345aa ELF constants and data structures.
llvm-svn: 11945
2004-02-28 06:26:20 +00:00
Misha Brukman 370c58a44a New Function-level transformation utils.
llvm-svn: 11938
2004-02-28 03:33:30 +00:00
Misha Brukman 3151628a0d Add the prototype for the LoopExtractor Pass.
llvm-svn: 11937
2004-02-28 03:33:17 +00:00
Alkis Evlogimenos a0bae43032 Make MachineOperand's immediate value an int and save 4 bytes out of
each MachineOperand. We don't really need an int64_t immediate :-).

llvm-svn: 11906
2004-02-27 15:05:28 +00:00
Misha Brukman 61107d315b Doxygenify comments.
llvm-svn: 11891
2004-02-26 23:20:29 +00:00
Misha Brukman c49e64347c Doxygenify and tersify comments.
llvm-svn: 11890
2004-02-26 23:20:08 +00:00
Alkis Evlogimenos 61719d48d2 Uncomment assertions that register# != 0 on calls to
MRegisterInfo::is{Physical,Virtual}Register. Apply appropriate fixes
to relevant files.

llvm-svn: 11882
2004-02-26 22:00:20 +00:00
Chris Lattner a990863851 Annotations are evil. This makes Value not derive from Annotable, which makes
all dynamically allocated LLVM values 4 bytes smaller, eliminate some vtables, and
make Value's destructor faster.

This makes Function derive from Annotation now because it is the only core LLVM
class that still has an annotation stuck onto it: MachineFunction.
MachineFunction is obviously horrible and gross (like most other annotations), but
will be the subject of refactorings later in the future.  Besides many fewer
Function objects are dynamically allocated that instructions blocks, constants,
types, etc... :)

llvm-svn: 11878
2004-02-26 08:08:38 +00:00
Chris Lattner e495e774b7 Make TargetData no longer use annotations!
llvm-svn: 11874
2004-02-26 08:01:57 +00:00
Chris Lattner 526a80ec25 Eliminate copy-and-paste comments
llvm-svn: 11873
2004-02-26 08:01:30 +00:00
Chris Lattner 120035898b Make sure that at least one virtual method is defined in a .cpp file to avoid
having the compiler emit RTTI and vtables to EVERY translation unit.

llvm-svn: 11871
2004-02-26 07:24:18 +00:00
Chris Lattner 5e39cf9fbd Fix a bug in the densemap that was killing the local allocator, and probably
other clients.  The problem is that the nullVal member was left to the default
constructor to initialize, which for int's does nothing (ie, leaves it unspecified).

To get a zero value, we must use T().  It's C++ wonderful? :)

llvm-svn: 11867
2004-02-26 05:00:15 +00:00
Chris Lattner 973556b724 Fix typeo. grow() cannot shrink storage. clear() should really nuke storage
llvm-svn: 11865
2004-02-26 04:07:12 +00:00
Alkis Evlogimenos 802cf52b91 Temporarily comment out asserts as they break things. I will uncomment
them when all the problem areas are fixed.

llvm-svn: 11855
2004-02-25 23:56:36 +00:00
Brian Gaeke 7b4be13f94 Represent va_list in interpreter as a (ec-stack-depth . var-arg-index)
pair, and look up varargs in the execution stack every time, instead of
just pushing iterators (which can be invalidated during callFunction())
around.  (union GenericValue now has a "pair of uints" member, to support
this mechanism.) Fixes Bug 234.

llvm-svn: 11845
2004-02-25 23:01:48 +00:00
Alkis Evlogimenos ae54cfc19f Duh, forgot to close the parenthesis.
llvm-svn: 11843
2004-02-25 22:07:14 +00:00
Alkis Evlogimenos cb69f50cb5 Add assert to isPhysicalRegister and isVirtualRegister to fail when
passed the special 'register' 0.

llvm-svn: 11842
2004-02-25 22:04:28 +00:00
Alkis Evlogimenos d8bace7f60 Add DenseMap template and actually use it for for mapping virtual regs
to objects.

llvm-svn: 11840
2004-02-25 21:55:45 +00:00
Chris Lattner 14da4ead95 Add prototype
llvm-svn: 11837
2004-02-25 21:34:51 +00:00
Brian Gaeke 068b4596d4 Great renaming part II: Sparc --> SparcV9 (also includes command-line options and Makefiles)
llvm-svn: 11827
2004-02-25 19:08:12 +00:00
Brian Gaeke 04cff21c2f Cygwin defines log2 as a macro. Undef it here IFF it has already been defined,
so that we always get the inline function instead. Remember, kids, like it says
in the GCC manual, "An Inline Function is As Fast As a Macro."

llvm-svn: 11815
2004-02-25 01:53:45 +00:00
Brian Gaeke 10a32da382 FunctionLiveVarInfo.h moved: include/llvm/CodeGen -> lib/Target/Sparc/LiveVar
llvm-svn: 11804
2004-02-24 19:46:00 +00:00
Chris Lattner c7f8ba9f4f Add some helpful methods for dealing with switch instructions
llvm-svn: 11794
2004-02-24 06:26:00 +00:00
Chris Lattner 291ebdbfcc Hrm, my find must have been faulty. It didn't remove these as well.
llvm-svn: 11788
2004-02-24 03:54:22 +00:00
Chris Lattner 0da4862a80 Boost is now unneeded, thanks to the fix for PR253, contributed by Reid Spencer!
llvm-svn: 11787
2004-02-24 03:53:00 +00:00
Chris Lattner 101e704b0b Use the new LLVM is_class template instead of the boost one, allowing us to
remove our dependency on boost!  Thanks to Reid Spencer for making this possible!

llvm-svn: 11785
2004-02-24 03:50:05 +00:00
Chris Lattner 78eed17a29 Check in a new type_traits header which provides the mysterious is_class
template.  Thanks go out to Reid Spencer for skillfully extracting this
from boost!

llvm-svn: 11784
2004-02-24 03:49:29 +00:00
Chris Lattner 1302e3ac95 Noone cares about similarity to boost
llvm-svn: 11783
2004-02-24 03:47:25 +00:00
Brian Gaeke 686efc0b56 DataTypes.h is now output from configure, and shortened
llvm-svn: 11778
2004-02-23 22:07:26 +00:00
Brian Gaeke 1bc5aaefc6 Regenerated with autoheader-2.57.
llvm-svn: 11773
2004-02-23 21:30:39 +00:00
Brian Gaeke c685388125 ThreadSupport.h is now output from configure.
llvm-svn: 11770
2004-02-23 21:30:29 +00:00
Brian Gaeke cc7644407c Renamed to hash_set.in; move to using autoconf substitution tags.
llvm-svn: 11765
2004-02-23 18:56:36 +00:00
Brian Gaeke 17d7a29d76 Renamed to hash_map.in; move to using autoconf substitution tags.
llvm-svn: 11764
2004-02-23 18:56:35 +00:00
Brian Gaeke ceb6842293 Regenerated using autoheader-2.57.
llvm-svn: 11762
2004-02-23 18:56:04 +00:00
Brian Gaeke 0fa55f7909 Renamed from include/Support/iterator. Doxygenify comments; add autoconf substitution tags.
llvm-svn: 11754
2004-02-23 18:16:10 +00:00
Brian Gaeke bd02d1806f Replaced by include/Support/iterator.in.
llvm-svn: 11753
2004-02-23 18:16:10 +00:00
Brian Gaeke e27fc812ca Regenerated with autoheader-2.57.
llvm-svn: 11752
2004-02-23 18:16:09 +00:00
Alkis Evlogimenos af2de4848e Refactor rewinding code for finding the first terminator of a basic
block into MachineBasicBlock::getFirstTerminator().

This also fixes a bug in the implementation of the above in both
RegAllocLocal and InstrSched, where instructions where added after the
terminator if the basic block's only instruction was a terminator (it
shouldn't matter for RegAllocLocal since this case never occurs in
practice).

llvm-svn: 11748
2004-02-23 18:14:48 +00:00
Alkis Evlogimenos 486b12b71a Move LiveIntervals.h to lib/CodeGen since it shouldn't be exposed to other parts of the compiler
llvm-svn: 11719
2004-02-23 00:50:15 +00:00
Alkis Evlogimenos 8358cc573d Move MOTy::UseType enum into MachineOperand. This eliminates the
switch statements in the constructors and simplifies the
implementation of the getUseType() member function. You will have to
specify defs using MachineOperand::Def instead of MOTy::Def though
(similarly for Use and UseAndDef).

llvm-svn: 11715
2004-02-22 19:23:26 +00:00
Alkis Evlogimenos cb243ab173 Fix silly bug in implementation of getUseType(). Thanks Misha.
llvm-svn: 11711
2004-02-22 07:24:19 +00:00
Alkis Evlogimenos de51c65299 When folding memory operands in machine instructions be careful to
leave register operands with the same use/def flags as the original
instruction.

llvm-svn: 11709
2004-02-22 06:54:26 +00:00
Chris Lattner d25dfe43b9 Significantly simplify gep_type_iterator, and make its interface more general/powerful
llvm-svn: 11708
2004-02-22 06:27:03 +00:00
Alkis Evlogimenos d890f59f19 Abstract merging of ranges away from number of slots per instruction.
Also make it less aggressive as the current implementation breaks in
some cases.

llvm-svn: 11696
2004-02-22 04:05:13 +00:00
Chris Lattner 6983f46792 Update comments and add warning
llvm-svn: 11691
2004-02-21 22:27:20 +00:00
Brian Gaeke 3056626e7b Regenerated using autoheader-2.57.
llvm-svn: 11657
2004-02-20 06:40:58 +00:00
Alkis Evlogimenos 76eca062ea Too many changes in one commit:
1. LiveIntervals now implement a 4 slot per instruction model. Load,
   Use, Def and a Store slot. This is required in order to correctly
   represent caller saved register clobbering on function calls,
   register reuse in the same instruction (def resues last use) and
   also spill code added later by the allocator. The previous
   representation (2 slots per instruction) was insufficient and as a
   result was causing subtle bugs.

2. Fixes in spill code generation. This was the major cause of
   failures in the test suite.

3. Linear scan now has core support for folding memory operands. This
   is untested and not enabled (the live interval update function does
   not attempt to fold loads/stores in instructions).

4. Lots of improvements in the debugging output of both live intervals
   and linear scan. Give it a try... it is beautiful :-)

In summary the above fixes all the issues with the recent reserved
register elimination changes and get the allocator very close to the
next big step: folding memory operands.

llvm-svn: 11654
2004-02-20 06:15:40 +00:00
Chris Lattner a7350c53d2 Add a method useful for updating DSA
llvm-svn: 11636
2004-02-19 21:27:50 +00:00
Chris Lattner c62ce162ff Add a new function
llvm-svn: 11630
2004-02-19 20:03:08 +00:00
Chris Lattner bef87a990a ADd a method for when an instruction moves
llvm-svn: 11626
2004-02-19 18:28:22 +00:00
Chris Lattner d23a882f2f Add a MachineBasicBlock::getParent() method
llvm-svn: 11622
2004-02-19 16:13:54 +00:00
Alkis Evlogimenos 3562c2dd9f Make ToolExecutionError inherit std::exception and implement its
interface: getMessage() is gone, use what() instead.

llvm-svn: 11621
2004-02-19 07:39:26 +00:00
Alkis Evlogimenos 28b0468785 This is needed by assignment verification in linear-scan.
llvm-svn: 11618
2004-02-19 01:10:55 +00:00
Chris Lattner 5e76384093 Add support for just compiling a program
llvm-svn: 11610
2004-02-18 23:24:29 +00:00
Alkis Evlogimenos 671f1c87df Move unused typedefs in private section. Add method to return interval
given a register.

llvm-svn: 11608
2004-02-18 23:14:52 +00:00
Chris Lattner 3c10196aab Byebye method
llvm-svn: 11598
2004-02-18 20:38:12 +00:00
Chris Lattner 08180ecfcf When an error occurs executing a tool, we now throw an exception instead
of calling exit(1).

llvm-svn: 11593
2004-02-18 20:21:57 +00:00
Chris Lattner cc09204840 Change the order of the arguments to the ctor, allowing us to make the boolean default to true
llvm-svn: 11592
2004-02-18 20:20:52 +00:00
Chris Lattner 2bcf9410de Move a helper class out of bugpoint to here.
llvm-svn: 11582
2004-02-18 17:16:17 +00:00
Chris Lattner ab920f2dc7 eliminate a pair of really inefficient methods now that noone uses them
llvm-svn: 11579
2004-02-18 16:45:22 +00:00
Chris Lattner 9093e9b2a1 The CBE is no longer in llvm-dis
llvm-svn: 11532
2004-02-17 06:39:48 +00:00
Chris Lattner 1e70deff78 Simplify and document the new interface
llvm-svn: 11524
2004-02-17 05:54:26 +00:00
Alkis Evlogimenos 4d5f42f58f Add LiveIntervals::Interval::empty() member function.
llvm-svn: 11520
2004-02-17 05:14:37 +00:00
Alkis Evlogimenos cde4ade314 Add API to check and fold memory operands into instructions.
llvm-svn: 11519
2004-02-17 04:33:18 +00:00
Chris Lattner 946e46596f Add two missing pieces from last checkin
llvm-svn: 11513
2004-02-17 03:03:36 +00:00
Chris Lattner c14686440f Rearrange code to eliminate warnings
llvm-svn: 11512
2004-02-17 02:58:36 +00:00
Alkis Evlogimenos 14f3fe81c6 Add LeakDetection to MachineInstr.
Move out of line member functions of MachineBasicBlock to
MachineBasicBlock.cpp.

llvm-svn: 11497
2004-02-16 07:17:43 +00:00
Alkis Evlogimenos 2c5ddd20ba Eliminate the use of spill (reserved) registers.
llvm-svn: 11476
2004-02-15 10:24:21 +00:00
Chris Lattner 9fba3da879 Add a new ConstantAggregateZero class, to fix PR239. This makes zero
initializers for constant structs and arrays take constant space, instead of
space proportinal to the number of elements.  This reduces the memory usage of
the LLVM compiler by hundreds of megabytes when compiling some nasty SPEC95
benchmarks.

llvm-svn: 11470
2004-02-15 05:53:04 +00:00
Chris Lattner 2d6fca9717 finegrainify namespacification
llvm-svn: 11469
2004-02-15 05:52:36 +00:00
Chris Lattner 015e821279 ConstantArray::get and ConstantStruct::get now just return pointers to
'Constant', instead of specific subclass pointers.  In the future, these will
return an instance of ConstantAggregateZero if all of the inputs are zeros.

llvm-svn: 11467
2004-02-15 04:14:47 +00:00
Chris Lattner 72862f132c The prologue/epilogue related method calls have no reason to return a value,
make them return void.

llvm-svn: 11447
2004-02-14 19:49:05 +00:00
Chris Lattner dc632111bf Add llvm.memset/frameaddress/returnaddress intrinsics.
llvm-svn: 11431
2004-02-14 02:47:17 +00:00
Alkis Evlogimenos 7c6e4d5ae6 Add next() and prior() iterator utility functions. Unlike std::advance
they do not modify the passed iterator but return a copy.

next(myIt) returns copy of myIt incremented once
next(myIt, n) returns copy of myIt incremented n times
prior(myIt) returns copy of myIt decremented once
prior(myIt, n) returns copy of myIt decremented n times

While at it remove obsolete implementation of mapped_iterator.

llvm-svn: 11429
2004-02-14 01:17:28 +00:00
Chris Lattner 7934640709 Add method
llvm-svn: 11425
2004-02-14 00:30:31 +00:00
Chris Lattner 23472a5a2a Make sure to provide a prototype for the cbackend
llvm-svn: 11419
2004-02-13 23:36:03 +00:00
Chris Lattner c7dd48567f The cbackend has never had anything to do with llvm assembly writing
llvm-svn: 11411
2004-02-13 23:19:51 +00:00
Chris Lattner b09176a1e2 Change access to the cwriter
llvm-svn: 11406
2004-02-13 23:00:45 +00:00
Alkis Evlogimenos 8cdd0215bf Remove getAllocatedRegNum(). Use getReg() instead.
llvm-svn: 11393
2004-02-13 21:01:20 +00:00
Alkis Evlogimenos ef9d025ebe Mark MachineBasicBlock::operator[] deprecated.
llvm-svn: 11392
2004-02-13 20:05:56 +00:00
Alkis Evlogimenos 0e98a0638e Add getNumVirtualRegs().
Whitespace cleanups.

llvm-svn: 11388
2004-02-13 18:07:06 +00:00