Commit Graph

184 Commits

Author SHA1 Message Date
Benjamin Kramer 41476410c9 TODO--
llvm-svn: 106102
2010-06-16 15:47:00 +00:00
Eli Friedman e17e4aea2a Add README entry; based on testcase from Bill Hart.
llvm-svn: 105878
2010-06-12 05:54:27 +00:00
Chris Lattner 4dc833c607 add a note
llvm-svn: 104404
2010-05-21 23:16:21 +00:00
Dan Gohman 73c8145505 Add a README entry.
llvm-svn: 102906
2010-05-03 14:31:00 +00:00
Chris Lattner cfc921cd2a add a note
llvm-svn: 101581
2010-04-16 23:52:30 +00:00
Chris Lattner 4041ab6e00 Implement rdar://7860110 (also in target/readme.txt) narrowing
a load/or/and/store sequence into a narrower store when it is
safe.  Daniel tells me that clang will start producing this sort
of thing with bitfields, and this does  trigger a few dozen times
on 176.gcc produced by llvm-gcc even now.

This compiles code like CodeGen/X86/2009-05-28-DAGCombineCrash.ll 
into:

        movl    %eax, 36(%rdi)

instead of:

        movl    $4294967295, %eax       ## imm = 0xFFFFFFFF
        andq    32(%rdi), %rax
        shlq    $32, %rcx
        addq    %rax, %rcx
        movq    %rcx, 32(%rdi)

and each of the testcases into a single store.  Each of them used
to compile into craziness like this:

_test4:
	movl	$65535, %eax            ## imm = 0xFFFF
	andl	(%rdi), %eax
	shll	$16, %esi
	addl	%eax, %esi
	movl	%esi, (%rdi)
	ret

llvm-svn: 101343
2010-04-15 04:48:01 +00:00
Chris Lattner 1f6689a8ba move PR6576 here.
llvm-svn: 98194
2010-03-10 21:42:42 +00:00
Chris Lattner 187242b3ab move PR6212 to this file.
llvm-svn: 95624
2010-02-09 00:11:10 +00:00
Eli Friedman 0de0b3677a Remove a completed item, add a couple new ones.
llvm-svn: 94945
2010-01-31 04:55:32 +00:00
Bob Wilson 7c42b9d51e Improve isSafeToLoadUnconditionally to recognize that GEPs with constant
indices are safe if the result is known to be within the bounds of the
underlying object.

llvm-svn: 94829
2010-01-29 19:19:08 +00:00
Chris Lattner e3a68d1063 reassociate should do this.
llvm-svn: 94374
2010-01-24 20:17:09 +00:00
Chris Lattner 7e3f8b60d6 add a note.
llvm-svn: 94373
2010-01-24 20:01:41 +00:00
Chris Lattner 249da5cb73 implement a simple instcombine xform that has been in the
readme forever.

llvm-svn: 94318
2010-01-23 18:49:30 +00:00
Chris Lattner 082da53f9a add some notes, making posix-memalign be nocapture would be an easy improvement.
llvm-svn: 94312
2010-01-23 17:59:23 +00:00
Eli Friedman 9ed49c5c8f Add some potentially interesting transformations to README.
llvm-svn: 93797
2010-01-18 22:36:59 +00:00
Duncan Sands c8493da5b1 Fix a README item: have functionattrs look through selects and
phi nodes when deciding which pointers point to local memory.
I actually checked long ago how useful this is, and it isn't
very: it hardly ever fires in the testsuite, but since Chris
wants it here it is!

llvm-svn: 92836
2010-01-06 15:37:47 +00:00
Duncan Sands 78376ad7e1 Partially address a README by having functionattrs consider calls to
memcpy, memset and other intrinsics that only access their arguments
to be readnone if the intrinsic's arguments all point to local memory.
This improves the testcase in the README to readonly, but it could in
theory be made readnone, however this would involve more sophisticated
analysis that looks through the memcpy.

