1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-01 16:33:37 +01:00
llvm-mirror/lib
Chris Lattner 662a872e15 When factoring multiply expressions across adds, factor both
positive and negative forms of constants together.  This 
allows us to compile:

int foo(int x, int y) {
    return (x-y) + (x-y) + (x-y);
}

into:

_foo:                                                       ## @foo
	subl	%esi, %edi
	leal	(%rdi,%rdi,2), %eax
	ret

instead of (where the 3 and -3 were not factored):

_foo:
        imull   $-3, 8(%esp), %ecx
        imull   $3, 4(%esp), %eax
        addl    %ecx, %eax
        ret

this started out as:
    movl    12(%ebp), %ecx
    imull   $3, 8(%ebp), %eax
    subl    %ecx, %eax
    subl    %ecx, %eax
    subl    %ecx, %eax
    ret

This comes from PR5359.

llvm-svn: 92381
2010-01-01 01:13:15 +00:00
..
Analysis fix Analysis/DebugInfo.h to not include Metadata.h. Do this 2009-12-31 03:02:08 +00:00
Archive
AsmParser remove some fixme's 2009-12-30 06:00:36 +00:00
Bitcode Remove derelict serialization code. 2009-12-31 23:40:17 +00:00
CodeGen remove a bunch of unneeded functions. 2009-12-29 09:32:19 +00:00
CompilerDriver Make Path use StringRef instead of std::string where possible. 2009-12-17 21:02:39 +00:00
ExecutionEngine Remove dead store and simplify code. 2009-12-28 01:53:00 +00:00
Linker rename "elements" of metadata to "operands". "Elements" are 2009-12-31 01:22:29 +00:00
MC
Support Document the edit-distance algorithm used in StringRef, switch it over 2009-12-31 04:24:34 +00:00
System Alternative fix to make sure that the extern declarations used by 2009-12-23 19:12:50 +00:00
Target Replace a few more SmallVectors with arrays. 2009-12-29 16:57:26 +00:00
Transforms When factoring multiply expressions across adds, factor both 2010-01-01 01:13:15 +00:00
VMCore fix refactoro 2009-12-31 08:23:09 +00:00
Makefile