Commit Graph

5807 Commits

Author SHA1 Message Date
Neil Booth
643ce59495 Reimplement convertFromUnsignedInteger so it is passed a const bignum.
It used to modify its argument in-place.

This interface is saner and the implementation more efficient.  It will
be needed for decimal->binary conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42733 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 12:07:53 +00:00
Neil Booth
ccf596a53e convertFromInteger, as originally written, expected sign-extended
input.  APInt unfortunately zero-extends signed integers, so Dale
modified the function to expect zero-extended input.  Make this
assumption explicit in the function name.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42732 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 11:45:55 +00:00
Neil Booth
33d4c92e78 combineLostFractions does not need to be a member function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42729 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 08:51:21 +00:00
Daniel Berlin
c27d61d3ae Some more problems noticed by Curtis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42717 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 04:47:57 +00:00
Gordon Henriksen
1cf08fddc7 C and Objective Caml bindings for PATypeHolder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42713 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 00:13:35 +00:00
Gordon Henriksen
c0491ac8b6 Bindings for the verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42707 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 21:00:36 +00:00
Gordon Henriksen
81a788176e Adopting a uniform naming convention for type constructors in bindings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42698 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 16:05:20 +00:00
Gordon Henriksen
e3b989d4a4 Adopting a uniform naming convention for constant constructors in bindings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42697 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 15:11:06 +00:00
Gordon Henriksen
4647569fe7 Adding C and Ocaml bindings for ConstantExpr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42696 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 14:29:36 +00:00
Anton Korobeynikov
57db1734af Include DataTypes.h to provide intptr_t type. This fixes OpenBSD compilation of this file.
Inspired by Laurence Tratt's patch


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42695 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 13:07:11 +00:00
Evan Cheng
186edc8fa1 Oops. Forgot this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42691 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 08:09:29 +00:00
Neil Booth
978661d053 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42669 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 00:24:48 +00:00
Gordon Henriksen
88cc699942 Wrapping Value::dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42668 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 00:08:49 +00:00
Gordon Henriksen
acd96191cd Removing the silly CHelpers header by rolling wrap and unwrap into the C
bindings headers themselves, hidden behind #ifdef __cplusplus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42666 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 23:59:36 +00:00
Dale Johannesen
161e897b0f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42644 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 20:04:43 +00:00
Chris Lattner
bca98326b6 Mark count method const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42639 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 17:40:38 +00:00
Dan Gohman
b6c7437568 SMUL_LOHI and UMUL_LOHI are commutative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42633 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 14:09:33 +00:00
Dan Gohman
fdd04d5dde Define target-indepenent SDNode types for multiply and divide that
produce two results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42632 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 14:07:56 +00:00
Duncan Sands
3ec81c0ee7 Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42631 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 10:37:00 +00:00
Daniel Berlin
ad92c633c7 Fix intersectWithComplement bug noticed by Curtis Dunham
Optimize |= case for empty RHS


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42629 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 05:10:53 +00:00
Evan Cheng
f10c973797 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42625 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:39:18 +00:00
Evan Cheng
66f0f64082 - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42621 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:32:41 +00:00
Evan Cheng
39305cf553 Add a variant of getTargetNode() that takes a vector of MVT::ValueType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42620 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:10:49 +00:00
Daniel Berlin
08bb699843 Fix the previous bug a slightly different way (by modifying how find_next works)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42613 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 21:27:17 +00:00
Daniel Berlin
9d03724c8c Fix off by one error in iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42612 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 21:18:20 +00:00
Daniel Berlin
8d69b5a113 It helps a lot when you check for the end of your list before randomly
dereferencing things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42605 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 05:29:36 +00:00
Daniel Berlin
c3a32d190c Make SparseBitVector::set actually work properly when sets are not in ascending or descending order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42604 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-04 05:25:51 +00:00
Neil Booth
a30b0ee959 Add APFloat -> hexadecimal string conversion, as per %a and %A in C99.
Useful for diagnostics and debugging.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42598 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 22:26:02 +00:00
Owen Anderson
9cb7f49ee9 Completely merge the implementation details of DomTree and PostDomTree.
Also, add a FIXME for a bug in PostDomTree calculation I noticed while writing this,


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42593 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 21:25:45 +00:00
Owen Anderson
9c8a9af5af Add a GraphTraits partial specialization to make the inverse of an inverse be the same as the underlying graph.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42592 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 21:24:38 +00:00
Chris Lattner
116c3219df Add initial iterator support for folding set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42589 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 21:12:09 +00:00
Dan Gohman
2bb7d0647e Fix a using namespace llvm; in a header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42584 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 19:04:09 +00:00
Neil Booth
b7dea4cb36 Tweak RoundAwayFromZero the bit number below which is truncated, and make
it const.

Preparation for APFloat -> hexadecimal string conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42576 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 15:16:41 +00:00
Gordon Henriksen
0abe116022 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42575 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 12:07:14 +00:00
Owen Anderson
471ab54df7 Factor some code from the DomTree and PostDomTree calculate methods up into
each one's runOnFunction method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42563 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 03:20:17 +00:00
Dale Johannesen
9ab7fb3ba4 Rewrite sqrt and powi to use anyfloat. By popular demand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42537 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-02 17:43:59 +00:00
Evan Cheng
450ff01faf Remove simple scheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42499 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 20:44:07 +00:00
Dale Johannesen
3b5b4cd1a5 Add getABITypeSize, getABITypeSizeInBits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42488 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 16:03:14 +00:00
Dan Gohman
21c276d2fa Add empty() member functions to a few container-like classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42487 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 16:01:23 +00:00
Chris Lattner
1bcc79666d Add a helper useful when mapping from a map element to its hash node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42480 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-30 08:31:46 +00:00
Owen Anderson
ab528fe0fb Template-ize more of the DomTree internal implementation details. Only the calculate() methods for DomTree and PostDomTree remain to be merged/template-ized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42476 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-30 04:17:16 +00:00
Chris Lattner
be207738d3 Add a new DenseSet abstraction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42474 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-30 00:47:20 +00:00
Duncan Sands
3c5f0233e0 Add newline at end of file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42470 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-29 16:38:37 +00:00
Gordon Henriksen
364caf0e19 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42466 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-29 02:13:43 +00:00
Gordon Henriksen
d070d1e56f Demoting CHelpers.h to include/llvm/Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42465 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-29 01:38:42 +00:00
Evan Cheng
e5f6204cd5 Enabling new condition code modeling scheme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42459 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-29 00:00:36 +00:00
Evan Cheng
22a529990b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42453 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 22:32:30 +00:00
Evan Cheng
74d2fd8dd8 Trim some unneeded fields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42442 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 19:24:24 +00:00
Owen Anderson
303f47b1dd Have PostDomTree use the newly templated DFSPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42427 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 01:23:47 +00:00
Dale Johannesen
317096ab37 Add sqrt and powi intrinsics for long double.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42423 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 01:08:20 +00:00