Commit Graph

36488 Commits

Author SHA1 Message Date
Chris Lattner
18bef16d84 Trivial patch to fix two warnings, please pull into llvm 2.2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46243 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-22 04:47:47 +00:00
Ted Kremenek
3387060470 Fixed buggy caching of the hash value of an ImutAVLTree node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46229 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:54:46 +00:00
Ted Kremenek
8893b0d3ac Moved method call within a conditional branch because its effects will
be ignored on the false branch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:51:35 +00:00
Ted Kremenek
c4125a3c44 Adjusted ImutAVLTree::ComputeHash to compute a hash value that is based on a
clearer sequence of hashing compositions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46227 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:50:37 +00:00
Ted Kremenek
c899b33b83 Added "clear" method to FoldingSetNodeID to allow a FoldingSetNodeID object
to be reused to compute multiple object profiles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46226 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:49:22 +00:00
Ted Kremenek
6518f5fcbf Replaced (FoldingSet) profiling of ImutAVLTree with a hashing based scheme. The
problem was that we previously hashed based on the pointers of the left and
right children, but this is bogus: we can easily have different trees that
represent the same set. Now we use a hashing based scheme that compares the
*contents* of the trees, but not without having to do a full scan of a tree. The
only caveat is that with hashing is that we may have collisions, which result in
two different trees being falsely labeled as equivalent. If this becomes a
problem, we can add extra data to the profile to hopefully resolve most
collisions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46224 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:33:30 +00:00
Anton Korobeynikov
82137bd061 Provide iterator access to ListInit contents
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46223 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:30:26 +00:00
Chris Lattner
c2f191cc2a Fix the failures in the PPC JIT by marking relocation entries for
external symbols (e.g. 'fmod') as needing a stub.  This regression
was introduced by Evan's jit patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071231/056749.html

With this fixed, the two ExecutionEngine failures are passing on ppc,
and the ppc jit works on freebench and olden.

