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

72596 Commits

Author SHA1 Message Date
Akira Hatanaka
e2e584df0e Expand f64 FPOW.
llvm-svn: 131928
2011-05-23 22:23:58 +00:00
Akira Hatanaka
5b696387f7 Add pattern for double-to-integer conversion. Patch by Sasa Stankovic.
llvm-svn: 131927
2011-05-23 22:16:43 +00:00
Devang Patel
e829168e05 Revert 121907 (it causes llc crash) and apply original patch from PR9817.
llvm-svn: 131926
2011-05-23 22:04:42 +00:00
Akira Hatanaka
daa4afec69 Fixes related to coding style.
llvm-svn: 131922
2011-05-23 21:13:59 +00:00
Dan Gohman
3dd68e8eca Document llvm.exp and llvm.pow.
llvm-svn: 131921
2011-05-23 21:13:03 +00:00
Dan Gohman
e6a4a2aa6f When checking for signed multiplication overflow, watch out for INT_MIN and -1.
This fixes PR9845.

llvm-svn: 131919
2011-05-23 21:07:39 +00:00
Jim Grosbach
76f8f3d479 Propagate error correctly in the MC Asm parser for leading '$' expressions.
llvm-svn: 131918
2011-05-23 20:36:04 +00:00
Akira Hatanaka
123ee4388c Fix MipsAsmPrinter::printSavedRegsBitmaskChange. Remove functions and variables
in MipsFunctionInfo that are no longer used.

llvm-svn: 131917
2011-05-23 20:34:30 +00:00
Chris Lattner
f58c2c02b5 clarify this, apparently it is confusing :)
llvm-svn: 131916
2011-05-23 20:17:44 +00:00
Akira Hatanaka
6ddbe02441 Change StackDirection from StackGrowsUp to StackGrowsDown.
The following improvements are accomplished as a result of applying this patch:
- Fixed frame objects' offsets (relative to either the virtual frame pointer or
  the stack pointer) are set before instruction selection is completed. There is
  no need to wait until Prologue/Epilogue Insertion is run to set them.
- Calculation of final offsets of fixed frame objects is straightforward. It is
  no longer necessary to assign negative offsets to fixed objects for incoming
  arguments in order to distinguish them from the others.
- Since a fixed object has its relative offset set during instruction
  selection, there is no need to conservatively set its alignment to 4.
- It is no longer necessary to reorder non-fixed frame objects in 
  MipsFrameLowering::adjustMipsStackFrame.

llvm-svn: 131915
2011-05-23 20:16:59 +00:00
Devang Patel
ac809854cc Test case for r131908.
llvm-svn: 131909
2011-05-23 17:49:29 +00:00
Devang Patel
37ab34a49f Preserve debug info during iSel by keeping DanglingDebugInfoMap live until end of function.
Patch by Micah Villmow

llvm-svn: 131908
2011-05-23 17:44:13 +00:00
Devang Patel
5920de5c8c While replacing all uses of a SDValue with another value, do not forget to transfer SDDbgValue.
llvm-svn: 131907
2011-05-23 17:35:08 +00:00
Devang Patel
791327d23b Clear list of instructions without DebugLoc.
llvm-svn: 131906
2011-05-23 17:34:18 +00:00
Duncan Sands
9f313fa916 The dragonegg option to disable LLVM optimizations changed.
llvm-svn: 131903
2011-05-23 16:50:29 +00:00
Charles Davis
b38506e3a7 Implement .seh_stackalloc and .seh_pushframe parsing.
I haven't implemented any of the ones that take registers yet. The problem is
that for x86-64 the streamer methods expect a native x86 register number (note:
%r8-%r15 want 8-15 instead of 0-7; same for %xmm8-%xmm15). I haven't figured
out exactly how I want to do that yet.

llvm-svn: 131899
2011-05-23 16:43:09 +00:00
Chris Lattner
c64a4d1170 fix a really nasty basicaa mod/ref calculation bug that was causing miscompilation of
UnitTests/ObjC/messages-2.m with the recent optimizer improvements.

