1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

27463 Commits

Author SHA1 Message Date
Chris Lattner
b89dbcd448 do not export all the X86FastISel symbols, ever.
llvm-svn: 66382
2009-03-08 18:44:31 +00:00
Nick Lewycky
5355d525f8 Fix comments, pointed out by Duncan Sands.
llvm-svn: 66381
2009-03-08 17:08:09 +00:00
Duncan Sands
26ab759672 Apply ODR linkage changes accidentally dropped during
final cleaning.  This fixes a bunch of testsuite failures.

llvm-svn: 66380
2009-03-08 13:35:23 +00:00
Sebastian Redl
538a21a5a9 Test commit
llvm-svn: 66378
2009-03-08 11:43:20 +00:00
Nick Lewycky
365f21b20f Mark function returns as noalias.
llvm-svn: 66369
2009-03-08 06:20:47 +00:00
Chris Lattner
f05ebf0849 teach SROA to handle promoting vector allocas with a memset into them into
a vector type instead of into an integer type.

llvm-svn: 66368
2009-03-08 04:17:04 +00:00
Chris Lattner
950cbfb6c0 fix typo
llvm-svn: 66367
2009-03-08 04:06:26 +00:00
Chris Lattner
54d2292fe5 Enhance SROA to "promote to scalar" allocas which are
memcpy/memmove'd into or out of.  This fixes a serious
perf issue that Nate ran into.

llvm-svn: 66366
2009-03-08 04:04:21 +00:00
Evan Cheng
67ccd79e39 Recognize triplets starting with armv5-, armv6- etc. And set the ARM arch version accordingly.
llvm-svn: 66365
2009-03-08 04:02:49 +00:00
Chris Lattner
e367477979 change the MemIntrinsic get/setAlignment method to take an unsigned
instead of a Constant*, which is what the clients of it really want.

llvm-svn: 66364
2009-03-08 03:59:00 +00:00
Evan Cheng
483ece4d2e If a MI uses the same register more than once, only mark one of them as 'kill'.
llvm-svn: 66363
2009-03-08 03:58:35 +00:00
Chris Lattner
7ddad92288 use MemTransferInst.
llvm-svn: 66362
2009-03-08 03:37:35 +00:00
Chris Lattner
f827ae4fa5 Introduce a new MemTransferInst pseudo class, which is a common
parent between MemCpyInst and MemMoveInst, simplify some code to
use it.

llvm-svn: 66361
2009-03-08 03:37:16 +00:00
Chris Lattner
3342ba06d4 add a note.
llvm-svn: 66360
2009-03-08 03:04:26 +00:00
Chris Lattner
8ace06fdda add a note.
llvm-svn: 66359
2009-03-08 01:54:43 +00:00
Chris Lattner
578b634f56 implement an optimization to codegen c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4.
For 2009-03-07-FPConstSelect.ll we now produce:

_f:
	xorl	%eax, %eax
	testl	%edi, %edi
	movl	$4, %ecx
	cmovne	%rax, %rcx
	leaq	LCPI1_0(%rip), %rax
	movss	(%rcx,%rax), %xmm0
	ret

previously we produced:

_f:
	subl	$4, %esp
	cmpl	$0, 8(%esp)
	movss	LCPI1_0, %xmm0
	je	LBB1_2	## entry
LBB1_1:	## entry
	movss	LCPI1_1, %xmm0
LBB1_2:	## entry
	movss	%xmm0, (%esp)
	flds	(%esp)
	addl	$4, %esp
	ret

on PPC the code also improves to:

_f:
	cntlzw r2, r3
	srwi r2, r2, 5
	li r3, lo16(LCPI1_0)
	slwi r2, r2, 2
	addis r3, r3, ha16(LCPI1_0)
	lfsx f1, r3, r2
	blr 

from:

_f:
	li r2, lo16(LCPI1_1)
	cmplwi cr0, r3, 0
	addis r2, r2, ha16(LCPI1_1)
	beq cr0, LBB1_2	; entry
LBB1_1:	; entry
	li r2, lo16(LCPI1_0)
	addis r2, r2, ha16(LCPI1_0)
LBB1_2:	; entry
	lfs f1, 0(r2)
	blr 

This also improves the existing pic-cpool case from:

foo:
	subl	$12, %esp
	call	.Lllvm$1.$piclabel
.Lllvm$1.$piclabel:
	popl	%eax
	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %eax
	cmpl	$0, 16(%esp)
	movsd	.LCPI1_0@GOTOFF(%eax), %xmm0
	je	.LBB1_2	# entry
.LBB1_1:	# entry
	movsd	.LCPI1_1@GOTOFF(%eax), %xmm0
