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

18450 Commits

Author SHA1 Message Date
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
Chris Lattner
98199016ae remove dead target hooks
llvm-svn: 35846
2007-04-09 23:33:39 +00:00
Chris Lattner
3f9ff05309 remove some dead hooks
llvm-svn: 35845
2007-04-09 23:31:19 +00:00
Chris Lattner
78fffcb81b eliminate the last uses of some TLI methods.
llvm-svn: 35844
2007-04-09 23:29:07 +00:00
Owen Anderson
94e3511ef6 Unconst-ify stuff that broke the build.
llvm-svn: 35843
2007-04-09 23:08:26 +00:00
Owen Anderson
3d132f812a Const-ify some parameters, and some cosmetic cleanups. No functionality
change.

llvm-svn: 35842
2007-04-09 22:54:50 +00:00
Owen Anderson
148566d2e3 Tabs -> Spaces
llvm-svn: 35841
2007-04-09 22:31:43 +00:00
Chris Lattner
ae6e2c0ee5 remove some dead target hooks, subsumed by isLegalAddressingMode
llvm-svn: 35840
2007-04-09 22:27:04 +00:00
Owen Anderson
6f5fe179cc Improve some _slow_ behavior introduced in my patches the last few days.
llvm-svn: 35839
2007-04-09 22:25:09 +00:00
Chris Lattner
87c89cafb2 switch LSR to use isLegalAddressingMode instead of other simpler hooks
llvm-svn: 35837
2007-04-09 22:20:14 +00:00
Devang Patel
70205cceea Check _all_ PHINodes.
llvm-svn: 35836
2007-04-09 22:20:10 +00:00
Chris Lattner
b4ef9c8be3 Fix a bug in PPCTargetLowering::isLegalAddressingMode, scales other than 0/1/2
are always unsupported.

llvm-svn: 35835
2007-04-09 22:10:05 +00:00
Anton Korobeynikov
6e6b2d493a Use integer log for metric calculation
llvm-svn: 35834
2007-04-09 21:57:03 +00:00
Devang Patel
5392489e86 Insert new pre-header before new header. Original pre-header may
happen to be an entry, in such case, it is not a good idea to
insert new block before entry.

Also fix typo in assertion check.

llvm-svn: 35833
2007-04-09 21:40:43 +00:00
Chris Lattner
d186d37694 Fix a bug where calling materializeModule could corrupt the module, reading
multiple copies of the function into the Function*.

llvm-svn: 35831
2007-04-09 20:28:40 +00:00
Devang Patel
cdea453adb Preserve canonical loop form.
llvm-svn: 35829
2007-04-09 20:19:46 +00:00
Jeff Cohen
f489bef844 When the number of elements is zero, don't malloc 32GB on 64-bit systems.
Fixes unexpected failures on FreeBSD/amd64 of:
  CFrontend/2005-09-24-BitFieldCrash.c:
  CFrontend/2007-02-04-EmptyStruct.c:
  CFrontend/2007-03-26-ZeroWidthBitfield.c:
  CodeGen/Generic/2005-10-18-ZeroSizeStackObject.ll:

llvm-svn: 35828
2007-04-09 19:26:30 +00:00
Reid Spencer
60da7b09e7 Don't link against System or Support library. These things will already
be in the opt tool.

llvm-svn: 35827
2007-04-09 19:17:47 +00:00
Devang Patel
9263a797b3 Do not create new pre-header. Reuse original pre-header.
llvm-svn: 35825
2007-04-09 19:04:21 +00:00
Reid Spencer
93a57ef458 For PR1146:
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory
  leaks. This will change when ParamAttrsList is uniquified but needs to
  be correct until then.

llvm-svn: 35824
2007-04-09 18:00:57 +00:00
Reid Spencer
1acc089771 Remove a memory leak, until ParamAttrsList is uniqued.
llvm-svn: 35823
2007-04-09 17:20:18 +00:00
Devang Patel
e038420dc6 Simpler for() loops.
llvm-svn: 35822
2007-04-09 17:09:13 +00:00
Devang Patel
dd269ce747 Fix future bug. Of course, Chris spotted this.
Handle Argument or Undef as an incoming PHI value.

llvm-svn: 35821
2007-04-09 16:41:46 +00:00
Devang Patel
ba5018aaff More cosmetic changes.
llvm-svn: 35820
2007-04-09 16:21:29 +00:00
Devang Patel
f66f3dd962 Only cosmetic changes. Zero functionality Change.
llvm-svn: 35819
2007-04-09 16:11:48 +00:00
Reid Spencer
d2380cfb76 For PR1146:
* Add ParamAttrList pointers to Function and CallInst.
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp

llvm-svn: 35818
2007-04-09 15:01:12 +00:00
Jeff Cohen
b3d61e6c05 Unbreak VC++ build.
llvm-svn: 35817
2007-04-09 14:32:59 +00:00
Anton Korobeynikov
6ee97ee42a Next stage into switch lowering refactoring
1. Fix some bugs in the jump table lowering threshold
2. Implement much better metric for optimal pivot selection
3. Tune thresholds for different lowering methods
4. Implement shift-and trick for lowering small (<machine word
length) cases with few destinations. Good testcase will follow.

llvm-svn: 35816
2007-04-09 12:31:58 +00:00
Chris Lattner
730f5588be Convert ImmediateDominators::DFSPass from being recursive to being iterative.
llvm-svn: 35815
2007-04-09 06:44:42 +00:00
Reid Spencer
2660b8dccb For PR1146:
Adapt handling of parameter attributes to use the new ParamAttrsList class.

llvm-svn: 35814
2007-04-09 06:17:21 +00:00
Reid Spencer
3ffd70d6e4 Regenerate
llvm-svn: 35813
2007-04-09 06:16:21 +00:00
Reid Spencer
b43eb600c2 For PR1146:
Use ParamAttrsList for writing parameter attributes. Since they are sparse
now, we also write them sparsely (saves a few bytes). Unfortunately, this
is a bytecode file format change.

