1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 21:42:54 +02:00
Commit Graph

134 Commits

Author SHA1 Message Date
Gabor Greif
5291d4d65b ooops, forgot to include the pointless-write eliminator in my previous checkin
llvm-svn: 66081
2009-03-04 21:54:31 +00:00
Gabor Greif
9a8e64c76f Give sentinel traits the right to determine the policy where the sentinel is kept.
This should result in less indirect memory accesses, less dead writes and tighter code.

llvm-svn: 66061
2009-03-04 20:36:44 +00:00
Gabor Greif
f8d2f7429d "Ghostify" embedded sentinels. This is a real win in all cases
because less bytes are allocated and subobject construction is gone.
For reference how it works, see BasicBlock.h.
Btw. it is very assuring to see that somebody has invented
this ilist-embedded sentinel technique before me :-)

llvm-svn: 66026
2009-03-04 06:57:48 +00:00
Dan Gohman
23a5f63b21 Simplify the MachineLICM pass by having it only traverse outer
loops, hoisting instructions all the way out in one step rather
than hoisting them one nest level at a time. Also, make a few
other code simplifications. This speeds up MachineLICM
by several fold.

llvm-svn: 62283
2009-01-15 22:01:38 +00:00
Dan Gohman
86527c1834 Const-ify several TargetInstrInfo methods.
llvm-svn: 57622
2008-10-16 01:49:15 +00:00
Dan Gohman
bf63ae1e29 Add a new MachineBasicBlock utility function, isLayoutSuccessor, that
can be used when deciding if a block can transfer control to another
via a fall-through instead of a branch.

llvm-svn: 56968
2008-10-02 22:09:09 +00:00
Cedric Venet
68f5000738 Update VS projects.
Change some class to struct for coherency.

llvm-svn: 56389
2008-09-20 18:02:18 +00:00
Dan Gohman
9653b21dc2 Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.

Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.

Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.

llvm-svn: 54146
2008-07-28 21:51:04 +00:00
Dan Gohman
f38f99ccc5 Re-introduce LeakDetector support for MachineInstrs and MachineBasicBlocks.
Fix a leak that this turned up in LowerSubregs.cpp.
And, comment a leak in LiveIntervalAnalysis.cpp.

llvm-svn: 53746
2008-07-17 23:49:46 +00:00
Dan Gohman
cd25487258 Pool-allocation for MachineInstrs, MachineBasicBlocks, and
MachineMemOperands. The pools are owned by MachineFunctions.

This drastically reduces the number of calls to malloc/free made
during the "Emit" phase of scheduling, as well as later phases
in CodeGen. Combined with other changes, this speeds up the
"instruction selection" phase of CodeGen by 10% in some cases.

llvm-svn: 53212
2008-07-07 23:14:23 +00:00
Anton Korobeynikov
f77142326f For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h"
llvm-svn: 51687
2008-05-29 17:41:17 +00:00
Mon P Wang
84a269e023 Added addition atomic instrinsics and, or, xor, min, and max.
llvm-svn: 50663
2008-05-05 19:05:59 +00:00
Evan Cheng
d9353009b7 Fix more -Wshorten-64-to-32 warnings.
llvm-svn: 50659
2008-05-05 18:30:58 +00:00
Evan Cheng
1a97cb159e - Check if a register is livein before removing it. It may have already been removed.
- Do not iterate over SmallPtrSet, the order of iteration is not deterministic.

llvm-svn: 50209
2008-04-24 09:06:33 +00:00
Evan Cheng
f8b1257d2e Add a quick and dirty "loop aligner pass". x86 uses it to align its loops to 16-byte boundaries.
llvm-svn: 47703
2008-02-28 00:43:03 +00:00
Chris Lattner
d8b7ecd871 properly encapsulate the parent field of MBB and MI with get/set accessors.
llvm-svn: 45469
2007-12-31 04:56:33 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
David Greene
ad230f223f Fix misue of iterator pointing to erased object. Uncovered by
_GLIBCXX_DEBUG.