llvm-svn: 131897
2011-05-23 05:15:43 +00:00
Cameron Zwarich
5a416bda73 Fix <rdar://problem/9476260> by having tail calls always generate 32-bit branches
in Darwin Thumb2 code. Tail calls are already disabled on Thumb1.

llvm-svn: 131894
2011-05-23 01:57:17 +00:00
Chris Lattner
bee56202ba rearrange two transforms, since one subsumes the other. Make the shift-exactness
xform recurse.

llvm-svn: 131888
2011-05-23 00:32:19 +00:00
Chris Lattner
ec35f49b3e Transform any logical shift of a power of two into an exact/NUW shift when
in a known-non-zero context.

llvm-svn: 131887
2011-05-23 00:21:50 +00:00
Bill Wendling
6f30676150 Use a more efficient data structure for the "operand map". The number of
operands to an instruction aren't great, so an iterative search is fairly quick
and doesn't have the overhead of std::map.

llvm-svn: 131886
2011-05-23 00:18:33 +00:00
Chris Lattner
498f516575 use the valuetracking isPowerOfTwo function, which is more powerful than checking
for a constant directly.  Thanks to Duncan for pointing this out.

llvm-svn: 131885
2011-05-23 00:09:55 +00:00
Chris Lattner
c277b19e97 Teach valuetracking that byval arguments with a specified alignment are
aligned.

Teach memcpyopt to not give up all hope when confonted with an underaligned
memcpy feeding an overaligned byval.  If the *source* of the memcpy can be
determined to be adequeately aligned, or if it can be forced to be, we can
eliminate the memcpy.

This addresses PR9794.  We now compile the example into:

define i32 @f(%struct.p* nocapture byval align 8 %q) nounwind ssp {
entry:
  %call = call i32 @g(%struct.p* byval align 8 %q) nounwind
  ret i32 %call
}

in both x86-64 and x86-32 mode.  We still don't get a tailcall though,
because tailcalls apparently can't handle byval.

llvm-svn: 131884
2011-05-23 00:03:39 +00:00
Chris Lattner
5fd8380a35 add a helper method to get the byval alignment of an argument.
llvm-svn: 131883
2011-05-22 23:57:23 +00:00
Chris Lattner
ca9723d80b Eliminate some temporary variables, and don't call getByValTypeAlignment
when we're just going to throw the result away.  No functionality change.

