Commit Graph

5789 Commits

Author SHA1 Message Date
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
Owen Anderson
58ec8825d4 Convert DFSPass into a templated friend function, in preparation for making it common to DomTree and PostDomTree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42420 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 23:23:00 +00:00
Dan Gohman
82482944ed 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42419 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 23:12:31 +00:00
Gordon Henriksen
fc3282221f 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 22:18:46 +00:00
Gordon Henriksen
d9900c9442 My previous Registry.h header, as well as Collectors.h, which is the
registry for dynamically-loaded garbage collection compiler plugins.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42415 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 19:34:27 +00:00
Evan Cheng
8ed3ffee53 Oops. Forgot this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42377 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 21:38:03 +00:00
Neil Booth
117acf9e36 Whitespace cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42374 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 21:35:05 +00:00
Evan Cheng
ff11026575 - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42372 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 21:31:07 +00:00
Gordon Henriksen
46abf91f73 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42367 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 20:56:12 +00:00
Evan Cheng
9efce638d3 Allow copyRegToReg to emit cross register classes copies.
Tested with "make check"!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42346 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 06:25:56 +00:00
Daniel Berlin
9f711252f5 Fix small bug in operator== for iterators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42331 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 00:11:59 +00:00
Duncan Sands
d98164e6ee Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42296 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 13:53:22 +00:00
Evan Cheng
a6fb1b6743 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42284 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 01:54:36 +00:00
Evan Cheng
a3602685b3 New temporary option -new-cc-modeling-scheme to test the new cc modeling scheme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42283 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 01:50:04 +00:00
Daniel Berlin
e6f0479aee Comment fixups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42279 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 22:20:45 +00:00
Dan Gohman
72252732c8 Merge hasDotLoc and hasDotFile into hasDotLocAndDotFile since .loc and .file
aren't really usable without each other. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42274 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 21:09:53 +00:00
Dan Gohman
189f80dc25 Add a routine for emitting .file directives, for setting up
file numbers to use with .loc directives.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42272 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 20:58:13 +00:00
Daniel Berlin
d81ccc2806 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42269 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 19:45:49 +00:00
Dan Gohman
746767b097 explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42262 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 15:48:49 +00:00