1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

5805 Commits

Author SHA1 Message Date
Gordon Henriksen
99c0e2918b C and Objective Caml bindings for PATypeHolder.
llvm-svn: 42713
2007-10-07 00:13:35 +00:00
Gordon Henriksen
06eeba26c1 Bindings for the verifier.
llvm-svn: 42707
2007-10-06 21:00:36 +00:00
Gordon Henriksen
ee9c8932e4 Adopting a uniform naming convention for type constructors in bindings.
llvm-svn: 42698
2007-10-06 16:05:20 +00:00
Gordon Henriksen
574434313a Adopting a uniform naming convention for constant constructors in bindings.
llvm-svn: 42697
2007-10-06 15:11:06 +00:00
Gordon Henriksen
65ce7c3085 Adding C and Ocaml bindings for ConstantExpr.
llvm-svn: 42696
2007-10-06 14:29:36 +00:00
Anton Korobeynikov
1f11738913 Include DataTypes.h to provide intptr_t type. This fixes OpenBSD compilation of this file.
Inspired by Laurence Tratt's patch

llvm-svn: 42695
2007-10-06 13:07:11 +00:00
Evan Cheng
c6b349980a Oops. Forgot this.
llvm-svn: 42691
2007-10-06 08:09:29 +00:00
Neil Booth
2c4419d71b Generalize tcFullMultiply so that the operands can be of differing
part widths.  Also, return the number of parts actually required to
hold the result's value.
Remove an over-cautious condition from rounding of float->hex conversion.

llvm-svn: 42669
2007-10-06 00:24:48 +00:00
Gordon Henriksen
8d97ababb0 Wrapping Value::dump.
llvm-svn: 42668
2007-10-06 00:08:49 +00:00
Gordon Henriksen
543f859a00 Removing the silly CHelpers header by rolling wrap and unwrap into the C
bindings headers themselves, hidden behind #ifdef __cplusplus.

llvm-svn: 42666
2007-10-05 23:59:36 +00:00
Dale Johannesen
c7b51b678d First round of ppc long double. call/return and
basic arithmetic works.
Rename RTLIB long double functions to distinguish
different flavors of long double; the lib functions
have different names, alas.

llvm-svn: 42644
2007-10-05 20:04:43 +00:00
Chris Lattner
c604dd270a Mark count method const.
llvm-svn: 42639
2007-10-05 17:40:38 +00:00
Dan Gohman
bc0aadce14 SMUL_LOHI and UMUL_LOHI are commutative.
llvm-svn: 42633
2007-10-05 14:09:33 +00:00
Dan Gohman
148f07390d Define target-indepenent SDNode types for multiply and divide that
produce two results.

llvm-svn: 42632
2007-10-05 14:07:56 +00:00
Duncan Sands
922a92a9e2 Fix typo in comment.
llvm-svn: 42631
2007-10-05 10:37:00 +00:00
Daniel Berlin
7cb8b28613 Fix intersectWithComplement bug noticed by Curtis Dunham
Optimize |= case for empty RHS

llvm-svn: 42629
2007-10-05 05:10:53 +00:00
Evan Cheng
de07843bf3 If a node that defines a physical register that is expensive to copy. The
scheduler will try a number of tricks in order to avoid generating the
copies. This may not be possible in case the node produces a chain value
that prevent movement. Try unfolding the load from the node before to allow
it to be moved / cloned.

llvm-svn: 42625
2007-10-05 01:39:18 +00:00
Evan Cheng
f536e2f41e - Added a few target hooks to generate load / store instructions from / to any
address (not just from / to frameindexes).
- Added target hooks to unfold load / store instructions / SDNodes into separate
load, data processing, store instructions / SDNodes.