llvm-svn: 35811
2007-04-09 06:14:31 +00:00
Reid Spencer
1f674acbdf For PR1146:
Simplify construction of FunctionType to use default arguments.

llvm-svn: 35810
2007-04-09 06:12:07 +00:00
Reid Spencer
a2b16b4ee5 For PR1146:
Parameter attributes can now be defaulted for intrinsics.

llvm-svn: 35809
2007-04-09 06:11:23 +00:00
Reid Spencer
3d414b473d For PR1146:
Adjust writing of parameter attributes to use ParamAttrList class.

llvm-svn: 35808
2007-04-09 06:10:42 +00:00
Chris Lattner
884f49c47e minor cleanups
llvm-svn: 35807
2007-04-09 06:10:06 +00:00
Reid Spencer
6bc0205a2a For PR1146:
Move parameter attributes functionality to ParamAttrsList class.

llvm-svn: 35806
2007-04-09 06:07:52 +00:00
Chris Lattner
de148c7887 move a bunch of register constraints from being handled by
getRegClassForInlineAsmConstraint to being handled by
getRegForInlineAsmConstraint.  This allows us to let the llvm register allocator
allocate, which gives us better code.  For example, X86/2007-01-29-InlineAsm-ir.ll
used to compile to:

_run_init_process:
        subl $4, %esp
        movl %ebx, (%esp)
        xorl %ebx, %ebx
        movl $11, %eax
        movl %ebx, %ecx
        movl %ebx, %edx
        # InlineAsm Start
        push %ebx ; movl %ebx,%ebx ; int $0x80 ; pop %ebx
        # InlineAsm End

Now we get:
_run_init_process:
        xorl %ecx, %ecx
        movl $11, %eax
        movl %ecx, %edx
        # InlineAsm Start
        push %ebx ; movl %ecx,%ebx ; int $0x80 ; pop %ebx
        # InlineAsm End

llvm-svn: 35804
2007-04-09 05:49:22 +00:00
Chris Lattner
b940a717ac implement support for CodeGen/X86/inline-asm-x-scalar.ll:test3 - i32/i64 values
used with x constraints.

llvm-svn: 35803
2007-04-09 05:31:48 +00:00
Chris Lattner
13a530ec7f implement CodeGen/X86/inline-asm-x-scalar.ll:test3
llvm-svn: 35802
2007-04-09 05:31:20 +00:00
Chris Lattner
c360f69afe add some assertions
llvm-svn: 35800
2007-04-09 05:23:13 +00:00
Chris Lattner
e2d3bf8ecf implement CodeGen/X86/inline-asm-x-scalar.ll
llvm-svn: 35799
2007-04-09 05:11:28 +00:00
Owen Anderson
e4c29f0b01 Move isReachableFromEntry out of line to avoid an unnecessary #include
llvm-svn: 35797
2007-04-09 04:07:36 +00:00
Chris Lattner
b3c4c64197 Fix a bug that caused alignment information to occasionally get stripped off
of an allocation instruction when writing to bytecode.

llvm-svn: 35796
2007-04-09 03:37:36 +00:00
Reid Spencer
4ede44609e Regenerate
llvm-svn: 35795
2007-04-09 01:56:05 +00:00
Reid Spencer
93d41cc941 Drop the implementation keyword.
llvm-svn: 35794
2007-04-09 01:55:42 +00:00
Chris Lattner
218d43af10 Fix PR1304 and Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll
llvm-svn: 35792
2007-04-09 01:37:55 +00:00
Chris Lattner
958d804293 Fix a bug introduced with my previous patch, where it didn't correctly handle
instructions which replace themselves when FI's are rewritten (common on ppc).
This fixes CodeGen/PowerPC/2006-10-17-ppc64-alloca.ll

llvm-svn: 35789
2007-04-09 01:19:33 +00:00
Chris Lattner
b3d105a4f9 Eliminate useless insertelement instructions. This implements
Transforms/InstCombine/vec_insertelt.ll and fixes PR1286.

We now compile the code from that bug into:

_foo:
        movl 4(%esp), %eax
        movdqa (%eax), %xmm0
        movl 8(%esp), %ecx
        psllw (%ecx), %xmm0
        movdqa %xmm0, (%eax)
        ret

instead of:

_foo:
        subl $4, %esp
        movl %ebp, (%esp)
        movl %esp, %ebp
        movl 12(%ebp), %eax
        movdqa (%eax), %xmm0
        #IMPLICIT_DEF %eax
        pinsrw $2, %eax, %xmm0
        xorl %ecx, %ecx
        pinsrw $3, %ecx, %xmm0
        pinsrw $4, %eax, %xmm0
        pinsrw $5, %ecx, %xmm0
        pinsrw $6, %eax, %xmm0
        pinsrw $7, %ecx, %xmm0
        movl 8(%ebp), %eax
        movdqa (%eax), %xmm1
        psllw %xmm0, %xmm1
        movdqa %xmm1, (%eax)
        movl %ebp, %esp
        popl %ebp
        ret

woo :)

llvm-svn: 35788
2007-04-09 01:11:16 +00:00
Owen Anderson
f9a432a613 Cleanup some from my DomSet-removal changes. Add a new
isReachableFromEntry
test to ETForest to factor a common test out of code.

llvm-svn: 35786
2007-04-09 00:52:49 +00:00
Chris Lattner
1a746d3b8e Fix CodeGen/Generic/2007-04-08-MultipleFrameIndices.ll and PR1308:
some instructions can have multiple frame indices in them.  If this happens,
rewrite all of them.

