Charles Davis
3ac82d9bb2
Add a method to TargetRegisterInfo to get the register number that the Win64 EH
...
scheme uses internally. Implement it for x86 (the only architecture that LLVM
supports for which this matters right now).
llvm-svn: 131969
2011-05-24 16:57:53 +00:00
Cameron Zwarich
e425894eaf
Clean up the lazy initialization of DIBuilder a bit.
...
llvm-svn: 131956
2011-05-24 06:00:08 +00:00
Jakob Stoklund Olesen
222e83f44b
Work around code generation bug in Visual Studio 2010.
...
See http://llvm.org/pr9976 for details.
llvm-svn: 131954
2011-05-24 03:20:56 +00:00
Cameron Zwarich
462b5db500
Make LoadAndStorePromoter preserve debug info and create llvm.dbg.values when
...
promoting allocas to SSA variables. Fixes <rdar://problem/9479036>.
llvm-svn: 131953
2011-05-24 03:10:43 +00:00
Rafael Espindola
8e44a53856
Explain FIXME.
...
llvm-svn: 131952
2011-05-24 03:10:31 +00:00
Rafael Espindola
176fe6a0e0
Fix the defaults for .eh_frame. We were marking it as writable.
...
llvm-svn: 131951
2011-05-24 02:50:20 +00:00
Evan Cheng
b5950697e8
- Teach SelectionDAG::isKnownNeverZero to return true (op x, c) when c is
...
non-zero.
- Teach X86 cmov optimization to eliminate the cmov from ctlz, cttz extension
when the source of X86ISD::BSR / X86ISD::BSF is proven to be non-zero.
rdar://9490949
llvm-svn: 131948
2011-05-24 01:48:22 +00:00
Evan Cheng
e6e324363e
Remove dead option.
...
llvm-svn: 131947
2011-05-24 01:43:38 +00:00
Andrew Trick
f3efa64b97
FileCheck-ize a couple of IV unit tests.
...
llvm-svn: 131946
2011-05-24 01:02:49 +00:00
Rafael Espindola
4e20425b24
Fix cmake dependencies.
...
llvm-svn: 131943
2011-05-24 00:58:06 +00:00
Akira Hatanaka
d0694fb652
Simplify offset calculation of stack frame objects for $gp restore location and
...
variable arguments in LowerCall and LowerFormalArguments. This should also fix
the bug in which handling of variable arguments is incorrect when the front-end
optimizes away unused fixed arguments.
llvm-svn: 131942
2011-05-24 00:23:52 +00:00
Devang Patel
5bce258c3d
Fix debug info for blocks' variable.
...
llvm-svn: 131940
2011-05-24 00:22:25 +00:00
Andrew Trick
f346cb419d
Test case for r130799 - indvars: Added canExpandBackEdgeTakenCount.
...
llvm-svn: 131939
2011-05-24 00:17:53 +00:00
Devang Patel
8a90970a54
Remove unnecessary comment.
...
llvm-svn: 131936
2011-05-23 23:16:14 +00:00
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