llvm-svn: 131880
2011-05-22 23:23:02 +00:00
Chris Lattner
859ce35115 add test from PR9164
llvm-svn: 131876
2011-05-22 22:35:34 +00:00
Chris Lattner
009caa6b41 testcase for PR9378
llvm-svn: 131875
2011-05-22 22:32:53 +00:00
Chris Lattner
5442c034a8 add a missing alias to make us more bug compatible with gcc, PR9378
llvm-svn: 131874
2011-05-22 22:31:57 +00:00
Chris Lattner
9275a4413b document thiscall, PR9101
llvm-svn: 131873
2011-05-22 22:28:47 +00:00
Chris Lattner
78663aa9f5 implement PR9315, constant folding exp2 in terms of pow (since hosts without
C99 runtimes don't have exp2).

llvm-svn: 131872
2011-05-22 22:22:35 +00:00
Renato Golin
759db3cbe3 RTABI chapter 4.3.4 specifies __eabi_mem* calls. Specifically, __eabi_memset accepts parameters (ptr, size, value) in a different order than GNU's memset (ptr, value, size), therefore the special lowering in AAPCS mode. Implementation by Evzen Muller.
llvm-svn: 131868
2011-05-22 21:41:23 +00:00
Charles Davis
a4187a96c9 Add methods to parse the SEH directives to the COFFAsmParser. Implement some
of them, particularly the ones that don't take arguments. Also implement
.seh_proc and .seh_handler.

llvm-svn: 131866
2011-05-22 21:12:15 +00:00
Chris Lattner
3066a7e5ad add a note.
llvm-svn: 131863
2011-05-22 18:28:46 +00:00
Chris Lattner
84f101ea45 add some random notes.
llvm-svn: 131862
2011-05-22 18:26:48 +00:00
Evan Cheng
a2e8770368 Teach ValueTracking about x86 crc32 intrinsics.
llvm-svn: 131861
2011-05-22 18:25:30 +00:00
Chris Lattner
8ed794f599 Carve out a place in instcombine to put transformations which work knowing that their
result is non-zero.  Implement an example optimization (PR9814), which allows us to
transform:
  A / ((1 << B) >>u 2)
into:
  A >>u (B-2)

which we compile into:

_divu3:                                 ## @divu3
	leal	-2(%rsi), %ecx
	shrl	%cl, %edi
	movl	%edi, %eax
	ret

instead of:

_divu3:                                 ## @divu3
	movb	%sil, %cl
	movl	$1, %esi
	shll	%cl, %esi
	shrl	$2, %esi
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%esi, %eax
	ret

llvm-svn: 131860
2011-05-22 18:18:41 +00:00
Johnny Chen
6e8aeaa2f4 Fix Bug 9386 - ARM disassembler failed to disassemble conditional bx
Modified the patch to .td file supplied by Jyun-Yan You.  Add a test case and
modified ARMDisassemblerCore.cpp a little bit.

llvm-svn: 131859
2011-05-22 17:51:04 +00:00
Chris Lattner
44516c3ba3 Fix PR9815: I was trying to get out of "generating code and then
failing to form a memset, then having to delete it" but my approximation
isn't safe for self recurrent loops.  Instead of doign a hack, just
do it the right way.

llvm-svn: 131858
2011-05-22 17:39:56 +00:00
Frits van Bommel
df58ece78a Add a parameter to ConstantFoldTerminator() that callers can use to ask it to also clean up the condition of any conditional terminator it folds to be unconditional, if that turns the condition into dead code. This just means it calls RecursivelyDeleteTriviallyDeadInstructions() in strategic spots. It defaults to the old behavior.
I also changed -simplifycfg, -jump-threading and -codegenprepare to use this to produce slightly better code without any extra cleanup passes (AFAICT this was the only place in -simplifycfg where now-dead conditions of replaced terminators weren't being cleaned up). The only other user of this function is -sccp, but I didn't read that thoroughly enough to figure out whether it might be holding pointers to instructions that could be deleted by this.

llvm-svn: 131855
2011-05-22 16:24:18 +00:00
Chris Lattner
b2b8de15d8 another typo
llvm-svn: 131854
2011-05-22 15:44:02 +00:00
Chris Lattner
ddafd147a2 fix comment typo
llvm-svn: 131853
2011-05-22 15:34:37 +00:00
Chris Lattner
6830c25f35 I missed a checking with my GVN change.
llvm-svn: 131851
2011-05-22 07:20:02 +00:00
Chris Lattner
2be4296485 insertvalue takes a variable number of arguments, document this, fixing PR9935.
llvm-svn: 131850
2011-05-22 07:18:08 +00:00
Chris Lattner
98ce5cd957 fix PR9856, an incorrectly conservative assertion: a global can be
"stored once" even if its address is compared.

llvm-svn: 131849
2011-05-22 07:15:13 +00:00
Chris Lattner
6cce3b63ab fix PR9841 by having GVN not process dead loads. This was
causing it to get into infinite loops when it would widen a 
load (which can necessarily leave around dead loads).

llvm-svn: 131847
2011-05-22 07:03:34 +00:00
Chris Lattner
dcb6599980 remove a trivial test, make some other tests less trivial.
llvm-svn: 131846
2011-05-22 07:02:43 +00:00
Chris Lattner
ed5d5cc74d make this test less trivial.
llvm-svn: 131845
2011-05-22 06:59:33 +00:00
Chris Lattner
84d1d4b89c initialize and finalize function passes, pointed out by Cameron.
llvm-svn: 131843
2011-05-22 06:44:19 +00:00
Chris Lattner
75adf06d44 fix a bug for hosts without round, PR8893.
llvm-svn: 131842
2011-05-22 06:03:53 +00:00
Chris Lattner
9359dea740 move PR9408 here.
llvm-svn: 131841
2011-05-22 05:45:06 +00:00