llvm-svn: 42621
2007-10-05 01:32:41 +00:00
Evan Cheng
5ae84c0fa6 Add a variant of getTargetNode() that takes a vector of MVT::ValueType.
llvm-svn: 42620
2007-10-05 01:10:49 +00:00
Daniel Berlin
cf42f07a47 Fix the previous bug a slightly different way (by modifying how find_next works)
llvm-svn: 42613
2007-10-04 21:27:17 +00:00
Daniel Berlin
bbe5e56458 Fix off by one error in iterator
llvm-svn: 42612
2007-10-04 21:18:20 +00:00
Daniel Berlin
cd14e3d42a It helps a lot when you check for the end of your list before randomly
dereferencing things.

llvm-svn: 42605
2007-10-04 05:29:36 +00:00
Daniel Berlin
a4df074d31 Make SparseBitVector::set actually work properly when sets are not in ascending or descending order.
llvm-svn: 42604
2007-10-04 05:25:51 +00:00
Neil Booth
2dc065755d Add APFloat -> hexadecimal string conversion, as per %a and %A in C99.
Useful for diagnostics and debugging.

llvm-svn: 42598
2007-10-03 22:26:02 +00:00
Owen Anderson
cb51170957 Completely merge the implementation details of DomTree and PostDomTree.
Also, add a FIXME for a bug in PostDomTree calculation I noticed while writing this,

llvm-svn: 42593
2007-10-03 21:25:45 +00:00
Owen Anderson
7d39d6d4cb Add a GraphTraits partial specialization to make the inverse of an inverse be the same as the underlying graph.
llvm-svn: 42592
2007-10-03 21:24:38 +00:00
Chris Lattner
de233151af Add initial iterator support for folding set.
llvm-svn: 42589
2007-10-03 21:12:09 +00:00
Dan Gohman
b278232a22 Fix a using namespace llvm; in a header file.
llvm-svn: 42584
2007-10-03 19:04:09 +00:00
Neil Booth
1e709921bc Tweak RoundAwayFromZero the bit number below which is truncated, and make
it const.

Preparation for APFloat -> hexadecimal string conversion.

llvm-svn: 42576
2007-10-03 15:16:41 +00:00
Gordon Henriksen
5d52ac7333 Regenerate.
llvm-svn: 42575
2007-10-03 12:07:14 +00:00
Owen Anderson
91e23d710c Factor some code from the DomTree and PostDomTree calculate methods up into
each one's runOnFunction method.

llvm-svn: 42563
2007-10-03 03:20:17 +00:00
Dale Johannesen
a4e3643cb3 Rewrite sqrt and powi to use anyfloat. By popular demand.
llvm-svn: 42537
2007-10-02 17:43:59 +00:00
Evan Cheng
d1a77589e9 Remove simple scheduler.
llvm-svn: 42499
2007-10-01 20:44:07 +00:00
Dale Johannesen
ef488c7b0e Add getABITypeSize, getABITypeSizeInBits
llvm-svn: 42488
2007-10-01 16:03:14 +00:00
Dan Gohman
50ba8a297c Add empty() member functions to a few container-like classes.
llvm-svn: 42487
2007-10-01 16:01:23 +00:00
Chris Lattner
c013b7f395 Add a helper useful when mapping from a map element to its hash node.
llvm-svn: 42480
2007-09-30 08:31:46 +00:00
Owen Anderson
09ba812a80 Template-ize more of the DomTree internal implementation details. Only the calculate() methods for DomTree and PostDomTree remain to be merged/template-ized.
llvm-svn: 42476
2007-09-30 04:17:16 +00:00
Chris Lattner
1654385fd0 Add a new DenseSet abstraction.
llvm-svn: 42474
2007-09-30 00:47:20 +00:00
Duncan Sands
4358ea12f8 Add newline at end of file.
llvm-svn: 42470
2007-09-29 16:38:37 +00:00
Gordon Henriksen
2b019da6b0 Collector is the base class for garbage collection code generators.
This version enhances the previous patch to add root initialization
as discussed here:

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070910/053455.html

Collector gives its subclasses control over generic algorithms:

  unsigned NeededSafePoints; //< Bitmask of required safe points.
  bool CustomReadBarriers;   //< Default is to insert loads.
  bool CustomWriteBarriers;  //< Default is to insert stores.
  bool CustomRoots;          //< Default is to pass through to backend.
  bool InitRoots;            //< If set, roots are nulled during lowering.