llvm-svn: 35785
2007-04-09 00:46:10 +00:00
Chris Lattner
5f8b0c2acc Fix PR1316
llvm-svn: 35783
2007-04-09 00:33:58 +00:00
Reid Spencer
aedaf87e5e No functional change, this is just easier to read and debug.
llvm-svn: 35782
2007-04-08 23:58:41 +00:00
Chris Lattner
f9506a185b Fix for CodeGen/X86/2007-04-08-InlineAsmCrash.ll and PR1314
llvm-svn: 35779
2007-04-08 22:23:26 +00:00
Owen Anderson
4b323657b9 Remove DomSet completely. This concludes work on PR1171.
llvm-svn: 35775
2007-04-08 21:30:05 +00:00
Reid Spencer
82c0c6353b Make sure temporary data is not used past its life span.
llvm-svn: 35773
2007-04-08 20:10:14 +00:00
Chris Lattner
4ed32d0891 Fix a typo that broke SimplifyLibCalls/SPrintF.ll (pr1315)
llvm-svn: 35768
2007-04-08 18:11:26 +00:00
Chris Lattner
1a1b798eb5 reenable this xform, whoops :)
llvm-svn: 35765
2007-04-08 08:01:49 +00:00
Chris Lattner
1760b42378 Fix regression on Instcombine/apint-or2.ll
llvm-svn: 35763
2007-04-08 07:55:22 +00:00
Chris Lattner
d435e0bfd2 Generalize the code that handles (A&B)|(A&C) to work where B/C are not constants.
Add a new xform to simplify (A&B)|(~A&C).  THis implements InstCombine/or2.ll:test1

llvm-svn: 35760
2007-04-08 07:47:01 +00:00
Chris Lattner
34464bdf2b implement a fixme: move optimizations for fwrite out of fputs into a new
fwrite optimizer.

llvm-svn: 35758
2007-04-08 07:00:35 +00:00
Nick Lewycky
71592d1ef2 Remove DominatorSet usage from LoopSimplify. Patch from Owen Anderson.
llvm-svn: 35757
2007-04-08 01:04:30 +00:00
Nick Lewycky
26652f5681 Don't crash when encountering a BasicBlock that hasn't been registered yet.
llvm-svn: 35756
2007-04-08 01:02:12 +00:00
Chris Lattner
16fe035aa4 Significantly simplify the clients of GetConstantStringInfo, by having it
just return the string itself.

llvm-svn: 35755
2007-04-07 21:58:02 +00:00
Chris Lattner
5b3be230d4 Fix problems in the sprintf optimizer
llvm-svn: 35754
2007-04-07 21:17:51 +00:00
Chris Lattner
99a7ea0b00 Change CastToCStr to take a pointer instead of a reference.
Fix some miscompilations in fprintf optimizer.

llvm-svn: 35753
2007-04-07 21:04:50 +00:00
Jeff Cohen
d40c15afaa Unbreak VC++ build.
llvm-svn: 35751
2007-04-07 20:47:27 +00:00
Chris Lattner
fcc6fe0a9c Fix an off-by-one error that broke Prolangs/deriv2 with llc on x86
and Prolangs-C/cdecl

llvm-svn: 35749
2007-04-07 20:19:08 +00:00
Reid Spencer
fb17dbb809 Avoid a useless temporary constrution.
llvm-svn: 35747
2007-04-07 19:51:45 +00:00
Reid Spencer
845c291c87 Fix another PathWithStatus issue.
llvm-svn: 35744
2007-04-07 19:45:30 +00:00
Reid Spencer
875a2bc4db For PR1291:
Change uses of sys::Path class to sys::PathWithStatus in those places where
the file status information is needed.

llvm-svn: 35743
2007-04-07 18:53:16 +00:00
Reid Spencer
14fb379888 For PR1291:
Implement the PathWithStatus class and its use throughout lib/System.

llvm-svn: 35742
2007-04-07 18:52:17 +00:00
Owen Anderson
7cf9d12f2e Add DomSet back, and revert the changes to LoopSimplify. Apparently the
ETForest updating mechanisms don't work as I thought they did.  These changes
will be reapplied once the issue is worked out.

llvm-svn: 35741
2007-04-07 18:23:27 +00:00
Zhou Sheng
c2cfa6111d Eliminate unnecessary APInt construction.
llvm-svn: 35740
2007-04-07 17:48:27 +00:00
Zhou Sheng
7bcd47dbc1 Make APInt variables do the computation stuffs instead of
ConstantExpr::getXX if possible.

llvm-svn: 35738
2007-04-07 17:40:57 +00:00
Zhou Sheng
21dfc2107a Eliminate unnecessary zext/trunc stuffs.
llvm-svn: 35737
2007-04-07 17:12:38 +00:00
Nick Lewycky
e6cb3e2433 Add support for cast instructions.
llvm-svn: 35734
2007-04-07 15:48:32 +00:00
Nick Lewycky
ec51e934ef Add signExtend to ConstantRange, to complement zeroExtend and truncate.
llvm-svn: 35733
2007-04-07 15:41:33 +00:00
Owen Anderson
85b0e20f2a Completely purge DomSet. This is the (hopefully) final patch for PR1171.
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
Owen Anderson
177b1a6aea Completely purge DomSet from LoopSimplify. This is part of the
continuing work on PR1171.

llvm-svn: 35730
2007-04-07 06:56:47 +00:00
Owen Anderson
e2add101a4 BreakCriticalEdges does still preserve DominatorTree.
llvm-svn: 35729
2007-04-07 05:57:09 +00:00
Owen Anderson
eb184ee17b Expunge DomSet from BreakCriticalEdges. This is part of the continuing
work for PR 1171.

llvm-svn: 35728
2007-04-07 05:49:29 +00:00
Chris Lattner
c1bce783e8 Fix a bug in my earlier commit which exposed positional options backwards.
This fixes llvm-ar.

llvm-svn: 35727
2007-04-07 05:38:53 +00:00
Owen Anderson
41bf50021d Expunge DomSet from CodeExtractor. This is part of the continuing work
on PR1171.

