Commit Graph

6239 Commits

Author SHA1 Message Date
Ted Kremenek f5601e2169 Added additional overloaded operators for APSInt to match the operators of
APInt.

While some operators were already specifically overloaded for APSInt, others
resulted in using the overloaded operator methods in APInt, which would result
in the signedness bit being lost.

Modified the APSInt(APInt&) constructor to be "explicit" and to take an
extra (optional) flag to indicate the signedness.  Making the ctor explicit
will catch any implicit conversations between APSInt -> APInt -> APSInt that
results in the signedness flag being lost.

llvm-svn: 46316
2008-01-24 18:59:52 +00:00
Chris Lattner e30f09d0c5 Add hasByValAttr() and hasNoAliasAttr() methods to the Argument class.
llvm-svn: 46314
2008-01-24 17:47:11 +00:00
Owen Anderson 2a8a485630 Move some functionality for adding flags to MachineInstr's into methods on MachineInstr rather than LiveVariables.
llvm-svn: 46295
2008-01-24 01:10:07 +00:00
Evan Cheng 35abd840a6 Let each target decide byval alignment. For X86, it's 4-byte unless the aggregare contains SSE vector(s). For x86-64, it's max of 8 or alignment of the type.
llvm-svn: 46286
2008-01-23 23:17:41 +00:00
Ted Kremenek 9e7a112377 Added special escape sequences "\{", "\}", and "\|" when processing
getNodeLabel(); these sequences allow the user to specify the characters '{',
'}', and '|' in the label, which facilitate breaking the label into multiple
record segments.

llvm-svn: 46283
2008-01-23 22:29:58 +00:00
Ted Kremenek 9d21a0cb07 Added "getRoot()" to ImmutableSet.
Made ImmutableSet::ImmutableSet(ImutAVLTree* Root) public. (this allows handy
casting between trees and sets).

llvm-svn: 46277
2008-01-23 19:57:33 +00:00
Anton Korobeynikov 427f3167bc Silence a warning. Should we turn this into configure-time check?
llvm-svn: 46251
2008-01-22 11:01:23 +00:00
Ted Kremenek a7287785ad Fixed buggy caching of the hash value of an ImutAVLTree node.
llvm-svn: 46229
2008-01-21 22:54:46 +00:00
Ted Kremenek 5465d11a23 Moved method call within a conditional branch because its effects will
be ignored on the false branch.

llvm-svn: 46228
2008-01-21 22:51:35 +00:00
Ted Kremenek aea769ee6d Adjusted ImutAVLTree::ComputeHash to compute a hash value that is based on a
clearer sequence of hashing compositions.

llvm-svn: 46227
2008-01-21 22:50:37 +00:00
Ted Kremenek 048bf7a0f9 Added "clear" method to FoldingSetNodeID to allow a FoldingSetNodeID object
to be reused to compute multiple object profiles.

llvm-svn: 46226
2008-01-21 22:49:22 +00:00
Ted Kremenek 16b838f9c6 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.

llvm-svn: 46224
2008-01-21 22:33:30 +00:00
Chris Lattner 4fe3c99310 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.

