1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 06:22:56 +02:00
Commit Graph

21381 Commits

Author SHA1 Message Date
Scott Michel
506e61bad1 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.

llvm-svn: 46142
2008-01-17 20:38:41 +00:00
Chris Lattner
41717f6989 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
Chris Lattner
31081fc513 code cleanups, no functionality change.
llvm-svn: 46126
2008-01-17 07:20:38 +00:00
Chris Lattner
d033200a8f * 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
Evan Cheng
c187163bab DAE bug fix. Don't lose parameter attributes on vararg arguments.
llvm-svn: 46113
2008-01-17 04:18:54 +00:00
Evan Cheng
8633da0707 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.

llvm-svn: 46111
2008-01-17 02:08:17 +00:00
Chris Lattner
c32be7e6b2 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.

llvm-svn: 46108
2008-01-17 01:17:03 +00:00
Evan Cheng
a637a9c2f5 Replace std::vector<bool> with BitVector.
llvm-svn: 46104
2008-01-17 00:35:26 +00:00
Evan Cheng
5be34d811c 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.

llvm-svn: 46099
2008-01-16 23:11:54 +00:00
Duncan Sands
78e448d8b4 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!

llvm-svn: 46098
2008-01-16 22:55:25 +00:00
Chris Lattner
81a39bb7ba Handle attribute(used) global variables that are i8.
llvm-svn: 46090
2008-01-16 21:35:43 +00:00
Dale Johannesen
cfa41e888e 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
0d572fea6f Fix a ppc long double regression I introduced yesterday due to a
simplification.  This fixes automotive-basicmath on PPC.

llvm-svn: 46072
2008-01-16 17:59:31 +00:00
Chris Lattner
fb1774e709 merge a few pieces of code that do the store/load to stack
pattern to use EmitStackConvert now.

llvm-svn: 46066
2008-01-16 07:51:34 +00:00
Chris Lattner
cd012ca345 rename ExpandBIT_CONVERT to EmitStackConvert, generalizing
it to allow it to emit different load and store kinds.

llvm-svn: 46065
2008-01-16 07:45:30 +00:00
Chris Lattner
db34498516 simplify a bunch of code by using SelectionDAG::CreateStackTemporary
instead of inlining its body.

llvm-svn: 46062
2008-01-16 07:03:22 +00:00
Chris Lattner
1f22d9154a 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.

llvm-svn: 46061
2008-01-16 06:57:07 +00:00
Chris Lattner
2825f8fff0 make it more clear that this predicate only applies to scalar FP types.
llvm-svn: 46058
2008-01-16 06:24:21 +00:00
Chris Lattner
fbb75278b2 introduce a isTypeInSSEReg predicate, which allows us to simplify
some code.  No functionality change.

llvm-svn: 46055
2008-01-16 06:19:45 +00:00
Chris Lattner
41e1fd13b2 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.

llvm-svn: 46054
2008-01-16 05:56:59 +00:00
Chris Lattner
1819f31640 make the 'fp return in ST(0)' optimization smart enough to
look through token factor

llvm-svn: 46053
2008-01-16 05:53:06 +00:00
Chris Lattner
d9f29a1e3e various whitespace cleanups, no functionality change.
llvm-svn: 46052
2008-01-16 05:52:18 +00:00
Chris Lattner
50f1b6f9a5 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
Devang Patel
a8d63b0b30 Do not strip llvm.used values.
llvm-svn: 46045
2008-01-16 03:33:05 +00:00
Dale Johannesen
1268083b64 Missed file from previous checkin.
llvm-svn: 46030
2008-01-15 23:25:27 +00:00
Dale Johannesen
319c7bb405 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
214c1c3461 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
Chris Lattner
2595fd0ca7 improve compatibility with mingw, patch by Alain Frisch
llvm-svn: 46026
2008-01-15 22:50:50 +00:00
Chris Lattner
dac9c1bcfe If someone wants to implement ppc TRAP, they can go for it :)
llvm-svn: 46019
2008-01-15 22:15:02 +00:00
Chris Lattner
bcb087fd62 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

llvm-svn: 46018
2008-01-15 22:09:33 +00:00
Chris Lattner
6846e346a8 rename SDTRet -> SDTNone.
Move definition of 'trap' sdnode up from x86 instrinfo to targetselectiondag.td.

llvm-svn: 46017
2008-01-15 22:02:54 +00:00
Owen Anderson
946d55e773 Remove DefInst from LiveVariables::VarInfo. Use the facilities on MachineRegisterInfo instead.
llvm-svn: 46016
2008-01-15 22:02:46 +00:00
Chris Lattner
0072ce1ff4 no need to expand ISD::TRAP to X86ISD::TRAP, just match ISD::TRAP.
llvm-svn: 46015
2008-01-15 21:58:22 +00:00
Chris Lattner
54fd35650d Add support for targets that have a legal ISD::TRAP.
llvm-svn: 46014
2008-01-15 21:58:08 +00:00
Anton Korobeynikov
44893ee93d Fix JIT encoding of trap/ud2 instruction
llvm-svn: 46012
2008-01-15 21:40:02 +00:00
Bill Wendling
0ad07f292c Reformatted. It was confusing the other way. No functionality change.
llvm-svn: 46009
2008-01-15 21:16:32 +00:00
Evan Cheng
4eb3d6c8d6 Oops. Forgot to commit this.
llvm-svn: 46002
2008-01-15 07:49:36 +00:00
Anton Korobeynikov
08ea121968 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
Evan Cheng
d7403ac663 Rename CCIfStruct to CCIfByVal and CCStructAssign to CCPassByVal. Remove unused parameters of CCStructAssign and add size and alignment requirement info.
llvm-svn: 45997
2008-01-15 03:34:58 +00:00
Evan Cheng
4eb7ae04c5 Both x86-32 and x86-64 handle byval parameter attributes.
llvm-svn: 45996
2008-01-15 03:15:41 +00:00
Evan Cheng
57714c090b ByVal stack slot alignment should be at least as large as pointer ABI alignment.
llvm-svn: 45995
2008-01-15 03:14:05 +00:00
Duncan Sands
087d6020ee Simplify CallInst::hasByValArgument using a new method.
llvm-svn: 45974
2008-01-14 19:57:00 +00:00
Duncan Sands
81e35b4d47 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
Chris Lattner
b067edf1b3 don't create the post-ra scheduler unless it is enabled.
llvm-svn: 45972
2008-01-14 19:00:06 +00:00
Chris Lattner
a6559b0047 remove dead #include
llvm-svn: 45971
2008-01-14 18:45:28 +00:00
Chris Lattner
554971a6d6 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%.

llvm-svn: 45955
2008-01-14 06:41:29 +00:00
Evan Cheng
12fb1dc67e Simplify code.
llvm-svn: 45950
2008-01-14 02:38:45 +00:00
Chris Lattner
efb498eddb 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.

llvm-svn: 45949
2008-01-14 02:09:12 +00:00
Chris Lattner
5d135cc20a The isNotSuitableForSRA property is now dead, don't compute it.
llvm-svn: 45948
2008-01-14 01:32:52 +00:00
Chris Lattner
760b05a331 Change SRAGlobal to not depend on isNotSuitableForSRA, which makes it very
difficult to understand the invariants.

llvm-svn: 45947
2008-01-14 01:31:05 +00:00