Owen Anderson
907b0a4e10
Have internal df_iterator's use SmallPtrSet instead of std::set. This provides compile time speedups to any pass using df_iterator.
...
llvm-svn: 37694
2007-06-21 21:25:36 +00:00
Devang Patel
bfb1c7192e
Move code to update dominator information after basic block is split
...
from LoopSimplify.cpp to Dominator.cpp
llvm-svn: 37689
2007-06-21 17:23:45 +00:00
Dan Gohman
1815e9bdb3
Rename TargetLowering::getNumElements and friends to
...
TargetLowering::getNumRegisters and similar, to avoid confusion with
the actual number of elements for vector types.
llvm-svn: 37687
2007-06-21 14:42:22 +00:00
Tanya Lattner
6d152cd7df
Move inliner pass header file.
...
llvm-svn: 37664
2007-06-19 22:29:02 +00:00
Dan Gohman
bb705e230a
Rename ScalarEvolution::deleteInstructionFromRecords to
...
deleteValueFromRecords and loosen the types to all it to accept
Value* instead of just Instruction*, since this is what
ScalarEvolution uses internally anyway. This allows more flexibility
for future uses.
llvm-svn: 37657
2007-06-19 14:28:31 +00:00
Dan Gohman
b60d8a92c9
Replace M_REMATERIALIZIBLE and the newly-added isOtherReMaterializableLoad
...
with a general target hook to identify rematerializable instructions. Some
instructions are only rematerializable with specific operands, such as loads
from constant pools, while others are always rematerializable. This hook
allows both to be identified as being rematerializable with the same
mechanism.
llvm-svn: 37644
2007-06-19 01:48:05 +00:00
Evan Cheng
4358a7f1e9
Replace CanBeDuplicated() with a M_NOT_DUPLICABLE bit.
...
llvm-svn: 37642
2007-06-19 01:21:41 +00:00
Chris Lattner
6e631d5d4f
add isvararg tracking to CCState
...
llvm-svn: 37639
2007-06-19 00:10:25 +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
Tanya Lattner
fedfcab2ab
Modify annotate intrinsic to take 2 additional args: file and line number.
...
Fix up Annotate attribute test case.
Fix DebugFilename.c test case to look for right file name.
llvm-svn: 37632
2007-06-18 22:23:39 +00:00
Chris Lattner
80de50ac63
add helper
...
llvm-svn: 37631
2007-06-18 21:50:49 +00:00
Dan Gohman
27de646c66
Add keyword explicit.
...
llvm-svn: 37624
2007-06-18 14:11:31 +00:00
Evan Cheng
34a6cb0b2e
Added CanBeDuplicated(). It returns true if an instruction can be safely duplicated (e.g. during ifcvt).
...
llvm-svn: 37605
2007-06-15 21:13:54 +00:00
Tanya Lattner
203b1ae094
Add local var annotation intrinsic.
...
llvm-svn: 37603
2007-06-15 20:50:54 +00:00
Evan Cheng
13a9ca69bc
No longer needed.
...
llvm-svn: 37598
2007-06-15 19:05:13 +00:00
Dan Gohman
838ba27094
Add a SCEV class and supporting code for sign-extend expressions.
...
This created an ambiguity for expandInTy to decide when to use
sign-extension or zero-extension, but it turns out that most of its callers
don't actually need a type conversion, now that LLVM types don't have
explicit signedness. Drop expandInTy in favor of plain expand, and change
the few places that actually need a type conversion to do it themselves.
llvm-svn: 37591
2007-06-15 14:38:12 +00:00
Chris Lattner
1de26b7677
m_not should match vector not
...
llvm-svn: 37587
2007-06-15 06:13:47 +00:00
Chris Lattner
145fdc7e2a
add a Constant::getAllOnesValue helper function, which works on integers
...
AND vectors.
llvm-svn: 37586
2007-06-15 06:10:53 +00:00
Dan Gohman
2fd7d26df8
Rename MVT::getVectorBaseType to MVT::getVectorElementType.
...
llvm-svn: 37579
2007-06-14 22:58:02 +00:00
Dale Johannesen
62f49dd524
Do not treat FP_REG_KILL as terminator in branch analysis (X86).
...
llvm-svn: 37578
2007-06-14 22:03:45 +00:00
Dan Gohman
35f2b4d716
Add a target hook to allow loads from constant pools to be rematerialized, and an
...
implementation for x86.
llvm-svn: 37576
2007-06-14 20:50:44 +00:00
Dan Gohman
74c92798d8
Eliminate some redundant newlines in asm output.
...
llvm-svn: 37574
2007-06-14 15:00:27 +00:00
Christopher Lamb
68017d151b
Add support to tablegen for specifying subregister classes on a per register class basis.
...
llvm-svn: 37572
2007-06-13 22:20:15 +00:00
Dan Gohman
6415b2548e
Introduce new SelectionDAG node opcodes VEXTRACT_SUBVECTOR and
...
VCONCAT_VECTORS. Use these for CopyToReg and CopyFromReg legalizing in
the case that the full register is to be split into subvectors instead
of scalars. This replaces uses of VBIT_CONVERT to present values as
vector-of-vector types in order to make whole subvectors accessible via
BUILD_VECTOR and EXTRACT_VECTOR_ELT.
This is in preparation for adding extended ValueType values, where
having vector-of-vector types is undesirable.
llvm-svn: 37569
2007-06-13 15:12:02 +00:00
Devang Patel
ca555be4ca
Protect updateDFSNumbers()
...
llvm-svn: 37560
2007-06-12 17:30:56 +00:00
Devang Patel
73ae5acfd0
Make DFS number manipulation methods private.
...
llvm-svn: 37553
2007-06-12 05:49:31 +00:00
Devang Patel
ab4cb51479
Break DominatorTree from ETNode.
...
Remove unused PostETForest.
llvm-svn: 37551
2007-06-12 00:54:38 +00:00
Devang Patel
73d23a5f70
Maintain DFS number in DomTreeNode itself.
...
This means now ETNodes are not useful anymore.
llvm-svn: 37546
2007-06-12 00:14:41 +00:00
Devang Patel
bc3887310b
Add and use DominatorTreeBase::findNearestCommonDominator().
...
llvm-svn: 37545
2007-06-11 23:31:22 +00:00
Evan Cheng
1a6c0341fd
Add a utility routine to check for unpredicated terminator instruction.
...
llvm-svn: 37528
2007-06-08 21:59:56 +00:00
Devang Patel
d1a779c4fe
Fix spelling.
...
llvm-svn: 37522
2007-06-08 17:59:02 +00:00
David Greene
6b14050d1e
Factor live variable analysis so it does not do register coalescing
...
simultaneously. Move that pass to SimpleRegisterCoalescing.
This makes it easier to implement alternative register allocation and
coalescing strategies while maintaining reuse of the existing live
interval analysis.
llvm-svn: 37520
2007-06-08 17:18:56 +00:00
Devang Patel
cfb3a761ae
Update LoopSimplify to require and preserve DominatorTree only.
...
Now LoopSimplify does not require nor preserve ETForest.
llvm-svn: 37512
2007-06-08 01:50:32 +00:00
Devang Patel
738f460b18
Add new method - nearestCommonDominator().
...
llvm-svn: 37508
2007-06-08 00:21:17 +00:00
Devang Patel
d544f5262e
Use DominatorTree instead of ETForest.
...
llvm-svn: 37507
2007-06-08 00:17:13 +00:00
Devang Patel
b5554f450a
Do not preserve ETForest.
...
llvm-svn: 37506
2007-06-08 00:02:08 +00:00
Devang Patel
9772222f41
Add instruction level dominates(A,B) interface.
...
llvm-svn: 37504
2007-06-07 23:52:40 +00:00
Devang Patel
3daf3625ab
Do not use ETForest as well as DomiantorTree. DominatorTree is sufficient.
...
llvm-svn: 37501
2007-06-07 22:17:16 +00:00
Devang Patel
a466c96f77
Use DominatorTree instead of ETForest.
...
This allows faster immediate domiantor walk.
llvm-svn: 37500
2007-06-07 21:57:03 +00:00
Devang Patel
3aece48470
Add basic block level properlyDominates(A,B) interface.
...
llvm-svn: 37497
2007-06-07 21:34:22 +00:00
Devang Patel
e63f8b85f7
Add BasicBlock level dominates(A,B) interface.
...
llvm-svn: 37493
2007-06-07 18:39:40 +00:00
Devang Patel
babcd06827
Maintain ETNode as part of DomTreeNode.
...
This adds redundancy for now.
llvm-svn: 37492
2007-06-07 17:47:21 +00:00
Evan Cheng
4de6599e83
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
a1ad601255
add accessor
...
llvm-svn: 37453
2007-06-06 01:22:09 +00:00
Devang Patel
782ec1fbbb
Break friendship.
...
llvm-svn: 37450
2007-06-06 00:59:48 +00:00
Devang Patel
59091c81b6
Rename.
...
llvm-svn: 37448
2007-06-06 00:49:02 +00:00
Devang Patel
43c684a62d
Simplify class hierarchy.
...
llvm-svn: 37447
2007-06-06 00:46:36 +00:00
Devang Patel
61661c6774
Avoid non-trivial loop unswitching while optimizing for size.
...
llvm-svn: 37446
2007-06-06 00:21:03 +00:00
Zhou Sheng
09b12fef98
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
ba29e5e591
s/ETNode::getChildren/ETNode::getETNodeChildren/g
...
llvm-svn: 37426
2007-06-04 23:45:02 +00:00
Devang Patel
3ad9b9f927
Add FIXMEs.
...
llvm-svn: 37417
2007-06-04 17:38:00 +00:00
Devang Patel
8faaa37b1a
Remove unused method.
...
llvm-svn: 37416
2007-06-04 16:49:36 +00:00
Devang Patel
74785c1f3c
s/DominatorTree::createNewNode/DominatorTree::addNewBlock/g
...
llvm-svn: 37415
2007-06-04 16:43:25 +00:00
Devang Patel
26d8a86df7
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
0dbe4d04db
Move ReplaceUsesOfBlockWith() out of BranchFolding into a MachineBasicBlock general facility.
...
llvm-svn: 37408
2007-06-04 06:44:01 +00:00
Devang Patel
2ef6caf14f
s/llvm::DominatorTreeBase::DomTreeNode/llvm::DomTreeNode/g
...
llvm-svn: 37407
2007-06-04 00:32:22 +00:00
Devang Patel
d58b82f83a
s/DominatorTreeBase::Node/DominatorTreeBase:DomTreeNode/g
...
llvm-svn: 37403
2007-06-03 06:26:14 +00:00
Duncan Sands
f37bc8207e
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
37925d3f39
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
0dc7a8cac6
Target specific ifcvt code duplication limit.
...
llvm-svn: 37384
2007-06-01 08:25:24 +00:00
Chris Lattner
72e07238ba
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
1ba04f7d87
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
d765ae21f7
Put GVN-PRE in all the right places.
...
llvm-svn: 37352
2007-05-29 23:36:32 +00:00
Evan Cheng
d8b25a2091
Add missing const qualifiers.
...
llvm-svn: 37341
2007-05-29 18:35:22 +00:00
Chris Lattner
da86fddf1f
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
3eb349409f
Disable Tail Merging for now.
...
llvm-svn: 37329
2007-05-25 01:00:24 +00:00
Dan Gohman
2c5d31ee81
Minor comment cleanups.
...
llvm-svn: 37321
2007-05-24 14:36:04 +00:00
Devang Patel
bf5c49f62c
Add dump() routines for debugging assistance.
...
llvm-svn: 37314
2007-05-23 19:55:36 +00:00
Anton Korobeynikov
0f184e86ab
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
f2d1d0124e
Add a couple of target hooks for predication.
...
llvm-svn: 37306
2007-05-23 07:19:12 +00:00
Chris Lattner
3928e8e16d
make these accessors private.
...
llvm-svn: 37302
2007-05-23 05:46:04 +00:00
Dale Johannesen
738f94210c
name change requested by review of previous patch
...
llvm-svn: 37289
2007-05-22 18:31:04 +00:00
Dale Johannesen
fe0fe14411
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
7d3f771e9c
Consistency.
...
llvm-svn: 37274
2007-05-22 01:21:58 +00:00
Chris Lattner
5565c09a5b
better portability for intptr_t.
...
llvm-svn: 37221
2007-05-18 07:07:05 +00:00
Evan Cheng
234aab208a
RemoveBranch() and InsertBranch() now returns number of instructions deleted / inserted.
...
llvm-svn: 37192
2007-05-18 00:05:48 +00:00
Evan Cheng
3ce37e8d78
Fix comment.
...
llvm-svn: 37191
2007-05-18 00:00:30 +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
Dan Gohman
98860888df
Correct a name in a comment.
...
llvm-svn: 37178
2007-05-17 21:30:39 +00:00
Chris Lattner
c68a1721c2
silence some "comparison between signed and unsigned integer expressions"
...
warnings
llvm-svn: 37177
2007-05-17 20:01:40 +00:00
Dan Gohman
2340529c17
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
dc9e574073
Remove. Not needed.
...
llvm-svn: 37139
2007-05-17 00:11:35 +00:00
Evan Cheng
3163b77d5e
Add target hook to specify block size limit for if-conversion.
...
llvm-svn: 37134
2007-05-16 23:45:53 +00:00
Evan Cheng
973f4a19cb
PredicateInstruction returns true if the operation was successful.
...
llvm-svn: 37124
2007-05-16 21:53:07 +00:00
Evan Cheng
3b10540b5e
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
db7986458d
add missing mmx intrinsic
...
llvm-svn: 37099
2007-05-16 06:03:49 +00:00
Evan Cheng
770584a8cd
Fix comments.
...
llvm-svn: 37096
2007-05-16 05:09:34 +00:00
Evan Cheng
aafca4d4a2
Initial commit of (very basic) if converter.
...
llvm-svn: 37092
2007-05-16 02:00:57 +00:00
Evan Cheng
7fe6d7cb7e
Add TargetInstrInfo predication hooks.
...
llvm-svn: 37091
2007-05-16 01:58:56 +00:00
Evan Cheng
eea85a767e
Added getNumExplicitOperands and findFirstPredOperand.
...
llvm-svn: 37064
2007-05-15 01:26:09 +00:00
Evan Cheng
71c4d42bd7
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
b0fd1c9640
Correct a comment.
...
llvm-svn: 37058
2007-05-15 00:20:13 +00:00
Evan Cheng
e9e48bcf28
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
17cd3485e1
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
1fba6fb9a8
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
82c4362a67
update comments
...
llvm-svn: 37027
2007-05-14 01:54:16 +00:00
Reid Spencer
a17d02ad08
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
100919126f
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
7daaf71b29
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
19d23d8595
Remove forward-declarations for classes that don't exist.
...
llvm-svn: 36993
2007-05-11 21:05:57 +00:00
Dan Gohman
c0617dde90
Add explicit keywords to several constructors that now have one argument.
...
llvm-svn: 36992
2007-05-11 21:04:48 +00:00
Dan Gohman
fad75ac3af
Simplify BranchInst::getSuccessor, avoiding a conditional operator.
...
llvm-svn: 36991
2007-05-11 20:59:29 +00:00
Anton Korobeynikov
0a29b65e0c
Allow multiple invokes per landing pad. This (probably) fixes PR1410.
...
llvm-svn: 36977
2007-05-10 22:34:59 +00:00
Evan Cheng
855b26b72e
Eliminate MarkVirtRegAliveInBlock recursion.
...
llvm-svn: 36943
2007-05-08 19:00:00 +00:00
Evan Cheng
abe2299a19
Add MachineBasicBlock preds / succs reverse iterators.
...
llvm-svn: 36942
2007-05-08 18:55:03 +00:00
Chris Lattner
114dad2f8f
update comments, no functionality change
...
llvm-svn: 36929
2007-05-08 05:38:32 +00:00
Jeff Cohen
2e8263c013
Unbreak VC++ build.
...
llvm-svn: 36901
2007-05-07 15:21:46 +00:00
Chris Lattner
112d26a164
Enhance MemoryBuffer to return error messages in strings if they occur.
...
llvm-svn: 36899
2007-05-06 23:32:36 +00:00
Chris Lattner
5ca60f2489
remove bytecode headers
...
llvm-svn: 36885
2007-05-06 19:47:36 +00:00
Chris Lattner
7dbcbe7af5
remove dead header
...
llvm-svn: 36884
2007-05-06 19:46:23 +00:00
Nick Lewycky
c2306ff5b4
Fix typo in comment.
...
llvm-svn: 36873
2007-05-06 13:37:16 +00:00
Chris Lattner
6cfc34329b
Move this here from Bytecode/Archive.h
...
llvm-svn: 36865
2007-05-06 09:14:53 +00:00
Chris Lattner
87753518a9
allow zero-length arrays
...
llvm-svn: 36863
2007-05-06 08:22:10 +00:00
Chris Lattner
37779a0b4c
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
ae80a1de2f
add support for identifying bitcode files
...
llvm-svn: 36845
2007-05-06 05:30:10 +00:00
Chris Lattner
cee444cf93
Add a helper that either opens a file or stdin.
...
llvm-svn: 36835
2007-05-06 04:41:59 +00:00
Jeff Cohen
0b108b4f29
Make code more 64-bit aware.
...
llvm-svn: 36833
2007-05-06 03:24:19 +00:00
Jeff Cohen
ce844b2aaa
Unbreak VC++.
...
llvm-svn: 36831
2007-05-06 03:12:47 +00:00
Chris Lattner
bf23240f44
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
c9ca38fedf
add inline asm code
...
llvm-svn: 36826
2007-05-06 01:50:11 +00:00
Chris Lattner
2753e54f7b
Fix a subtle bug that prevented round-tripping 470.lbm
...
llvm-svn: 36825
2007-05-06 01:43:38 +00:00
Chris Lattner
6d0c5eb739
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
34b256e1a6
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
9818d0a7e6
fix a bug I introduced when I merged some code together
...
llvm-svn: 36813
2007-05-05 23:40:48 +00:00
Anton Korobeynikov
ce48606d7a
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
7d16cb364d
minor bugfix
...
llvm-svn: 36777
2007-05-05 07:20:34 +00:00
Chris Lattner
cedc5577f2
add a 6-bit encoding type for strings.
...
llvm-svn: 36770
2007-05-05 01:15:42 +00:00
Chris Lattner
eca2bb1334
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
e2b2272c53
use a template to eliminate manual code duplication
...
llvm-svn: 36757
2007-05-04 20:40:50 +00:00
Bill Wendling
dc82c5a195
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
75b84adf6b
add support for array abbreviations.
...
llvm-svn: 36754
2007-05-04 20:33:47 +00:00
Chris Lattner
a4aa2e9b7a
eliminate lengths from record bodies
...
llvm-svn: 36751
2007-05-04 19:10:48 +00:00
Chris Lattner
4e0c6003b7
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
f0086ffafa
refcount BitCodeAbbrev objects
...
llvm-svn: 36747
2007-05-04 17:35:19 +00:00
Chris Lattner
da3b0264f7
if functiontype is going to have a pointer to a paramattr object, it better
...
be const. The only way to get a pointer to these returns a const pointer.
llvm-svn: 36734
2007-05-04 03:39:28 +00:00
Chris Lattner
b973c9b64e
add a helper
...
llvm-svn: 36729
2007-05-04 03:13:39 +00:00
Chris Lattner
bb8d1755f6
remove unused code
...
llvm-svn: 36727
2007-05-04 03:01:46 +00:00
Chris Lattner
2d0c97d9a1
add new codes
...
llvm-svn: 36725
2007-05-04 03:00:00 +00:00
Chris Lattner
43c70c8404
add a new code
...
llvm-svn: 36703
2007-05-03 22:16:11 +00:00
Jeff Cohen
d59084b6f6
Unbreak VC++ build.
...
llvm-svn: 36700
2007-05-03 22:09:21 +00:00
Devang Patel
e0b9bd0e49
Use iterative while loop instead of recursive function call.
...
llvm-svn: 36694
2007-05-03 20:55:18 +00:00
Dan Gohman
793c6e2d5e
Use the explicit keyword for the SCEV class' constructor.
...
llvm-svn: 36686
2007-05-03 18:45:06 +00:00
Chris Lattner
49b1ec44eb
This is a patch to fix a compile error in STLExtras.h, and
...
a bug in GraphWriter.cpp.
Patch by Florian Brandner
llvm-svn: 36684
2007-05-03 18:32:10 +00:00
Chris Lattner
8b4f0920ab
remove extraneous type qualifiers
...
llvm-svn: 36679
2007-05-03 18:14:56 +00:00
Chris Lattner
fb7a009708
remove extraneous top-level semi's
...
llvm-svn: 36678
2007-05-03 18:13:15 +00:00
Chris Lattner
060e3be47e
remove two useless functions. Just inherit Type's implementation instead.
...
llvm-svn: 36677
2007-05-03 17:10:20 +00:00
Chris Lattner
d710ec51bf
remove useless type qualifiers
...
llvm-svn: 36676
2007-05-03 17:09:36 +00:00
Chris Lattner
5f70561cc5
avoid invalid C++ token in #error
...
llvm-svn: 36674
2007-05-03 16:57:26 +00:00
Devang Patel
cd45427a87
Drop 'const'
...
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Chris Lattner
a3d01187b7
Add a new option.
...
llvm-svn: 36657
2007-05-03 00:16:07 +00:00
Devang Patel
8ee9065162
Use 'static const char' instead of 'static const int'.
...
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.
llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel
32786f1037
Re-install patch to enable use of PassID.
...
I am preparing another patch to address the failure that prompted
Chris to revert this patch earlier.
llvm-svn: 36649
2007-05-02 20:38:25 +00:00
Chris Lattner
79333821da
update to reflect reality
...
llvm-svn: 36643
2007-05-02 05:47:22 +00:00
Chris Lattner
055c13234b
revert enough of devang's recent patches to get the tree basically working again
...
llvm-svn: 36638
2007-05-02 04:25:31 +00:00
Anton Korobeynikov
6e6bfcaf4d
Fix couple of bugs connected with eh info:
...
1. Correct output offsets on Linux
2. Fix "style" of personality function. It shouldn't be indirect.
llvm-svn: 36633
2007-05-01 22:23:12 +00:00
Devang Patel
38a66bc82e
Do not use typeinfo to identify pass in pass manager.
...
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Evan Cheng
e7bd8c76db
Pass call frame setup SP adjustment along to eliminateFrameIndex().
...
llvm-svn: 36624
2007-05-01 08:59:18 +00:00
Evan Cheng
65f0ba62d5
Add SPAdj parameter to account for call frame setup SP adjustment.
...
llvm-svn: 36623
2007-05-01 08:58:27 +00:00
Nate Begeman
767ee95d29
llvm bug #1350 , parts 1, 2, and 3.
...
llvm-svn: 36618
2007-05-01 05:57:02 +00:00
Chris Lattner
21e0d64a6e
several bitfixes to JumpToBit
...
llvm-svn: 36616
2007-05-01 05:51:32 +00:00
Chris Lattner
eb2a5f5f99
add JumpToBit, an explicit init method, and a default ctor.
...
llvm-svn: 36613
2007-05-01 04:59:06 +00:00
Chris Lattner
92eca49c3f
add missing opcode.
...
llvm-svn: 36608
2007-05-01 02:12:05 +00:00
Evan Cheng
34e61fc3cd
Added hook hasReservedCallFrame(). It returns true if the call frame is
...
included as part of the stack frame.
llvm-svn: 36606
2007-05-01 00:47:46 +00:00
Christopher Lamb
799da3f145
Implement review feedback.
...
llvm-svn: 36603
2007-04-30 23:54:10 +00:00
Christopher Lamb
b8a156a82e
Header file for ELF relocations.
...
llvm-svn: 36597
2007-04-30 20:41:08 +00:00
Anton Korobeynikov
14376967ac
Fix comment
...
llvm-svn: 36596
2007-04-30 19:14:56 +00:00
Reid Spencer
db43279e9a
If an archive is not recognized as an LLVM bytecode archive then declare
...
that it is native so that the linker will pass it on downstream. This avoids
a problem where the native link line fails because there is both a .so and
a .a file. The .a file gets processed as bytecode and then dropped from the
command line.
llvm-svn: 36584
2007-04-30 00:29:39 +00:00
Chris Lattner
31d1dec66d
add some helpers
...
llvm-svn: 36580
2007-04-29 21:49:05 +00:00
Chris Lattner
8a40d39a8e
compute this value correctly
...
llvm-svn: 36575
2007-04-29 19:49:58 +00:00
Dale Johannesen
1ee5f128f6
Make ARM-specific version of getInlineAsmLength
...
llvm-svn: 36572
2007-04-29 19:17:45 +00:00
Chris Lattner
d61ccde429
add a method
...
llvm-svn: 36571
2007-04-29 19:17:32 +00:00
Anton Korobeynikov
3d95e52ea2
Implement protected visibility. This partly implements PR1363. Linker
...
should be taught to deal with protected symbols.
llvm-svn: 36565
2007-04-29 18:35:00 +00:00
Anton Korobeynikov
cb2004f82c
Implement review feedback
...
llvm-svn: 36564
2007-04-29 18:02:48 +00:00
Chris Lattner
631dd78a41
Jeff's fix was fine
...
llvm-svn: 36563
2007-04-29 17:44:10 +00:00
Chris Lattner
2e9010f6e6
add missing ctor
...
llvm-svn: 36562
2007-04-29 17:40:50 +00:00
Jeff Cohen
7cfc4b404f
Fix MemoryBuffer breakage correctly.
...
llvm-svn: 36561
2007-04-29 14:43:31 +00:00
Chris Lattner
8308e85781
make this file self-contained
...
llvm-svn: 36555
2007-04-29 08:05:07 +00:00
Chris Lattner
eee1022086
Switch the bitcode reader interface to take a MemoryBuffer instead of knowing
...
anything about disk I/O itself. This greatly simplifies its interface -
eliminating the need for the ReaderWrappers.cpp file.
This adds a new option to llvm-dis (-bitcode) which instructs it to read
the input file as bitcode. Until/unless the bytecode reader is taught to
read from MemoryBuffer, there is no way to handle stdin reading without it.
I don't plan to switch the bytecode reader over, I'd rather delete it :),
so the option will stay around temporarily.
llvm-svn: 36554
2007-04-29 07:54:31 +00:00
Chris Lattner
4749cca517
Add a new memorybuffer class, to unify all the file reading code in the system
...
llvm-svn: 36553
2007-04-29 06:58:52 +00:00
Chris Lattner
ad7a365974
new method for creating a path, which does not create a temporary string.
...
llvm-svn: 36552
2007-04-29 06:16:32 +00:00
Anton Korobeynikov
45162c6dad
Implement review feedback. Aliasees can be either GlobalValue's or
...
bitcasts of them.
llvm-svn: 36537
2007-04-28 13:45:00 +00:00
Chris Lattner
5bc24967c1
add a default parameter
...
llvm-svn: 36529
2007-04-28 05:42:38 +00:00
Chris Lattner
ab3ae8dd2f
add a way to make this less brittle
...
llvm-svn: 36528
2007-04-28 05:38:52 +00:00
Chris Lattner
0b40f6db6c
represent indirect operands explicitly in inline asm strings.
...
llvm-svn: 36522
2007-04-28 01:02:58 +00:00
Chris Lattner
9bfe8f4517
add a GEP helper function
...
llvm-svn: 36515
2007-04-27 20:35:56 +00:00
Jeff Cohen
adae970e06
Fix prolific source of 'possible loss of data' warnings.
...
llvm-svn: 36507
2007-04-27 14:43:05 +00:00
Devang Patel
e7e2cb2826
Move ~Pass() from Pass.h into Pass.cpp
...
llvm-svn: 36498
2007-04-26 21:33:42 +00:00
Devang Patel
2becf3a0a4
Delete Analysis Resolver.
...
llvm-svn: 36493
2007-04-26 21:06:41 +00:00
Dan Gohman
bda4470e76
Fix a typo in a comment.
...
llvm-svn: 36485
2007-04-26 19:40:56 +00:00
Evan Cheng
eff332e3e1
Rename findRegisterUseOperand to findRegisterUseOperandIdx to avoid confusion.
...
llvm-svn: 36483
2007-04-26 19:00:32 +00:00
Jeff Cohen
34d6dc5574
Rename identifier that GCC uses as a macro, breaking llvm-gcc build.
...
llvm-svn: 36474
2007-04-26 15:07:47 +00:00
Chris Lattner
e1248f05f2
start defining codes for instructions
...
llvm-svn: 36471
2007-04-26 05:53:04 +00:00
Chris Lattner
4721ac3ee0
add a new code
...
llvm-svn: 36462
2007-04-26 03:26:26 +00:00
Chris Lattner
4a0785ffcd
add alias support to bitcode
...
llvm-svn: 36460
2007-04-26 02:46:23 +00:00
Evan Cheng
cfa2a787f7
Be careful when to add implicit kill / dead operands. Don't add them during / post reg-allocation.
...
llvm-svn: 36458
2007-04-26 01:40:09 +00:00
Evan Cheng
132ea465a1
Change UsedPhysRegs from array bool to BitVector to save some space. Setting / getting its states now go through MachineFunction.
...
llvm-svn: 36451
2007-04-25 22:10:09 +00:00
Evan Cheng
e464e596a6
Data structure change to improve compile time (especially in debug mode).
...
llvm-svn: 36447
2007-04-25 19:34:00 +00:00
Devang Patel
6a358e5694
Mem2Reg does not need TargetData.
...
llvm-svn: 36446
2007-04-25 18:41:11 +00:00
Devang Patel
b6ef7bc5d9
Remove unused function argument.
...
llvm-svn: 36441
2007-04-25 17:15:20 +00:00
Anton Korobeynikov
d9de1e8852
Add missed file
...
llvm-svn: 36439
2007-04-25 16:42:39 +00:00
Anton Korobeynikov
25dc9a61cb
Implement aliases. This fixes PR1017 and it's dependent bugs. CFE part
...
will follow.
llvm-svn: 36435
2007-04-25 14:27:10 +00:00
Evan Cheng
e884f9cb2a
Fix for PR1306.
...
- A register def / use now implicitly affects sub-register liveness but does
not affect liveness information of super-registers.
- Def of a larger register (if followed by a use later) is treated as
read/mod/write of a smaller register.
llvm-svn: 36434
2007-04-25 07:30:23 +00:00
Evan Cheng
46096a692c
Test if a register is sub- or super-register of another.
...
llvm-svn: 36433
2007-04-25 07:24:50 +00:00
Evan Cheng
7edd354721
Minor speed tweak.
...
llvm-svn: 36432
2007-04-25 07:24:13 +00:00
Chris Lattner
893d87cda5
support for >4G frames
...
llvm-svn: 36424
2007-04-25 04:29:06 +00:00
Chris Lattner
a2b590fff8
support > 4G stack objects
...
llvm-svn: 36422
2007-04-25 04:20:54 +00:00
Chris Lattner
4a45c98b6f
allow 64-bit stack objects
...
llvm-svn: 36419
2007-04-25 04:07:31 +00:00
Bill Wendling
498c102df6
Add the final MMX instructions. Correct a few wrong patterns.
...
llvm-svn: 36405
2007-04-24 21:18:37 +00:00
Chris Lattner
61f8d0e81c
comentate
...
llvm-svn: 36395
2007-04-24 15:54:42 +00:00
Chris Lattner
5ae162a9d2
add records for constant exprs
...
llvm-svn: 36393
2007-04-24 07:03:08 +00:00
Chris Lattner
ea07262cc5
add codes for constants table
...
llvm-svn: 36382
2007-04-23 23:29:59 +00:00
Christopher Lamb
872116a106
Fix bug in isFloatingPoint()
...
llvm-svn: 36381
2007-04-23 22:50:40 +00:00
Chris Lattner
b6ae31a101
add a missing operator
...
llvm-svn: 36375
2007-04-23 20:58:14 +00:00
Chris Lattner
8f45aa08fa
Fix a bug in bitstream writer handling abbrevs, add value symtab
...
llvm-svn: 36373
2007-04-23 20:34:46 +00:00
Chris Lattner
193294e642
implement reading of abbrevs
...
llvm-svn: 36366
2007-04-23 18:57:58 +00:00
Chris Lattner
38568c7454
minor cleanups
...
llvm-svn: 36365
2007-04-23 18:57:32 +00:00
Chris Lattner
69a8eda44d
finish implementation of basic abbrev writing.
...
llvm-svn: 36364
2007-04-23 17:43:52 +00:00
Chris Lattner
5510ac5a56
first part of implementation of abbrevs. The writer isn't fully there yet and the
...
reader doesn't handle them at all yet.
llvm-svn: 36363
2007-04-23 16:04:05 +00:00
Chris Lattner
1aa0ae26a8
promote this to being a public header.
...
llvm-svn: 36357
2007-04-23 01:01:15 +00:00
Christopher Lamb
a157874a8a
PR400 phase 2. Propagate attributed load/store information through DAGs.
...
llvm-svn: 36356
2007-04-22 23:15:30 +00:00
Christopher Lamb
041ee2a78d
PR400 phase 1 implementation feedback.
...
llvm-svn: 36354
2007-04-22 22:22:02 +00:00
Jeff Cohen
726786aa76
Have compiler enforce this.
...
llvm-svn: 36353
2007-04-22 22:16:55 +00:00
Christopher Lamb
5606cd66e2
PR400 work phase 1. Add attributed load/store instructions for volatile/align to LLVM.
...
llvm-svn: 36349
2007-04-22 19:24:39 +00:00
Jeff Cohen
577e8b8c63
Fix build problem with Gentoo 4.1.1-r3.
...
llvm-svn: 36348
2007-04-22 18:49:32 +00:00
Reid Spencer
4169952dab
For PR1136:
...
Add reference counting to ParamAttrsList and make use of it in Function,
CallInst and InvokeInst classes.
llvm-svn: 36346
2007-04-22 17:28:03 +00:00
Reid Spencer
bcf9c262e7
Terminate with newline.
...
llvm-svn: 36345
2007-04-22 16:31:22 +00:00
Reid Spencer
5e886278ba
Undo premature commit.
...
llvm-svn: 36344
2007-04-22 16:30:47 +00:00
Reid Spencer
f2bf7ece0f
Terminate file with newline.
...
llvm-svn: 36343
2007-04-22 16:29:35 +00:00
Jeff Cohen
abe7ce99f0
Implement review feedback.
...
llvm-svn: 36342
2007-04-22 15:11:24 +00:00
Jeff Cohen
2cf2830f4d
Teach Visual Studio about Bitcode.
...
llvm-svn: 36341
2007-04-22 15:00:52 +00:00
Chris Lattner
97852839f7
Define the content-independent interfaces to read/write bitcode files and
...
the high-level interface to read/write LLVM IR bitcode files.
This is a work in progress.
llvm-svn: 36329
2007-04-22 06:22:05 +00:00
Reid Spencer
4721577334
For PR1146:
...
Make ParamAttrsList objects unique. You can no longer directly create or
destroy them but instead must go through the ParamAttrsList::get()
interface.
llvm-svn: 36327
2007-04-22 05:46:44 +00:00
Lauro Ramos Venancio
3b60b9546e
X86 TLS: Implement review feedback.
...
llvm-svn: 36318
2007-04-21 20:56:26 +00:00
Reid Spencer
81070d52da
Revert Christopher Lamb's load/store alignment changes.
...
llvm-svn: 36309
2007-04-21 18:36:27 +00:00
Jeff Cohen
5b012f8b7f
Make enum-valued bitfield large enough to avoid interpretation as negative values in VC++.
...
llvm-svn: 36304
2007-04-21 16:29:37 +00:00
Jeff Cohen
facf6d55d3
Fix breakage of bytecode reader when built with VC++.
...
llvm-svn: 36303
2007-04-21 15:29:13 +00:00
Jeff Cohen
193124f5f1
The expression "SubclassData = (SubclassData & ~1) | (V) ? 1 : 0;" does not do what
...
was intended! | has higher precedence than ?. Caught by Visual Studio.
llvm-svn: 36302
2007-04-21 14:32:59 +00:00
Christopher Lamb
b56b6a7ad7
add support for alignment attributes on load/store instructions
...
llvm-svn: 36301
2007-04-21 08:16:25 +00:00
Owen Anderson
2767bc3188
Fix some null checks to actually test the part that needs checking.
...
llvm-svn: 36298
2007-04-21 07:04:45 +00:00
Evan Cheng
05a82b68e8
Add super-register set.
...
llvm-svn: 36295
2007-04-21 00:54:06 +00:00
Chris Lattner
4928ec0460
Fix a problem where primitive types lose their name after llvm_shutdown is called.
...
This also reduces the amount of work done at static construction time.
llvm-svn: 36285
2007-04-20 22:33:47 +00:00
Lauro Ramos Venancio
bc32d90b46
Implement "general dynamic", "initial exec" and "local exec" TLS models for
...
X86 32 bits.
llvm-svn: 36283
2007-04-20 21:38:10 +00:00
Evan Cheng
1835371d44
Add sub-registers set accessor.
...
llvm-svn: 36282
2007-04-20 21:28:05 +00:00
Evan Cheng
9ade37c2f1
Add sub-register sets.
...
llvm-svn: 36277
2007-04-20 21:11:22 +00:00
Owen Anderson
41b527b75f
Move more passes to using ETForest instead of DominatorTree.
...
llvm-svn: 36271
2007-04-20 06:27:13 +00:00
Owen Anderson
e49ca2c78b
Add null checks and const-ify these accessors.
...
llvm-svn: 36270
2007-04-20 05:44:16 +00:00
Chris Lattner
2ba953680f
Fix a very strange assertion message, patch by Christopher Lamb
...
CVS: ----------------------------------------------------------------------
llvm-svn: 36267
2007-04-20 03:27:36 +00:00
Jeff Cohen
ac369daaa3
Fix some VC++ warnings.
...
llvm-svn: 36259
2007-04-19 02:04:09 +00:00
Owen Anderson
c08636e1f0
Add accessor to get the blocks immediately dominated by a given block to ETForest.
...
llvm-svn: 36251
2007-04-18 05:25:09 +00:00
Evan Cheng
fbbdb92c9d
VarInfo::UsedBlocks is no longer used. Remove.
...
llvm-svn: 36250
2007-04-18 05:04:38 +00:00
Owen Anderson
7553394275
Add an accessor to make ETForest more useful.
...
llvm-svn: 36246
2007-04-18 04:38:39 +00:00
Evan Cheng
1325999a14
Don't populate TryAgainList when coalescing only physical registers with virtual registers.
...
llvm-svn: 36240
2007-04-18 02:30:19 +00:00
Chris Lattner
2411bc5af8
what's an & between friends?
...
llvm-svn: 36234
2007-04-18 00:43:05 +00:00
Evan Cheng
48352d7a71
Copy coalescing change to prevent a physical register from being pin to a
...
long live interval that has low usage density.
1. Change order of coalescing to join physical registers with virtual
registers first before virtual register intervals become too long.
2. Check size and usage density to determine if it's worthwhile to join.
3. If joining is aborted, assign virtual register live interval allocation
preference field to the physical register.
4. Register allocator should try to allocate to the preferred register
first (if available) to create identify moves that can be eliminated.
llvm-svn: 36218
2007-04-17 20:32:26 +00:00
Evan Cheng
c5d2df366a
Add a register allocation preference field; add a method to compute size of a live interval.
...
llvm-svn: 36216
2007-04-17 20:25:11 +00:00
Evan Cheng
023342b277
Change getAllocatableSet() so it returns allocatable registers for a specific register class.
...
llvm-svn: 36215
2007-04-17 20:23:34 +00:00
Evan Cheng
94e0223e55
Keep track of number of uses within the function per virtual register.
...
llvm-svn: 36214
2007-04-17 20:22:11 +00:00
Chris Lattner
4a83860eea
Commit an patch from Gabor Greif in Mar 2005. This eliminates the tail
...
pointer from ilist, storing it in the prev pointer of the first node in the
list instead.
This shrinks ilist from 8 to 4 bytes, BasicBlock from 40->36 bytes, Function
from 76->68 bytes, Module from 52->44 bytes.
llvm-svn: 36210
2007-04-17 18:41:42 +00:00
Chris Lattner
77b13b351b
make getnext/getprev accessors private.
...
llvm-svn: 36209
2007-04-17 18:30:41 +00:00
Chris Lattner
3bc0ec8776
make next/prev accessors private
...
llvm-svn: 36207
2007-04-17 18:16:39 +00:00
Chris Lattner
23ea4ce93b
bool on darwin/ppc is 4 bytes.
...
llvm-svn: 36206
2007-04-17 18:15:04 +00:00
Chris Lattner
917d8832a1
Instruction:: Next/Prev accessors are now private
...
llvm-svn: 36204
2007-04-17 18:03:55 +00:00
Anton Korobeynikov
9bc4b792bf
Implemented correct stack probing on mingw/cygwin for dynamic alloca's.
...
Also, fixed static case in presence of eax livin. This fixes PR331
PS: Why don't we still have push/pop instructions? :)
llvm-svn: 36195
2007-04-17 09:20:00 +00:00
Jeff Cohen
5780312029
Fix build breakage on 64-bit systems.
...
llvm-svn: 36193
2007-04-17 05:33:04 +00:00
Chris Lattner
db7de8e497
merge several fields in GlobalValue to use the same word, move CallingConv
...
field into SubclassData in Value. This shrinks GlobalVAlue from 48->40
bytes, Function from 88->76, and GlobalVariable from 76->68. This trims
4640 bytes off my testcase, reading a bc file without materializing any
functions.
llvm-svn: 36192
2007-04-17 04:31:29 +00:00
Chris Lattner
cc56e116fe
The (negative) offset from a SymbolTableListTraits-using ilist to its container
...
object is always constant. As such, evaluate it at compile time instead of storing
it as an ivar in SymbolTableListTraits. This shrinks every SymbolTableListTraits
ilist by a word, shrinking BasicBlock from 44->40 bytes, Function from 96->88 bytes,
and Module from 60->52 bytes.
llvm-svn: 36189
2007-04-17 04:04:14 +00:00
Chris Lattner
71a21677f4
Refactor SymbolTableListTraits to only have a single pointer in it, instead
...
of two. This shrinkifies Function by 8 bytes (104->96) and Module by 8
bytes (68->60). On a testcase of mine, this reduces the memory used to
read a module header from 565680b to 561024, a little over 4K.
llvm-svn: 36188
2007-04-17 03:26:42 +00:00
Chris Lattner
3c118ffaf7
urr, yeah.
...
llvm-svn: 36187
2007-04-17 02:04:39 +00:00
Reid Spencer
e8cf6202ec
Fix 80 col violations.
...
llvm-svn: 36168
2007-04-16 21:24:12 +00:00
Devang Patel
af0b4b4191
Proivde getAnalysis<FPAnalysis>(Func) support.
...
llvm-svn: 36159
2007-04-16 20:56:24 +00:00
Devang Patel
c1010840fa
Give each pass manager chance to manage lower level analysis pass, which is
...
pass required by one of pass managed by the manager.
llvm-svn: 36153
2007-04-16 20:12:57 +00:00
Devang Patel
a76dce77d9
Add getPotentialPassManagerType(). No functionality change, yet.
...
llvm-svn: 36149
2007-04-16 18:51:25 +00:00
Anton Korobeynikov
f3e62a428a
Removed tabs everywhere except autogenerated & external files. Add make
...
target for tabs checking.
llvm-svn: 36146
2007-04-16 18:10:23 +00:00
Reid Spencer
f12ab5a55b
For PR1328:
...
Don't assert everytime an intrinsic name isn't recognized. Instead, make
the assert optional when callin getIntrinsicID(). This allows the assembler
to handle invalid intrinsic names gracefully.
llvm-svn: 36120
2007-04-16 06:54:34 +00:00
Owen Anderson
b371956400
Tabs -> Spaces
...
llvm-svn: 36094
2007-04-15 23:14:18 +00:00
Owen Anderson
ea857029ea
Remove ImmediateDominator analysis. The same information can be obtained from DomTree. A lot of code for
...
constructing ImmediateDominator is now folded into DomTree construction.
This is part of the ongoing work for PR217.
llvm-svn: 36063
2007-04-15 08:47:27 +00:00
Owen Anderson
41582c8198
Make ETForest depend on DomTree rather than IDom. This is the first step
...
in the long process that will be fixing PR 217.
llvm-svn: 36034
2007-04-14 23:49:24 +00:00
Jeff Cohen
5a502fb622
Fix PR1329.
...
llvm-svn: 36016
2007-04-14 21:50:21 +00:00
Chris Lattner
5ed58fc4a9
add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method.
...
Writing it twice in the same day was too much for me.
llvm-svn: 35978
2007-04-14 00:12:57 +00:00
Reid Spencer
6e7854339e
Implement a getBitsNeeded method to determine how many bits are needed to
...
represent a string in binary form by an APInt.
llvm-svn: 35968
2007-04-13 19:19:07 +00:00
Dan Gohman
2d4b1767ab
Rename Value::getValueType to getValueID, to avoid confusion with
...
other things named getValueType.
llvm-svn: 35964
2007-04-13 18:12:09 +00:00
Chris Lattner
335f1cb1f8
CSE simple binary expressions when they are inserted. This makes LSR produce
...
less huge code that needs to be cleaned up by sdisel.
llvm-svn: 35959
2007-04-13 05:04:18 +00:00
Lauro Ramos Venancio
a76c2806de
Implement the "thread_local" keyword.
...
llvm-svn: 35950
2007-04-12 18:32:50 +00:00
Reid Spencer
82da0eb67c
For PR1284:
...
Implement the "part_set" intrinsic.
llvm-svn: 35938
2007-04-12 02:48:46 +00:00
Chris Lattner
9564abbfb5
improve the patch for PR1318 to also support grouped options with custom
...
handlers (like the pass list). My previous fix only supported *new* command
line options, not additions to old ones.
This fixes test/Feature/load_module.ll
llvm-svn: 35935
2007-04-12 00:36:29 +00:00
Reid Spencer
2792e203c5
For PR1146:
...
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.
llvm-svn: 35877
2007-04-11 02:44:20 +00:00
Reid Spencer
caf5a6cbd7
Teach sys::Path how to recognize different kinds of object files for ELF
...
and Mach-O systems. Additionally, correct the Mach-O logic code to look at
byte 12 not byte 15. Hopefully this fixes the llvm-ld warning on Darwin.
llvm-svn: 35876
2007-04-11 02:02:09 +00:00
Bill Wendling
3b1189afbf
Add support for our first SSSE3 instruction "pmulhrsw".
...
llvm-svn: 35869
2007-04-10 22:10:25 +00:00
Chris Lattner
5af0826c0b
fix a comment bug Reid noticed
...
llvm-svn: 35864
2007-04-10 16:33:06 +00:00
Chris Lattner
f661523670
add missing methods, mark stuff const
...
llvm-svn: 35862
2007-04-10 07:06:21 +00:00
Chris Lattner
da0e61ca4c
getLimitedValue now just forward to APInt's getLimitedValue. Mark it const.
...
llvm-svn: 35861
2007-04-10 06:44:12 +00:00
Chris Lattner
9359e7f928
add a method
...
llvm-svn: 35860
2007-04-10 06:43:18 +00:00
Reid Spencer
85e4416d26
Drop the "bit" prefix for the part.select intrinsic.
...
llvm-svn: 35854
2007-04-10 02:52:46 +00:00
Chris Lattner
461f7ed33b
remove dead target hooks.
...
llvm-svn: 35847
2007-04-09 23:34:08 +00:00
Chris Lattner
ae6e2c0ee5
remove some dead target hooks, subsumed by isLegalAddressingMode
...
llvm-svn: 35840
2007-04-09 22:27:04 +00:00
Chris Lattner
b31e6eee0c
add a default ctor for AddrMode.
...
llvm-svn: 35832
2007-04-09 21:18:34 +00:00
Reid Spencer
93a57ef458
For PR1146:
...
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory
leaks. This will change when ParamAttrsList is uniquified but needs to
be correct until then.
llvm-svn: 35824
2007-04-09 18:00:57 +00:00
Reid Spencer
d2380cfb76
For PR1146:
...
* Add ParamAttrList pointers to Function and CallInst.
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp
llvm-svn: 35818
2007-04-09 15:01:12 +00:00
Anton Korobeynikov
6ee97ee42a
Next stage into switch lowering refactoring
...
1. Fix some bugs in the jump table lowering threshold
2. Implement much better metric for optimal pivot selection
3. Tune thresholds for different lowering methods
4. Implement shift-and trick for lowering small (<machine word
length) cases with few destinations. Good testcase will follow.
llvm-svn: 35816
2007-04-09 12:31:58 +00:00
Reid Spencer
a617889460
For PR1146:
...
Remove the handling of ParameterAttributes from FunctionType as they are
their own object defined in ParameterAttributes.h now.
llvm-svn: 35805
2007-04-09 06:06:57 +00:00
Owen Anderson
e4c29f0b01
Move isReachableFromEntry out of line to avoid an unnecessary #include
...
llvm-svn: 35797
2007-04-09 04:07:36 +00:00
Reid Spencer
135f2f1261
Chris convinced me that the default size of the SmallVector (2) was too
...
small. Since it doesn't cost much to have 2 more (8 bytes), but not having
them would require a malloc as soon as the third one is needed. Setting
the default to 4 delays the malloc until the 5th parameter attribute.
llvm-svn: 35793
2007-04-09 01:53:54 +00:00
Reid Spencer
4ea619ae00
Remove redundancy.
...
llvm-svn: 35790
2007-04-09 01:26:02 +00:00
Owen Anderson
f9a432a613
Cleanup some from my DomSet-removal changes. Add a new
...
isReachableFromEntry
test to ETForest to factor a common test out of code.
llvm-svn: 35786
2007-04-09 00:52:49 +00:00
Reid Spencer
52e3bd1df0
Fix a typo.
...
llvm-svn: 35781
2007-04-08 22:50:29 +00:00
Reid Spencer
bcb7b5ca5d
Implement more feedback:
...
* Allow attributes to be added and removed singly or jointly so that in
the future something like -pruneh can manipulate them more easily.
* Move functions generally only useful for LLVM internals to the end of
the accessors list instead of the beginning.
llvm-svn: 35780
2007-04-08 22:30:27 +00:00
Reid Spencer
065db06580
Implement review feedback.
...
llvm-svn: 35777
2007-04-08 22:05:44 +00:00
Owen Anderson
4b323657b9
Remove DomSet completely. This concludes work on PR1171.
...
llvm-svn: 35775
2007-04-08 21:30:05 +00:00
Reid Spencer
e62f16d5c6
Implement the output inserter for PathWithStatus
...
llvm-svn: 35770
2007-04-08 20:05:10 +00:00
Reid Spencer
8b99493ea3
For PR1146:
...
New header file to provide parameter attribute declarations.
llvm-svn: 35767
2007-04-08 14:46:50 +00:00
Reid Spencer
aad3d1f6c8
For PR1291:
...
Change to use PathWithStatus
llvm-svn: 35746
2007-04-07 19:50:21 +00:00
Reid Spencer
14fb379888
For PR1291:
...
Implement the PathWithStatus class and its use throughout lib/System.
llvm-svn: 35742
2007-04-07 18:52:17 +00:00
Owen Anderson
7cf9d12f2e
Add DomSet back, and revert the changes to LoopSimplify. Apparently the
...
ETForest updating mechanisms don't work as I thought they did. These changes
will be reapplied once the issue is worked out.
llvm-svn: 35741
2007-04-07 18:23:27 +00:00
Nick Lewycky
ec51e934ef
Add signExtend to ConstantRange, to complement zeroExtend and truncate.
...
llvm-svn: 35733
2007-04-07 15:41:33 +00:00
Owen Anderson
85b0e20f2a
Completely purge DomSet. This is the (hopefully) final patch for PR1171.
...
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
Owen Anderson
41bf50021d
Expunge DomSet from CodeExtractor. This is part of the continuing work
...
on PR1171.
llvm-svn: 35726
2007-04-07 05:31:27 +00:00
Chris Lattner
b30cb05d63
add loop rot
...
llvm-svn: 35722
2007-04-07 04:43:02 +00:00
Devang Patel
562df7f986
Add loop rotation pass.
...
llvm-svn: 35714
2007-04-07 01:25:15 +00:00
Chris Lattner
0160bf7114
rearchitect the registration mechanism used by the command line option stuff.
...
This dramatically reduce the amount of memory allocated by the commandline stuff
at static init time, changing it to build local data structures when ParseCommandLineOptions
is called. In a dummy empty program that links some llvm libraries, this reduces
the number of malloc'd bytes from 4864 to 3360 on entry to main. Most of that
memory is now allocated by non-commandline related stuff.
llvm-svn: 35701
2007-04-06 21:06:55 +00:00
Chris Lattner
d0cc2333d1
Switch some vectors to smallvectors. This reduces amount of malloc'd
...
memory that occurs before main starts from 5104 to 4864 bytes with a dummy
example app.
llvm-svn: 35698
2007-04-06 18:36:18 +00:00
Chris Lattner
2f1c6daeae
Eliminate unneeded virtual methods
...
llvm-svn: 35697
2007-04-06 18:06:27 +00:00
Reid Spencer
5d36a01dba
For PR1209:
...
Implement Type class's ContainedTys without using a std::vector.
llvm-svn: 35693
2007-04-06 02:02:20 +00:00
Chris Lattner
4272783ca4
eliminate a virtual method
...
llvm-svn: 35691
2007-04-05 22:21:39 +00:00
Chris Lattner
d33f94f2d2
remove the dead removeArgument method, rename Options to OptionsMap.
...
llvm-svn: 35690
2007-04-05 21:58:17 +00:00
Chris Lattner
d39ae2fa6d
Add a helper class (APSInt) which can represent an APInt along with sign
...
information. This is useful when a value does have a sign associated with
it. This shouldn't be used generally in LLVM for mid-level optimizer stuff.
llvm-svn: 35681
2007-04-05 05:20:11 +00:00
Reid Spencer
6eb55df794
Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
...
llvm-svn: 35678
2007-04-04 23:48:25 +00:00
Lauro Ramos Venancio
2dfc0515a6
Fix release build.
...
llvm-svn: 35676
2007-04-04 22:13:39 +00:00
Anton Korobeynikov
e16f421e0e
Properly emit range comparisons for switch cases, where neighbour cases
...
go to the same destination. Now we're producing really good code for
switch-lower-feature.ll testcase
llvm-svn: 35672
2007-04-04 21:14:49 +00:00
Evan Cheng
a8c9533e3e
Add isFixedObjectIndex. It returns true if the stack slot index is for a fixed stack object.
...
llvm-svn: 35659
2007-04-04 07:38:25 +00:00
Reid Spencer
a54d904575
Make the LinkInFile and LinkInLibrary both return an indication of whether
...
the file was found to be a native library (and thus not linked by these
functions).
llvm-svn: 35652
2007-04-04 06:32:01 +00:00
Reid Spencer
6dc38e6fbd
For PR1302:
...
Make the FileType enumerators more readable and add COFF, ELF and Mach-O.
llvm-svn: 35649
2007-04-04 06:29:49 +00:00
Chris Lattner
5d12d66728
trivial optimization
...
llvm-svn: 35648
2007-04-04 06:18:21 +00:00
Chris Lattner
8a4ca643dd
use calloc instead of new/memset, it is more efficient
...
llvm-svn: 35644
2007-04-04 00:44:31 +00:00
Chris Lattner
60c84ed4e9
Initialize the symbol table to zero explicitly. This ensures that the
...
symbol table does no allocations for prototypes or other lazily deserialized
functions, saving significant space and time.
llvm-svn: 35643
2007-04-04 00:30:49 +00:00
Chris Lattner
dbf6a79a71
Extend StringMap to support being initialized as completely empty. When
...
initialized this way, they do not do a malloc to allocate their buckets.
llvm-svn: 35642
2007-04-04 00:29:37 +00:00
Bill Wendling
a4aa65bc38
Adding more MMX instructions.
...
llvm-svn: 35638
2007-04-03 23:48:32 +00:00
Bill Wendling
ca2124e5a9
Add FEMMS and ADDQ. Renamed MMX recipes to prepend the MMX_ to them.
...
llvm-svn: 35616
2007-04-03 06:00:37 +00:00
Chris Lattner
b5e5784b28
add missing operator
...
llvm-svn: 35613
2007-04-03 04:25:46 +00:00
Chris Lattner
96c4c71f2c
add a helper function to constantint.
...
llvm-svn: 35610
2007-04-03 01:41:34 +00:00
Evan Cheng
d0366b0024
Ugh. Copy coalescer does not update register numbers.
...
llvm-svn: 35600
2007-04-02 18:49:18 +00:00
Chris Lattner
3ff8b2cf06
add a helper function.
...
llvm-svn: 35585
2007-04-02 05:41:00 +00:00
Chris Lattner
b59fc9767b
add range version of insert()
...
llvm-svn: 35572
2007-04-02 01:21:19 +00:00
Zhou Sheng
551fa60212
Remove unused methods.
...
llvm-svn: 35553
2007-04-01 12:45:33 +00:00
Reid Spencer
419396d2fe
For PR1297:
...
Implement bswap, ctpop, ctlz, and cttz utilizing the new overloaded
intrinsic feature of tblgen. By defining llvm_int_ty to have an ValueType
of iAny, any intrinsic using that type becomes an overloaded intrinsic.
This signals that a) any integer type could be used for that argument and
b) the intrinsic needs a suffix to match each such argument for the
actual intrinsic.
llvm-svn: 35544
2007-04-01 07:30:57 +00:00
Reid Spencer
5ac41f7bc9
For PR1297:
...
Intrinsic functions might need to be generated (if they are overloaded) so
returning a const char* is no longer possible. Change getOperationName to
return a std::string instead.
llvm-svn: 35543
2007-04-01 07:28:37 +00:00
Reid Spencer
e1b0aae7c7
For PR1297:
...
Change the interface to the getName, getType, getDeclaration methods to
include the "actual" types of the result/arguments. This is necessary to
support overloaded intrinsics.
llvm-svn: 35542
2007-04-01 07:26:35 +00:00
Reid Spencer
f4ea8f8a73
For PR1297:
...
Add an "iAny" ValueType as a place holder for an integer type of any
bit width. This is used for intrinsics overloading on integer type.
llvm-svn: 35538
2007-04-01 07:17:45 +00:00
Chris Lattner
579b1c63d5
Split the sdisel code munging stuff out into its own opt-pass, CodeGenPrepare.
...
llvm-svn: 35528
2007-03-31 04:06:36 +00:00
Chris Lattner
8747705792
switch TL::getValueType to use MVT::getValueType.
...
llvm-svn: 35527
2007-03-31 04:05:24 +00:00
Chris Lattner
546138e3dd
add a method to turn a type into a VT.
...
llvm-svn: 35526
2007-03-31 04:03:02 +00:00
Chris Lattner
143464e05f
add one addressing mode description hook to rule them all.
...
llvm-svn: 35520
2007-03-30 23:14:50 +00:00
Zhou Sheng
68b7faad88
Make sure this method just return value equal or less than Limit.
...
llvm-svn: 35509
2007-03-30 16:50:28 +00:00
Duncan Sands
def480579a
Correct typo.
...
llvm-svn: 35504
2007-03-30 06:39:42 +00:00
Zhou Sheng
3352181fc8
Rename and correct the method "greaterOrEqual".
...
llvm-svn: 35502
2007-03-30 05:10:59 +00:00
Zhou Sheng
489a1dbb92
Add two utility methods into ConstantInt.
...
llvm-svn: 35501
2007-03-30 03:22:55 +00:00
Reid Spencer
4269ae1274
For PR789:
...
Make the sys::Path::getFileStatus function more efficient by having it
return a pointer to the FileStatus structure rather than copy it. Adjust
uses of the function accordingly. Also, fix some memory issues in sys::Path.
llvm-svn: 35476
2007-03-29 19:05:44 +00:00
Chris Lattner
1c3ed414f6
add a hook to demat functions.
...
llvm-svn: 35471
2007-03-29 18:30:26 +00:00
Jeff Cohen
e38e3a8a5d
uniqueID is a uint64_t (caught by VC++)
...
llvm-svn: 35465
2007-03-29 17:28:31 +00:00
Reid Spencer
d0eb672f1e
Add a uniqueID field to the FileStatus structure for Paths. This will map
...
to the inode number on Unix and something far less unique on Windows. The
windows case needs to be improved.
llvm-svn: 35461
2007-03-29 17:00:31 +00:00
Reid Spencer
c767f6f709
Don't forget to delete the FileStatus structure on destruction of Path.
...
llvm-svn: 35459
2007-03-29 16:50:49 +00:00
Reid Spencer
fc67ef7cfe
For PR789:
...
* Add a method: bool isAbsolute() const, which determines if the path name
is absolute or not.
* Implement caching of file status information in the Path object. Allow it
to be updated forcefully or lazily re-fetched from the cached value.
llvm-svn: 35456
2007-03-29 16:43:20 +00:00
Evan Cheng
a55449c051
Remove isLegalAddressImmediate.
...
llvm-svn: 35406
2007-03-28 01:53:55 +00:00
Bill Wendling
f9c5de3792
Add support for integer comparison builtins.
...
llvm-svn: 35384
2007-03-27 20:21:31 +00:00
Evan Cheng
201771637e
Change findRegisterUseOperand() to return operand index instead.
...
llvm-svn: 35363
2007-03-26 22:37:45 +00:00
Dale Johannesen
3ad8ab7b61
Fix reversed logic in getRegsUsed. Rename RegStates to RegsAvailable to
...
hopefully forestall similar errors.
llvm-svn: 35362
2007-03-26 22:23:54 +00:00
Bill Wendling
a42484728c
Add support for the v1i64 type. This makes better code for this:
...
#include <mmintrin.h>
extern __m64 C;
void baz(__v2si *A, __v2si *B)
{
*A = C;
_mm_empty();
}
We get this:
_baz:
call "L1$pb"
"L1$pb":
popl %eax
movl L_C$non_lazy_ptr-"L1$pb"(%eax), %eax
movq (%eax), %mm0
movl 4(%esp), %eax
movq %mm0, (%eax)
emms
ret
GCC gives us this:
_baz:
pushl %ebx
call L3
"L00000000001$pb":
L3:
popl %ebx
subl $8, %esp
movl L_C$non_lazy_ptr-"L00000000001$pb"(%ebx), %eax
movl (%eax), %edx
movl 4(%eax), %ecx
movl 16(%esp), %eax
movl %edx, (%eax)
movl %ecx, 4(%eax)
emms
addl $8, %esp
popl %ebx
ret
llvm-svn: 35351
2007-03-26 07:53:08 +00:00
Chris Lattner
cc91b2a91d
Start value symbol tables out small (space for 16 elts), not huge (space for 512).
...
This is particularly useful for the JIT, which lazily deserializes functions.
llvm-svn: 35346
2007-03-26 01:45:35 +00:00
Reid Spencer
4984ab6c01
Compute getLowBitsSet correctly. Using the complement of a 64-bit value
...
and shifting down without regard for the bitwidth of the APInt can lead
to incorrect initialization values. Instead, check for the word size case
(to avoid undef results from shift) and then do (1 << loBitsSet) - 1
llvm-svn: 35344
2007-03-25 21:58:42 +00:00
Anton Korobeynikov
6f78c59650
First step of switch lowering refactoring: perform worklist-driven
...
strategy, emit JT's where possible.
llvm-svn: 35338
2007-03-25 15:07:15 +00:00
Chris Lattner
b19069959d
switch TargetLowering::getConstraintType to take the entire constraint,
...
not just the first letter. No functionality change.
llvm-svn: 35322
2007-03-25 02:14:49 +00:00
Reid Spencer
b5b291924a
Fix a typo in a comment.
...
llvm-svn: 35316
2007-03-25 01:13:46 +00:00
Reid Spencer
16d08887ef
Actually, for getHighBitsSet and getLowBitsSet, don't make a 0 bit size
...
illegal. Instead do the 0 valued construction for the user. This is because
the caller may not know (or care to check) that the number of bits set is
zero.
llvm-svn: 35315
2007-03-25 00:01:47 +00:00
Reid Spencer
d24dc1f9a6
Make it illegal to set 0 bits in getHighBitsSet and getLowBitsSet. For that
...
they should have used the uint64_t constructor. This avoids causing
undefined results via shifts by the word size when the bit width is an
exact multiple of the word size.
llvm-svn: 35313
2007-03-24 23:47:58 +00:00
Reid Spencer
fb188ea881
In the getBitsSet function, don't optimize for a common case that is
...
already covered by getLowBitsSet (i.e. when loBits==0). Consequently, remove
the default value for loBits and reorder the arguments to the more natural
loBits, hiBits order. This makes it more clear that this function is for bit
groups in the middle of the bit width and not towards one end or the other.
llvm-svn: 35312
2007-03-24 23:42:47 +00:00
Reid Spencer
091d6cf3b7
Don't invoke undefined behavior in shifts in the functions getHighBitsSet
...
and getLowBitsSet.
llvm-svn: 35311
2007-03-24 23:35:54 +00:00
Reid Spencer
0e466b183f
Implement the getBitsSet function.
...
llvm-svn: 35310
2007-03-24 23:27:48 +00:00
Reid Spencer
1aa3f64ef4
Implement the getHighBitsSet and getLowBitsSet functions.
...
llvm-svn: 35308
2007-03-24 23:05:35 +00:00
Reid Spencer
30351837ca
Get the signs in the right place!
...
llvm-svn: 35307
2007-03-24 22:50:43 +00:00
Reid Spencer
0ceb493ee2
Undo the last change and make this really implement remainder and not
...
modulus. The previous change was a result of incorrect documentation in
the LangRef.html.
llvm-svn: 35305
2007-03-24 22:37:23 +00:00
Reid Spencer
c1dfceab8b
Correct the implementation of srem to be remainder, not modulus. The sign of
...
the result must follow the sign of the divisor.
llvm-svn: 35302
2007-03-24 21:56:22 +00:00
Reid Spencer
52ea41bb97
Clean up this interface:
...
1. Group similar methods into doxygen groups
2. Reorganize the groups into a consist flow.
3. Significantly improve the quality of the documentation on several methods
4. Rewrite srem and sdiv to eliminate a copy and improve readability.
5. Eliminate unneeded forward references.
llvm-svn: 35300
2007-03-24 18:09:18 +00:00
Chris Lattner
3a16450eaf
add a valuetype for v1i64, which is needed by mmx.
...
llvm-svn: 35298
2007-03-24 17:36:26 +00:00
Bill Wendling
ad01036d5c
This is dead. DEAD I tells you!!
...
llvm-svn: 35291
2007-03-23 22:42:04 +00:00
Bill Wendling
124f2c8706
PR1260:
...
Add final support to get the QT example to compile.
llvm-svn: 35290
2007-03-23 22:35:46 +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
Bill Wendling
e6a9c6dfe6
We generate a shufflevector instruction, so we don't need the builtin
...
intrinsic.
llvm-svn: 35269
2007-03-22 20:29:26 +00:00
Jeff Cohen
2f87ca6cc7
Be more explicit concerning argument sizes.
...
Use VC++ byteswap intrinsics.
llvm-svn: 35267
2007-03-22 19:11:57 +00:00
Bill Wendling
1bcad4c1cd
Support added for shifts and unpacking MMX instructions.
...
llvm-svn: 35266
2007-03-22 18:42:45 +00:00
Reid Spencer
17f3eeaf48
For PR1145:
...
Add the NoUnwindAttribute to allow explicit marking of functions that do
not unwind the stack via the unwind instruction. This is akin to gcc's
NoThrow attribute and used for optimizing exception handling.
llvm-svn: 35250
2007-03-22 00:32:02 +00:00
Reid Spencer
76c1fef30a
Fix a comment.
...
llvm-svn: 35246
2007-03-21 22:22:19 +00:00
Dale Johannesen
44c0a5d545
repair x86 performance, dejagnu problems from previous change
...
llvm-svn: 35245
2007-03-21 21:51:52 +00:00
Dale Johannesen
3e422e3b49
do not share old induction variables when this would result in invalid
...
instructions (that would have to be split later)
llvm-svn: 35227
2007-03-20 21:54:54 +00:00
Dale Johannesen
50a22f6fe6
maintain LiveIn when splitting blocks (register scavenging needs it)
...
llvm-svn: 35226
2007-03-20 21:35:06 +00:00
Devang Patel
19dae84536
LoopSimplify::FindPHIToPartitionLoops()
...
Use ETForest instead of DominatorSet.
llvm-svn: 35222
2007-03-20 20:19:48 +00:00
Evan Cheng
0176b9859d
First cut trivial re-materialization support.
...
llvm-svn: 35208
2007-03-20 08:13:50 +00:00
Evan Cheng
41f4f032ee
Added MRegisterInfo hook to re-materialize an instruction.
...
llvm-svn: 35205
2007-03-20 08:09:38 +00:00
Zhou Sheng
a9c0018850
Correct the name: isStrictPositive --> isStrictlyPositive.
...
llvm-svn: 35201
2007-03-20 02:18:16 +00:00
Chris Lattner
305c3525af
Add a dtor to fix leaks from all clients of BitVector.
...
llvm-svn: 35200
2007-03-20 02:10:56 +00:00
Reid Spencer
7d20e42a97
Allow ConstantInt::get(Ty, uint64_t) to interpret the 64-bit values as a
...
negative number. This is needed to fix test/Assembler/2007-03-19-NegValue.ll
llvm-svn: 35181
2007-03-19 20:39:08 +00:00
Reid Spencer
c3422e56d6
Add an indication of signedness to the uint64_t constructor so sign bits
...
can be extended. This helps fix test/Assembler/2007-03-19-NegValue.ll
llvm-svn: 35179
2007-03-19 20:36:48 +00:00
Duncan Sands
90c42a15d5
Fix obvious typo in comment.
...
llvm-svn: 35164
2007-03-19 14:25:02 +00:00
Evan Cheng
2081cf96ed
Add a TargetInstrDescriptor flag to mark an instruction as "re-materializable".
...
It means the instruction can be easily re-materialized at any point. e.g.
constant generation, load from constantpool.
llvm-svn: 35158
2007-03-19 06:19:16 +00:00
Zhou Sheng
6ecf1045a6
Add isStrictPositive() to APInt to determine if this APInt Value > 0.
...
llvm-svn: 35156
2007-03-19 05:22:18 +00:00
Evan Cheng
1d943badac
Fix comment.
...
llvm-svn: 35139
2007-03-18 03:26:04 +00:00
Evan Cheng
5be8544e8a
Track the BB's where each virtual register is used.
...
llvm-svn: 35135
2007-03-17 09:29:54 +00:00
Evan Cheng
ce8b779c6c
Added isLegalAddressExpression hook to test if the given expression can be
...
folded into target addressing mode for the given type.
llvm-svn: 35121
2007-03-16 08:42:32 +00:00
Evan Cheng
0408dc0d37
These forward declarations are not needed.
...
llvm-svn: 35120
2007-03-16 08:41:06 +00:00
Bill Wendling
feaff80149
Multiplication support for MMX.
...
llvm-svn: 35118
2007-03-15 21:24:36 +00:00
Jeff Cohen
b19ec59b5c
Fix for VS 2005 problem supplied by Morten Ofstad.
...
llvm-svn: 35098
2007-03-14 15:25:21 +00:00
Zhou Sheng
dfcf9376bc
Add zextOrCopy() into APInt for convenience.
...
llvm-svn: 35079
2007-03-13 06:16:26 +00:00
Evan Cheng
f132fa5bba
More flexible TargetLowering LSR hooks for testing whether an immediate is
...
a legal target address immediate or scale.
llvm-svn: 35071
2007-03-12 23:26:27 +00:00
Zhou Sheng
9643d0a422
Add getSignBit() and operator<<= into APInt for convenience.
...
llvm-svn: 35059
2007-03-11 07:16:10 +00:00
Nick Lewycky
2af4a3ab17
Add getter methods for the extremes of a ConstantRange.
...
llvm-svn: 35056
2007-03-10 15:54:12 +00:00
Bill Wendling
236cfc4344
Adding more arithmetic operators to MMX. This is an almost exact copy of
...
the addition. Please let me know if you have suggestions.
llvm-svn: 35055
2007-03-10 09:57:05 +00:00
Bill Wendling
5fef3fd7e7
Added "padd*" support for MMX. Added MMX move stuff to X86InstrInfo so that
...
moves, loads, etc. are recognized.
llvm-svn: 35031
2007-03-08 22:09:11 +00:00
Evan Cheng
6bf2f3665e
Add ReadOnlySection directive.
...
llvm-svn: 35015
2007-03-08 01:00:38 +00:00
Evan Cheng
7513c95267
Added ContainsRelocations() to check if a constant might only be resolvable at load time.
...
llvm-svn: 35014
2007-03-08 00:59:12 +00:00
Anton Korobeynikov
85d6c1ebad
Refactoring of formal parameter flags. Enable properly use of
...
zext/sext/aext stuff.
llvm-svn: 35008
2007-03-07 16:25:09 +00:00
Evan Cheng
d4fb00bb6b
Add a utility function to test whether a load is unindexed.
...
llvm-svn: 35004
2007-03-07 08:04:41 +00:00
Devang Patel
6a56e3c1a0
Now IndVarSimplify is a LoopPass.
...
llvm-svn: 35003
2007-03-07 06:39:01 +00:00
Devang Patel
16107bb71b
Now LICM is a LoopPass.
...
llvm-svn: 35001
2007-03-07 04:41:30 +00:00
Anton Korobeynikov
090c2d50ea
Fix DWARF debugging information on x86/Linux and (hopefully)
...
Mingw32/Cygwin targets. This fixes PR978
llvm-svn: 35000
2007-03-07 02:47:57 +00:00
Evan Cheng
4161981d63
Add skipTo to set internal iterator. Useful when pointed to instruction is deleted.
...
llvm-svn: 34997
2007-03-07 02:36:16 +00:00
Devang Patel
3a24891f80
Now LoopUnroll is a LoopPass.
...
llvm-svn: 34996
2007-03-07 01:38:05 +00:00
Devang Patel
c35610b9f9
Now LoopUnswitch is a LoopPass.
...
llvm-svn: 34992
2007-03-07 00:26:10 +00:00
Devang Patel
0b82378a28
Now LoopStrengthReduce is a LoopPass.
...
llvm-svn: 34984
2007-03-06 21:14:09 +00:00
Devang Patel
57322d0462
Use schedulePass() instead of assignPassManager() to add new LPPassManager.
...
This ensures that require analysis info is available.
llvm-svn: 34980
2007-03-06 19:11:25 +00:00
Devang Patel
b44e86318e
Add LPPassManager::insertLoop().
...
llvm-svn: 34979
2007-03-06 19:00:02 +00:00
Devang Patel
8490ffbcdc
LPPassManager::deleteLoopFromQueue() add meat. Cut-n-paste code from
...
LoopUnswitch pass.
llvm-svn: 34977
2007-03-06 18:38:33 +00:00
Devang Patel
d3cf506865
LPPassManager. Implement preparePassManager() hook.
...
llvm-svn: 34975
2007-03-06 17:59:37 +00:00
Devang Patel
b9e705f09e
Keep track of higher level analysis.
...
llvm-svn: 34974
2007-03-06 17:52:53 +00:00
Devang Patel
e3abf559e5
LPPassManager : Add initialization and finalizatino hooks.
...
llvm-svn: 34968
2007-03-06 16:59:03 +00:00
Evan Cheng
b0c0d22f30
Minor interface change.
...
llvm-svn: 34967
2007-03-06 10:05:14 +00:00
Evan Cheng
077516f441
Register scavenger is now capable of scavenging. It spills a register whose use of furthest away to make it available.
...
llvm-svn: 34964
2007-03-06 10:01:25 +00:00
Anton Korobeynikov
4558f01db9
Enumerate SDISel formal parameter attributes. Make use of new
...
enumeration.
llvm-svn: 34960
2007-03-06 06:10:33 +00:00
Anton Korobeynikov
d0375d0852
Implement PR1240
...
llvm-svn: 34959
2007-03-06 05:32:48 +00:00
Reid Spencer
564f193ad0
Make StoreValueToMemory a little more efficient by not copying a
...
GenericValue to a temporary.
llvm-svn: 34957
2007-03-06 05:02:28 +00:00
Reid Spencer
b5e0b0bc5e
Make GenericeValue into a struct with a union instead of just a union. This
...
allows an APInt value to be constructed. Remove all the native integer types
from the union. These are replaced with the single IntVal of type APInt.
llvm-svn: 34945
2007-03-06 03:01:54 +00:00
Devang Patel
e4da6fa801
Use std::deque to manage loop queue inside LPPassManager.
...
llvm-svn: 34943
2007-03-06 02:30:46 +00:00
Devang Patel
45343b04b3
Keep track of inherited analysis. For example, if a loop pass does not
...
preserve dominator info then it should update parent FPPassManager's
available analysis info to reflect this.
llvm-svn: 34942
2007-03-06 01:55:46 +00:00
Devang Patel
edbde240be
Add preparePassManager() hook. This allows each pass to check whether
...
current active pass manager is appropriate or not.
A loop pass may consider current LPPassManager in appropraite if loop
pass is not preserving analysis information that is used by other
passes managed by current LPPassManager. In such situation, loop pass
can pop current LPPassManager from the PMStack using this hook
and use new LPPassManager for itself.
llvm-svn: 34941
2007-03-06 01:06:16 +00:00
Bill Wendling
c52174dee3
Add the emms intrinsic for MMX support.
...
llvm-svn: 34938
2007-03-05 23:09:45 +00:00
Reid Spencer
5ecf7f6214
Document the use of getValueType() more accurately, specifically explain
...
that the instruction opcode is added to the InstructionVal value and the
consequences of that.
llvm-svn: 34937
2007-03-05 23:06:32 +00:00
Devang Patel
79495d839e
Current pass manager, not the parent pass manager, assumes the role of
...
last user when one of the managed pass uses info provided by parent pass
manager.
This was exposed by LPPassManager work.
llvm-svn: 34936
2007-03-05 22:57:49 +00:00
Devang Patel
6668a341ae
Avoid constructing std::strings unless pass debugging is ON.
...
llvm-svn: 34933
2007-03-05 20:01:30 +00:00
Jeff Cohen
84d84f7381
The hack won't work on VS 2005, and it might not be needed anyway.
...
llvm-svn: 34930
2007-03-05 17:22:33 +00:00
Zhou Sheng
b6d1ac8682
Correct the calculation in APInt::logBase2().
...
llvm-svn: 34929
2007-03-05 16:42:58 +00:00
Jeff Cohen
b58af23ff3
Elminate tabs and improve comments.
...
llvm-svn: 34921
2007-03-05 00:46:22 +00:00
Jeff Cohen
98c99a3a02
Unbreak VC++ build.
...
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Chris Lattner
7fdddda045
add a getSignBit method, elimiante virtual method from getBitMask()
...
llvm-svn: 34916
2007-03-04 23:33:19 +00:00
Chris Lattner
69aafa4be8
fix 80 col violations, mark arrays static
...
llvm-svn: 34915
2007-03-04 23:33:03 +00:00
Chris Lattner
295b3d69b1
add a new node
...
llvm-svn: 34912
2007-03-04 20:40:06 +00:00
Chris Lattner
2510829eba
add iterator range version of ctor.
...
llvm-svn: 34899
2007-03-04 04:04:43 +00:00
Reid Spencer
cdb5aa2805
Make the creation functions take an error string. This will help the
...
ExecutionEngine report errors on creation (like bytecode stuff) and also
help to get rid of exception handling.
llvm-svn: 34886
2007-03-03 18:18:11 +00:00
Reid Spencer
e96b55e61f
Require the destination GlobalValue for LoadValueFromMemory to be passed
...
in as a parameter instead of returned.
llvm-svn: 34882
2007-03-03 08:35:14 +00:00
Reid Spencer
e2bf55dfe8
Regularize the interface for conversion functions to/from float/double.
...
llvm-svn: 34881
2007-03-03 08:34:02 +00:00
Reid Spencer
36fb227e99
Add APIntVal as a possible GenericeValue.
...
llvm-svn: 34879
2007-03-03 07:36:44 +00:00
Reid Spencer
503dda5840
Make getNumWords public so that those using getRawData stand a chance of
...
not reading beyond the end of the buffer returned.
llvm-svn: 34873
2007-03-03 06:17:23 +00:00
Reid Spencer
47b01d6acb
Add names for some of the operators. This is needed for the macros in
...
the Interpreter.
llvm-svn: 34872
2007-03-03 05:37:23 +00:00
Reid Spencer
e5244b132b
Add isPositive for symmetry with isNegative.
...
llvm-svn: 34862
2007-03-03 00:24:39 +00:00
Anton Korobeynikov
af46a0e4a2
Fix uninitialized use of variable. Remove tabs and fix identation.
...
llvm-svn: 34850
2007-03-02 22:19:41 +00:00
Chris Lattner
68244ce570
Fix PR1234 by working around a compiler bug.
...
llvm-svn: 34845
2007-03-02 18:16:29 +00:00
Owen Anderson
6d3b179de3
Fix a typo.
...
llvm-svn: 34836
2007-03-02 05:03:07 +00:00
Evan Cheng
44257955c8
Make it 64-bit safe.
...
llvm-svn: 34829
2007-03-02 02:31:37 +00:00
Reid Spencer
53a673b3ed
Add a non-virtual test for zero, isZero, and rename isUnitValue isOne.
...
These will be used in upcoming patches to avoid virtual function call when
the client knows it is a ConstantInt.
llvm-svn: 34820
2007-03-02 00:27:06 +00:00
Reid Spencer
d86182b19b
Add an abs() function to get the absolute value.
...
llvm-svn: 34819
2007-03-01 23:37:09 +00:00
Reid Spencer
c5d33cef76
Remove virtual keyword from method that doesn't need to be virtual.
...
llvm-svn: 34817
2007-03-01 23:20:52 +00:00
Reid Spencer
ee77d22f26
Make it possible to create an SCEVUnknown from an APInt as well as an int.
...
llvm-svn: 34816
2007-03-01 22:28:51 +00:00
Reid Spencer
2ce72a4bd8
Add an isUnitValue method for comparison against 1. This just follows a
...
common pattern with isNullValue, isAllOnesValue, etc. It also helps to
prevent things like getZExtValue() == 1, which could assert for large
bitwidths.
llvm-svn: 34813
2007-03-01 21:50:41 +00:00
Owen Anderson
070c37407c
Use GCC intrinsics when available, and use smarter fallbacks when not.
...
llvm-svn: 34812
2007-03-01 21:16:30 +00:00
Reid Spencer
003170430b
Add doubleToBits and floatToBits methods.
...
llvm-svn: 34807
2007-03-01 20:39:01 +00:00
Jim Laskey
73e3ad1b10
Collect eh filter info.
...
llvm-svn: 34804
2007-03-01 20:25:32 +00:00
Jim Laskey
88c98a4128
Add eh filter intrinsic.
...
llvm-svn: 34801
2007-03-01 20:23:39 +00:00
Reid Spencer
90b6227b81
Add bitsToDouble and bitsToFloat methods for re-interpretation of bits as FP.
...
llvm-svn: 34800
2007-03-01 20:06:51 +00:00
Reid Spencer
b4e877c488
Drop the ConstantInt(const Type&, const APInt&) constructor. It is
...
redundant and more verbose than the ConstantInt(const APInt&) constructor.
llvm-svn: 34792
2007-03-01 19:30:34 +00:00
Reid Spencer
6a95676875
Add methods for bit width modification: sextOrTrunc, zextOrTrunc.
...
llvm-svn: 34789
2007-03-01 17:15:32 +00:00
Evan Cheng
0aa68b9246
Add a version of FindUnusedReg that restrict search to a specific set of registers.
...
llvm-svn: 34784
2007-03-01 08:56:24 +00:00
Reid Spencer
3f3487918c
Remove the "isSigned" parameters from ConstantRange. It turns out they
...
are not needed as the results are the same with or without it.
Patch by Nicholas Lewycky.
llvm-svn: 34782
2007-03-01 07:54:15 +00:00
Owen Anderson
cbbf9aa6b0
Use the GCC built-in for PopulationCount when it's available, and use a faster
...
algorithm when it's not. This should be particularly noticeable in the
64-bit case.
llvm-svn: 34776
2007-03-01 05:41:28 +00:00
Reid Spencer
b6dd32889e
Add a square root function.
...
llvm-svn: 34775
2007-03-01 05:39:56 +00:00
Reid Spencer
32d0051c64
Reduce #includage by taking a method out of line.
...
llvm-svn: 34774
2007-03-01 04:02:06 +00:00
Reid Spencer
4937dcdf1f
Add an IntegerType::getMask() method to get an APInt mask for the type.
...
llvm-svn: 34771
2007-03-01 02:25:03 +00:00
Evan Cheng
b2afac27e9
Clean up interface.
...
llvm-svn: 34769
2007-03-01 02:18:06 +00:00
Evan Cheng
d1fa618990
Track all joined registers and eliminate unneeded kills after all joining are done.
...
llvm-svn: 34767
2007-03-01 02:03:03 +00:00
Evan Cheng
0c89fbb835
MachineBasicBlock fields should not be public.
...
llvm-svn: 34766
2007-03-01 02:00:40 +00:00
Reid Spencer
f119927a6f
Move ConstantRange class to lib/Support from lib/Analysis and make its
...
interface not depend on Type or ICmpInst.
llvm-svn: 34761
2007-02-28 22:02:48 +00:00
Reid Spencer
f632e1cd14
Provide an ICmpInst::makeConstantRange to generate a ConstantRange value
...
from a predicate and an APInt. This is removed from ConstantRange class
so that ConstantRange doesn't have to depend on lib/VMCore.
llvm-svn: 34760
2007-02-28 22:00:54 +00:00
Reid Spencer
965067a054
For PR1205:
...
Remove ConstantInt from ConstantRange interface and adjust its users to
compensate.
llvm-svn: 34758
2007-02-28 19:57:34 +00:00
Reid Spencer
a9d0cc903b
Implement a convenience method to construct a ConstantInt directly from an
...
APInt. The implied type is the integer type that corresponds to the bit
width of the APInt.
llvm-svn: 34757
2007-02-28 19:50:21 +00:00
Reid Spencer
e2b4631435
For PR1205:
...
First round of ConstantRange changes. This makes all CR constructors use
only APInt and not use ConstantInt. Clients are adjusted accordingly.
llvm-svn: 34756
2007-02-28 18:57:32 +00:00
Jim Laskey
1fea0fa316
Provide a more meaningful name.
...
llvm-svn: 34751
2007-02-28 18:37:50 +00:00
Reid Spencer
2b933467ad
For PR1205:
...
Convert ConstantRange class to use APInt internally as its value type for
the constant range, instead of ConstantInt.
llvm-svn: 34745
2007-02-28 17:36:23 +00:00
Reid Spencer
0f2d45e42c
Make APInt a little more friendly to its users:
...
* Add support for + and - of a uint64_t.
* Make trunc/sext/zext return *this so it can be chained with other ops
* Add smin, smax, umin, umax functions for getting min/max values.
llvm-svn: 34742
2007-02-28 17:33:36 +00:00
Nate Begeman
2288ec3331
More Mach-O writer improvements.
...
llvm-svn: 34740
2007-02-28 07:40:50 +00:00
Chris Lattner
6d383bd2f1
add methods for analysis of call results and return nodes.
...
llvm-svn: 34738
2007-02-28 07:09:40 +00:00
Chris Lattner
a68a949ba5
add methods to analyze calls and formals.
...
llvm-svn: 34736
2007-02-28 06:56:37 +00:00
Reid Spencer
949b3612a8
getActiveWords should return the number of words, not the index of the
...
highest active words. Increment its result by one.
llvm-svn: 34713
2007-02-28 02:20:49 +00:00
Evan Cheng
db591ecaa8
Make requiresRegisterScavenging determination on a per MachineFunction basis.
...
llvm-svn: 34711
2007-02-28 00:59:19 +00:00
Evan Cheng
ee2e5de4fb
MRegisterInfo disowns RegScavenger. It's immutable.
...
llvm-svn: 34706
2007-02-28 00:17:36 +00:00
Reid Spencer
355cec42d1
Add some syntactic sugar.
...
llvm-svn: 34704
2007-02-27 23:47:33 +00:00