llvm-svn: 92829
2010-01-06 08:45:52 +00:00
Chris Lattner 2d91231d82 implement an instcombine xform needed by clang's codegen
on the example in PR4216.  This doesn't trigger in the testsuite,
so I'd really appreciate someone scrutinizing the logic for
correctness.

llvm-svn: 92458
2010-01-04 06:03:59 +00:00
Chris Lattner 39f18e545e Teach codegen to lower llvm.powi to an efficient (but not optimal)
multiply sequence when the power is a constant integer.  Before, our
codegen for std::pow(.., int) always turned into a libcall, which was
really inefficient.

This should also make many gfortran programs happier I'd imagine.

llvm-svn: 92388
2010-01-01 03:32:16 +00:00
Chris Lattner 71cf7c256f update this. To take the next step, llvm.powi should be generalized to work
on integers as well and codegen should lower them to branch trees.

llvm-svn: 92382
2010-01-01 01:29:26 +00:00
Eli Friedman 96cf7f42b0 More info on this transformation.
llvm-svn: 91230
2009-12-12 23:23:43 +00:00
Eli Friedman 8eada9f580 Remove some stuff that's already implemented. Also, remove the note about
merging x >u 5 and x <s 20 because it's impossible to implement.

llvm-svn: 91228
2009-12-12 21:41:48 +00:00
Chris Lattner f05330a5c8 expand note.
llvm-svn: 90429
2009-12-03 07:43:46 +00:00
Chris Lattner d1e4ee3c2b add a note
llvm-svn: 90428
2009-12-03 07:41:54 +00:00
Chris Lattner 58ccf88c36 update and consolidate the load pre notes.
llvm-svn: 90050
2009-11-29 02:19:52 +00:00
Chris Lattner 83a4a9868f add a deadargelim note.
llvm-svn: 90009
2009-11-27 17:12:30 +00:00
Chris Lattner ca9e0e83b3 This testcase is actually only partially redundant, and requires
the FIXME I added yesterday to be implemented.

llvm-svn: 90008
2009-11-27 16:53:57 +00:00
Chris Lattner cc6d29286c this (and probably several others) are now done.
llvm-svn: 89982
2009-11-27 00:35:04 +00:00
Chris Lattner 9bd2136ca3 Teach memdep to phi translate bitcasts. This allows us to compile
the example in GCC PR16799 to:

LBB1_2:                                                     ## %bb1
	movl	%eax, %eax
	subq	%rax, %rdi
	movq	%rdi, (%rcx)
	movl	(%rdi), %eax
	testl	%eax, %eax
	je	LBB1_2

instead of:

LBB1_2:                                                     ## %bb1
	movl	(%rdi), %ecx
	subq	%rcx, %rdi
	movq	%rdi, (%rax)
	cmpl	$0, (%rdi)
	je	LBB1_2

llvm-svn: 89978
2009-11-26 23:41:07 +00:00
Chris Lattner 29bc8a91d3 Teach basicaa that x|c == x+c when the c bits of x are clear. This
allows us to compile the example in readme.txt into:

LBB1_1:                                                     ## %bb
	movl	4(%rdx,%rax), %ecx
	movl	%ecx, %esi
	imull	(%rdx,%rax), %esi
	imull	%esi, %ecx
	movl	%esi, 8(%rdx,%rax)
	imull	%ecx, %esi
	movl	%ecx, 12(%rdx,%rax)
	movl	%esi, 16(%rdx,%rax)
	imull	%ecx, %esi
	movl	%esi, 20(%rdx,%rax)
	addq	$16, %rax
	cmpq	$4000, %rax
	jne	LBB1_1

instead of:

LBB1_1: 
	movl	(%rdx,%rax), %ecx
	imull	4(%rdx,%rax), %ecx
	movl	%ecx, 8(%rdx,%rax)
	imull	4(%rdx,%rax), %ecx
	movl	%ecx, 12(%rdx,%rax)
	imull	8(%rdx,%rax), %ecx
	movl	%ecx, 16(%rdx,%rax)
	imull	12(%rdx,%rax), %ecx
	movl	%ecx, 20(%rdx,%rax)
	addq	$16, %rax
	cmpq	$4000, %rax
	jne	LBB1_1

GCC (4.2) doesn't seem to be able to eliminate the loads in this 
testcase either, it generates:

L2:
	movl	(%rdx), %eax
	imull	4(%rdx), %eax
	movl	%eax, 8(%rdx)
	imull	4(%rdx), %eax
	movl	%eax, 12(%rdx)
	imull	8(%rdx), %eax
	movl	%eax, 16(%rdx)
	imull	12(%rdx), %eax
	movl	%eax, 20(%rdx)
	addl	$4, %ecx
	addq	$16, %rdx
	cmpl	$1002, %ecx
	jne	L2

llvm-svn: 89952
2009-11-26 16:26:43 +00:00
Chris Lattner 12dacdd359 teach basicaa that A[i] != A[i+1].
llvm-svn: 89951
2009-11-26 16:18:10 +00:00
Chris Lattner 8e09ad6f3c update some notes slightly
llvm-svn: 89913
2009-11-26 01:51:18 +00:00
Nick Lewycky ef4ea9a2a9 Add a complex missed optimization opportunity I came across while investigating
bug 5438.

llvm-svn: 88855
2009-11-15 17:51:23 +00:00
Chris Lattner 7a09964e81 another const prop failure.
llvm-svn: 86848
2009-11-11 17:54:02 +00:00
Chris Lattner 539bdf0487 add a note
llvm-svn: 86847
2009-11-11 17:51:27 +00:00
Chris Lattner 0169fd7c62 add a note
llvm-svn: 86756
2009-11-10 23:47:45 +00:00
Chris Lattner 8ff26038ef I did this a week or two ago
llvm-svn: 86754
2009-11-10 23:40:49 +00:00
Nick Lewycky b9397262b7 Improve tail call elimination to handle the switch statement.
llvm-svn: 86403
2009-11-07 21:10:15 +00:00
Chris Lattner 06c26d982e add a note from PR5313
llvm-svn: 86146
2009-11-05 18:19:19 +00:00
Bill Wendling 2e5198ff09 Add new note.
llvm-svn: 85341
2009-10-27 23:30:07 +00:00
Bill Wendling fd2730ee8c Move and clarify note.
llvm-svn: 85334
2009-10-27 22:48:31 +00:00
Chris Lattner 13b8b56dd4 this is done.
llvm-svn: 85041
2009-10-25 06:17:51 +00:00
Chris Lattner 851193b873 some stuff is done, we still have constantexpr simplification to do.
llvm-svn: 84943
2009-10-23 07:00:55 +00:00
Chris Lattner bc69313909 IPSCCP is missing stuff.
llvm-svn: 84725
2009-10-21 01:10:37 +00:00
Chris Lattner 61858787b1 add a note
llvm-svn: 82442
2009-09-21 06:04:07 +00:00
Chris Lattner 9858859fd6 one case handled, expanded another testcase inline.
llvm-svn: 82427
2009-09-21 02:53:57 +00:00
Chris Lattner fc2d846dc8 update an entry, delete an entry which has been fixed.
llvm-svn: 82398
2009-09-20 17:37:38 +00:00
Nick Lewycky 9b3ed87506 Peer through zext and sext to eliminate them when it is safe to do so.
llvm-svn: 82389
2009-09-20 07:31:25 +00:00
Chris Lattner dda095ec4a add PR#
llvm-svn: 81770
2009-09-14 16:49:26 +00:00
Dan Gohman 4ac2f639cd Transform -X/C to X/-C, implementing a README.txt entry.
llvm-svn: 78812
2009-08-12 16:37:02 +00:00