oota-llvm.git
16 years agoChanged argument name for 'Profile' method to potentially fix a name conflict
Ted Kremenek [Sat, 19 Jan 2008 17:21:43 +0000 (17:21 +0000)]
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

16 years agoNeed to handle any 'nest' parameter before integer
Duncan Sands [Sat, 19 Jan 2008 16:42:10 +0000 (16:42 +0000)]
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

16 years agoModified ImmutableSet/ImmutableMap to use FoldingSet profiling using
Ted Kremenek [Sat, 19 Jan 2008 04:51:55 +0000 (04:51 +0000)]
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

16 years agoAdded FoldingSet style 'profiling' support for APSInt.
Ted Kremenek [Sat, 19 Jan 2008 04:31:12 +0000 (04:31 +0000)]
Added FoldingSet style 'profiling' support for APSInt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46189 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded FoldingSet style 'profiling' support for APInt.
Ted Kremenek [Sat, 19 Jan 2008 04:23:33 +0000 (04:23 +0000)]
Added FoldingSet style 'profiling' support for APInt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46188 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMade 'FoldingSetNodeID' a proper class instead of a nested class in
Ted Kremenek [Sat, 19 Jan 2008 04:22:50 +0000 (04:22 +0000)]
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

16 years agoMade 'profiling' of objects in a FoldingSet trait-based using FoldingSetTrait
Ted Kremenek [Sat, 19 Jan 2008 03:58:00 +0000 (03:58 +0000)]
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

16 years agoFix makefiles to enable Apply style debug build.
Evan Cheng [Fri, 18 Jan 2008 21:01:00 +0000 (21:01 +0000)]
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

16 years agoImplement flt_rounds for PowerPC.
Dale Johannesen [Fri, 18 Jan 2008 19:55:37 +0000 (19:55 +0000)]
Implement flt_rounds for PowerPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46174 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove extraneous &&'s from tests, as Scott is apparently not going to.
Chris Lattner [Fri, 18 Jan 2008 19:53:43 +0000 (19:53 +0000)]
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

16 years agoTest is correct again for the moment.
Dale Johannesen [Fri, 18 Jan 2008 19:53:31 +0000 (19:53 +0000)]
Test is correct again for the moment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46172 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove extraneous &'s.
Chris Lattner [Fri, 18 Jan 2008 19:36:20 +0000 (19:36 +0000)]
remove extraneous &'s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46171 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agodon't form an std::string with a null pointer, it aborts.
Chris Lattner [Fri, 18 Jan 2008 18:54:31 +0000 (18:54 +0000)]
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

16 years agoget symbolic information for ppc ldbl nodes.
Chris Lattner [Fri, 18 Jan 2008 18:51:16 +0000 (18:51 +0000)]
get symbolic information for ppc ldbl nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46165 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove magic numbers.
Chris Lattner [Fri, 18 Jan 2008 17:13:03 +0000 (17:13 +0000)]
remove magic numbers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46162 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a latent bug exposed by my truncstore patch. We compiled stfiwx-2.ll to:
Chris Lattner [Fri, 18 Jan 2008 16:54:56 +0000 (16:54 +0000)]
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

16 years agomake a method public
Chris Lattner [Fri, 18 Jan 2008 06:52:41 +0000 (06:52 +0000)]
make a method public

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46159 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReverted implementation of ImmutableMap::find() to return a TreeTy* instead of
Ted Kremenek [Fri, 18 Jan 2008 00:38:04 +0000 (00:38 +0000)]
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

16 years agoRevert the part of 45849 that treated weak globals
Dale Johannesen [Thu, 17 Jan 2008 23:36:04 +0000 (23:36 +0000)]
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

16 years agoRevert the part of 45848 that treated weak globals
Dale Johannesen [Thu, 17 Jan 2008 23:04:07 +0000 (23:04 +0000)]
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

16 years agoForward progress: crtbegin.c now compiles successfully!
Scott Michel [Thu, 17 Jan 2008 20:38:41 +0000 (20:38 +0000)]
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

16 years agoThis commit changes:
Chris Lattner [Thu, 17 Jan 2008 19:59:44 +0000 (19:59 +0000)]
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