llvm-svn: 35726
2007-04-07 05:31:27 +00:00
Nick Lewycky
3e77af40ff Support NE inequality in ValueRanges.
llvm-svn: 35724
2007-04-07 04:49:12 +00:00
Owen Anderson
5403a248af Expunge DomSet from LoadValueNumbering. This is part of the continuing
work on PR1171.

llvm-svn: 35723
2007-04-07 04:43:07 +00:00
Owen Anderson
54c7efee4d Expunge a bunch of uses of DomSet from LoopSimplify. Many more remain.
This is the beginning of work for PR1171.

llvm-svn: 35720
2007-04-07 04:37:14 +00:00
Nick Lewycky
7fbec59fb4 Cleanup. Refactor out the applying of value ranges to its own method.
llvm-svn: 35719
2007-04-07 03:36:51 +00:00
Nick Lewycky
80cf96b3f8 Use TargetData to find the size of a type.
llvm-svn: 35718
2007-04-07 03:16:12 +00:00
Nick Lewycky
3ddf638983 Strengthen icmp snuggling by doing 'compare-or-equal-to' to 'compare'
first and then range testing second.

llvm-svn: 35715
2007-04-07 02:30:14 +00:00
Devang Patel
562df7f986 Add loop rotation pass.
llvm-svn: 35714
2007-04-07 01:25:15 +00:00
Chris Lattner
dbf5d6cf68 fix a miscompilation in printf optimizer.
llvm-svn: 35713
2007-04-07 01:18:36 +00:00
Chris Lattner
9aa0d009c1 trunc to bool no longer compares against zero
llvm-svn: 35712
2007-04-07 01:03:46 +00:00
Chris Lattner
312c204869 cleanups for strlen optimizer
llvm-svn: 35711
2007-04-07 01:02:00 +00:00
Chris Lattner
5f27ea3613 Introduce a new ReplaceCallWith method, which simplifies a lot of code.
llvm-svn: 35710
2007-04-07 00:42:32 +00:00
Chris Lattner
fba13c72ef fixes for strcpy optimizer
llvm-svn: 35709
2007-04-07 00:26:18 +00:00
Chris Lattner
02ae7ab94f Fix bugs in strncmp.
llvm-svn: 35708
2007-04-07 00:06:57 +00:00
Chris Lattner
d8a16e67ab fix 3 miscompilations and several compielr crashes in strcmp optimizer.
llvm-svn: 35707
2007-04-07 00:01:51 +00:00
Chris Lattner
c61ff0afc0 Fix several nasty bugs in the strchr optimizer, this fixes
SimplifyLibCalls/2007-04-06-strchr-miscompile.ll and PR1307

llvm-svn: 35706
2007-04-06 23:38:55 +00:00
Chris Lattner
bfad67243a clean up strcat optimizer, no functionality change.
llvm-svn: 35704
2007-04-06 22:59:33 +00:00
Chris Lattner
d03767c332 rename getConstantStringLength -> GetConstantStringInfo. Make it return
the start index of the array as well as the length.  No functionality change.

llvm-svn: 35703
2007-04-06 22:54:17 +00:00
Chris Lattner
0160bf7114 rearchitect the registration mechanism used by the command line option stuff.
This dramatically reduce the amount of memory allocated by the commandline stuff
at static init time, changing it to build local data structures when ParseCommandLineOptions
is called.  In a dummy empty program that links some llvm libraries, this reduces
the number of malloc'd bytes from 4864 to 3360 on entry to main.  Most of that
memory is now allocated by non-commandline related stuff.

llvm-svn: 35701
2007-04-06 21:06:55 +00:00
Chris Lattner
03c84be56b implement Transforms/InstCombine/malloc2.ll and PR1313
llvm-svn: 35700
2007-04-06 18:57:34 +00:00
Chris Lattner
b39a2df066 minor comment fix
llvm-svn: 35696
2007-04-06 17:47:14 +00:00
Reid Spencer
5d36a01dba For PR1209:
Implement Type class's ContainedTys without using a std::vector.

llvm-svn: 35693
2007-04-06 02:02:20 +00:00
Chris Lattner
d33f94f2d2 remove the dead removeArgument method, rename Options to OptionsMap.
llvm-svn: 35690
2007-04-05 21:58:17 +00:00
Chris Lattner
19b9e90f9c Fix Transforms/GlobalOpt/2007-04-05-Crash.ll
llvm-svn: 35689
2007-04-05 21:09:42 +00:00
Chris Lattner
997967979f Use a worklist-driven algorithm instead of a recursive one.
llvm-svn: 35680
2007-04-05 01:27:02 +00:00
Reid Spencer
aad0b4536b Change the bit_part_select (non)implementation from "return 0" to abort.
llvm-svn: 35679
2007-04-05 01:20:18 +00:00
Reid Spencer
6eb55df794 Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
llvm-svn: 35678
2007-04-04 23:48:25 +00:00
Reid Spencer
a72beea861 Squelch a warning about mismatch between sign of constant and sign of return
type.

llvm-svn: 35674
2007-04-04 22:07:24 +00:00
Anton Korobeynikov
e16f421e0e Properly emit range comparisons for switch cases, where neighbour cases
go to the same destination. Now we're producing really good code for
switch-lower-feature.ll testcase

llvm-svn: 35672
2007-04-04 21:14:49 +00:00
Dale Johannesen
fb15913194 Prevent transformConstExprCastCall from generating conversions that assert
elsewhere.

