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

18270 Commits

Author SHA1 Message Date
Anton Korobeynikov
5bb6590218 Fix PR1323 : we haven't updated phi nodes in good manner :)
llvm-svn: 35963
2007-04-13 06:53:51 +00:00
Chris Lattner
e7cab7b7a4 arm has r+r*s and r+i addr modes, but no r+i+r*s addr modes.
llvm-svn: 35962
2007-04-13 06:50:55 +00:00
Zhou Sheng
dedfc40044 Make the apint construction more effective.
llvm-svn: 35960
2007-04-13 05:57:32 +00:00
Chris Lattner
335f1cb1f8 CSE simple binary expressions when they are inserted. This makes LSR produce
less huge code that needs to be cleaned up by sdisel.

llvm-svn: 35959
2007-04-13 05:04:18 +00:00
Reid Spencer
d31093d340 Implement review feedback .. don't double search a set.
llvm-svn: 35957
2007-04-12 21:57:15 +00:00
Reid Spencer
f1154e6d96 Make sure intrinsics that are lowered to functions make the function weak
linkage so we only end up with one of them in a program. These are, after
all overloaded and templatish in nature.

llvm-svn: 35956
2007-04-12 21:53:38 +00:00
Reid Spencer
0325471d3c Provide support for intrinsics that lower themselves to a function body.
This can happen for intrinsics that are overloaded.  In such cases it is
necessary to emit a function prototype before the body of the function
that calls the intrinsic and to ensure we don't emit it multiple times.

llvm-svn: 35954
2007-04-12 21:00:45 +00:00
Lauro Ramos Venancio
6c5f53f6ac Implement Thread Local Storage (TLS) in CBackend.
llvm-svn: 35951
2007-04-12 18:42:08 +00:00
Lauro Ramos Venancio
a76c2806de Implement the "thread_local" keyword.
llvm-svn: 35950
2007-04-12 18:32:50 +00:00
Reid Spencer
1e53c865c2 Fix bugs in generated code for part_select and part_set so that llc doesn't
barf when CBE is run with a program that contains these intrinsics.

llvm-svn: 35946
2007-04-12 13:30:14 +00:00
Reid Spencer
76e9a17f61 Fix a bug in PartSet. The replacement value needs to be zext or trunc to
the size of the value, not just zext. Also, give better names to two BBs.

llvm-svn: 35945
2007-04-12 12:46:33 +00:00
Chris Lattner
0da8de5848 the result of an inline asm copy can be an arbitrary VT that the register
class supports.  In the case of vectors, this means we often get the wrong
type (e.g. we get v4f32 instead of v8i16).  Make sure to convert the vector
result to the right type.  This fixes CodeGen/X86/2007-04-11-InlineAsmVectorResult.ll

llvm-svn: 35944
2007-04-12 06:00:20 +00:00
Chris Lattner
7acaf64d70 fold noop vbitconvert instructions
llvm-svn: 35943
2007-04-12 05:58:43 +00:00
Chris Lattner
2f221a83ec Fix weirdness handling single element vectors.
llvm-svn: 35941
2007-04-12 04:44:28 +00:00
Chris Lattner
2b6b79b896 Fix mmx paddq, add support for the 'y' register class, though it isn't tested.
llvm-svn: 35940
2007-04-12 04:14:49 +00:00
Reid Spencer
82da0eb67c For PR1284:
Implement the "part_set" intrinsic.

llvm-svn: 35938
2007-04-12 02:48:46 +00:00
Chris Lattner
9564abbfb5 improve the patch for PR1318 to also support grouped options with custom
handlers (like the pass list).  My previous fix only supported *new* command
line options, not additions to old ones.

This fixes test/Feature/load_module.ll

llvm-svn: 35935
2007-04-12 00:36:29 +00:00
Chris Lattner
b97b122176 Fix CodeGen/X86/2007-03-24-InlineAsmPModifier.ll
llvm-svn: 35926
2007-04-11 22:29:46 +00:00
Reid Spencer
2afe5c8354 Build Hello by default so it can be used in test cases.
llvm-svn: 35922
2007-04-11 21:03:37 +00:00
Chris Lattner
f29ad16397 fix an infinite loop compiling ldecod, notice by JeffC.
llvm-svn: 35910
2007-04-11 16:51:53 +00:00
Chris Lattner
e9a9a3f172 Fix incorrect fall-throughs in addr mode code. This fixes CodeGen/ARM/arm-negative-stride.ll
llvm-svn: 35909
2007-04-11 16:17:12 +00:00
Chris Lattner
f7451ea3c2 Fix Transforms/ScalarRepl/union-pointer.ll
llvm-svn: 35906
2007-04-11 15:45:25 +00:00
Chris Lattner
32f6730bb1 Fix PR1318 by reacting appropriately to a mutating option list.
llvm-svn: 35905
2007-04-11 15:35:18 +00:00
Reid Spencer
bd2afc8391 Fix a bug where ICmpInst objects instantiated directly with a name would
not retain that name. Not noticed because AsmParser always sets name after
construction. However, llvm2cpp noticed.

