Commit Graph

98 Commits

Author SHA1 Message Date
Chris Lattner
3380d5c4aa revert r76602, 76603, and r76615, pending design discussions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 21:12:58 +00:00
David Greene
4b938958bc Add PrefixPrinter arguments to the dump routines for MachineFunction and
MachineBasicBlock.  We'll use these shortly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76603 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 18:27:05 +00:00
Dan Gohman
688ed8583e Tidy up #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 15:32:28 +00:00
Dan Gohman
968dc7a207 Reapply 68073, with fixes. EH Landing-pad basic blocks are not
entered via fall-through. Don't miss fallthroughs from blocks
terminated by conditional branches. Also, move
isOnlyReachableByFallthrough out of line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68129 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 18:39:13 +00:00
Bill Wendling
df4881c68a Really temporarily revert r68073.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68100 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 08:42:40 +00:00
Bill Wendling
e67f5e4273 Oy! When reverting r68073, I added in experimental code. Sorry...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 08:41:31 +00:00
Bill Wendling
8fe00540fc Revert r68073. It's causing a failure in the Apple-style builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 08:26:26 +00:00
Dan Gohman
80c93e7442 Except in asm-verbose mode, avoid printing labels for blocks that are
only reachable via fall-through edges. This dramatically reduces the
number of labels printed, and thus also the number of labels the
assembler must parse and remember.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 22:55:17 +00:00
Dan Gohman
6d1b89e74f Constify arguments in isSuccessor and isLayoutSuccessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68054 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 20:06:29 +00:00
Dan Gohman
9c01f2dd0b Revert r67844. This fixes the llvm-gcc-4.2 build on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67856 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-27 18:37:13 +00:00
Duncan Sands
76d3838454 Reapply r66415, which was reverted in r66426 for
causing a bootstrap failure.  Bootstraps here on
x86-32-linux and x86-64-linux.  Requested by the
author Gabor Greif who says that a bug that might
have been causing the failure has since been fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67844 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-27 15:29:38 +00:00
Bill Wendling
9aaa0796ad Revert r66415. It's causing failures during bootstrap builds:
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c: In function '__muldi3':
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:567: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c: In function '__lshrdi3':
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:421: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[5]: *** [libgcc/./_lshrdi3.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: *** [libgcc/./_muldi3.o] Error 1
make[5]: *** [libgcc/./_negdi2.o] Error 1


--- Reverse-merging (from foreign repository) r66415 into '.':
U    include/llvm/BasicBlock.h
U    include/llvm/ADT/ilist_node.h
U    include/llvm/CodeGen/SelectionDAG.h
U    include/llvm/CodeGen/MachineFunction.h
U    include/llvm/CodeGen/MachineBasicBlock.h
U    include/llvm/Function.h



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 18:01:33 +00:00
Gabor Greif
5c3e7b1718 in builds without asserts we do not need to allocate the Next pointer in "ghostly" sentinels
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66415 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 07:09:01 +00:00
Gabor Greif
abab81f420 do not close friendship with every odd class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66229 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06 01:09:27 +00:00
Gabor Greif
f3841fcbd5 ooops, forgot to include the pointless-write eliminator in my previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 21:54:31 +00:00
Gabor Greif
c23b8719ef 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66061 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 20:36:44 +00:00
Gabor Greif
c7f6b8c5d4 "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 :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66026 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 06:57:48 +00:00
Dan Gohman
c475c3608a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62283 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 22:01:38 +00:00
Dan Gohman
8e8b8a223c Const-ify several TargetInstrInfo methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57622 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 01:49:15 +00:00
Dan Gohman
6ade6f55a8 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56968 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-02 22:09:09 +00:00
Cedric Venet
8e4018e2de Update VS projects.
Change some class to struct for coherency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-20 18:02:18 +00:00
Dan Gohman
fed90b6d09 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-28 21:51:04 +00:00
Dan Gohman
2c3f7ae384 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53746 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-17 23:49:46 +00:00
Dan Gohman
8e5f2c6f65 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53212 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 23:14:23 +00:00
Anton Korobeynikov
43d1fd449f For PR1338: rename include/llvm/ADT/ilist and friends to end with ".h"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 17:41:17 +00:00
Mon P Wang
63307c335a Added addition atomic instrinsics and, or, xor, min, and max.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50663 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-05 19:05:59 +00:00
Evan Cheng
34cd4a484e Fix more -Wshorten-64-to-32 warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-05 18:30:58 +00:00
Evan Cheng
a971dbdde2 - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50209 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-24 09:06:33 +00:00
Evan Cheng
fb8075d03f Add a quick and dirty "loop aligner pass". x86 uses it to align its loops to 16-byte boundaries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47703 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28 00:43:03 +00:00
Chris Lattner
f20c1a497f properly encapsulate the parent field of MBB and MI with get/set accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45469 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-31 04:56:33 +00:00
Chris Lattner
7ed47a1335 Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 19:59:42 +00:00
David Greene
8a46d342d8 Fix misue of iterator pointing to erased object. Uncovered by
_GLIBCXX_DEBUG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37793 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-29 02:45:24 +00:00
Evan Cheng
2bdb7d0cc8 Move CorrectExtraCFGEdges() from BranchFolding.cpp to a MachineBasicBlock method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37633 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-18 22:43:58 +00:00
Evan Cheng
0370fad74b Move ReplaceUsesOfBlockWith() out of BranchFolding into a MachineBasicBlock general facility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37408 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-04 06:44:01 +00:00
Evan Cheng
4f098788d3 Move isSuccessor() offline, change it to use std::find.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37190 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-17 23:58:53 +00:00
Evan Cheng
6603d7ec67 Add MachineBasicBlock preds / succs reverse iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36942 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-08 18:55:03 +00:00
Dan Gohman
423c2260f9 Add the 'explicit' keyword to several constructors that accept one
argument that don't appear intended as implicit-conversion operators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35280 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-23 18:44:11 +00:00
Evan Cheng
3193a2d6b0 MachineBasicBlock fields should not be public.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34766 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 02:00:40 +00:00
Jim Laskey
033c9715d9 Remove isAccessable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34497 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-22 16:39:03 +00:00
Jim Laskey
30b8e51add Add a flag to MBBs to indicate whether it is an eh landing pad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34474 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-21 22:39:52 +00:00
Evan Cheng
b371f457b0 Re-apply my liveintervalanalysis changes. Now with PR1207 fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34428 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-19 21:49:54 +00:00
Reid Spencer
a284cbf667 For PR1207:
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34399 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-19 03:20:00 +00:00
Evan Cheng
9e66eb6046 Added removeLiveIn and more livein iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34378 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-17 11:07:41 +00:00
Evan Cheng
13d8285678 Add live-ins to MachineBasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34111 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 02:38:19 +00:00
Bill Wendling
5c7e326585 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32636 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-17 05:15:13 +00:00
Jeff Cohen
4b607748d8 The best unbreakage yet, addressing Bill's concerns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32622 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-16 02:15:42 +00:00
Jeff Cohen
c21c5eeb4f An even better unbreakage...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32617 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 22:57:14 +00:00
Bill Wendling
e81561909d Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 01:30:32 +00:00
Bill Wendling
b5ebf15b2b Added a temporary hack to get the llvm-streams to work for future checkins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31978 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 22:21:29 +00:00
Chris Lattner
9b9cc5ab71 MachineInstr includes this
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31858 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-18 21:48:05 +00:00