It also has callbacks which collectors can hook:

  /// If any of the actions are set to Custom, this is expected to
  /// be overriden to create a transform to lower those actions to
  /// LLVM IR.
  virtual Pass *createCustomLoweringPass() const;

  /// beginAssembly/finishAssembly - Emit module metadata as
  /// assembly code.
  virtual void beginAssembly(Module &M, std::ostream &OS,
                             AsmPrinter &AP,
                             const TargetAsmInfo &TAI) const;
  virtual void finishAssembly(Module &M,
                              CollectorModuleMetadata &CMM,
                              std::ostream &OS, AsmPrinter &AP,
                              const TargetAsmInfo &TAI) const;  

Various other independent algorithms could be implemented, but were
not necessary for the initial two collectors. Some examples are
listed here:

http://llvm.org/docs/GarbageCollection.html#collector-algos

llvm-svn: 42466
2007-09-29 02:13:43 +00:00
Gordon Henriksen
b3d98e2023 Demoting CHelpers.h to include/llvm/Support.
llvm-svn: 42465
2007-09-29 01:38:42 +00:00
Evan Cheng
f3c130a8b6 Enabling new condition code modeling scheme.
llvm-svn: 42459
2007-09-29 00:00:36 +00:00
Evan Cheng
1a48cdc61e If two instructions are both two-address code, favors (schedule closer to
terminator) the one that has a CopyToReg use. This fixes
2006-05-11-InstrSched.ll with -new-cc-modeling-scheme.

llvm-svn: 42453
2007-09-28 22:32:30 +00:00
Evan Cheng
71904c241e Trim some unneeded fields.
llvm-svn: 42442
2007-09-28 19:24:24 +00:00
Owen Anderson
a533c458f5 Have PostDomTree use the newly templated DFSPass.
llvm-svn: 42427
2007-09-28 01:23:47 +00:00
Dale Johannesen
e61886cee4 Add sqrt and powi intrinsics for long double.
llvm-svn: 42423
2007-09-28 01:08:20 +00:00
Owen Anderson
e529f66979 Convert DFSPass into a templated friend function, in preparation for making it common to DomTree and PostDomTree.
llvm-svn: 42420
2007-09-27 23:23:00 +00:00
Dan Gohman
50747737a5 TargetAsmInfo::getAddressSize() was incorrect for x86-64 and 64-bit targets
other than PPC64. Instead of fixing it, just remove it and fix all the
places that use it to use TargetData::getPointerSize() instead, as there
aren't very many. Most of the references were in DwarfWriter.cpp.

llvm-svn: 42419
2007-09-27 23:12:31 +00:00
Gordon Henriksen
b20ff7f981 CollectorMetadata abstractly describes stack maps for a function.
It includes:

 - location and of each safe point in machine code (identified by a
   label)
 - location of each root within the stack frame (identified by an
   offset), including the metadata tag provided to llvm.gcroot in
   the user program
 - size of the stack frame (for collectors which want to cheat on
   stack crawling :)
 - and eventually will include liveness

It is to be populated by back-ends during code-generation.

CollectorModuleMetadata aggregates this information across the
entire module.

llvm-svn: 42418
2007-09-27 22:18:46 +00:00
Gordon Henriksen
2571db23f1 My previous Registry.h header, as well as Collectors.h, which is the
registry for dynamically-loaded garbage collection compiler plugins.

llvm-svn: 42415
2007-09-27 19:34:27 +00:00
Evan Cheng
2075b448c3 Oops. Forgot this.
llvm-svn: 42377
2007-09-26 21:38:03 +00:00
Neil Booth
3680e05d98 Whitespace cleanup.
llvm-svn: 42374
2007-09-26 21:35:05 +00:00
Evan Cheng
0f9e307353 - Added MRegisterInfo::getCrossCopyRegClass() hook. For register classes where reg to reg copies are not possible, this returns another register class which registers in the specified register class can be copied to (and copy back from).
- X86 copyRegToReg() now supports copying between EFLAGS and GR32 / GR64 registers.

