1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

274 Commits

Author SHA1 Message Date
Benjamin Kramer
f4e9cbfc05 Add two notes for correlated-expression optimizations.
llvm-svn: 139263
2011-09-07 22:49:26 +00:00
Benjamin Kramer
1cab6179ab Don't emit a bit test if there is only one case the test can yield false. A simple SETNE is sufficient.
llvm-svn: 135126
2011-07-14 01:38:42 +00:00
Benjamin Kramer
5079b61657 InstCombine: Fold A-b == C --> b == A-C if A and C are constants.
The backend already knew this trick.

llvm-svn: 132915
2011-06-13 15:24:24 +00:00
Chris Lattner
f58c2c02b5 clarify this, apparently it is confusing :)
llvm-svn: 131916
2011-05-23 20:17:44 +00:00
Chris Lattner
3066a7e5ad add a note.
llvm-svn: 131863
2011-05-22 18:28:46 +00:00
Chris Lattner
9359dea740 move PR9408 here.
llvm-svn: 131841
2011-05-22 05:45:06 +00:00
Chris Lattner
01ceb99a05 Transform: "icmp eq (trunc (lshr(X, cst1)), cst" to "icmp (and X, mask), cst"
when X has multiple uses.  This is useful for exposing secondary optimizations,
but the X86 backend isn't ready for this when X has a single use.  For example,
this can disable load folding.

This is inching towards resolving PR6627.

llvm-svn: 130238
2011-04-26 20:18:20 +00:00
Chris Lattner
35166f3b22 add a missed bitfield instcombine.
llvm-svn: 130137
2011-04-25 18:44:26 +00:00
Benjamin Kramer
f6eab5f86e DAGCombine: fold "(zext x) == C" into "x == (trunc C)" if the trunc is lossless.
On x86 this allows to fold a load into the cmp, greatly reducing register pressure.
  movzbl	(%rdi), %eax
  cmpl	$47, %eax
->
  cmpb	$47, (%rdi)

This shaves 8k off gcc.o on i386. I'll leave applying the patch in README.txt to Chris :)

llvm-svn: 130005
2011-04-22 18:47:44 +00:00
Chris Lattner
5fa2544086 add a minor missed dag combine that is blocking mid-level optimization
improvements, that will lead to fixing PR6627.

llvm-svn: 129504
2011-04-14 04:21:42 +00:00
Benjamin Kramer
12ea727553 Add a note.
llvm-svn: 128286
2011-03-25 17:32:40 +00:00
Eli Friedman
f9d5010081 A bit more analysis of a memset-related README entry.
llvm-svn: 128107
2011-03-22 20:49:53 +00:00
Eli Friedman
0da0b4aed0 This README entry was fixed recently.
llvm-svn: 127982
2011-03-21 01:33:03 +00:00
Chris Lattner
871d62dc5b add a note
llvm-svn: 126719
2011-03-01 00:24:51 +00:00
Benjamin Kramer
412ffed4f0 Add some DAGCombines for (adde 0, 0, glue), which are useful to optimize legalized code for large integer arithmetic.
1. Inform users of ADDEs with two 0 operands that it never sets carry
2. Fold other ADDs or ADDCs into the ADDE if possible

It would be neat if we could do the same thing for SETCC+ADD eventually, but we can't do that in target independent code.

llvm-svn: 126557
2011-02-26 22:48:07 +00:00
Chris Lattner
c373140c8b add a missed loop deletion case.
llvm-svn: 126103
2011-02-21 02:13:39 +00:00
Chris Lattner
8760c28fe1 add an idiom that loop idiom could theoretically catch.
llvm-svn: 126101
2011-02-21 01:33:38 +00:00
Duncan Sands
e0ece264ba This has been implemented.
llvm-svn: 125738
2011-02-17 08:16:56 +00:00
Chris Lattner
035876162f add some notes on compares + binops. Remove redundant entries.
llvm-svn: 125702
2011-02-17 01:43:46 +00:00
Chris Lattner
9f4e529571 Add a few missed xforms from GCC PR14753
llvm-svn: 125681
2011-02-16 19:16:34 +00:00
Eli Friedman
b409f8da64 Remove outdated README entry.
llvm-svn: 125660
2011-02-16 07:41:19 +00:00
Eli Friedman
5f848d70fa Remove outdated README entry.
llvm-svn: 125659
2011-02-16 07:18:18 +00:00
Eli Friedman
30a64ae1b9 Update README entry.
llvm-svn: 125658
2011-02-16 07:17:44 +00:00
Anders Carlsson
61f2126479 Remove a virtual inheritance case that clang can devirtualize fully now.
llvm-svn: 124989
2011-02-06 20:16:49 +00:00
Benjamin Kramer
b739613711 SimplifyCFG: Turn switches into sub+icmp+branch if possible.
This makes the job of the later optzn passes easier, allowing the vast amount of
icmp transforms to chew on it.

We transform 840 switches in gcc.c, leading to a 16k byte shrink of the resulting
binary on i386-linux.

The testcase from README.txt now compiles into
  decl  %edi
  cmpl  $3, %edi
  sbbl  %eax, %eax
  andl  $1, %eax
  ret