16 years agonew testcase.
Chris Lattner [Thu, 17 Jan 2008 19:47:23 +0000 (19:47 +0000)]
new testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46139 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImplemented "FIXME" in ImutAVLTree: isEqual() now also compares the *data* value
Ted Kremenek [Thu, 17 Jan 2008 17:36:49 +0000 (17:36 +0000)]
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

16 years agoadd some helper methods.
Chris Lattner [Thu, 17 Jan 2008 07:30:38 +0000 (07:30 +0000)]
add some helper methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46128 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTest case for varargs parameter attribute issue I just fixed.
Evan Cheng [Thu, 17 Jan 2008 07:26:31 +0000 (07:26 +0000)]
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

16 years agocode cleanups, no functionality change.
Chris Lattner [Thu, 17 Jan 2008 07:20:38 +0000 (07:20 +0000)]
code cleanups, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46126 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago* Introduce a new SelectionDAG::getIntPtrConstant method
Chris Lattner [Thu, 17 Jan 2008 07:00:52 +0000 (07:00 +0000)]
* 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

16 years agoadd testcase that has been sitting in my tree for awhile.
Chris Lattner [Thu, 17 Jan 2008 06:54:09 +0000 (06:54 +0000)]
add testcase that has been sitting in my tree for awhile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46124 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate license for current year.
Tanya Lattner [Thu, 17 Jan 2008 05:57:59 +0000 (05:57 +0000)]
Update license for current year.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46120 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate version to 2.3svn
Tanya Lattner [Thu, 17 Jan 2008 05:57:22 +0000 (05:57 +0000)]
Update version to 2.3svn
Regenerate configure with 2.60.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46119 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDAE bug fix. Don't lose parameter attributes on vararg arguments.
Evan Cheng [Thu, 17 Jan 2008 04:18:54 +0000 (04:18 +0000)]
DAE bug fix. Don't lose parameter attributes on vararg arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46113 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoEnable CBE
Devang Patel [Thu, 17 Jan 2008 02:10:08 +0000 (02:10 +0000)]
Enable CBE

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46112 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWhen a live virtual register is being clobbered by an implicit def, it is spilled
Evan Cheng [Thu, 17 Jan 2008 02:08:17 +0000 (02:08 +0000)]
When a live virtual register is being clobbered by an implicit def, it is spilled
and the spill is its kill. However, if the local allocator has determined the
register has not been modified (possible when its value was reloaded), it would
not issue a restore. In that case, mark the last use of the virtual register as
kill.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46111 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix arg promotion to propagate the correct attrs on the calls to
Chris Lattner [Thu, 17 Jan 2008 01:17:03 +0000 (01:17 +0000)]
Fix arg promotion to propagate the correct attrs on the calls to
promoted functions.  This is important for varargs calls in
particular.  Thanks to duncan for providing a great testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46108 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReplace std::vector<bool> with BitVector.
Evan Cheng [Thu, 17 Jan 2008 00:35:26 +0000 (00:35 +0000)]
Replace std::vector<bool> with BitVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46104 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFixes a nasty dag combiner bug that causes a bunch of tests to fail at -O0.
Evan Cheng [Wed, 16 Jan 2008 23:11:54 +0000 (23:11 +0000)]
Fixes a nasty dag combiner bug that causes a bunch of tests to fail at -O0.