llvm-svn: 42372
2007-09-26 21:31:07 +00:00
Gordon Henriksen
c73d5c73a6 Added C and Ocaml bindings for functions, basic blocks, and
instruction creation. No support yet for instruction introspection.

Also eliminated allocas from the Ocaml bindings for portability,
and avoided unnecessary casts.

llvm-svn: 42367
2007-09-26 20:56:12 +00:00
Evan Cheng
5f9e291240 Allow copyRegToReg to emit cross register classes copies.
Tested with "make check"!

llvm-svn: 42346
2007-09-26 06:25:56 +00:00
Daniel Berlin
4ba5c86ebb Fix small bug in operator== for iterators
llvm-svn: 42331
2007-09-26 00:11:59 +00:00
Duncan Sands
1118f5f67f Fix spelling.
llvm-svn: 42296
2007-09-25 13:53:22 +00:00
Evan Cheng
6d8f155a63 Added major new capabilities to scheduler (only BURR for now) to support physical register dependency. The BURR scheduler can now backtrace and duplicate instructions in order to avoid "expensive / impossible to copy" values (e.g. status flag EFLAGS for x86) from being clobbered.
llvm-svn: 42284
2007-09-25 01:54:36 +00:00
Evan Cheng
6bfaf13dd9 New temporary option -new-cc-modeling-scheme to test the new cc modeling scheme.
llvm-svn: 42283
2007-09-25 01:50:04 +00:00
Daniel Berlin
f6cb4c3d65 Comment fixups
llvm-svn: 42279
2007-09-24 22:20:45 +00:00
Dan Gohman
b642a1ddf8 Merge hasDotLoc and hasDotFile into hasDotLocAndDotFile since .loc and .file
aren't really usable without each other. 

llvm-svn: 42274
2007-09-24 21:09:53 +00:00
Dan Gohman
d005faa65d Add a routine for emitting .file directives, for setting up
file numbers to use with .loc directives.

llvm-svn: 42272
2007-09-24 20:58:13 +00:00
Daniel Berlin
f900d1295f Implement offline variable substitution in order to reduce memory
and time usage.
Fixup operator == to make this work, and add a resize method to DenseMap
so we can resize our hashtable once we know how big it should be.

llvm-svn: 42269
2007-09-24 19:45:49 +00:00
Dan Gohman
ed361aa114 explicit keywords.
llvm-svn: 42262
2007-09-24 15:48:49 +00:00
Dan Gohman
c852b7450b Remove an unnecessary static_cast.
llvm-svn: 42261
2007-09-24 15:46:02 +00:00
Owen Anderson
02c6c6bba7 Fix typo.
llvm-svn: 42256
2007-09-24 02:33:22 +00:00
Owen Anderson
a0a11ee8b9 Merge significant portions of the DomTree and PostDomTree implementations.
The two remaining unmerged parts are DFSPass, and the Calculate().

llvm-svn: 42255
2007-09-24 02:29:29 +00:00
Owen Anderson
bc099e74d8 Factor the calculation details for PostDomTree out of PostDominators.cpp and
into a separate header file.

Next step: merging PostDominatorCalculation.h with DominatorCalculation.h.

llvm-svn: 42251
2007-09-23 22:21:00 +00:00
Owen Anderson
677db80624 Move DFSPass back down into DominatorTree. I need to figure out what the difference is between it
and the PostDomTree version first.

llvm-svn: 42250
2007-09-23 22:16:38 +00:00
Owen Anderson
de1937fcee Factor the dominator tree calculation details out into DominatorCalculation.h. This
change is not useful in and of itself, but it lays the groundwork for combining
the dominator and postdominator implementations.

Also, factor a few methods that are common to DominatorTree and PostDominatorTree
into DominatorTreeBase.  Again, this will make merging the two calculation methods
simpler in the future.