llvm-svn: 37793
2007-06-29 02:45:24 +00:00
Evan Cheng
978058bcd7 Move CorrectExtraCFGEdges() from BranchFolding.cpp to a MachineBasicBlock method.
llvm-svn: 37633
2007-06-18 22:43:58 +00:00
Evan Cheng
0dbe4d04db Move ReplaceUsesOfBlockWith() out of BranchFolding into a MachineBasicBlock general facility.
llvm-svn: 37408
2007-06-04 06:44:01 +00:00
Evan Cheng
b4cc6606d5 Move isSuccessor() offline, change it to use std::find.
llvm-svn: 37190
2007-05-17 23:58:53 +00:00
Evan Cheng
abe2299a19 Add MachineBasicBlock preds / succs reverse iterators.
llvm-svn: 36942
2007-05-08 18:55:03 +00:00
Dan Gohman
42a3f4e16e Add the 'explicit' keyword to several constructors that accept one
argument that don't appear intended as implicit-conversion operators.

llvm-svn: 35280
2007-03-23 18:44:11 +00:00
Evan Cheng
0c89fbb835 MachineBasicBlock fields should not be public.
llvm-svn: 34766
2007-03-01 02:00:40 +00:00
Jim Laskey
8c79f0f892 Remove isAccessable.
llvm-svn: 34497
2007-02-22 16:39:03 +00:00
Jim Laskey
8fdff03f2b Add a flag to MBBs to indicate whether it is an eh landing pad.
llvm-svn: 34474
2007-02-21 22:39:52 +00:00
Evan Cheng
e4ab9c032b Re-apply my liveintervalanalysis changes. Now with PR1207 fixes.
llvm-svn: 34428
2007-02-19 21:49:54 +00:00
Reid Spencer
b27fcf3482 For PR1207:
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.

llvm-svn: 34399
2007-02-19 03:20:00 +00:00
Evan Cheng
2db4db48ed Added removeLiveIn and more livein iterators.
llvm-svn: 34378
2007-02-17 11:07:41 +00:00
Evan Cheng
6dc088ffd4 Add live-ins to MachineBasicBlock.
llvm-svn: 34111
2007-02-10 02:38:19 +00:00
Bill Wendling
7f6a73eb5c Added an automatic cast to "std::ostream*" etc. from OStream. We then can
rework the hacks that had us passing OStream in. We pass in std::ostream*
instead, check for null, and then dispatch to the correct print() method.

llvm-svn: 32636
2006-12-17 05:15:13 +00:00
Jeff Cohen
c396e18e8e The best unbreakage yet, addressing Bill's concerns.
llvm-svn: 32622
2006-12-16 02:15:42 +00:00
Jeff Cohen
03161dd132 An even better unbreakage...
llvm-svn: 32617
2006-12-15 22:57:14 +00:00
Bill Wendling
a3246c4272 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Bill Wendling
4157840bd6 Added a temporary hack to get the llvm-streams to work for future checkins.
llvm-svn: 31978
2006-11-28 22:21:29 +00:00
Chris Lattner
4715f9a02e MachineInstr includes this
llvm-svn: 31858
2006-11-18 21:48:05 +00:00
Chris Lattner
3a34164b82 Implement operator<< for machine basic blocks to make it easier to dump them.
llvm-svn: 31857
2006-11-18 21:47:36 +00:00
Chris Lattner
108484eb68 add two helper methods
llvm-svn: 31143
2006-10-23 23:35:35 +00:00
Chris Lattner
9b527c4477 New, wonderful isSuccessor method
llvm-svn: 31103
2006-10-21 06:50:05 +00:00
Chris Lattner
a05ee6de92 ADd a method
llvm-svn: 30707
2006-10-03 20:16:45 +00:00
Misha Brukman
4ad5efd1a9 Remove trailing whitespace
llvm-svn: 21409
2005-04-21 20:39:54 +00:00
Chris Lattner
92b24431d9 Improve spelling
llvm-svn: 19931
2005-01-30 00:13:34 +00:00
Chris Lattner
aa4ae8f5b3 Adjust to ilist changes.
llvm-svn: 19923
2005-01-29 18:41:12 +00:00
Chris Lattner
dd0094e4ed Convert 'struct' to 'class' in various places to adhere to the coding standards
and work better with VC++.  Patch contributed by Morten Ofstad!