It's not safe to use the two value CombineTo variant to combine away a dead load.
e.g.
v1, chain2 = load chain1, loc
v2, chain3 = load chain2, loc
v3         = add v2, c
Now we replace use of v1 with undef, use of chain2 with chain1.
ReplaceAllUsesWith() will iterate through uses of the first load and update operands:
v1, chain2 = load chain1, loc
v2, chain3 = load chain1, loc
v3         = add v2, c
Now the second load is the same as the first load, SelectionDAG cse will ensure
the use of second load is replaced with the first load.
v1, chain2 = load chain1, loc
v3         = add v1, c
Then v1 is replaced with undef and bad things happen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46099 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTrampoline support for x86-64. This looks like
Duncan Sands [Wed, 16 Jan 2008 22:55:25 +0000 (22:55 +0000)]
Trampoline support for x86-64.  This looks like
it should work, but I have no machine to test
it on.  Committed because it will at least
cause no harm, and maybe someone can test it
for me!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46098 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHandle attribute(used) global variables that are i8.
Chris Lattner [Wed, 16 Jan 2008 21:35:43 +0000 (21:35 +0000)]
Handle attribute(used) global variables that are i8.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46090 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDo not mark EH tables no-dead-strip unless the
Dale Johannesen [Wed, 16 Jan 2008 19:59:28 +0000 (19:59 +0000)]
Do not mark EH tables no-dead-strip unless the
associated function is so marked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46088 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd testcase for regression
Chris Lattner [Wed, 16 Jan 2008 18:03:52 +0000 (18:03 +0000)]
add testcase for regression

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46073 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a ppc long double regression I introduced yesterday due to a
Chris Lattner [Wed, 16 Jan 2008 17:59:31 +0000 (17:59 +0000)]
Fix a ppc long double regression I introduced yesterday due to a
simplification.  This fixes automotive-basicmath on PPC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46072 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomerge a few pieces of code that do the store/load to stack
Chris Lattner [Wed, 16 Jan 2008 07:51:34 +0000 (07:51 +0000)]
merge a few pieces of code that do the store/load to stack
pattern to use EmitStackConvert now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46066 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorename ExpandBIT_CONVERT to EmitStackConvert, generalizing
Chris Lattner [Wed, 16 Jan 2008 07:45:30 +0000 (07:45 +0000)]
rename ExpandBIT_CONVERT to EmitStackConvert, generalizing
it to allow it to emit different load and store kinds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46065 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agosimplify a bunch of code by using SelectionDAG::CreateStackTemporary
Chris Lattner [Wed, 16 Jan 2008 07:03:22 +0000 (07:03 +0000)]
simplify a bunch of code by using SelectionDAG::CreateStackTemporary
instead of inlining its body.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46062 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoChange legalizeop of FP_ROUND and FP_EXTEND to not fall through
Chris Lattner [Wed, 16 Jan 2008 06:57:07 +0000 (06:57 +0000)]
Change legalizeop of FP_ROUND and FP_EXTEND  to not fall through
into the ANY_EXTEND/ZERO_EXTEND/SIGN_EXTEND code to simplify it.

Unmerge the code for FP_ROUND and FP_EXTEND from each other to
make each one simpler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46061 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomake sure to use a cpu that has sse.
Chris Lattner [Wed, 16 Jan 2008 06:32:02 +0000 (06:32 +0000)]
make sure to use a cpu that has sse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46060 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomake it more clear that this predicate only applies to scalar FP types.
Chris Lattner [Wed, 16 Jan 2008 06:24:21 +0000 (06:24 +0000)]
make it more clear that this predicate only applies to scalar FP types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46058 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agointroduce a isTypeInSSEReg predicate, which allows us to simplify
Chris Lattner [Wed, 16 Jan 2008 06:19:45 +0000 (06:19 +0000)]
introduce a isTypeInSSEReg predicate, which allows us to simplify
some code.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46055 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMy previous commit had an incomplete message, it should have been:
Chris Lattner [Wed, 16 Jan 2008 05:56:59 +0000 (05:56 +0000)]
My previous commit had an incomplete message, it should have been:

make the 'fp return in ST(0)' optimization smart enough to
look through token factor nodes.  THis allows us to compile
testcases like CodeGen/X86/fp-stack-retcopy.ll into:

_carg:
subl $12, %esp
call L_foo$stub
fstpl (%esp)
fldl (%esp)
addl $12, %esp
ret

instead of:

_carg:
subl $28, %esp
call L_foo$stub
fstpl 16(%esp)
movsd 16(%esp), %xmm0
movsd %xmm0, 8(%esp)
fldl 8(%esp)
addl $28, %esp
ret