llvm-svn: 42248
2007-09-23 21:31:44 +00:00
Dale Johannesen
ea6ffa0b36 Fix PR 1681. When X86 target uses +sse -sse2,
keep f32 in SSE registers and f64 in x87.  This
is effectively a new codegen mode.
Change addLegalFPImmediate to permit float and
double variants to do different things.
Adjust callers.

llvm-svn: 42246
2007-09-23 14:52:20 +00:00
Tanya Lattner
e8c1cb789d Adding support for __builtin_annotation with an intrinsic called llvm.annotation. This is similar to llvm.var.annotation but is applied to expressions.
llvm-svn: 42211
2007-09-21 22:59:12 +00:00
Dale Johannesen
c7279629cc Change APFloat::convertFromInteger to take the incoming
bit width instead of number of words allocated, which
makes it actually work for int->APF conversions.
Adjust callers.  Add const to one of the APInt constructors
to prevent surprising match when called with const
argument.

llvm-svn: 42210
2007-09-21 22:09:37 +00:00
Owen Anderson
40196b7929 Fix CopyFrom for non-POD data types.
llvm-svn: 42208
2007-09-21 20:55:54 +00:00
Dan Gohman
230fc11cca There is no {rsqrt,rcp}{p,s}d.
llvm-svn: 42190
2007-09-21 15:24:00 +00:00
Dale Johannesen
04682bdc81 More long double fixes. x86_64 should build now.
llvm-svn: 42155
2007-09-19 23:55:34 +00:00
Ted Kremenek
c924fd3edf Previously GraphWriter assumed operator*() for node_iterator always
returned a reference type.  This patch allows operator*() to return a
non-reference type while still maintaining the old behavior when it
does return a reference type.

This patch was motivated when I tried to use "df_iterator" (see
llvm/ADT/DepthFirstIterator.h) as a "node_iterator", as df_iterator
does not return a reference type and thus we would get a compilation
error when trying to take the address of a temporary.

llvm-svn: 42151
2007-09-19 21:26:49 +00:00
Owen Anderson
5454d4cbc9 Add a flag to mark a dirty cache entry. This is not yet used, but will eventually
help non-local memdep caching.

llvm-svn: 42137
2007-09-19 16:13:57 +00:00
Evan Cheng
4a117958df Use struct SDep instead of std::pair for SUnit pred and succ lists. First step
in tracking physical register output dependencies.

llvm-svn: 42125
2007-09-19 01:38:40 +00:00
Evan Cheng
859720c33b Add CopyCost to TargetRegisterClass. This specifies the cost of copying a value
between two registers in the specific class.

llvm-svn: 42123
2007-09-19 01:35:01 +00:00
Gordon Henriksen
9deea8ed1a Tests of the ocaml (and thus C) bindings for constants.
llvm-svn: 42101
2007-09-18 18:07:51 +00:00
Bill Wendling
bfd2f2f6d7 Don't pass back a reference to a temporary.
llvm-svn: 42086
2007-09-18 09:10:16 +00:00
Bill Wendling
537b869514 The exception handling function info should be reset for each new
function. The information isn't used heavily -- it's only used at the end
of exception handling emission -- so there's no need to cache it.

llvm-svn: 42078
2007-09-18 05:03:44 +00:00
Gordon Henriksen
3dc9d9f145 C bindings for libLLVMCore.a and libLLVMBitWriter.a.
- The naming prefix is LLVM.
- All types are represented using opaque references.
- Functions are not named LLVM{Type}{Method}; the names became
  unreadable goop. Instead, they are named LLVM{ImperativeSentence}.
- Where an attribute only appears once in the class hierarchy (e.g.,
  linkage only applies to values; parameter types only apply to
  function types), the class is omitted from identifiers for
  brevity. Tastes like methods.
- Strings are C strings or string/length tuples on a case-by-case
  basis.
- APIs which give the caller ownership of an object are not mapped
  (removeFromParent, certain constructor overloads). This keeps
  keep memory management as simple as possible.