llvm-svn: 17281
2004-10-27 16:14:51 +00:00
Chris Lattner
fabd2aa5b5 Remove the unused MachineBasicBlock2IndexFunctor class.
Move method bodies that depend on <algorithm> out of line to
MachineBasicBlock.cpp.  Patch contributed by Morten Ofstad!

llvm-svn: 17252
2004-10-26 15:41:13 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Alkis Evlogimenos
877fe7d13c Add MachineBasicBlock2IndexFunctor. This is useful for densemaps from
MachineBasicBlocks to an arbitrary type.

llvm-svn: 16068
2004-08-27 04:00:26 +00:00
Chris Lattner
0829da11d7 Expose some helpful methods
llvm-svn: 15366
2004-07-31 09:59:04 +00:00
Chris Lattner
6f4beb3664 Add some machine CFG related stuff
llvm-svn: 15352
2004-07-31 01:59:11 +00:00
Brian Gaeke
fb83999991 Add a forwarding method pop_front() that allows you to delete instructions
from the beginning of a MBB.

llvm-svn: 14074
2004-06-08 18:52:47 +00:00
Tanya Lattner
7cf16701f7 Moved MachineBasicBlock deconstructor to cpp file and removed it from LeakDetector to fix memory leak bug.
llvm-svn: 13718
2004-05-24 07:14:35 +00:00
Tanya Lattner
aabaaec037 Added MachineFunction parent* to MachineBasicBlock. Customized ilist template
to set the parent when a MachineBasicBlock is added to a MachineFunction.

llvm-svn: 13716
2004-05-24 06:11:51 +00:00
Brian Gaeke
b964085c4c Fix a comment.
llvm-svn: 13518
2004-05-12 21:57:23 +00:00
Brian Gaeke
a0d9f814da Add a Number field w/ accessor method, for function-level unique numbering
of MBBs.

Add non-const MachineBasicBlock::getParent() accessor method.

llvm-svn: 13512
2004-05-12 21:35:20 +00:00
Brian Gaeke
397162e886 Chris told me to take these assertions out a few days ago, but I forgot to
check this in.

llvm-svn: 13313
2004-05-02 01:04:52 +00:00
Chris Lattner
939685e14b Move the GraphTraits for MachineBasicBlocks to the MachineBasicBlock file.
llvm-svn: 13299
2004-05-01 21:05:34 +00:00
Brian Gaeke
8e3668faca Add pred./succ. list size methods.
llvm-svn: 13214
2004-04-28 04:46:35 +00:00
Brian Gaeke
369fa0ed81 Move private methods to end of class decl at Chris's request
llvm-svn: 13210
2004-04-28 04:15:06 +00:00
Brian Gaeke
d63179c70b Fix thinkos that Chris caught for me.
Make pred mutators private.

llvm-svn: 13209
2004-04-28 03:59:48 +00:00
Brian Gaeke
213538a039 Add machine-code CFG support: MachineBasicBlocks may now have their own
predecessors and successors