This should be pulled into the 2.2 release branch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46222 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:27:27 +00:00
Devang Patel
5768c9658e New test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46220 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:15:58 +00:00
Owen Anderson
a6b1926531 Clarify a deviation from the original algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46218 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:03:00 +00:00
Owen Anderson
3b489522df Improve a few comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46217 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:01:01 +00:00
Duncan Sands
03531a4816 It turns out that in C++ it is legal to declare functions
that return an opaque type by value, as long as you don't
call it or provide a body (you can take the address of it).
So it is wrong to insist that sret parameters not be an
opaque*.  And I guess it is really up to codegen to complain
if someone tries to call such a function.  I'm also removing
the analogous check from byval parameters, since I don't
see why we shouldn't allow them as long as no-one tries to
call the function or give it a body.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46216 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 21:37:41 +00:00
Devang Patel
e5d53f5fe8 New test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46209 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 19:28:13 +00:00
Duncan Sands
333e8be5e8 Check that sret is only used on pointers to types
with a size, like byval.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46207 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 11:28:49 +00:00
Duncan Sands
53d4afcee9 Be consistent with other attribute methods, and
check the callee also if it is known.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46206 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 11:27:55 +00:00
Dale Johannesen
da9bb3578e Move DAG-changing code out of #ifndef NDEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46204 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 01:00:34 +00:00
Duncan Sands
e003813e96 Make sure the caller doesn't use freed memory.
Fixes PR1935.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46203 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-20 16:51:46 +00:00
Anton Korobeynikov
ea74c7e498 Honour ByVal parameter attribute for name decoration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46200 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-20 14:00:07 +00:00
Anton Korobeynikov
99e635ca69 Remove Darwin'ism
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46199 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-20 13:59:37 +00:00
Anton Korobeynikov
49964d6847 Enable PIC codegen on x86-64/linux
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46198 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-20 13:58:16 +00:00
Duncan Sands
02ec6e51ed Initializing an unsigned with ~0UL causes the compiler
to complain on x86-64 (gcc 4.1).  Use ~0U instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46197 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-20 10:49:23 +00:00
Dale Johannesen
713ed3f7c0 Do not generate a FP_ROUND of f64 to f64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46195 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-20 01:18:38 +00:00
Ted Kremenek
187784996c Changed argument name for 'Profile' method to potentially fix a name conflict
reported in pr1929 (http://llvm.org/PR1929).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46193 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 17:21:43 +00:00
Duncan Sands
4bdad51596 Need to handle any 'nest' parameter before integer
parameters, since otherwise it won't be passed in
the right register.  With this change trampolines
work on x86-64 (thanks to Luke Guest for providing
access to an x86-64 box).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46192 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 16:42:10 +00:00
Ted Kremenek
3cf8bec783 Modified ImmutableSet/ImmutableMap to use FoldingSet profiling using
FoldingSetTrait instead of directly calling a 'Profile' method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46190 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 04:51:55 +00:00
Ted Kremenek
4048a08284 Added FoldingSet style 'profiling' support for APSInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46189 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 04:31:12 +00:00
Ted Kremenek
e420debd26 Added FoldingSet style 'profiling' support for APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46188 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 04:23:33 +00:00
Ted Kremenek
0a3fecad0a Made 'FoldingSetNodeID' a proper class instead of a nested class in
'FoldingSetNodeImpl' (previously 'FoldingSetNodeID' was a typedef of
'FoldingSetNodeImpl::NodeID').

Why?  Clients can now easily forward declare 'FoldingSetNodeID' without having
to include FoldingSet.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46187 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 04:22:50 +00:00
Ted Kremenek
a753f703d1 Made 'profiling' of objects in a FoldingSet trait-based using FoldingSetTrait
instead of always assuming that the stored objects had a method called
'Profile'. The default behavior is to dispatch to a 'Profile' method (as
before), but via template specialization this behavior can now be overridden by
clients.

Added templated class 'FoldingSetNodeWrapper', a generic wrapper class that
allows one to insert objects into a FoldingSet that do not directly inherit from
FoldingSetNode. This is useful for inserting objects that do not always need to
pay the overhead of inheriting from FoldingSetNode, or were designed with that
behavior in mind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46186 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-19 03:58:00 +00:00
Evan Cheng
b4eae999f6 Fix makefiles to enable Apply style debug build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46180 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 21:01:00 +00:00
Dale Johannesen
5c5eb80255 Implement flt_rounds for PowerPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46174 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 19:55:37 +00:00
Chris Lattner
994d6cfb3d remove extraneous &&'s from tests, as Scott is apparently not going to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46173 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 19:53:43 +00:00
Dale Johannesen
9929207fde Test is correct again for the moment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46172 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 19:53:31 +00:00
Chris Lattner
c9133f9772 remove extraneous &'s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46171 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 19:36:20 +00:00
Chris Lattner
4569553432 don't form an std::string with a null pointer, it aborts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46166 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 18:54:31 +00:00
Chris Lattner
ef97c676f9 get symbolic information for ppc ldbl nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46165 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 18:51:16 +00:00
Chris Lattner
561e8c80f5 remove magic numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46162 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 17:13:03 +00:00
Chris Lattner
a7a02fb828 Fix a latent bug exposed by my truncstore patch. We compiled stfiwx-2.ll to:
_test:
	fctiwz f0, f1
	stfiwx f0, 0, r4
	blr 

instead of:

_test:
	fctiwz f0, f1
	stfd f0, -8(r1)
	nop
	nop
	lwz r2, -4(r1)
	stb r2, 0(r4)
	blr 

The former is not correct (stores 4 bytes, not 1).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46161 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 16:54:56 +00:00
Chris Lattner
3d66185ff8 make a method public
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46159 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 06:52:41 +00:00
Ted Kremenek
e8277538e7 Reverted implementation of ImmutableMap::find() to return a TreeTy* instead of
an iterator, since the implementation returned an iterator that pointed to a
different node! Renamed this implementation to SlimFind() so that users do not
expect it to return an iterator (it is a more efficient implementation than
returning an iterator if the user just wants to find the value of a key).

Added a FIXME to implement ImmutableMap::find() that returns an iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 00:38:04 +00:00
Dale Johannesen
25a0195114 Revert the part of 45849 that treated weak globals
as weak globals rather than commons.  While not wrong,
this change tickled a latent bug in Darwin's strip,
so revert it for now as a workaround.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46147 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 23:36:04 +00:00
Dale Johannesen
d15d086956 Revert the part of 45848 that treated weak globals
as weak globals rather than commons.  While not wrong,
this change tickled a latent bug in Darwin's strip,
so revert it for now as a workaround.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46144 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 23:04:07 +00:00
Scott Michel
58c5818c01 Forward progress: crtbegin.c now compiles successfully!
Fixed CellSPU's A-form (local store) address mode, so that all globals,
externals, constant pool and jump table symbols are now wrapped within
a SPUISD::AFormAddr pseudo-instruction. This now identifies all local
store memory addresses, although it requires a bit of legerdemain during
instruction selection to properly select loads to and stores from local
store, properly generating "LQA" instructions.

Also added mul_ops.ll test harness for exercising integer multiplication.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46142 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 20:38:41 +00:00
Chris Lattner
ddf89566a9 This commit changes:
1. Legalize now always promotes truncstore of i1 to i8. 
2. Remove patterns and gunk related to truncstore i1 from targets.
3. Rename the StoreXAction stuff to TruncStoreAction in TLI.
4. Make the TLI TruncStoreAction table a 2d table to handle from/to conversions.
5. Mark a wide variety of invalid truncstores as such in various targets, e.g.
   X86 currently doesn't support truncstore of any of its integer types.
6. Add legalize support for truncstores with invalid value input types.
7. Add a dag combine transform to turn store(truncate) into truncstore when
   safe.

The later allows us to compile CodeGen/X86/storetrunc-fp.ll to:

_foo:
	fldt	20(%esp)
	fldt	4(%esp)
	faddp	%st(1)
	movl	36(%esp), %eax
	fstps	(%eax)
	ret

instead of:

_foo:
	subl	$4, %esp
	fldt	24(%esp)
	fldt	8(%esp)
	faddp	%st(1)
	fstps	(%esp)
	movl	40(%esp), %eax
	movss	(%esp), %xmm0
	movss	%xmm0, (%eax)
	addl	$4, %esp
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46140 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 19:59:44 +00:00
Chris Lattner
41c5a3918f new testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46139 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 19:47:23 +00:00
Ted Kremenek
e509e7a178 Implemented "FIXME" in ImutAVLTree: isEqual() now also compares the *data* value
and not just the key value when comparing trees. To do this we added data_type
and data_type_ref to the ImutContainerInfo trait classes. For values stored in
the tree that do not have separate key and data components, data_type is simply
a typedef of bool, and isDataEqual() always evaluates to true. This allows us to
support both ImmutableSet and ImmutableMap using the same underlying logic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46130 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 17:36:49 +00:00
Chris Lattner
39354cb743 add some helper methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46128 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 07:30:38 +00:00
Evan Cheng
e6d5c77d5d Test case for varargs parameter attribute issue I just fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46127 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 07:26:31 +00:00
Chris Lattner
4626b250a2 code cleanups, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46126 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 07:20:38 +00:00
Chris Lattner
0bd4893a07 * Introduce a new SelectionDAG::getIntPtrConstant method
and switch various codegen pieces and the X86 backend over
  to using it.

* Add some comments to SelectionDAGNodes.h

* Introduce a second argument to FP_ROUND, which indicates
  whether the FP_ROUND changes the value of its input. If
  not it is safe to xform things like fp_extend(fp_round(x)) -> x.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46125 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 07:00:52 +00:00