llvm-svn: 35903
2007-04-11 13:04:48 +00:00
Reid Spencer
9b497be3c4 Fix an approximate calculation in an assertion not to give false negatives.
llvm-svn: 35901
2007-04-11 13:00:04 +00:00
Chris Lattner
27a80589de Turn stuff like:
icmp slt i32 %X, 0              ; <i1>:0 [#uses=1]
        sext i1 %0 to i32               ; <i32>:1 [#uses=1]

into:

        %X.lobit = ashr i32 %X, 31              ; <i32> [#uses=1]

This implements InstCombine/icmp.ll:test[34]

llvm-svn: 35891
2007-04-11 06:57:46 +00:00
Chris Lattner
b659c04f13 Simplify some comparisons to arithmetic, this implements:
Transforms/InstCombine/icmp.ll

llvm-svn: 35890
2007-04-11 06:53:04 +00:00
Chris Lattner
1d20292190 Fix this harder.
llvm-svn: 35888
2007-04-11 06:50:51 +00:00
Chris Lattner
01ebc25b36 don't create shifts by zero, fix some problems with my previous patch
llvm-svn: 35887
2007-04-11 06:43:25 +00:00
Chris Lattner
50a7c8f34e canonicalize (x <u 2147483648) -> (x >s -1) and (x >u 2147483647) -> (x <s 0)
llvm-svn: 35886
2007-04-11 06:12:58 +00:00
Chris Lattner
cbd4a7e79c fix a miscompilation of:
define i32 @test(i32 %X) {
entry:
        %Y = and i32 %X, 4              ; <i32> [#uses=1]
        icmp eq i32 %Y, 0               ; <i1>:0 [#uses=1]
        sext i1 %0 to i32               ; <i32>:1 [#uses=1]
        ret i32 %1
}

by moving code out of commonIntCastTransforms into visitZExt.  Simplify the
APInt gymnastics in it etc.

llvm-svn: 35885
2007-04-11 05:45:39 +00:00
Chris Lattner
b7448f6187 done
llvm-svn: 35884
2007-04-11 05:34:00 +00:00
Chris Lattner
0289490285 Teach the codegen to turn [aez]ext (setcc) -> selectcc of 1/0, which often
allows other simplifications.  For example, this compiles:
int isnegative(unsigned int X) {
   return !(X < 2147483648U);
}

Into this code:

x86:
        movl 4(%esp), %eax
        shrl $31, %eax
        ret
arm:
        mov r0, r0, lsr #31
        bx lr
thumb:
        lsr r0, r0, #31
        bx lr

instead of:

x86:
        cmpl $0, 4(%esp)
        sets %al
        movzbl %al, %eax
        ret

arm:
        mov r3, #0
        cmp r0, #0
        movlt r3, #1
        mov r0, r3
        bx lr

thumb:
        mov r2, #1
        mov r1, #0
        cmp r0, #0
        blt LBB1_2      @entry
LBB1_1: @entry
        cpy r2, r1
LBB1_2: @entry
        cpy r0, r2
        bx lr

Testcase here: test/CodeGen/Generic/ispositive.ll

llvm-svn: 35883
2007-04-11 05:32:27 +00:00
Chris Lattner
3f0e49403c Codegen integer abs more efficiently using the trick from the PPC CWG. This
improves codegen on many architectures.  Tests committed as CodeGen/*/iabs.ll

X86 Old:			X86 New:
_test:				_test:
   movl 4(%esp), %ecx		   movl 4(%esp), %eax
   movl %ecx, %eax		   movl %eax, %ecx
   negl %eax			   sarl $31, %ecx
   testl %ecx, %ecx		   addl %ecx, %eax
   cmovns %ecx, %eax		   xorl %ecx, %eax
   ret				   ret

PPC Old:			PPC New:
_test:				_test:
   cmpwi cr0, r3, -1		   srawi r2, r3, 31
   neg r2, r3			   add r3, r3, r2
   bgt cr0, LBB1_2 ;		   xor r3, r3, r2
LBB1_1: ;			   blr
   mr r3, r2
LBB1_2: ;
   blr

ARM Old:			ARM New:
_test:				_test:
   rsb r3, r0, #0		   add r3, r0, r0, asr #31
   cmp r0, #0			   eor r0, r3, r0, asr #31
   movge r3, r0			   bx lr
   mov r0, r3
   bx lr

Thumb Old:			Thumb New:
_test:				_test:
   neg r2, r0			   asr r2, r0, #31
   cmp r0, #0			   add r0, r0, r2
   bge LBB1_2			   eor r0, r2
LBB1_1: @			   bx lr
   cpy r0, r2
LBB1_2: @
   bx lr


Sparc Old:			Sparc New:
test:				test:
   save -96, %o6, %o6		   save -96, %o6, %o6
   sethi 0, %l0			   sra %i0, 31, %l0
   sub %l0, %i0, %l0		   add %i0, %l0, %l1
   subcc %i0, -1, %l1		   xor %l1, %l0, %i0
   bg .BB1_2			   restore %g0, %g0, %g0
   nop				   retl
.BB1_1:				   nop
   or %g0, %l0, %i0
.BB1_2:
   restore %g0, %g0, %g0
   retl
   nop

It also helps alpha/ia64 :)

llvm-svn: 35881
2007-04-11 05:11:38 +00:00
Chris Lattner
c7c7a4712e fix a regression introduced by my last patch.
llvm-svn: 35879
2007-04-11 03:27:24 +00:00
Chris Lattner
2e1f36a4dc Hack to get sys::Path to recognize macho dylibs.
llvm-svn: 35878
2007-04-11 03:15:35 +00:00
Reid Spencer
2792e203c5 For PR1146:
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.

llvm-svn: 35877
2007-04-11 02:44:20 +00:00
Reid Spencer
caf5a6cbd7 Teach sys::Path how to recognize different kinds of object files for ELF
and Mach-O systems. Additionally, correct the Mach-O logic code to look at
byte 12 not byte 15. Hopefully this fixes the llvm-ld warning on Darwin.

llvm-svn: 35876
2007-04-11 02:02:09 +00:00
Chris Lattner
4ea7a156ba Simplify SROA conversion to integer in some ways, make it more general in others.
We now tolerate small amounts of undefined behavior, better emulating what
would happen if the transaction actually occurred in memory.  This fixes
SingleSource/UnitTests/2007-04-10-BitfieldTest.c on PPC, at least until
Devang gets a chance to fix the CFE from doing undefined things with bitfields :)

llvm-svn: 35875
2007-04-11 00:57:54 +00:00
Reid Spencer
e580735108 Make isDynamicLibrary detect more than just an ELF file.
llvm-svn: 35874
2007-04-11 00:49:39 +00:00
Bill Wendling
3b1189afbf Add support for our first SSSE3 instruction "pmulhrsw".
llvm-svn: 35869
2007-04-10 22:10:25 +00:00
Chris Lattner
60f3ece40f new micro optzn
llvm-svn: 35867
2007-04-10 21:14:01 +00:00
Chris Lattner
3bbd376057 restore support for negative strides
llvm-svn: 35859
2007-04-10 03:48:29 +00:00
Chris Lattner
e2444f7ec8 apparently some people commit without building the tree, or they forget to
commit a LOT of files.

llvm-svn: 35858
2007-04-10 03:20:39 +00:00
Chris Lattner
8557e71577 unbreak the build :(
llvm-svn: 35857
2007-04-10 03:18:19 +00:00
Jeff Cohen
9bc2960be6 Fix build problem.
llvm-svn: 35856
2007-04-10 03:10:46 +00:00
Chris Lattner
fe1860b138 Strengthen the boundary conditions of this fold, implementing
InstCombine/set.ll:test25

llvm-svn: 35852
2007-04-09 23:52:13 +00:00
Jeff Cohen
bd7d060e79 No longer needed.
llvm-svn: 35850
2007-04-09 23:42:32 +00:00
Owen Anderson
5d0148ae7c Re-constify things that don't break the build. Last patch in this
series, I promise.

llvm-svn: 35848
2007-04-09 23:38:18 +00:00
Chris Lattner
461f7ed33b remove dead target hooks.
llvm-svn: 35847
2007-04-09 23:34:08 +00:00