Commit Graph

4126 Commits

Author SHA1 Message Date
Evan Cheng
513da43c9c Reapply 42677.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42692 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 08:19:55 +00:00
Chris Lattner
5349de1372 revert evan's patch until the header is committed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42686 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 06:08:17 +00:00
Evan Cheng
c231e8c8a5 Added DAG xforms. e.g.
(vextract (v4f32 s2v (f32 load $addr)), 0) -> (f32 load $addr) 
(vextract (v4i32 bc (v4f32 s2v (f32 load $addr))), 0) -> (i32 load $addr)
Remove x86 specific patterns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42677 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 02:46:29 +00:00
Dale Johannesen
638ccd52b9 Next powerpc long double bits. Comparisons work,
although not well, and shortening FP converts.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42672 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 01:24:11 +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
Dan Gohman
e14ea86744 Legalize support for MUL_LOHI and DIVREM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42636 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 14:17:22 +00:00
Dan Gohman
2eb4ebd953 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42635 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 14:11:58 +00:00
Dan Gohman
ccd60799cd Provide names for MUL_LOHI and DIVREM operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42634 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 14:11:04 +00:00
Evan Cheng
d5cb5a462b Chain producing nodes cannot be moved, not chain reading nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42627 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:42:35 +00:00
Evan Cheng
117c366219 Oops. Didn't mean to leave this in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42626 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:39:40 +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
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
Evan Cheng
daccea18ca Silence a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42619 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-05 01:09:32 +00:00
Dan Gohman
cb406c2597 Use empty() member functions when that's what's being tested for instead
of comparing begin() and end().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42585 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-03 19:26:29 +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
Dale Johannesen
a7ac2bd407 Fix stride computations for long double arrays.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42508 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 23:08:35 +00:00
Dan Gohman
d57c3884af Move the code that emits the .file directives so that it runs after the
SourceFiles list is fully filled in so that it sees all of the files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42506 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01 22:40:20 +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
d89b117850 remove dup comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42486 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-30 19:08:12 +00:00
Dale Johannesen
88216af3ea Constant fold int-to-long-double conversions;
use APFloat for int-to-float/double; use
round-to-nearest for these (implementation-defined,
seems to match gcc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42484 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-30 18:19:03 +00:00
Gordon Henriksen
078f5e1875 This is done already.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42467 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-29 02:23:08 +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
Dan Gohman
9fe4662d9a Teach SplitVectorOp how to split INSERT_VECTOR_ELT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42457 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 23:53:40 +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
ddde335cb7 Remove a poor scheduling heuristic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42443 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 19:37:35 +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
Dale Johannesen
72292f0712 Fix long double -> uint64 conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42440 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 18:44:17 +00:00
Dale Johannesen
4292d1c02a minor long double related changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42439 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 18:06:58 +00:00
Dan Gohman
9fda5be36b Make the checks for DW_FORM_data4 consistent with the others, and
add more such code for DIEDwarfLabel::SizeOf and DIEObjectLabel::SizeOf.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42435 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 16:50:28 +00:00
Dan Gohman
06ff4e67c4 Use 32-bit data directives for DW_FORM_data4 format data, even on
targets with 64-bit addresses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42434 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-28 15:43:33 +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
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
cd1c00cc65 Avoid inserting a live register more than once.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 18:46:06 +00:00
Evan Cheng
64f638df56 Silence a compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42389 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 07:35:39 +00:00
Evan Cheng
2dc7a0e075 Boogs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42388 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 07:29:27 +00:00
Evan Cheng
a2ee2756f7 Be smarter about which node to force schedule. Reduce # of duplications + copies; Added statistics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42387 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 07:09:03 +00:00
Evan Cheng
6e4c46cea5 Backtracking only when it won't create a cycle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42384 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-27 00:25:29 +00:00
Dale Johannesen
693717fbe6 Make temporaries explicit to avoid premature
destruction of compiler-created ones.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42383 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 23:20:33 +00:00
Evan Cheng
42d60274ea - Move getPhysicalRegisterRegClass() from ScheduleDAG to MRegisterInfo.
- Added ability to emit cross class register copies to the BBRU scheduler.
- More aggressive backtracking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42375 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 21:36:17 +00:00
Dale Johannesen
2f42901dff Enable codegen for long double abs, sin, cos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42368 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 21:10:55 +00:00
Dale Johannesen
f41db2136f Fix f80 UNDEF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42359 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26 17:26:49 +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
Dan Gohman
c3b0b5ca1d Move the setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand) and
the check to see if the assembler supports .loc from X86TargetLowering
into the superclass TargetLowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42297 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25 15:10:49 +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
Dan Gohman
81a148bd56 Don't emit .debug_line header data if there aren't any lines to put in it,
such as will happen when .loc directives are used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42277 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 21:43:52 +00:00
Dan Gohman
44de9267c3 Move the Asm->EOL() call for EmitDebugARanges outside the #ifdef for
consistency with the other currently empty sections.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42276 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 21:36:21 +00:00
Dan Gohman
8549636fcf Add support for emitting .file directives to set up file numbers for
use with .loc directives.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42275 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-24 21:32:18 +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