llvm-svn: 13208
2004-04-28 02:16:33 +00:00
Brian Gaeke
e7f4f73f67 Add clear() forwarding method.
llvm-svn: 12580
2004-03-31 22:43:12 +00:00
Chris Lattner
3f24ea6ccf MachineBasicBlock::remove should not change the iterator passed into it
llvm-svn: 12569
2004-03-31 21:58:50 +00:00
Alkis Evlogimenos
9b103024ef 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
Chris Lattner
436ab13009 Add a MachineBasicBlock::getParent() method
llvm-svn: 11622
2004-02-19 16:13:54 +00:00
Chris Lattner
34f3bce70c eliminate a pair of really inefficient methods now that noone uses them
llvm-svn: 11579
2004-02-18 16:45:22 +00:00
Alkis Evlogimenos
790b000aa7 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
e504fa6710 Mark MachineBasicBlock::operator[] deprecated.
llvm-svn: 11392
2004-02-13 20:05:56 +00:00
Brian Gaeke
7707461afa Include <iosfwd>.
Add prototypes for MachineBasicBlock's dump() and print() methods.

llvm-svn: 11365
2004-02-13 04:40:15 +00:00
Alkis Evlogimenos
00d97b6a13 Move ilist_trairs<MachineInstr> in MachineBasicBlock.
llvm-svn: 11358
2004-02-12 19:12:03 +00:00
Alkis Evlogimenos
3ecdcd18c5 Add parent pointer to MachineInstr that points to owning
MachineBasicBlock. Also change opcode to a short and numImplicitRefs
to an unsigned char so that overall MachineInstr's size stays the
same.

llvm-svn: 11357
2004-02-12 18:49:07 +00:00
Alkis Evlogimenos
b755d35fd2 Change MachineBasicBlock's vector of MachineInstr pointers into an
ilist of MachineInstr objects. This allows constant time removal and
insertion of MachineInstr instances from anywhere in each
MachineBasicBlock. It also allows for constant time splicing of
MachineInstrs into or out of MachineBasicBlocks.

llvm-svn: 11340
2004-02-12 02:27:10 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
16c6cda9d5 Added LLVM copyright header (for lack of a better term).
llvm-svn: 9304
2003-10-20 20:19:47 +00:00
Chris Lattner
a522d0ebf9 Code generation phases are not allowed to modify the LLVM representation.
Because of this, we'll make the MBB->BB mapping const as it should be

llvm-svn: 7351
2003-07-26 23:30:37 +00:00
Chris Lattner
329956d9f9 Get rid of deprecated function
llvm-svn: 4997
2002-12-13 07:30:45 +00:00
Chris Lattner
7cdc2977f0 Change MachineBasicBlock's to not be Annotations, instead they are kept as
part of a linked list tracked by MachineFunction.  MachineBasicBlock::get
is now linear time instead of constant time, and thus is deprecated!

llvm-svn: 4337
2002-10-28 05:30:46 +00:00
Chris Lattner
daf162b45a Add BasicBlock list to MchineFunction that will eventually be the only
way to access MachineBasicBlocks.  For now, it is never filled.

llvm-svn: 4324
2002-10-28 02:08:43 +00:00
Chris Lattner
85e7d46739 Remvoe dead fixme and typedef
llvm-svn: 4320
2002-10-28 01:55:26 +00:00
Chris Lattner
46509e42f8 MachineBasicBlock doesn't need basicblock.h, it needs Annotation.h
llvm-svn: 4319
2002-10-28 01:53:00 +00:00
Chris Lattner
4f2c612b21 Inline some methods from .cpp files into .h files, minor cleanups
llvm-svn: 4313
2002-10-28 01:21:55 +00:00
Misha Brukman
142795fd17 Changed MachineCodeForMethod' to MachineFunction'.
llvm-svn: 4301
2002-10-28 00:28:31 +00:00
Chris Lattner
2bc0fd8115 Prune #includes
llvm-svn: 4295
2002-10-27 20:49:47 +00:00
Vikram S. Adve
248e623726 Add erase() method for a single element.
llvm-svn: 3849
2002-09-20 00:55:57 +00:00
Vikram S. Adve
bacbe6b240 Interface to class MachineCodeForBasicBlock.
Moved here from MachineInstr.h to make it an annotation on BasicBlock.

llvm-svn: 2823
2002-07-08 22:40:34 +00:00