.LBB1_2:	# entry
	movsd	%xmm0, (%esp)
	fldl	(%esp)
	addl	$12, %esp
	ret

to:

foo:
	call	.Lllvm$1.$piclabel
.Lllvm$1.$piclabel:
	popl	%eax
	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %eax
	xorl	%ecx, %ecx
	cmpl	$0, 4(%esp)
	movl	$8, %edx
	cmovne	%ecx, %edx
	fldl	.LCPI1_0@GOTOFF(%eax,%edx)
	ret

This triggers a few dozen times in spec FP 2000.

llvm-svn: 66358
2009-03-08 01:51:30 +00:00
Chris Lattner
f89a9c9d74 random cleanups.
llvm-svn: 66357
2009-03-08 01:47:41 +00:00
Chris Lattner
fc43115972 fix a serious pessimization that Tron on IRC pointed out where we would
"boolify" pointers, generating really awful code because getting the pointer
value requires a load itself.  Before:

_foo:
	movb	$1, _X.b
	ret
_get:
	xorl	%ecx, %ecx
	movb	_X.b, %al
	testb	%al, %al
	movl	$_Y, %eax
	cmove	%ecx, %eax
	ret

With the xform disabled:

_foo:
	movl	$_Y, _X
	ret
_get:
	movl	_X, %eax
	ret

llvm-svn: 66351
2009-03-07 23:32:02 +00:00
Duncan Sands
5ab54d488f Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr.  These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global.  In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time.   This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function.  If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body.  The
code generators on the other hand map weak and weak_odr linkage
to the same thing.

llvm-svn: 66339
2009-03-07 15:45:40 +00:00
Gabor Greif
02b0968a7a simplify the way how traits get hold of the symbol table
llvm-svn: 66336
2009-03-07 12:33:24 +00:00
Gabor Greif
37f450f486 further simplifications arising from peruse of the more declarative interface
llvm-svn: 66333
2009-03-07 10:49:57 +00:00
Chris Lattner
005d001719 When a crash signal is delivered do two things: remove all of our
signal handlers to prevent reentrance on unrelated things (a sigabort
where the handle bus errors) also, clear the signal mask so that the
signal doesn't infinitely reissue.  This fixes rdar://6654827 -
Crash causes clang to loop

llvm-svn: 66330
2009-03-07 08:15:47 +00:00
Nate Begeman
24605efdaf Finish cross-process JIT work, and clean up previous work.
1. When the JIT is asked to remove a function, updating it's
   mapping to 0, we invalidate any function stubs used only 
   by that function.  Now, also invalidate the JIT's mapping
   from the GV the stub pointed to, to the address of the GV.

2. When dlsym stubs for cross-process JIT are enabled, do not
   abort just because a named function cannot be found in the
   JIT's process.

3. Fix various assumptions about when it is ok to use the lazy
   resolver when non-lazy JITing is enabled.

llvm-svn: 66324
2009-03-07 06:41:19 +00:00
Dan Gohman
b9c32f1aca Arithmetic instructions don't set EFLAGS bits OF and CF bits
the same say the "test" instruction does in overflow cases,
so eliminating the test is only safe when those bits aren't
needed, as is the case for COND_E and COND_NE, or if it
can be proven that no overflow will occur. For now, just
restrict the optimization to COND_E and COND_NE and don't
do any overflow analysis.

llvm-svn: 66318
2009-03-07 01:58:32 +00:00
Daniel Dunbar
d9a5a0cf1f Add Module::getNamedValue; use to normalize access to Module symbol
table.
 - No functionality change.

llvm-svn: 66289
2009-03-06 22:04:43 +00:00
Dale Johannesen
0643e4e36c Fix another case where debug info interferes with
an optimization.

llvm-svn: 66288
2009-03-06 21:08:33 +00:00
Dan Gohman
23d7aa62d4 Use c_str() to force the string to be nul-terminated.
llvm-svn: 66279
2009-03-06 18:13:15 +00:00
Chris Lattner
c5dba8954e add a bunch more passes to the C bindings (PR3734), patch by
Lennart Augustsson!

llvm-svn: 66272
2009-03-06 16:52:18 +00:00
Duncan Sands
26567dea82 While thinking about the one-definition-rule and trying
to find a tiny mouse hole to squeeze through, it struck
me that globals without a name can be considered internal
since they can't be referenced from outside the current
module.  This patch makes GlobalOpt give them internal
linkage.  Also done for aliases even though they always
have names, since in my opinion anonymous aliases should
be allowed for consistency with global variables and
functions.  So if that happens one day, this code is ready!

