Devang Patel
aee309e353
Use DominatorTree instead of ETForest.
...
llvm-svn: 37507
2007-06-08 00:17:13 +00:00
Devang Patel
8ecffa996a
Do not preserve ETForest.
...
llvm-svn: 37506
2007-06-08 00:02:08 +00:00
Devang Patel
46d92cae96
Add instruction level dominates(A,B) interface.
...
llvm-svn: 37504
2007-06-07 23:52:40 +00:00
Devang Patel
cf470e5255
Do not use ETForest as well as DomiantorTree. DominatorTree is sufficient.
...
llvm-svn: 37501
2007-06-07 22:17:16 +00:00
Devang Patel
fc7fdef7d2
Use DominatorTree instead of ETForest.
...
This allows faster immediate domiantor walk.
llvm-svn: 37500
2007-06-07 21:57:03 +00:00
Devang Patel
895ab0c570
Add basic block level properlyDominates(A,B) interface.
...
llvm-svn: 37497
2007-06-07 21:34:22 +00:00
Devang Patel
171bbf61ed
Add BasicBlock level dominates(A,B) interface.
...
llvm-svn: 37493
2007-06-07 18:39:40 +00:00
Devang Patel
af41e4a192
Maintain ETNode as part of DomTreeNode.
...
This adds redundancy for now.
llvm-svn: 37492
2007-06-07 17:47:21 +00:00
Evan Cheng
fcde8e52b3
Add a machine instruction flag indicating the instruction can clobber condition code / register(s) used to predicate instructions.
...
llvm-svn: 37464
2007-06-06 10:13:55 +00:00
Chris Lattner
6b79636532
add accessor
...
llvm-svn: 37453
2007-06-06 01:22:09 +00:00
Devang Patel
5aced6a54a
Break friendship.
...
llvm-svn: 37450
2007-06-06 00:59:48 +00:00
Devang Patel
3c6ab49051
Rename.
...
llvm-svn: 37448
2007-06-06 00:49:02 +00:00
Devang Patel
d7d3d71c7a
Simplify class hierarchy.
...
llvm-svn: 37447
2007-06-06 00:46:36 +00:00
Devang Patel
506310d3dd
Avoid non-trivial loop unswitching while optimizing for size.
...
llvm-svn: 37446
2007-06-06 00:21:03 +00:00
Zhou Sheng
2444a9adeb
Commit first round work of PR1373. "noalias" is now fully supported in
...
VMCore, BitCode, and Assembly. Documentation and test case paramattrs.ll
updated also.
llvm-svn: 37432
2007-06-05 05:28:26 +00:00
Devang Patel
b3adb9876a
s/ETNode::getChildren/ETNode::getETNodeChildren/g
...
llvm-svn: 37426
2007-06-04 23:45:02 +00:00
Devang Patel
4a7c2830d4
Add FIXMEs.
...
llvm-svn: 37417
2007-06-04 17:38:00 +00:00
Devang Patel
f7a4aad658
Remove unused method.
...
llvm-svn: 37416
2007-06-04 16:49:36 +00:00
Devang Patel
ebc5b96735
s/DominatorTree::createNewNode/DominatorTree::addNewBlock/g
...
llvm-svn: 37415
2007-06-04 16:43:25 +00:00
Devang Patel
a89566aefd
Add basic block level interface to change immediate dominator
...
and create new node.
llvm-svn: 37414
2007-06-04 16:22:33 +00:00
Evan Cheng
df75785594
Move ReplaceUsesOfBlockWith() out of BranchFolding into a MachineBasicBlock general facility.
...
llvm-svn: 37408
2007-06-04 06:44:01 +00:00
Devang Patel
bdd1aaef10
s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g
...
llvm-svn: 37407
2007-06-04 00:32:22 +00:00
Devang Patel
0e8aa7b69a
s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g
...
llvm-svn: 37403
2007-06-03 06:26:14 +00:00
Duncan Sands
f708f73a1b
The semantics of invoke require that we always jump to the unwind block
...
(landing pad) when an exception unwinds through the call. This doesn't
quite match the way the dwarf unwinder works: by default it only jumps to
the landing pad if the catch or filter specification matches, and otherwise
it keeps on unwinding. There are two ways of specifying to the unwinder
that it should "always" (more on why there are quotes here later) jump to
the landing pad: follow the specification by a 0 typeid, or follow it by
the typeid for the NULL typeinfo. GCC does the first, and this patch makes
LLVM do the same as gcc. However there is a problem: the unwinder performs
optimizations based on C++ semantics (it only expects destructors to be
run if the 0 typeid fires - known as "cleanups"), meaning it assumes that no
exceptions will be raised and that the raised exception will be reraised
at the end of the cleanup code. So if someone writes their own LLVM code
using the exception intrinsics they will get a nasty surprise if they don't
follow these rules. The other possibility of using the typeid corresponding
to NULL (catch-all) causes the unwinder to make no assumptions, so this is
probably what we should use in the long-run. However since we are still
having trouble getting exception handling working properly, for the moment
it seems best to closely imitate GCC.
llvm-svn: 37399
2007-06-02 17:16:06 +00:00
Duncan Sands
c063f5f362
Integrate exception filter support and exception catch support. This
...
simplifies the code in DwarfWriter, allows for multiple filters and
makes it trivial to specify filters accompanied by cleanups or catch-all
specifications (see next patch). What a deal! Patch blessed by Anton.
llvm-svn: 37398
2007-06-02 16:53:42 +00:00
Evan Cheng
b964b9c025
Target specific ifcvt code duplication limit.
...
llvm-svn: 37384
2007-06-01 08:25:24 +00:00
Chris Lattner
3e3ff30aa2
Fix the asmprinter so that a globalvalue can specify an explicit alignment
...
smaller than the preferred alignment, but so that the target can actually
specify a minimum alignment if needed. This fixes some objc protocol
failures Devang tracked down.
llvm-svn: 37373
2007-05-31 18:57:45 +00:00
Dale Johannesen
a69ebdbebc
Make stable_sort in tail merging actually be stable (it never was, but didn't
...
matter until my last change). Reenable tail merging by default.
llvm-svn: 37354
2007-05-29 23:47:50 +00:00
Owen Anderson
9429cd1a61
Put GVN-PRE in all the right places.
...
llvm-svn: 37352
2007-05-29 23:36:32 +00:00
Evan Cheng
5983bdbb2c
Add missing const qualifiers.
...
llvm-svn: 37341
2007-05-29 18:35:22 +00:00
Chris Lattner
8deaba7622
Add a new LLVMBuilder class, which makes it simpler and more uniform to
...
create large amounts of instructions by separating the insertion point
logic from the logic of what to create.
llvm-svn: 37332
2007-05-27 15:09:34 +00:00
Devang Patel
1b63e7a4b8
Disable Tail Merging for now.
...
llvm-svn: 37329
2007-05-25 01:00:24 +00:00
Dan Gohman
30978078bf
Minor comment cleanups.
...
llvm-svn: 37321
2007-05-24 14:36:04 +00:00
Devang Patel
d50859e87b
Add dump() routines for debugging assistance.
...
llvm-svn: 37314
2007-05-23 19:55:36 +00:00
Anton Korobeynikov
3b327826db
Mark all calls as "could throw", when exceptions are enabled. Emit necessary LP info too. This fixes PR1439
...
llvm-svn: 37311
2007-05-23 11:08:31 +00:00
Evan Cheng
1e25f56508
Add a couple of target hooks for predication.
...
llvm-svn: 37306
2007-05-23 07:19:12 +00:00
Chris Lattner
c7e60517ed
make these accessors private.
...
llvm-svn: 37302
2007-05-23 05:46:04 +00:00
Dale Johannesen
f9cbdc676c
name change requested by review of previous patch
...
llvm-svn: 37289
2007-05-22 18:31:04 +00:00
Dale Johannesen
82810c8a13
Make tail merging the default, except on powerPC. There was no prior art
...
for a target-dependent default with a command-line override; this way
should be generally usable.
llvm-svn: 37285
2007-05-22 17:14:46 +00:00
Evan Cheng
1933bbc735
Consistency.
...
llvm-svn: 37274
2007-05-22 01:21:58 +00:00
Chris Lattner
3d1937591d
better portability for intptr_t.
...
llvm-svn: 37221
2007-05-18 07:07:05 +00:00
Evan Cheng
99be49dd9b
RemoveBranch() and InsertBranch() now returns number of instructions deleted / inserted.
...
llvm-svn: 37192
2007-05-18 00:05:48 +00:00
Evan Cheng
c0dc382fb7
Fix comment.
...
llvm-svn: 37191
2007-05-18 00:00:30 +00:00
Evan Cheng
a92b2b38ff
Move isSuccessor() offline, change it to use std::find.
...
llvm-svn: 37190
2007-05-17 23:58:53 +00:00
Dan Gohman
99ec2d88fb
Correct a name in a comment.
...
llvm-svn: 37178
2007-05-17 21:30:39 +00:00
Chris Lattner
e1047b2cfe
silence some "comparison between signed and unsigned integer expressions"
...
warnings
llvm-svn: 37177
2007-05-17 20:01:40 +00:00
Dan Gohman
26b4ef76d9
Fix some sporadic segfaults that are triggered when SmallVector's heap
...
storage lands near the end of the available address space. In the expression
Begin+N > Capacity, the Begin+N was overflowing. Fix this by replacing it
by with an expression that doesn't involve computation of an address
beyond the end of allocated memory.
llvm-svn: 37171
2007-05-17 18:29:01 +00:00
Evan Cheng
2db22024cf
Remove. Not needed.
...
llvm-svn: 37139
2007-05-17 00:11:35 +00:00
Evan Cheng
429178d727
Add target hook to specify block size limit for if-conversion.
...
llvm-svn: 37134
2007-05-16 23:45:53 +00:00
Evan Cheng
dcff2eb0e8
PredicateInstruction returns true if the operation was successful.
...
llvm-svn: 37124
2007-05-16 21:53:07 +00:00
Evan Cheng
b862b46aac
Rename M_PREDICATED to M_PREDICABLE; Move TargetInstrInfo::isPredicatable() to MachineInstr::isPredicable().
...
llvm-svn: 37115
2007-05-16 20:43:42 +00:00
Chris Lattner
bf7366e908
add missing mmx intrinsic
...
llvm-svn: 37099
2007-05-16 06:03:49 +00:00
Evan Cheng
c4f5ac8383
Fix comments.
...
llvm-svn: 37096
2007-05-16 05:09:34 +00:00
Evan Cheng
f5e53a58db
Initial commit of (very basic) if converter.
...
llvm-svn: 37092
2007-05-16 02:00:57 +00:00
Evan Cheng
eb3176552e
Add TargetInstrInfo predication hooks.
...
llvm-svn: 37091
2007-05-16 01:58:56 +00:00
Evan Cheng
4d728b0419
Added getNumExplicitOperands and findFirstPredOperand.
...
llvm-svn: 37064
2007-05-15 01:26:09 +00:00
Evan Cheng
785276fcda
All operands that made up of the predicate operands are maked M_PREDICATE_OPERAND.
...
llvm-svn: 37062
2007-05-15 01:21:27 +00:00
Dan Gohman
eca3b67199
Correct a comment.
...
llvm-svn: 37058
2007-05-15 00:20:13 +00:00
Evan Cheng
c690cba7d9
Fix for PR1406:
...
v1 =
r2 = move v1
= op r2<kill>
...
r2 = move v1
= op r2<kill>
Clear the first r2 kill if v1 and r2 are joined.
llvm-svn: 37050
2007-05-14 21:10:05 +00:00
Dan Gohman
86110bdf06
Use templates for the GraphType for DefaultDOTGraphTraits' members instead
...
of just using void*. This allows it to be used with graph adapters like
Inverse.
llvm-svn: 37032
2007-05-14 14:23:27 +00:00
Dan Gohman
619bfa47e3
Add a addRequiredTransitiveID member function, which is to
...
addRequiredTransitive as addRequiredID is to addRequired.
llvm-svn: 37031
2007-05-14 14:21:46 +00:00
Chris Lattner
ba12a9d1fb
update comments
...
llvm-svn: 37027
2007-05-14 01:54:16 +00:00
Reid Spencer
4c50b52f63
Add some things needed by the llvm-gcc version supporting bit accurate integer
...
types:
1. Functions to compute div/rem at the same time.
2. Further assurance that an APInt with 0 bitwidth cannot be constructed.
3. Left and right rotate operations.
4. An exactLogBase2 function which requires an exact power of two or it
returns -1.
llvm-svn: 37025
2007-05-13 23:44:59 +00:00
Anton Korobeynikov
bbaf55448b
Emit multiple common EH frames for multiple (including blank) personality
...
functions. This partly fixes PR1414: now we're restricted only to one
personality function per eh frame, not per module. Further work on
"multiple personalities" topic needs representative example.
llvm-svn: 37018
2007-05-13 15:42:26 +00:00
Anton Korobeynikov
13da17843c
More DWARF-related things cleanup:
...
1. Fix PR1380
2. Apply Duncan's patch from PR1410
3. Insert workaround for "one personality function per module" as noted in PR1414
4. Emit correct debug frames for x86/linux. This partly fixes DebugInfo/2006-11-06-StackTrace.cpp: stack trace is
shown correctly, but arguments for function on top of stack are displayed incorrectly.
llvm-svn: 37015
2007-05-12 22:36:25 +00:00
Dan Gohman
daff5ec052
Remove forward-declarations for classes that don't exist.
...
llvm-svn: 36993
2007-05-11 21:05:57 +00:00
Dan Gohman
fbb784e6af
Add explicit keywords to several constructors that now have one argument.
...
llvm-svn: 36992
2007-05-11 21:04:48 +00:00
Dan Gohman
c272746f44
Simplify BranchInst::getSuccessor, avoiding a conditional operator.
...
llvm-svn: 36991
2007-05-11 20:59:29 +00:00
Anton Korobeynikov
96142de3f0
Allow multiple invokes per landing pad. This (probably) fixes PR1410.
...
llvm-svn: 36977
2007-05-10 22:34:59 +00:00
Evan Cheng
9e17872c1d
Eliminate MarkVirtRegAliveInBlock recursion.
...
llvm-svn: 36943
2007-05-08 19:00:00 +00:00
Evan Cheng
6c6cea91fc
Add MachineBasicBlock preds / succs reverse iterators.
...
llvm-svn: 36942
2007-05-08 18:55:03 +00:00
Chris Lattner
aba457b30b
update comments, no functionality change
...
llvm-svn: 36929
2007-05-08 05:38:32 +00:00
Jeff Cohen
b6e144cffe
Unbreak VC++ build.
...
llvm-svn: 36901
2007-05-07 15:21:46 +00:00
Chris Lattner
275757a05e
Enhance MemoryBuffer to return error messages in strings if they occur.
...
llvm-svn: 36899
2007-05-06 23:32:36 +00:00
Chris Lattner
dc5d7ed6a7
remove bytecode headers
...
llvm-svn: 36885
2007-05-06 19:47:36 +00:00
Chris Lattner
7c01ed123b
remove dead header
...
llvm-svn: 36884
2007-05-06 19:46:23 +00:00
Nick Lewycky
e7da2d6ac3
Fix typo in comment.
...
llvm-svn: 36873
2007-05-06 13:37:16 +00:00
Chris Lattner
c9c5d3eed8
Move this here from Bytecode/Archive.h
...
llvm-svn: 36865
2007-05-06 09:14:53 +00:00
Chris Lattner
4492f73eb4
allow zero-length arrays
...
llvm-svn: 36863
2007-05-06 08:22:10 +00:00
Chris Lattner
eb99789fef
we aren't at the end of stream until we've consumed all the bytes AND all
...
the bits in those bytes.
llvm-svn: 36861
2007-05-06 08:12:09 +00:00
Chris Lattner
963a255853
add support for identifying bitcode files
...
llvm-svn: 36845
2007-05-06 05:30:10 +00:00
Chris Lattner
7284541754
Add a helper that either opens a file or stdin.
...
llvm-svn: 36835
2007-05-06 04:41:59 +00:00
Jeff Cohen
53555de8f2
Make code more 64-bit aware.
...
llvm-svn: 36833
2007-05-06 03:24:19 +00:00
Jeff Cohen
b3f36d48c6
Unbreak VC++.
...
llvm-svn: 36831
2007-05-06 03:12:47 +00:00
Chris Lattner
7ef417107b
add a new CreateBitcodeWriterPass method, which creates a bitcode writer as
...
a pass
llvm-svn: 36828
2007-05-06 02:30:12 +00:00
Chris Lattner
19f599471c
add inline asm code
...
llvm-svn: 36826
2007-05-06 01:50:11 +00:00
Chris Lattner
251d0a3adb
Fix a subtle bug that prevented round-tripping 470.lbm
...
llvm-svn: 36825
2007-05-06 01:43:38 +00:00
Chris Lattner
f25f710c4d
add a denser encoding for null terminated strings, add a 6-bit abbrev as
...
well. This shrinks kc++ from 2724088 to 2717360 bytes.
llvm-svn: 36821
2007-05-06 00:53:07 +00:00
Chris Lattner
036d1bddf2
implement the 'string constant' optimization. This shrinks kc.bit from
...
2878544 to 2815788
llvm-svn: 36818
2007-05-06 00:35:24 +00:00
Chris Lattner
e7b015b2ed
fix a bug I introduced when I merged some code together
...
llvm-svn: 36813
2007-05-05 23:40:48 +00:00
Anton Korobeynikov
4db0090339
Emit sections/directives in the proper order. This fixes PR1376. Also,
...
some small cleanup was made.
llvm-svn: 36780
2007-05-05 09:04:50 +00:00
Chris Lattner
b0e7f54875
minor bugfix
...
llvm-svn: 36777
2007-05-05 07:20:34 +00:00
Chris Lattner
7dce4b04ca
add a 6-bit encoding type for strings.
...
llvm-svn: 36770
2007-05-05 01:15:42 +00:00
Chris Lattner
982ec1eddc
Implement support for globally associating abbrevs with block IDs, which
...
relieves us from having to emit the abbrevs into each instance of the block.
This shrinks kc.bit from 3368K to 3333K, but will be a more significant win
once instructions are abbreviated.
The VST went from:
Block ID #14 (VALUE_SYMTAB):
Num Instances: 2345
Total Size: 1.29508e+07b/1.61885e+06B/404713W
Average Size: 5522.73b/690.342B/172.585W
% of file: 48.0645
Tot/Avg SubBlocks: 0/0
Tot/Avg Abbrevs: 7035/3
Tot/Avg Records: 120924/51.5667
% Abbrev Recs: 100
to:
Block ID #14 (VALUE_SYMTAB):
Num Instances: 2345
Total Size: 1.26713e+07b/1.58391e+06B/395978W
Average Size: 5403.53b/675.442B/168.86W
% of file: 47.5198
Tot/Avg SubBlocks: 0/0
Tot/Avg Abbrevs: 0/0
Tot/Avg Records: 120924/51.5667
% Abbrev Recs: 100
because we didn't emit the same 3 abbrevs 2345 times :)
llvm-svn: 36767
2007-05-05 00:17:00 +00:00
Chris Lattner
0c7704f23c
use a template to eliminate manual code duplication
...
llvm-svn: 36757
2007-05-04 20:40:50 +00:00
Bill Wendling
e6182267d7
Add an "implies" field to features. This indicates that, if the current
...
feature is set, then the features in the implied list should be set also.
The opposite is also enforced: if a feature in the implied list isn't set,
then the feature that owns that implies list shouldn't be set either.
llvm-svn: 36756
2007-05-04 20:38:40 +00:00
Chris Lattner
5c71df1376
add support for array abbreviations.
...
llvm-svn: 36754
2007-05-04 20:33:47 +00:00
Chris Lattner
a49bfa6701
eliminate lengths from record bodies
...
llvm-svn: 36751
2007-05-04 19:10:48 +00:00
Chris Lattner
83e10c4e67
minor cleanups. Add provisions for a new standard BLOCKINFO_BLOCK
...
block type.
llvm-svn: 36748
2007-05-04 18:25:49 +00:00
Chris Lattner
fde2829347
refcount BitCodeAbbrev objects
...
llvm-svn: 36747
2007-05-04 17:35:19 +00:00