llvm-svn: 35668
2007-04-04 19:16:42 +00:00
Chris Lattner
ed593d6789 stringmap memory managed with malloc now
llvm-svn: 35666
2007-04-04 17:24:28 +00:00
Jeff Cohen
01d4afe6da Fix 2007-04-04-BadFoldBitcastIntoMalloc.ll
llvm-svn: 35665
2007-04-04 16:58:57 +00:00
Evan Cheng
b7ec9433b3 Re-materialize all loads from fixed stack slots.
llvm-svn: 35660
2007-04-04 07:40:01 +00:00
Evan Cheng
48b94106d6 Trivially re-materializable instructions have spill weights that are half of what it would be otherwise.
llvm-svn: 35658
2007-04-04 07:04:55 +00:00
Reid Spencer
d8c3813f51 For PR1302:
Use local variable names that match the function parameter name that it
is passed to so the code is more clear, to wit: is_bytecode -> is_native

llvm-svn: 35656
2007-04-04 06:44:18 +00:00
Duncan Sands
de998e6599 Fix comment.
llvm-svn: 35655
2007-04-04 06:42:45 +00:00
Reid Spencer
87ede33a19 For PR1302:
Implement file tests for both LinkInLibrary and LinkInFile to determine if
the file is native. Don't generate warnings if the file is native.

llvm-svn: 35653
2007-04-04 06:33:17 +00:00
Reid Spencer
6df393cf38 For PR1302:
Adjust useage of sys::Path::FileType for new enumerator names.

llvm-svn: 35651
2007-04-04 06:31:04 +00:00
Reid Spencer
e825ec8a72 For PR1302:
Implement recognition of COFF, ELF and Mach-O object/shared lib files.

llvm-svn: 35650
2007-04-04 06:30:26 +00:00
Chris Lattner
8a4ca643dd use calloc instead of new/memset, it is more efficient
llvm-svn: 35644
2007-04-04 00:44:31 +00:00
Chris Lattner
dbf6a79a71 Extend StringMap to support being initialized as completely empty. When
initialized this way, they do not do a malloc to allocate their buckets.

llvm-svn: 35642
2007-04-04 00:29:37 +00:00
Evan Cheng
44488cb676 Implement inline asm modifier P.
llvm-svn: 35640
2007-04-04 00:13:29 +00:00
Evan Cheng
d5956e4409 Typo.
llvm-svn: 35639
2007-04-04 00:06:07 +00:00
Bill Wendling
a4aa65bc38 Adding more MMX instructions.
llvm-svn: 35638
2007-04-03 23:48:32 +00:00
Chris Lattner
78271f0596 make a new missing features section
llvm-svn: 35637
2007-04-03 23:41:34 +00:00
Evan Cheng
2cd9df6983 Remove unused constant pool entries.
llvm-svn: 35635
2007-04-03 23:39:48 +00:00
Bill Wendling
ff2c460267 Updated
llvm-svn: 35634
2007-04-03 23:37:20 +00:00
Chris Lattner
974e931689 Fix a bug I introduced with my patch yesterday which broke Qt (I converted
some constant exprs to apints).

Thanks to Anton for tracking down a small testcase that triggered this!

llvm-svn: 35633
2007-04-03 23:29:39 +00:00
Chris Lattner
59994ede6b greatly reduce hte default size of stringmap.
llvm-svn: 35632
2007-04-03 22:15:38 +00:00
Evan Cheng
db15aa24f9 Fixed a bug that causes codegen of noop like add r0, r0, #0.
llvm-svn: 35627
2007-04-03 21:31:21 +00:00
Chris Lattner
bfe18d29f9 reinstate the previous two patches, with a bugfix :)
ldecod now passes.

llvm-svn: 35626
2007-04-03 17:43:25 +00:00
Nicolas Geoffray
681a87d9e8 Starting implementation of the ELF32 ABI specification of varargs handling.
LowerVASTART emits the right code if the subtarget is ELF32, the other intrinsics
(VAARG, VACOPY and VAEND) are not yet implemented.

llvm-svn: 35625
2007-04-03 13:59:52 +00:00
Nicolas Geoffray
5897c064a6 The PPC64 ELF ABI is "intended to use the same structure layout and calling convention rules
as the 64-bit PowerOpen ABI" (Reference http://www.linux-foundation.org/spec/ELF/ppc64/).
Change all ELF tests to ELF32.

llvm-svn: 35624
2007-04-03 12:35:28 +00:00
Nicolas Geoffray
45c3620d12 Addition to the previous commit for getCalleeSavedRegClasses:
"The ELF ABI specifies F1-F8 registers as argument registers for double, not
F1-F10. This affects only ELF, not MachO."

llvm-svn: 35623
2007-04-03 10:57:49 +00:00
Nicolas Geoffray
b7c0895529 The ELF ABI specifies F1-F8 registers as argument registers for double, not
F1-F10. This affects only ELF, not MachO.

llvm-svn: 35622
2007-04-03 10:27:07 +00:00
Evan Cheng
e30cfe8e9e Reverting back to 1.723. The last two commits broke JM (and possibily others) on ARM.
llvm-svn: 35620
2007-04-03 08:11:50 +00:00
Evan Cheng
16696f0ad8 Inverted logic.
llvm-svn: 35619
2007-04-03 06:44:25 +00:00
Evan Cheng
bad40843ec Bad bad bug. findRegisterUseOperand() returns -1 if a use if not found.
llvm-svn: 35618
2007-04-03 06:43:29 +00:00
Bill Wendling
a2eabd50c0 Changed to new MMX_ recipes.
llvm-svn: 35617
2007-04-03 06:18:31 +00:00
Bill Wendling
ca2124e5a9 Add FEMMS and ADDQ. Renamed MMX recipes to prepend the MMX_ to them.
llvm-svn: 35616
2007-04-03 06:00:37 +00:00
Chris Lattner
4302c8bcdb split some code out into a helper function
llvm-svn: 35615
2007-04-03 05:11:24 +00:00
Chris Lattner
23d58bde29 Split a whole ton of code out of visitICmpInst into visitICmpInstWithInstAndIntCst.
llvm-svn: 35614
2007-04-03 04:46:52 +00:00
Chris Lattner
9b66a372c8 Fix PR1253 and xor2.ll:test[01]
llvm-svn: 35612
2007-04-03 01:47:41 +00:00
Chris Lattner
4d702a890c Arm supports negative strides as well, add them. This lets us compile:
CodeGen/ARM/arm-negative-stride.ll to:

LBB1_2: @bb
        str r1, [r3, -r0, lsl #2]
        add r0, r0, #1
        cmp r0, r2
        bne LBB1_2      @bb

llvm-svn: 35609
2007-04-03 00:13:57 +00:00
Chris Lattner
3df2382275 allow -1 strides to reuse "1" strides.
llvm-svn: 35607
2007-04-02 22:51:58 +00:00
Scott Michel
d6b3d3d6ab 1. Insert custom lowering hooks for ISD::ROTR and ISD::ROTL.
2. Help DAGCombiner recognize zero/sign/any-extended versions of ROTR and ROTL
patterns. This was motivated by the X86/rotate.ll testcase, which should now
generate code for other platforms (and soon-to-come platforms.) Rewrote code
slightly to make it easier to read.

llvm-svn: 35605
2007-04-02 21:36:32 +00:00
Dale Johannesen
e1c3dc7c78 fix off by 1 error in displacement computation
llvm-svn: 35602
2007-04-02 20:31:06 +00:00
Chris Lattner
726d461daf fix the CodeGen/ARM/2007-03-13-InstrSched.ll regression: allow IV's with scales
to be folded into non-store instructions.

llvm-svn: 35601
2007-04-02 18:51:18 +00:00
Evan Cheng
d0366b0024 Ugh. Copy coalescer does not update register numbers.
llvm-svn: 35600
2007-04-02 18:49:18 +00:00
Chris Lattner
ff9caac83e add support for the 'w' inline asm register class.
llvm-svn: 35598
2007-04-02 17:24:08 +00:00
Zhou Sheng
98c161c290 1. Make use of APInt operation instead of using ConstantExpr::getXXX.
2. Use cheaper APInt methods.

llvm-svn: 35594
2007-04-02 13:45:30 +00:00
Zhou Sheng
47311533a7 Use uint32_t for bitwidth instead of unsigned.
llvm-svn: 35593
2007-04-02 08:20:41 +00:00
Chris Lattner
d7c96e25e4 Pass the type of the store access, not the type of the store, into the
target hook.  This allows us to codegen a loop as:

LBB1_1: @cond_next
        mov r2, #0
        str r2, [r0, +r3, lsl #2]
        add r3, r3, #1
        cmn r3, #1
        bne LBB1_1      @cond_next

instead of:

LBB1_1: @cond_next
        mov r2, #0
        str r2, [r0], #+4
        add r3, r3, #1
        cmn r3, #1
        bne LBB1_1      @cond_next

This looks the same, but has one fewer induction variable (and therefore,
one fewer register) live in the loop.

llvm-svn: 35592
2007-04-02 06:34:44 +00:00
Chris Lattner
dbce9ef4b8 Fix a bug which caused us to never be able to use signed comparisons for
equality comparisons of a constant.  This allows us to codegen the 'sintzero'
loop in PR1288 as:

LBB1_1: ;cond_next
        li r4, 0
        addi r2, r2, 1
        stw r4, 0(r3)
        addi r3, r3, 4
        cmpwi cr0, r2, -1
        bne cr0, LBB1_1 ;cond_next

instead of:

LBB1_1: ;cond_next
        addi r2, r2, 1
        li r4, 0
        xoris r5, r2, 65535
        stw r4, 0(r3)
        addi r3, r3, 4
        cmplwi cr0, r5, 65535
        bne cr0, LBB1_1 ;cond_next

This implements CodeGen/PowerPC/compare-simm.ll, and also cuts 74
instructions out of kc++.

llvm-svn: 35590
2007-04-02 05:59:42 +00:00
Chris Lattner
aaf29d3b5e Wrap long line
llvm-svn: 35588
2007-04-02 05:48:58 +00:00
Chris Lattner
7208dd1001 use more obvious function name.
llvm-svn: 35587
2007-04-02 05:42:22 +00:00
Chris Lattner
6668db1331 Treat xor of signbit like an add.
llvm-svn: 35586
2007-04-02 05:41:38 +00:00
Chris Lattner
35ece02bea simplify (x+c)^signbit as (x+c+signbit), pointed out by PR1288. This implements
test/Transforms/InstCombine/xor.ll:test28

llvm-svn: 35584
2007-04-02 05:36:22 +00:00
Chris Lattner
d59b6b3d90 reduce use of std::set
llvm-svn: 35576
2007-04-02 01:44:59 +00:00
Chris Lattner
2f94a80322 Various passes before isel split edges and do other CFG-restructuring changes.
isel has its own particular features that it wants in the CFG, in order to
reduce the number of times a constant is computed, etc.  Make sure that we
clean up the CFG before doing any other things for isel.  Doing so can
dramatically reduce the number of split edges and reduce the number of
places that constants get computed.  For example, this shrinks
CodeGen/Generic/phi-immediate-factoring.ll from 44 to 37 instructions on X86,
and from 21 to 17 MBB's in the output.  This is primarily a code size win,
not a performance win.

This implements CodeGen/Generic/phi-immediate-factoring.ll and PR1296.

llvm-svn: 35575
2007-04-02 01:35:34 +00:00
Lauro Ramos Venancio
7e21418680 - Divides the comparisons in two types: comparisons that only use N and Z
flags (ARMISD::CMPNZ) and comparisons that use all flags (ARMISD::CMP).
- Defines the instructions: TST, TEQ (ARM) and TST (Thumb).

llvm-svn: 35573
2007-04-02 01:30:03 +00:00
Reid Spencer
419407379c For PR1297:
Make sure that the CTPOP result is casted to i32 as the bit counting
intrinsics all return i32 now (this affects CTLZ and CTTZ as well).

llvm-svn: 35567
2007-04-02 01:01:49 +00:00
Chris Lattner
ac77daac29 print the type of an inserted IV in -debug mode.
llvm-svn: 35563
2007-04-01 22:21:39 +00:00
Chris Lattner
a66a97908c simplify this code, make it work for ap ints
llvm-svn: 35561
2007-04-01 20:57:36 +00:00
Chris Lattner
4fb170e47b fix breakage from last night, simplify code.
llvm-svn: 35560
2007-04-01 20:49:36 +00:00
Reid Spencer
34b5a64f15 The bit counting intrinsics return i32 not the operand type. This fixes
last night's regression in SingleSource/UnitTests/2005-05-11-Popcount-ffs-fls

llvm-svn: 35556
2007-04-01 18:42:20 +00:00
Zhou Sheng
8b2b6b9e36 Avoid unnecessary APInt construction.
llvm-svn: 35555
2007-04-01 17:13:37 +00:00
Evan Cheng
949a34fbad Add i16 address mode.
llvm-svn: 35551
2007-04-01 08:06:46 +00:00
Reid Spencer
88fb617695 For PR1297:
Support overloaded intrinsics bswap, ctpop, cttz, ctlz.

llvm-svn: 35547
2007-04-01 07:35:23 +00:00
Reid Spencer
4a28a16efb For PR1297:
Adjust for changes in the bit counting intrinsics. They all return i32
now so we have to trunc/zext the DAG node accordingly.

llvm-svn: 35546
2007-04-01 07:34:11 +00:00
Reid Spencer
77c46f6cf5 For PR1297:
Change getOperationName to return std::string instead of const char*

llvm-svn: 35545
2007-04-01 07:32:19 +00:00
Reid Spencer
d371e2e492 For PR1297:
Implement "actual" argument types for the Intrinsic member functions. This
involves changing the getName, getType, and getDeclaration methods to have
optional parameters for the actual types. These are necessary in order for
the type/name to be constructed properly for overloaded intrinsics. Only
the caller knows the actual argument types desired.

llvm-svn: 35541
2007-04-01 07:25:33 +00:00
Reid Spencer
1db694fe4b For PR1297:
1. Clear up confusion between "GotBits" and "ExpectBits". GotBits is the
   type actually provided. ExpectedBits is the type expected for the
   intrinsics. Before this patch, it was reversed!
2. Implement checks for overloaded intrinsics. This involves computing the
   suffix expected and making sure the suffix matches the function name. It
   also includes some intrinsic-specific checks such as ensuring that the
   bswap parameter and result are the same width and an even number of bytes.

llvm-svn: 35540
2007-04-01 07:22:57 +00:00
Chris Lattner
aa4b06bdae Fix InstCombine/2007-03-31-InfiniteLoop.ll
llvm-svn: 35536
2007-04-01 05:36:37 +00:00
Nick Lewycky
03f9c0ffc9 Implement union of wrapped sets.
llvm-svn: 35534
2007-04-01 03:47:44 +00:00
Andrew Lenharth
ff1ff37be9 Readme
llvm-svn: 35533
2007-03-31 15:05:44 +00:00
Anton Korobeynikov
db09256c9f Consistency with native compilers
llvm-svn: 35532
2007-03-31 13:11:52 +00:00
Bill Wendling
8f16f4bf9c Fix comment.
llvm-svn: 35531
2007-03-31 09:36:12 +00:00
Chris Lattner
cea5e599ed add a note
llvm-svn: 35530
2007-03-31 07:06:25 +00:00
Chris Lattner
f01b0a800b move a bunch of code out of the sdisel pass into its own opt pass "codegenprepare".
llvm-svn: 35529
2007-03-31 04:18:03 +00:00
Chris Lattner
579b1c63d5 Split the sdisel code munging stuff out into its own opt-pass, CodeGenPrepare.
llvm-svn: 35528
2007-03-31 04:06:36 +00:00
Chris Lattner
8747705792 switch TL::getValueType to use MVT::getValueType.
llvm-svn: 35527
2007-03-31 04:05:24 +00:00
Chris Lattner
546138e3dd add a method to turn a type into a VT.
llvm-svn: 35526
2007-03-31 04:03:02 +00:00
Zhou Sheng
967239685a Delete dead code.
llvm-svn: 35525
2007-03-31 02:50:26 +00:00
Zhou Sheng
ebf4c32f0b Use APInt operators to calculate the carry bits, remove this loop.
llvm-svn: 35524
2007-03-31 02:38:39 +00:00
Bill Wendling
0cba5d3c15 Match GCC's MMX calling convention.
llvm-svn: 35523
2007-03-31 01:03:53 +00:00
Chris Lattner
330464a91c Add a -print-lsr-output option to LLC, to print the output of the LSR pass.
llvm-svn: 35522
2007-03-31 00:24:43 +00:00
Chris Lattner
c0405a348d implement the new addressing mode description hook.
llvm-svn: 35521
2007-03-30 23:15:24 +00:00
Chris Lattner
143464e05f add one addressing mode description hook to rule them all.
llvm-svn: 35520
2007-03-30 23:14:50 +00:00
Dale Johannesen
d4ab7d28e9 Fix incorrect combination of different loads. Reenable zext-over-truncate
combination.

llvm-svn: 35517
2007-03-30 21:38:07 +00:00
Evan Cheng
d814ad9d50 Don't add the same MI to register reuse "last def/use" twice if it reads the
register more than once.

llvm-svn: 35513
2007-03-30 20:21:35 +00:00
Evan Cheng
fc6519b457 Bug fix for PR1279. When isDead is propagate by copy coalescing, we keep length
of dead def live interval at 1 to avoid multiple def's targeting the same
register. The previous patch missed a case where the source operand is live-in.
In that case, remove the whole interval.

llvm-svn: 35512
2007-03-30 20:18:35 +00:00
Zhou Sheng
67bcf1cfb6 Make sure the use of ConstantInt::getZExtValue() for shift amount safe.
llvm-svn: 35510
2007-03-30 17:20:39 +00:00
Reid Spencer
e1fed6f90d For PR1293:
* Rename the FunctionType* parameter from M to FT on all the functions.
* Implement a fix for PR1293 by just asserting that library functions that
  must return pointers should have pointer typed results. This just makes
  sure that we don't attempt to use an uninitialized integer or something
  later on.

llvm-svn: 35508
2007-03-30 16:41:50 +00:00
Zhou Sheng
d667b5db0c 1. Make sure the use of ConstantInt::getZExtValue() for getting shift
amount is safe.
2. Use new method on ConstantInt instead of (? :) operator.
3. Use new method uge() on ConstantInt to simplify codes.

llvm-svn: 35505
2007-03-30 09:29:48 +00:00
Zhou Sheng
382723d8b4 Use APInt operation instead of ConstantExpr::getXX.
llvm-svn: 35503
2007-03-30 05:45:18 +00:00
Reid Spencer
bc87d8dbef For PR1289: Regenerate
llvm-svn: 35500
2007-03-30 01:37:39 +00:00
Reid Spencer
8a51bc0379 For PR1289:
Check at the end of the parse that there are no unresolved types and no
undefined values. Issue errors if there are. This gets rid of the need
for implementation or checkpoint by ensuring you can't finish a parse with
undefined things.

llvm-svn: 35499
2007-03-30 01:37:13 +00:00
Bill Wendling
503f3e41f6 Add MMX calling conventions.
llvm-svn: 35489
2007-03-30 00:35:22 +00:00
Evan Cheng
526a67c09b New entry.
llvm-svn: 35480
2007-03-29 21:40:13 +00:00
Evan Cheng
3a6b488265 Can't re-materialize mov r, imm in thumb since mov would clobber the condition code.
llvm-svn: 35479
2007-03-29 21:38:31 +00:00
Reid Spencer
e35e9d07b0 Use the stat information in the Path object, if it is already obtained. This
avoids a call to ::fstat by MappedFile when the file size information was
already obtained by the Path object.

llvm-svn: 35477
2007-03-29 19:11:22 +00:00
Reid Spencer
4269ae1274 For PR789:
Make the sys::Path::getFileStatus function more efficient by having it
return a pointer to the FileStatus structure rather than copy it. Adjust
uses of the function accordingly. Also, fix some memory issues in sys::Path.

llvm-svn: 35476
2007-03-29 19:05:44 +00:00
Chris Lattner
3a52e7b06d the bytecode reader supports dematerializeFunction
llvm-svn: 35475
2007-03-29 18:58:08 +00:00
Reid Spencer
6125321928 Regenerate.
llvm-svn: 35473
2007-03-29 18:50:01 +00:00
Reid Spencer
b4730512d7 Give users a grace period on the implementation keyword. This *will* get
removed in a few days.

llvm-svn: 35472
2007-03-29 18:49:28 +00:00
Jeff Cohen
67dbe2064f MS C does have inlining after all, just uses _inline instead of inline.
llvm-svn: 35467
2007-03-29 17:42:21 +00:00
Jeff Cohen
6e6a8a9128 Determine absolute paths the correct way :)
llvm-svn: 35464
2007-03-29 17:27:38 +00:00
Reid Spencer
d0eb672f1e Add a uniqueID field to the FileStatus structure for Paths. This will map
to the inode number on Unix and something far less unique on Windows. The
windows case needs to be improved.

llvm-svn: 35461
2007-03-29 17:00:31 +00:00
Reid Spencer
50b83584c4 For PR789:
Updates for change in interface of getFileStatus method of sys::Path class.

llvm-svn: 35458
2007-03-29 16:48:16 +00:00
Reid Spencer
fc67ef7cfe For PR789:
* Add a method: bool isAbsolute() const, which determines if the path name
  is absolute or not.
* Implement caching of file status information in the Path object. Allow it
  to be updated forcefully or lazily re-fetched from the cached value.

llvm-svn: 35456
2007-03-29 16:43:20 +00:00
Zhou Sheng
ac2b833c7a 1. Make more use of APInt::getHighBitsSet/getLowBitsSet.
2. Let APInt variable do the binary operation stuff instead of using
   ConstantExpr::getXXX.

llvm-svn: 35450
2007-03-29 08:15:12 +00:00
Evan Cheng
2d09850760 Disable load width reduction xform of variant (zext (truncate load x)) for
big endian targets until llvm-gcc build issue has been resolved.

llvm-svn: 35449
2007-03-29 07:56:46 +00:00
Evan Cheng
bde0409264 Add support for hidden visibility to darwin/arm.
llvm-svn: 35448
2007-03-29 07:49:34 +00:00
Zhou Sheng
684c2133f2 Clean up some codes in InstCombiner::SimplifyDemandedBits().
llvm-svn: 35446
2007-03-29 04:45:55 +00:00
Evan Cheng
a72a3b7a74 New entries.
llvm-svn: 35445
2007-03-29 02:48:56 +00:00
Zhou Sheng
067efd7806 Clean up codes in InstCombiner::SimplifyDemandedBits():
1. Line out nested call of APInt::zext/trunc.
2. Make more use of APInt::getHighBitsSet/getLowBitsSet.
3. Use APInt[] operator instead of expression like "APIntVal & SignBit".

llvm-svn: 35444
2007-03-29 02:26:30 +00:00
Zhou Sheng
74db84591c 1. Make the APInt variable do the binary operation stuff if possible
instead of using ConstantExpr::getXX.
2. Use constant reference to APInt if possible instead of expensive
   APInt copy.

llvm-svn: 35443
2007-03-29 01:57:21 +00:00