Still not optimal, but much better and this is a trivial patch.  Fixing
the rest requires invasive surgery that is is not llvm 2.2 material.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46054 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomake the 'fp return in ST(0)' optimization smart enough to
Chris Lattner [Wed, 16 Jan 2008 05:53:06 +0000 (05:53 +0000)]
make the 'fp return in ST(0)' optimization smart enough to
look through token factor

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46053 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agovarious whitespace cleanups, no functionality change.
Chris Lattner [Wed, 16 Jan 2008 05:52:18 +0000 (05:52 +0000)]
various whitespace cleanups, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46052 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFactor the ReachesChainWithoutSideEffects out of dag combiner into
Chris Lattner [Wed, 16 Jan 2008 05:49:24 +0000 (05:49 +0000)]
Factor the ReachesChainWithoutSideEffects out of dag combiner into
a public SDOperand::reachesChainWithoutSideEffects method.  No
functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46050 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDo not strip llvm.used values.
Devang Patel [Wed, 16 Jan 2008 03:33:05 +0000 (03:33 +0000)]
Do not strip llvm.used values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46045 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoChanged ImmutableMap::find to return an iterator instead of a pointer
Ted Kremenek [Tue, 15 Jan 2008 23:53:53 +0000 (23:53 +0000)]
Changed ImmutableMap::find to return an iterator instead of a pointer
to the tree node.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46034 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago- Introduces versioning macro LLVM_LTO_VERSION
Devang Patel [Tue, 15 Jan 2008 23:52:34 +0000 (23:52 +0000)]
- Introduces versioning macro LLVM_LTO_VERSION
- Communicate symbol visibility
- Communicate code generation model

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46033 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCommit a piece that I missed before, patch by Alain Frisch
Chris Lattner [Tue, 15 Jan 2008 23:27:40 +0000 (23:27 +0000)]
Commit a piece that I missed before, patch by Alain Frisch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46032 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMissed file from previous checkin.
Dale Johannesen [Tue, 15 Jan 2008 23:25:27 +0000 (23:25 +0000)]
Missed file from previous checkin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46030 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix and enable EH for x86-64 Darwin. Adds
Dale Johannesen [Tue, 15 Jan 2008 23:24:56 +0000 (23:24 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46029 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMove some calls to getVRegDef higher in the callgraph, so they don't get executed...
Owen Anderson [Tue, 15 Jan 2008 22:58:11 +0000 (22:58 +0000)]
Move some calls to getVRegDef higher in the callgraph, so they don't get executed as frequently in performance sensitive code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46027 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoimprove compatibility with mingw, patch by Alain Frisch
Chris Lattner [Tue, 15 Jan 2008 22:50:50 +0000 (22:50 +0000)]
improve compatibility with mingw, patch by Alain Frisch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46026 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd a test to ensure that argpromote of one argument doesn't
Chris Lattner [Tue, 15 Jan 2008 22:38:12 +0000 (22:38 +0000)]
add a test to ensure that argpromote of one argument doesn't
break the byval attr on some other argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46025 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd description of 'llvm.trap' intrinsic. Also, minor fixes in formatting.
Anton Korobeynikov [Tue, 15 Jan 2008 22:31:34 +0000 (22:31 +0000)]
Add description of 'llvm.trap' intrinsic. Also, minor fixes in formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46024 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoverify x86 generates ud2 for llvm.trap
Chris Lattner [Tue, 15 Jan 2008 22:22:02 +0000 (22:22 +0000)]
verify x86 generates ud2 for llvm.trap

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46023 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUnbreak the build.
Evan Cheng [Tue, 15 Jan 2008 22:19:35 +0000 (22:19 +0000)]
Unbreak the build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46021 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agonew testcase for llvm.trap.
Chris Lattner [Tue, 15 Jan 2008 22:17:26 +0000 (22:17 +0000)]
new testcase for llvm.trap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46020 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoIf someone wants to implement ppc TRAP, they can go for it :)
Chris Lattner [Tue, 15 Jan 2008 22:15:02 +0000 (22:15 +0000)]
If someone wants to implement ppc TRAP, they can go for it :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46019 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoThe type of the 'abort' node should be pointer type (because
Chris Lattner [Tue, 15 Jan 2008 22:09:33 +0000 (22:09 +0000)]
The type of the 'abort' node should be pointer type (because
it's a function pointer) not MVT::Other.  This fixes builtin_trap
lowering on ppc, alpha, ia64

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46018 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorename SDTRet -> SDTNone.
Chris Lattner [Tue, 15 Jan 2008 22:02:54 +0000 (22:02 +0000)]
rename SDTRet -> SDTNone.
Move definition of 'trap' sdnode up from x86 instrinfo to targetselectiondag.td.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46017 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove DefInst from LiveVariables::VarInfo. Use the facilities on MachineRegisterInf...
Owen Anderson [Tue, 15 Jan 2008 22:02:46 +0000 (22:02 +0000)]
Remove DefInst from LiveVariables::VarInfo.  Use the facilities on MachineRegisterInfo instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46016 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agono need to expand ISD::TRAP to X86ISD::TRAP, just match ISD::TRAP.
Chris Lattner [Tue, 15 Jan 2008 21:58:22 +0000 (21:58 +0000)]
no need to expand ISD::TRAP to X86ISD::TRAP, just match ISD::TRAP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46015 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd support for targets that have a legal ISD::TRAP.
Chris Lattner [Tue, 15 Jan 2008 21:58:08 +0000 (21:58 +0000)]
Add support for targets that have a legal ISD::TRAP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46014 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd files to windows project files. Also include <algorithm> explicitly so that...
Chuck Rose III [Tue, 15 Jan 2008 21:43:17 +0000 (21:43 +0000)]
Add files to windows project files.  Also include <algorithm> explicitly so that vstudio build works

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46013 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix JIT encoding of trap/ud2 instruction
Anton Korobeynikov [Tue, 15 Jan 2008 21:40:02 +0000 (21:40 +0000)]
Fix JIT encoding of trap/ud2 instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46012 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReformatted. It was confusing the other way. No functionality change.
Bill Wendling [Tue, 15 Jan 2008 21:16:32 +0000 (21:16 +0000)]
Reformatted. It was confusing the other way. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46009 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a memory correctness error noticed by valgrind (harmless in practice).
Gordon Henriksen [Tue, 15 Jan 2008 20:02:11 +0000 (20:02 +0000)]
Fix a memory correctness error noticed by valgrind (harmless in practice).

Thanks to Duncan Sands for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46007 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTestcase for gimplify_expr crash caused by an
Duncan Sands [Tue, 15 Jan 2008 19:55:41 +0000 (19:55 +0000)]
Testcase for gimplify_expr crash caused by an
unexpected placeholder_expr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46006 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoOops. Forgot to commit this.
Evan Cheng [Tue, 15 Jan 2008 07:49:54 +0000 (07:49 +0000)]
Oops. Forgot to commit this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46003 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoOops. Forgot to commit this.
Evan Cheng [Tue, 15 Jan 2008 07:49:36 +0000 (07:49 +0000)]
Oops. Forgot to commit this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46002 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFor PR1839: add initial support for __builtin_trap. llvm-gcc part is missed
Anton Korobeynikov [Tue, 15 Jan 2008 07:02:33 +0000 (07:02 +0000)]
For PR1839: add initial support for __builtin_trap. llvm-gcc part is missed
as well as PPC codegen

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46001 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoclarify that byval is valid for any pointer argument.
Chris Lattner [Tue, 15 Jan 2008 04:34:22 +0000 (04:34 +0000)]
clarify that byval is valid for any pointer argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45998 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRename CCIfStruct to CCIfByVal and CCStructAssign to CCPassByVal. Remove unused param...
Evan Cheng [Tue, 15 Jan 2008 03:34:58 +0000 (03:34 +0000)]
Rename CCIfStruct to CCIfByVal and CCStructAssign to CCPassByVal. Remove unused parameters of CCStructAssign and add size and alignment requirement info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45997 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoBoth x86-32 and x86-64 handle byval parameter attributes.
Evan Cheng [Tue, 15 Jan 2008 03:15:41 +0000 (03:15 +0000)]
Both x86-32 and x86-64 handle byval parameter attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45996 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoByVal stack slot alignment should be at least as large as pointer ABI alignment.
Evan Cheng [Tue, 15 Jan 2008 03:14:05 +0000 (03:14 +0000)]
ByVal stack slot alignment should be at least as large as pointer ABI alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45995 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevert my last commit. Not needed.
Evan Cheng [Tue, 15 Jan 2008 03:10:35 +0000 (03:10 +0000)]
Revert my last commit. Not needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45994 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSimplify CallInst::hasByValArgument using a new method.
Duncan Sands [Mon, 14 Jan 2008 19:57:00 +0000 (19:57 +0000)]
Simplify CallInst::hasByValArgument using a new method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45974 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoI noticed that the trampoline straightening transformation could
Duncan Sands [Mon, 14 Jan 2008 19:52:09 +0000 (19:52 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45973 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agodon't create the post-ra scheduler unless it is enabled.
Chris Lattner [Mon, 14 Jan 2008 19:00:06 +0000 (19:00 +0000)]
don't create the post-ra scheduler unless it is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45972 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove dead #include
Chris Lattner [Mon, 14 Jan 2008 18:45:28 +0000 (18:45 +0000)]
remove dead #include

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45971 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoNeed a space to separate Make options.
Evan Cheng [Mon, 14 Jan 2008 17:58:03 +0000 (17:58 +0000)]
Need a space to separate Make options.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45964 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoThis test is now the same as byval-1.ll, so remove it.
Duncan Sands [Mon, 14 Jan 2008 14:57:30 +0000 (14:57 +0000)]
This test is now the same as byval-1.ll, so remove it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45960 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTest that byval cannot be used with pointers to
Duncan Sands [Mon, 14 Jan 2008 14:55:05 +0000 (14:55 +0000)]
Test that byval cannot be used with pointers to
types with no size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45959 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWe now allow byval on fairly general pointer types.
Duncan Sands [Mon, 14 Jan 2008 06:53:45 +0000 (06:53 +0000)]
We now allow byval on fairly general pointer types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45956 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImprove the FP stackifier to decide all on its own whether
Chris Lattner [Mon, 14 Jan 2008 06:41:29 +0000 (06:41 +0000)]
Improve the FP stackifier to decide all on its own whether
an instruction kills a register or not.  This is cheap and
easy to do now that instructions record this on their flags,
and this eliminates the second pass of LiveVariables from the
x86 backend.  This speeds up a release llc by ~2.5%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45955 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSimplify code.
Evan Cheng [Mon, 14 Jan 2008 02:38:45 +0000 (02:38 +0000)]
Simplify code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45950 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix the miscompilation of MiBench/consumer-lame that was exposed by Evan's
Chris Lattner [Mon, 14 Jan 2008 02:09:12 +0000 (02:09 +0000)]
Fix the miscompilation of MiBench/consumer-lame that was exposed by Evan's
byval work.  This miscompilation is due to the program indexing an array out
of range and us doing a transformation that broke this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45949 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoThe isNotSuitableForSRA property is now dead, don't compute it.
Chris Lattner [Mon, 14 Jan 2008 01:32:52 +0000 (01:32 +0000)]
The isNotSuitableForSRA property is now dead, don't compute it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45948 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoChange SRAGlobal to not depend on isNotSuitableForSRA, which makes it very
Chris Lattner [Mon, 14 Jan 2008 01:31:05 +0000 (01:31 +0000)]
Change SRAGlobal to not depend on isNotSuitableForSRA, which makes it very
difficult to understand the invariants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45947 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake the 'shrink global to bool' optimization more self contained, and thus
Chris Lattner [Mon, 14 Jan 2008 01:17:44 +0000 (01:17 +0000)]
Make the 'shrink global to bool' optimization more self contained, and thus
easier to show that its safe.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45946 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTurn a memcpy from a double* into a load/store of double instead of
Chris Lattner [Mon, 14 Jan 2008 00:28:35 +0000 (00:28 +0000)]
Turn a memcpy from a double* into a load/store of double instead of
a load/store of i64.  The later prevents promotion/scalarrepl of the
source and dest in many cases.

This fixes the 300% performance regression of the byval stuff on
stepanov_v1p2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45945 91177308-0d34-0410-b5e6-96231b3b80d8