Commit Graph

20407 Commits

Author SHA1 Message Date
Dan Gohman
07f04fd574 Add an ISD::FPOW node type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42879 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 23:06:37 +00:00
Dale Johannesen
83e105c600 Add missing argument to PALIGNR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42874 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 20:58:37 +00:00
Gabor Greif
724441e64a Fix an assertion abort on sparc. malloc(0) is allowed to
return NULL.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42871 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 19:40:35 +00:00
Arnold Schwaighofer
c85e1716f0 Added tail call optimization to the x86 back end. It can be
enabled by passing -tailcallopt to llc.  The optimization is
performed if the following conditions are satisfied:
* caller/callee are fastcc
* elf/pic is disabled OR
  elf/pic enabled + callee is in module + callee has
  visibility protected or hidden


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42870 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 19:40:01 +00:00
Dale Johannesen
a471c2ecda Next PPC long double bits. First cut at constants.
No compile-time support for constant operations yet,
just format transformations.  Make readers and
writers work.  Split constants into 2 doubles in
Legalize.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42865 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 18:07:22 +00:00
Devang Patel
f9193de25b Lower memcpy if it makes sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42864 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 17:21:57 +00:00
Chris Lattner
85d0aaa291 Fix CodeGen/Generic/BasicInstrs.llx on sparc by marking divrem
illegal.  Thanks to gabor for pointing this out!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42832 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 18:10:57 +00:00
Duncan Sands
272dce0137 Correct swapped arguments to getConstant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42824 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 09:54:50 +00:00
Dale Johannesen
6eaeff29b8 Next PPC long double bits: ppcf128->i32 conversion.
Surprisingly complicated.
Adds getTargetNode for 2 outputs, no inputs (missing).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42822 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 01:01:31 +00:00
Evan Cheng
be8db245f5 Bad choice of variable name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42821 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 00:11:40 +00:00
Evan Cheng
5edc57fa42 Fix an extremely stupid bug that prevented first round of coalescing (physical registers only) from happening.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42820 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 23:36:27 +00:00
Chris Lattner
3daae2701b Add new MemoryBuffer::getMemBufferCopy method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42815 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 21:46:38 +00:00
Devang Patel
b593898e11 Do not walk invalid iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42812 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 21:31:36 +00:00
Dan Gohman
9a5263241d Pass argc by value, not by reference, since it isn't modified.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42788 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 16:04:57 +00:00
Dan Gohman
6d60cac029 LowerIntegerDivOrRem no longer exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42787 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 15:45:13 +00:00
Dan Gohman
74f87a63b6 Fix grammar in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42786 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 15:44:37 +00:00
Dan Gohman
5bf88ebab9 This is done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42785 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 15:42:21 +00:00
Evan Cheng
b76143cf8f Under 64-bit mode use LEA64_32r instead of LEA64r to save a byte.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42783 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 07:14:53 +00:00
Chris Lattner
be2c4596cb Change a #include into a forward declaration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42781 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 03:40:30 +00:00
Bruno Cardoso Lopes
8262df3aa4 Position Independent Code (PIC) support [3]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42780 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 03:15:11 +00:00
Bruno Cardoso Lopes
0a6040063f Position Independent Code (PIC) support [2]
- Added a function to hold the stack location 
  where GP must be stored during LowerCALL
- AsmPrinter now emits directives based on
  relocation type
