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
Nick Lewycky
82ddea6aaa
Commit test change, forgotten as part of r131838.
...
llvm-svn: 131839
2011-05-22 05:31:47 +00:00
Nick Lewycky
9f7644d549
Teach the inliner to emit llvm.lifetime.start/end, to scope the local variables
...
of the inlinee to the code representing the original function.
llvm-svn: 131838
2011-05-22 05:22:10 +00:00
Chris Lattner
7eb3367809
switch to using a smallvector to avoid allocations for most normal size instructions.
...
llvm-svn: 131837
2011-05-22 04:53:24 +00:00
Chris Lattner
b58a888c57
tidy some things up.
...
llvm-svn: 131836
2011-05-22 04:52:24 +00:00
Chris Lattner
1520c4f4f0
Fix some minor typos and grammar.
...
llvm-svn: 131835
2011-05-22 04:44:48 +00:00
Charles Davis
d74119d139
Implement emission of all Win64 exception tables. Make the COFF streamer emit
...
these tables.
llvm-svn: 131833
2011-05-22 04:15:07 +00:00
Charles Davis
c23700bb65
Make the COFF streamer emit unwind info when processing a .seh_handlerdata
...
directive.
Implement emission of Win64 EH unwind info.
Pull in <cassert> in MCWin64EH.h so it can use the assert() macro.
llvm-svn: 131832
2011-05-22 03:01:05 +00:00
Nick Lewycky
7cc4d86ea6
Fix grammar in test.
...
llvm-svn: 131831
2011-05-22 01:16:00 +00:00
Charles Davis
a537e589c9
Don't allow unaligned offsets and sizes in the Win64 EH directives.
...
Also, fix threshold for 'Big' register saves.
llvm-svn: 131830
2011-05-22 00:56:20 +00:00
Chris Lattner
69a52dd280
random comment cleanups.
...
llvm-svn: 131829
2011-05-22 00:50:53 +00:00
Chris Lattner
9413ffa53b
fix a file system case sensitivity issue.
...
llvm-svn: 131828
2011-05-22 00:37:51 +00:00
Chris Lattner
03d83a7b9b
remove StandardPasses, it has been replaced with PassManagerBuilder
...
llvm-svn: 131827
2011-05-22 00:30:45 +00:00
Chris Lattner
dd750b0404
switch opt to using PassManagerBuilder.h
...
llvm-svn: 131824
2011-05-22 00:21:33 +00:00