llvm-svn: 66267
2009-03-06 10:21:56 +00:00
Chris Lattner
bf3dee4ec7 on apple systems, integrate nicely with crash reporter.
llvm-svn: 66264
2009-03-06 07:19:54 +00:00
Devang Patel
12e9aa7629 While converting an aggregate to scalare, ignore and remove aggregate's debug info.
llvm-svn: 66262
2009-03-06 07:03:54 +00:00
Chris Lattner
33852b4f35 Sprinkle some PrettyStackEntry magic into the passmanager. With this, we now
get nice and happy stack traces when we crash in an optimizer or codegen.  For
example, an abort put in UnswitchLoops now looks like this:

Stack dump:
0.	Program arguments: clang pr3399.c -S -O3 
1.	<eof> parser at end of file
2.	per-module optimization passes
3.	Running pass 'CallGraph Pass Manager' on module 'pr3399.c'.
4.	Running pass 'Loop Pass Manager' on function '@foo'
5.	Running pass 'Unswitch loops' on basic block '%for.inc'
Abort

llvm-svn: 66260
2009-03-06 06:45:05 +00:00
Zhou Sheng
e3fb6cafd0 Remove this as dbginfo intrinsics has been defined as
IntrNoMem.

llvm-svn: 66256
2009-03-06 06:05:01 +00:00
Devang Patel
3ae9d5d375 While hoisting instruction to speculatively execute simple bb, ignore dbg intrinsics.
llvm-svn: 66255
2009-03-06 06:00:17 +00:00
Chris Lattner
86966da4a3 various cosmetic cleanups.
llvm-svn: 66254
2009-03-06 05:53:14 +00:00
Chris Lattner
a66675581a this wasn't intended to go in.
llvm-svn: 66252
2009-03-06 05:42:30 +00:00
Chris Lattner
1b05680d5f Change various llvm utilities to use PrettyStackTraceProgram in
their main routines.  This makes the tools print their argc/argv
commands if they crash.

llvm-svn: 66248
2009-03-06 05:34:10 +00:00
Devang Patel
ff51ec061c Do not count DbgInfoIntrinsic while estimating loop header size.
llvm-svn: 66245
2009-03-06 03:51:30 +00:00
Devang Patel
9abfbc2e14 Skip DbgInfoIntrinsic.
llvm-svn: 66244
2009-03-06 02:59:27 +00:00
Dan Gohman
42049dafd7 Fix ScheduleDAGRRList::CopyAndMoveSuccessors' handling of nodes
with multiple chain operands. This can occur when the scheduler
has added chain operands to a node that already has a chain
operand, in order to handle physical register dependencies.

This fixes an llvm-gcc bootstrap failure on x86-64 introduced
in r66058.

llvm-svn: 66240
2009-03-06 02:23:01 +00:00
Dale Johannesen
e07f7b0e3d Don't assign rank numbers to debug intrinsic "calls".
This is needed so debug info doesn't change codegen.

llvm-svn: 66235
2009-03-06 01:41:59 +00:00
Bill Wendling
5ddde1a24c When we split a basic block, there's a default branch to the newly created BB.
Delete this default branch, because we're going to generate our own.

llvm-svn: 66234
2009-03-06 01:41:15 +00:00
Devang Patel
c751e83e2b Revert 66224.
llvm-svn: 66233
2009-03-06 01:39:36 +00:00
Devang Patel
205f80b2f3 Revert rev. 66167.
We are still not out of woods yet.

llvm-svn: 66232
2009-03-06 01:37:41 +00:00
Evan Cheng
918955bbc4 SRThreshold is meant to be inclusive.
llvm-svn: 66227
2009-03-06 00:56:43 +00:00
Dale Johannesen
83c13c2ace Tweak the check for promotable alloca's to handle
debug intrinsics correctly.

llvm-svn: 66225
2009-03-06 00:42:50 +00:00
Devang Patel
f815005dfb Do not let debug info prevert globalopt from shriking a global vars to boolean.
llvm-svn: 66224
2009-03-06 00:21:00 +00:00
Devang Patel
28a28a2588 Add "check/remove dbg var" helper routines.
llvm-svn: 66223
2009-03-06 00:19:37 +00:00
Dan Gohman
f9599e6c5f Don't use plain INC32 and DEC32 on x86-64; it needs
INC64_32r and INC64_16r, because these instructions are encoded
differently on x86-64. This fixes JIT regressions on x86-64 in
kimwitu++ and others.

llvm-svn: 66207
2009-03-05 21:32:23 +00:00
Dan Gohman
1e9db7c1a1 When creating X86ISD::INC and X86ISD::DEC nodes, only add one operand.
The extra operand didn't appear to cause any trouble, but it was
erroneous regardless.

llvm-svn: 66206
2009-03-05 21:29:28 +00:00