llvm-svn: 124724
2011-02-02 15:56:22 +00:00
Chris Lattner
1d534245fc add a note, progress unblocked by PR8575 being fixed.
llvm-svn: 124599
2011-01-31 20:23:28 +00:00
Benjamin Kramer
6b3c3de09a Teach DAGCombine to fold fold (sra (trunc (sr x, c1)), c2) -> (trunc (sra x, c1+c2) when c1 equals the amount of bits that are truncated off.
This happens all the time when a smul is promoted to a larger type.

On x86-64 we now compile "int test(int x) { return x/10; }" into
  movslq  %edi, %rax
  imulq $1717986919, %rax, %rax
  movq  %rax, %rcx
  shrq  $63, %rcx
  sarq  $34, %rax <- used to be "shrq $32, %rax; sarl $2, %eax"
  addl  %ecx, %eax

This fires 96 times in gcc.c on x86-64.

llvm-svn: 124559
2011-01-30 16:38:43 +00:00
Chris Lattner
c025bec9e1 this isn't a memset, we do convert dest[i] to one though :)
llvm-svn: 124097
2011-01-24 02:32:00 +00:00
Chris Lattner
1f9ed3b437 with recent work, we now optimize this into:
define i32 @foo(i32 %x) nounwind readnone ssp {
entry:
  %tobool = icmp eq i32 %x, 0
  %tmp5 = select i1 %tobool, i32 2, i32 1
  ret i32 %tmp5
}

llvm-svn: 124091
2011-01-24 01:12:18 +00:00
Anders Carlsson
ba7114ef4c Add a memset loop that LoopIdiomRecognize doesn't recognize.
llvm-svn: 124082
2011-01-23 20:31:00 +00:00
Chris Lattner
08e1bf567f add a note
llvm-svn: 123752
2011-01-18 07:47:48 +00:00
Anders Carlsson
d0103ebf92 Update README.txt to remove the DAE enhancement.
llvm-svn: 123597
2011-01-16 21:26:15 +00:00
Chris Lattner
91f1b21cf1 add some commentary
llvm-svn: 123572
2011-01-16 06:39:44 +00:00
Chandler Carruth
a3261fcca5 Simplify a README.txt entry significantly to expose the core issue.
llvm-svn: 123556
2011-01-16 01:40:23 +00:00
Chris Lattner
d2d217dc46 typo
llvm-svn: 123406
2011-01-13 22:11:56 +00:00
Chris Lattner
6745cd150c memcpy + metadata = bliss :)
llvm-svn: 123405
2011-01-13 22:08:15 +00:00
Chandler Carruth
250dce460c Teach constant folding to perform conversions from constant floating
point values to their integer representation through the SSE intrinsic
calls. This is the last part of a README.txt entry for which I have real
world examples.

llvm-svn: 123206
2011-01-11 01:07:24 +00:00
Owen Anderson
4479341626 Fix a random missed optimization by making InstCombine more aggressive when determining which bits are demanded by
a comparison against a constant.

llvm-svn: 123203
2011-01-11 00:36:45 +00:00
Chris Lattner
c46188944e +0.0 vs -0.0 differences can be handled by looking at the user of the
operation in some cases.

llvm-svn: 123190
2011-01-10 21:01:17 +00:00
Chris Lattner
2bd48ecd43 expand on a note
llvm-svn: 123145
2011-01-10 00:33:01 +00:00
Chris Lattner
7926b7035f typo
llvm-svn: 123142
2011-01-09 23:48:41 +00:00
Chris Lattner
fc6d425076 xref a PR #
llvm-svn: 123141
2011-01-09 23:42:22 +00:00
Chandler Carruth
a4d454ae5e Add a note about the inability to model FP -> int conversions which
perform rounding other than truncation in the IR. Common C code for this
turns into really an LLVM intrinsic call that blocks a lot of further
optimizations.

llvm-svn: 123135
2011-01-09 22:36:18 +00:00
Chandler Carruth
2a30077fed Add a note about a missed FP optimization.
llvm-svn: 123126
2011-01-09 21:00:19 +00:00
Chandler Carruth
17c1672ea9 Another missed memset in std::vector initialization.
llvm-svn: 123116
2011-01-09 11:29:57 +00:00
Chandler Carruth
dcbd7b6eaa Fix a cut-paste-o so that the sample code is correct for my last note.
Also, switch to a more clear 'sink' function with its declaration to
avoid any confusion about 'g'. Thanks for the suggestion Frits.

llvm-svn: 123113
2011-01-09 10:10:59 +00:00
Chandler Carruth
3de0da8801 Another missed optimization of trivial vector code.
llvm-svn: 123112
2011-01-09 09:58:36 +00:00
Chandler Carruth
9220d9fa48 Add a note about vector's size-constructor producing dead stores.
llvm-svn: 123111
2011-01-09 09:58:33 +00:00
Chandler Carruth
815cbfb43c Add a note about a missed memset optimization from std::fill.
llvm-svn: 123103
2011-01-09 01:32:55 +00:00
Benjamin Kramer
62b5a4d14c Revert 122959, it needs more thought. Add it back to README.txt with additional notes.
llvm-svn: 123030
2011-01-07 20:42:20 +00:00