For each library with bindings:

  llvm-c/<LIB>.h       - Declares the bindings.
  lib/<LIB>/<LIB>.cpp  - Implements the bindings.

So just link with the library of your choice and use the C header
instead of the C++ one.

llvm-svn: 42077
2007-09-18 03:18:57 +00:00
Gordon Henriksen
25f8bcd5ee Fixing an comment in Module.h that refers to a nonexistent parameter.
Also adding some missing svn:ignores that've been bothering me.

llvm-svn: 42076
2007-09-18 02:09:34 +00:00
Bill Wendling
803e0d9970 Objective-C was generating EH frame info like this:
"_-[NSString(local) isNullOrNil]".eh = 0
        .no_dead_strip  "_-[NSString(local) isNullOrNil]".eh

The ".eh" should be inside the quotes.

llvm-svn: 42074
2007-09-18 01:47:22 +00:00
Bill Wendling
d269356b02 Add support for appending a suffix to the end of a mangled name.
llvm-svn: 42071
2007-09-17 22:39:32 +00:00
Devang Patel
547d418b8e Do not hide APInt::dump() inside #ifndef NDEBUG.
llvm-svn: 42068
2007-09-17 22:24:00 +00:00
Dale Johannesen
9ce8a9d633 Implement x86 long double in jit (not really
complete, but common cases work)

llvm-svn: 42043
2007-09-17 18:44:13 +00:00
Chris Lattner
cc315726f7 Merge DenseMapKeyInfo & DenseMapValueInfo into DenseMapInfo
Add a new DenseMapInfo::isEqual method to allow clients to redefine
the equality predicate used when probing the hash table.

llvm-svn: 42042
2007-09-17 18:34:04 +00:00
Daniel Berlin
a19af373e3 That's what i get for using carbon emacs in a terminal
llvm-svn: 42040
2007-09-17 18:05:59 +00:00
Daniel Berlin
d26deb0a6d Fix iterator so it doesn't sometimes report bits that aren't in the bitmap
llvm-svn: 42039
2007-09-17 18:04:21 +00:00
Dan Gohman
81b5cda0aa Add a utility function to SDOperand for testing if a value is unused.
llvm-svn: 42038
2007-09-17 17:44:31 +00:00
Daniel Berlin
d44b2016ca Fix bug in andersen's related to test_and_set.
Add operator == and != to SparseBitVector.
Simplify code for test_and_set

llvm-svn: 42018
2007-09-16 23:59:53 +00:00
Daniel Berlin
688e8d9b60 Fix a few bugs related to zero'ing of elements
llvm-svn: 42017
2007-09-16 22:31:47 +00:00
Chris Lattner
1b622ad721 Fix PR1666, SPASS with the CBE and 254.gap with the CBE.
GCC optimizes away things like ptr < NULL  to false.  To "fix" this,
have the CBE emit casts of pointers to intptr_t when doing relational
pointer comparisons.

llvm-svn: 41983
2007-09-15 06:51:03 +00:00
Owen Anderson
a37895cfee Remove RLE from the headers, since the pass itself is gone now.
llvm-svn: 41971
2007-09-14 22:54:46 +00:00
Dale Johannesen
575bd6070a Remove the assumption that FP's are either float or
double from some of the many places in the optimizers
it appears, and do something reasonable with x86
long double.
Make APInt::dump() public, remove newline, use it to
dump ConstantSDNode's.
Allow APFloats in FoldingSet.
Expand X86 backend handling of long doubles (conversions
to/from int, mostly).

llvm-svn: 41967
2007-09-14 22:26:36 +00:00
Dan Gohman
1c9bf0bfb9 And an FoldingSetImpl::NodeID::AddInteger overload for int64_t, to avoid
ambiguity.

llvm-svn: 41960
2007-09-14 20:48:42 +00:00
Dan Gohman
fb60c0dfed Remove isReg, isImm, and isMBB, and change all their users to use
isRegister, isImmediate, and isMachineBasicBlock, which are equivalent,
and more popular.

llvm-svn: 41958
2007-09-14 20:33:02 +00:00