llvm-svn: 46222
2008-01-21 22:27:27 +00:00
Ted Kremenek 7d2b746f08 Changed argument name for 'Profile' method to potentially fix a name conflict
reported in pr1929 (http://llvm.org/PR1929).

llvm-svn: 46193
2008-01-19 17:21:43 +00:00
Ted Kremenek bb80c7b800 Modified ImmutableSet/ImmutableMap to use FoldingSet profiling using
FoldingSetTrait instead of directly calling a 'Profile' method.

llvm-svn: 46190
2008-01-19 04:51:55 +00:00
Ted Kremenek 4875d2d997 Added FoldingSet style 'profiling' support for APSInt.
llvm-svn: 46189
2008-01-19 04:31:12 +00:00
Ted Kremenek 5c75d54c5b Added FoldingSet style 'profiling' support for APInt.
llvm-svn: 46188
2008-01-19 04:23:33 +00:00
Ted Kremenek c0259639ad 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.

llvm-svn: 46187
2008-01-19 04:22:50 +00:00
Ted Kremenek f1210f7c43 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.

llvm-svn: 46186
2008-01-19 03:58:00 +00:00
Chris Lattner 6d4ee152ff don't form an std::string with a null pointer, it aborts.
llvm-svn: 46166
2008-01-18 18:54:31 +00:00
Chris Lattner f0d396592a remove magic numbers.
llvm-svn: 46162
2008-01-18 17:13:03 +00:00
Ted Kremenek ab405774b6 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.

llvm-svn: 46150
2008-01-18 00:38:04 +00:00
Chris Lattner 1ea55cf816 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

llvm-svn: 46140
2008-01-17 19:59:44 +00:00
Ted Kremenek 2b8b71c148 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.

llvm-svn: 46130
2008-01-17 17:36:49 +00:00
Chris Lattner 686dfe829e add some helper methods.
llvm-svn: 46128
2008-01-17 07:30:38 +00:00
Chris Lattner 72733e573b * 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.

llvm-svn: 46125
2008-01-17 07:00:52 +00:00
Dale Johannesen ed20366706 Do not mark EH tables no-dead-strip unless the
associated function is so marked.

llvm-svn: 46088
2008-01-16 19:59:28 +00:00
Chris Lattner 2e50a6f90f Factor the ReachesChainWithoutSideEffects out of dag combiner into
a public SDOperand::reachesChainWithoutSideEffects method.  No 
functionality change.

llvm-svn: 46050
2008-01-16 05:49:24 +00:00
Ted Kremenek 7ea05687be Changed ImmutableMap::find to return an iterator instead of a pointer
to the tree node.

llvm-svn: 46034
2008-01-15 23:53:53 +00:00
Devang Patel 41f375a45c - Introduces versioning macro LLVM_LTO_VERSION
- Communicate symbol visibility
- Communicate code generation model

llvm-svn: 46033
2008-01-15 23:52:34 +00:00
Dale Johannesen 59a2250b0d Fix and enable EH for x86-64 Darwin. Adds
ShortenEHDataFor64Bits as a not-very-accurate
abstraction to cover all the changes in DwarfWriter.
Some cosmetic changes to Darwin assembly code for
gcc testsuite compatibility.

llvm-svn: 46029
2008-01-15 23:24:56 +00:00
Owen Anderson 897aed9109 Move some calls to getVRegDef higher in the callgraph, so they don't get executed as frequently in performance sensitive code.
llvm-svn: 46027
2008-01-15 22:58:11 +00:00
Evan Cheng 51a09143c2 Unbreak the build.
llvm-svn: 46021
2008-01-15 22:19:35 +00:00
Gordon Henriksen 1390ef4163 Fix a memory correctness error noticed by valgrind (harmless in practice).
Thanks to Duncan Sands for noticing it.

llvm-svn: 46007
2008-01-15 20:02:11 +00:00
Evan Cheng 4f7437f8af Oops. Forgot to commit this.
llvm-svn: 46003
2008-01-15 07:49:54 +00:00
Anton Korobeynikov 6bbbc4cbfa For PR1839: add initial support for __builtin_trap. llvm-gcc part is missed
as well as PPC codegen

llvm-svn: 46001
2008-01-15 07:02:33 +00:00
Duncan Sands b5ca2e9fcb I noticed that the trampoline straightening transformation could
drop attributes on varargs call arguments.  Also, it could generate
invalid IR if the transformed call already had the 'nest' attribute
somewhere (this can never happen for code coming from llvm-gcc,
but it's a theoretical possibility).  Fix both problems.

llvm-svn: 45973
2008-01-14 19:52:09 +00:00
Evan Cheng 09dde6001d Add hasByValArgument() to test if a call instruction has byval argument(s).
llvm-svn: 45913
2008-01-12 18:57:32 +00:00
Duncan Sands 0009c44464 Be more liberal in what parameter attributes are
allowed on the vararg arguments of a call.

llvm-svn: 45909
2008-01-12 16:42:01 +00:00
Chris Lattner 22ad7abdfe Allow clients to specify the inline threshold when creating
the inliner pass.  Patch by Robert Zeh.

llvm-svn: 45903
2008-01-12 06:49:13 +00:00
Chris Lattner 1f503ddab5 remove some incorrect classof's.
llvm-svn: 45893
2008-01-11 23:25:16 +00:00
Duncan Sands b99f44aa5e Do not allow attributes beyond a function's last
parameter, even if it is a varargs function.  Do
allow attributes on the varargs part of a call,
but not beyond the last argument.  Only allow
selected attributes to be on the varargs part of
a call (currently only 'byval' is allowed).  The
reasoning here is that most attributes, eg inreg,
simply make no sense here.

llvm-svn: 45887
2008-01-11 22:36:48 +00:00
Chris Lattner c70ed4ba5b add operator==/!= to smallvector.
llvm-svn: 45872
2008-01-11 18:42:02 +00:00
Chris Lattner 596875118c rename MachineInstr::setInstrDescriptor -> setDesc
llvm-svn: 45871
2008-01-11 18:10:50 +00:00
Chris Lattner 6d7cf509d1 don't include loopinfo.h from this file.
llvm-svn: 45858
2008-01-11 06:30:04 +00:00
Chris Lattner b3220147d2 Move typedef of loop to top of the file where it is more obvious.
llvm-svn: 45857
2008-01-11 06:29:42 +00:00
Chris Lattner b97b83fbf7 Fix 80 col violations
llvm-svn: 45856
2008-01-11 06:27:42 +00:00
Scott Michel 8d5841ae3c More CellSPU refinement and progress:
- Cleaned up custom load/store logic, common code is now shared [see note
  below], cleaned up address modes

- More test cases: various intrinsics, structure element access (load/store
  test), updated target data strings, indirect function calls.

Note: This patch contains a refactoring of the LoadSDNode and StoreSDNode
structures: they now share a common base class, LSBaseSDNode, that
provides an interface to their common functionality. There is some hackery
to access the proper operand depending on the derived class; otherwise,
to do a proper job would require finding and rearranging the SDOperands
sent to StoreSDNode's constructor. The current refactor errs on the
side of being conservatively and backwardly compatible while providing
functionality that reduces redundant code for targets where loads and
stores are custom-lowered.

llvm-svn: 45851
2008-01-11 02:53:15 +00:00
Chris Lattner c8226f32e9 Simplify the side effect stuff a bit more and make licm/sinking
both work right according to the new flags.

This removes the TII::isReallySideEffectFree predicate, and adds
TII::isInvariantLoad. 

It removes NeverHasSideEffects+MayHaveSideEffects and adds
UnmodeledSideEffects as machine instr flags.  Now the clients
can decide everything they need.

I think isRematerializable can be implemented in terms of the
flags we have now, though I will let others tackle that.

llvm-svn: 45843
2008-01-10 23:08:24 +00:00
Duncan Sands 53c954fa86 Output sinl for a long double FSIN node, not sin.
Likewise fix up a bunch of other libcalls.  While
there I remove NEG_F32 and NEG_F64 since they are
not used anywhere.  This fixes 9 Ada ACATS failures.

llvm-svn: 45833
2008-01-10 10:28:30 +00:00