- PIC_ set to default relocation type (same as GCC)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42779 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 03:01:19 +00:00
Bruno Cardoso Lopes
e78080c4dc Position Independent Code (PIC) support [1]
- Modified instruction format to handle pseudo instructions
- Added LoadAddr SDNode to load symbols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42778 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 02:55:31 +00:00
Evan Cheng
3f41d66d75 Bug fix. X86 was emitting redundant setcc and test instructions before a conditional move.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42774 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 22:16:29 +00:00
Dan Gohman
30d4254536 Call getFunctionNumber() instead of referencing FunctionNumber directly,
for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42769 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 21:27:12 +00:00
Dan Gohman
525178cdbf Migrate X86 and ARM from using X86ISD::{,I}DIV and ARMISD::MULHILO{U,S} to
use ISD::{S,U}DIVREM and ISD::{S,U}MUL_HIO. Move the lowering code
associated with these operators into target-independent in LegalizeDAG.cpp
and TargetLowering.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42762 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 18:33:35 +00:00
Evan Cheng
d47c84c1c9 Allow x86 compare to be commutable by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42761 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 18:27:46 +00:00
Gordon Henriksen
2618a6c112 C and Objective Caml bindings for PHINode::addIncoming etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42760 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 18:14:39 +00:00
Dan Gohman
389079b59f DAGCombiner support for UDIVREM/SDIVREM and UMUL_LOHI/SMUL_LOHI.
Check if one of the two results unneeded so see if a simpler operator
could bs used. Also check to see if each of the two computations could be
simplified if they were split into separate operators. Factor out the code
that calls visit() so that it can be used for this purpose.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42759 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 17:57:15 +00:00
Evan Cheng
b428657504 Remove debugging printf to get build going on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42757 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 17:49:43 +00:00
Dan Gohman
3ce990dc05 When we start enabling SMUL_LOHI/UMUL_LOHI or SDIVREM/UDIVREM in
target-indepenent lowering, don't use them on PowerPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42755 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 17:28:24 +00:00
Dan Gohman
08ce976971 Add convenience overloads of SelectionDAG::getNode that take a SDVTList
and individual SDOperand operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42753 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:49:58 +00:00
Dan Gohman
82a13c9c48 Move the space in overview output for commands out of each of the
commands and into the common code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42752 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:45:12 +00:00
Dan Gohman
8e41ed7c4e Simplify getIntPtrType, allowing it to work for arbitrary pointer sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:16:25 +00:00
Dan Gohman
c318329a10 Use correct parentheses with the '&& "..."' idiom in an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42750 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:13:30 +00:00
Dan Gohman
417e11b9bf In -debug mode, dump SelectionDAGs both before and after the
optimization passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42749 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:12:17 +00:00
Dan Gohman
cdf2b3b2f8 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42747 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 15:08:41 +00:00
Neil Booth
5477f8593d Use APInt::tcExtract. It's cleaner, and works :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42746 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 14:39:42 +00:00
Neil Booth
68e53ad6cb Add a new function tcExtract for extracting a bignum from an
arbitrary range of bits embedded in the middle of another bignum.
This kind of operation is desirable in many cases of software
floating point, e.g. converting bignum integers to floating point
numbers of fixed precision (you want to extract the precision most
significant bits).

Elsewhere, add an assertion, and exit the shift functions early if
the shift count is zero.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42745 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 13:47:12 +00:00
Owen Anderson
1aad74c9e8 Begin the process of allowing DomTree on MBB's. Step One: template DomTreeNode by making it a typedef of a templated DomTreeNodeBase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42743 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 07:44:39 +00:00
Evan Cheng
537d5c27ff Kill cycle of an live range is always the last use index + 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42742 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 06:59:30 +00:00
Gordon Henriksen
6d6203dff3 C and Objective Caml bindings for getFunction and getNamedGlobal. Also enhanced
the Objective Caml 'declare_*' functions to behave more or less like
getOrInsertFunction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42740 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 03:45:09 +00:00
Chris Lattner
f443ba7f97 disable this entirely: it is causing use of invalidated iterators and infinite looping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42739 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 22:00:31 +00:00
Chris Lattner
eac9385f09 Fix many regressions on x86 by avoiding dereferencing the end iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42738 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 21:53:12 +00:00
Gordon Henriksen
c84c16be9b C and Objective Caml bindings for GlobalVariable::isConstant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42736 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 17:31:42 +00:00
Neil Booth
f16c595252 Add back convertFromSignExtendedInteger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42735 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 12:15:41 +00:00
Neil Booth
7a7bc0f724 Now that convertFromUnsignedParts has a sane, constant interface,
convertFromZeroExtendedInteger can be simplified as it doesn't need
to make a copy of the source bignum.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42734 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 12:10:57 +00:00
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
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