Commit Graph

72660 Commits

Author SHA1 Message Date
Devang Patel 84b64a3e92 Remove unused statistical counter.
llvm-svn: 132087
2011-05-25 21:55:40 +00:00
Cameron Zwarich a946f476d3 Convert tBX_CALL / tBXr9_CALL to actual pseudoinstructions.
llvm-svn: 132086
2011-05-25 21:53:50 +00:00
Charles Davis 2f6ecea19d Add tests for .seh_setframe and .seh_handlerdata parsing. Fix issues with
them.

I had to add a special SwitchSectionNoChange method to MCStreamer just for
.seh_handlerdata. If this isn't OK, please let me know, and I'll find some
other way to fix .seh_handlerdata streaming.

llvm-svn: 132084
2011-05-25 21:43:45 +00:00
Eric Christopher 8f2cd0254d Clean up comment a bit.
llvm-svn: 132083
2011-05-25 21:19:19 +00:00
Eric Christopher 8c5e4192e6 Implement the 'm' modifier. Note that it only works for memory operands.
Part of rdar://9119939

llvm-svn: 132081
2011-05-25 20:51:58 +00:00
Akira Hatanaka f1412e4d2f Remove MipsTargetLowering::LowerFP_TO_SINT. Patterns for fp_to_sint have already
been defined in MipsInstrFPU.td.

llvm-svn: 132076
2011-05-25 20:08:05 +00:00
Akira Hatanaka 44eba3ac49 Custom-lower FCOPYSIGN nodes.
llvm-svn: 132074
2011-05-25 19:32:07 +00:00
Eli Friedman 5bbb75655b Prepare ARMFastISel::SelectSIToFP for getRegForValue returning registers for i8 and i16 values.
llvm-svn: 132073
2011-05-25 19:09:45 +00:00
Evan Cheng 9605a698b0 Simplify r132022 based on Cameron's feedback.
llvm-svn: 132071
2011-05-25 18:17:13 +00:00
Akira Hatanaka d72cc55fcc Update MaxCallFrameSize regardless of the relocation model selected.
llvm-svn: 132070
2011-05-25 18:08:32 +00:00
Akira Hatanaka 92a26d4e18 Change initial value of MaxCallFrameSize. MipsFI::getMaxCallFrameSize() should
return 0 if there are no function calls made. 

llvm-svn: 132065
2011-05-25 17:52:48 +00:00
Akira Hatanaka 46662e0f91 Coding style fixes. Added comments.
llvm-svn: 132063
2011-05-25 17:32:06 +00:00
Francois Pichet 85ec52125b Remove unused OpcodeMask enumerator.
llvm-svn: 132062
2011-05-25 17:02:53 +00:00
Francois Pichet f83114dceb Fix 3 MSVC warnings:
'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'

atexit really expects a "void f(void)" function.

llvm-svn: 132061
2011-05-25 16:32:33 +00:00
Francois Pichet 58b09c9366 Fix MSVC warning: "is out of range for enum constant"
MSVC doesn't support 64 bit enum. 
OpcodeMask is not used anywhere in the code base.

llvm-svn: 132057
2011-05-25 15:58:10 +00:00
Rafael Espindola 33dacdfe66 Fix some issues Duncan found in the previous commit.
I kept the reference to the ABI since that is the common case. The
-fno-asynchronous-unwind-tables option is a user controlled way of breaking
the ABI.

llvm-svn: 132053
2011-05-25 12:54:08 +00:00
Frits van Bommel 308a534431 Fix warning in the CMake build about redefining LLVM_PATH_XDOT_PY by making sure both definitions are identical. This used to produce warnings like
In file included from .../llvm/trunk/tools/lto/LTOCodeGenerator.cpp:45:
In file included from .../llvm/trunk/include/llvm/Support/system_error.h:225:
.../include/llvm/Config/config.h:591:9: warning: 'LLVM_PATH_XDOT_PY' macro redefined
#define LLVM_PATH_XDOT_PY ".../bin/xdot.py"
        ^
.../include/llvm/Config/llvm-config.h:98:9: note: previous definition is here
#define LLVM_PATH_XDOT_PY ""
        ^
1 warning generated.

(Paths edited for clarity)

Note: This only affected people who had xdot.py installed.
llvm-svn: 132050
2011-05-25 06:32:23 +00:00
Argyrios Kyrtzidis 0246d63715 [tablegen] A couple of changes to ClangDiagnosticEmmitter.
-Emit an empty warning option as string ("") instead of 0.
-For diagnostic names also emit the size of the string.

llvm-svn: 132046
2011-05-25 05:04:22 +00:00
Charles Davis 828b00c0e1 Add tests for .seh_savereg and .seh_savexmm parsing. Once again, fix the
buggy methods that parse these directives.

llvm-svn: 132045
2011-05-25 04:51:25 +00:00
Cameron Zwarich a51604e511 Restore an accidentally removed comment.
llvm-svn: 132044
2011-05-25 04:48:17 +00:00
Cameron Zwarich 6b66ee1865 Move some code to a more logical place.
llvm-svn: 132043
2011-05-25 04:45:29 +00:00
Cameron Zwarich 3088e0a179 Make tTAILJMPr/tTAILJMPrND emit a tBX without a preceding MOV of PC to LR. This
fixes <rdar://problem/9495913>

llvm-svn: 132042
2011-05-25 04:45:27 +00:00
Cameron Zwarich 310b3472ec Change the order of tBX's operands so that the predicate operands come after the
target register, matching BX. I filed this bug because I was confused at first:

PR10007 - ARM branch instructions have inconsistent predicate operand placement
<http://llvm.org/bugs/show_bug.cgi?id=10007>

llvm-svn: 132041
2011-05-25 04:45:23 +00:00
Cameron Zwarich 012247e60c Rename tBX_Rm to tBX.
llvm-svn: 132040
2011-05-25 04:45:20 +00:00
Cameron Zwarich deaf994ff0 Rename the existing tBX/tBXr9 instructions to tBX_CALL/tBXr9_CALL to better
reflect their actual meaning and match the ARM instructions.

llvm-svn: 132039
2011-05-25 04:45:14 +00:00
Andrew Trick eb3c36e69c indvars: fixed IV cloning in -disable-iv-rewrite mode with associated
cleanup and overdue test cases.

llvm-svn: 132038
2011-05-25 04:42:22 +00:00
Charles Davis b0c4f39173 Add a test for .seh_pushframe parsing. Fix the bug exposed by it (and another
one I found by inspection).

llvm-svn: 132037
2011-05-25 04:08:15 +00:00
Rafael Espindola fc9bae6f8b Replace the -unwind-tables option with a per function flag. This is more
LTO friendly as we can now correctly merge files compiled with or without
-fasynchronous-unwind-tables.

llvm-svn: 132033
2011-05-25 03:44:17 +00:00
Akira Hatanaka aac670c1c8 Fix lowering of DYNAMIC_STACKALLOC nodes.
llvm-svn: 132030
2011-05-25 02:20:00 +00:00
Charles Davis fc1e7ce850 Add a test for the .seh_handler directive. Fix problems with the parsing
method exposed by the test. While we're at it, simplify the .seh_proc
parsing method.

llvm-svn: 132028
2011-05-25 01:33:42 +00:00
Bruno Cardoso Lopes 5445213a25 Fix PR9762
Enable the parsing of the operand "cpsr_all" for the ARM msr instruction

llvm-svn: 132026
2011-05-25 00:35:03 +00:00
Evan Cheng 73e6c09d5e Forgot dyn_cast check.
llvm-svn: 132025
2011-05-24 23:47:50 +00:00
Eric Christopher 1b724948e9 Implement the arm 'L' asm modifier.
Part of rdar://9119939

llvm-svn: 132024
2011-05-24 23:27:13 +00:00
Eric Christopher b1dda56ac2 Implement the immediate part of the 'B' modifier.
Part of rdar://9119939

llvm-svn: 132023
2011-05-24 23:15:43 +00:00
Evan Cheng 1b55f56b01 Fix LoopUnswitch bug. RewriteLoopBodyWithConditionConstant can delete a dead
case of a switch instruction. Back off this optimization when this would
eliminate all of the predecessors to the latch.

Sorry, I am unable to reduce a reasonably sized test case.

rdar://9486843

llvm-svn: 132022
2011-05-24 23:12:57 +00:00
Eric Christopher d4562566b4 Add more unimplemented asm modifiers and some documentation of what they
do.

Part of rdar://9119939.

llvm-svn: 132015
2011-05-24 22:27:43 +00:00
Eric Christopher 7617883ce3 Add support for the arm 'y' asm modifier.
Fixes part of rdar://9444657

llvm-svn: 132011
2011-05-24 22:10:34 +00:00
Dan Gohman 4a70bfe3c0 Update documentation: -basicaa does chaining these days.
llvm-svn: 132010
2011-05-24 22:01:32 +00:00
Akira Hatanaka 2486729839 Test case for r132003.
llvm-svn: 132005
2011-05-24 21:28:18 +00:00
Charles Davis f4ce8fde18 Test basic SEH directive-parsing functionality. Fix a latent bug exposed by
this test.

llvm-svn: 132004
2011-05-24 21:22:53 +00:00
Akira Hatanaka 2db176c4c1 Enable printing of immediates that do not fit in 16-bit. .cprestore can have
offsets that are larger than 0x10000.

llvm-svn: 132003
2011-05-24 21:22:21 +00:00
Eli Friedman bacb17906a Change condition for determining whether a function is small for inlining metrics so that very long functions
with few basic blocks are not re-analyzed.

llvm-svn: 131994
2011-05-24 20:22:24 +00:00
Charles Davis 7f6176c3f9 Implement the rest of the SEH directive-parsing methods in the COFFAsmParser.
Add a size alignment check to the .seh_stackalloc directive parser. Add a
more descriptive error message to the .seh_handler directive parser.

Add methods to the TargetAsmInfo struct in support of all this.

llvm-svn: 131992
2011-05-24 20:06:30 +00:00
Akira Hatanaka ce4037ebcf Fix test case.
llvm-svn: 131988
2011-05-24 19:37:15 +00:00
Akira Hatanaka 0f30561bae Revision 131986 test case.
llvm-svn: 131987
2011-05-24 19:29:37 +00:00
Akira Hatanaka 5e16c6a9b2 Implement byval structure argument passing. The following limitations or
deficiencies exist:

- Works only if ABI is o32.
- Zero-sized structures cannot be passed.
- There is a lot of redundancy in generated code.

llvm-svn: 131986
2011-05-24 19:18:33 +00:00
Eli Friedman 68aab459ae Make instcombine O(N) instead of O(N^2) in code where the same simplifiable constant is used many times.
Part of rdar://9471075.

llvm-svn: 131979
2011-05-24 18:52:07 +00:00
Devang Patel 5de2375db8 Remove dead code.
llvm-svn: 131974
2011-05-24 18:27:52 +00:00
Cameron Zwarich d7707fc911 Fix "make check" in Release by removing debug-only options from an 'opt' invocation.
llvm-svn: 131972
2011-05-24 18:26:09 +00:00
Dan Gohman 0573b55c2b Make DecomposeGEPExpression check SimplifyInstruction only
after checking for a GEP, so that it matches what GetUnderlyingObject
does. This fixes an obscure bug turned up by bugpoint in the testcase
for PR9931.

llvm-svn: 131971
2011-05-24 18:24:08 +00:00
Charles Davis 97019c709d 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 46e1ebf367 Clean up the lazy initialization of DIBuilder a bit.
llvm-svn: 131956
2011-05-24 06:00:08 +00:00
Jakob Stoklund Olesen 0130027dec 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 843bc7d673 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 0d018b1155 Explain FIXME.
llvm-svn: 131952
2011-05-24 03:10:31 +00:00
Rafael Espindola 0f33be1b87 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 88f9137fd7 - 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 a3b4203cbc Remove dead option.
llvm-svn: 131947
2011-05-24 01:43:38 +00:00
Andrew Trick 37f0082804 FileCheck-ize a couple of IV unit tests.
llvm-svn: 131946
2011-05-24 01:02:49 +00:00
Rafael Espindola 7e9ca2c095 Fix cmake dependencies.
llvm-svn: 131943
2011-05-24 00:58:06 +00:00
Akira Hatanaka cb4a1a8d3f 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 354fa0798f Fix debug info for blocks' variable.
llvm-svn: 131940
2011-05-24 00:22:25 +00:00
Andrew Trick 1ea0243bd0 Test case for r130799 - indvars: Added canExpandBackEdgeTakenCount.
llvm-svn: 131939
2011-05-24 00:17:53 +00:00
Devang Patel faaa16ea2c Remove unnecessary comment.
llvm-svn: 131936
2011-05-23 23:16:14 +00:00
Akira Hatanaka dfb8cda11f Expand f64 FPOW.
llvm-svn: 131928
2011-05-23 22:23:58 +00:00
Akira Hatanaka 6af5bd2537 Add pattern for double-to-integer conversion. Patch by Sasa Stankovic.
llvm-svn: 131927
2011-05-23 22:16:43 +00:00
Devang Patel efec7715ec 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 9dbb45b596 Fixes related to coding style.
llvm-svn: 131922
2011-05-23 21:13:59 +00:00
Dan Gohman 911fa9084c Document llvm.exp and llvm.pow.
llvm-svn: 131921
2011-05-23 21:13:03 +00:00
Dan Gohman 6c4a319088 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 bae9fee95f Propagate error correctly in the MC Asm parser for leading '$' expressions.
llvm-svn: 131918
2011-05-23 20:36:04 +00:00
Akira Hatanaka 90d96f44ce 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 d71ed9431a clarify this, apparently it is confusing :)
llvm-svn: 131916
2011-05-23 20:17:44 +00:00
Akira Hatanaka f9e5750fc8 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 9987d3098b Test case for r131908.
llvm-svn: 131909
2011-05-23 17:49:29 +00:00
Devang Patel 7992883811 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 c4d9a84159 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 0f6b46b826 Clear list of instructions without DebugLoc.
llvm-svn: 131906
2011-05-23 17:34:18 +00:00
Duncan Sands f0f143e31d The dragonegg option to disable LLVM optimizations changed.
llvm-svn: 131903
2011-05-23 16:50:29 +00:00
Charles Davis d9eafdcfd5 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 026f5e61f0 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 bc90690b24 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 388cb8a57c 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 8aff4f8efc 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 f5199debc0 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 321c58fc41 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 83791ced7b 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 4d37d99798 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 68254fcbca 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 af5fecb747 add test from PR9164
llvm-svn: 131876
2011-05-22 22:35:34 +00:00
Chris Lattner 819278891a testcase for PR9378
llvm-svn: 131875
2011-05-22 22:32:53 +00:00
Chris Lattner e240dc52ff 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 f98eadee17 document thiscall, PR9101
llvm-svn: 131873
2011-05-22 22:28:47 +00:00
Chris Lattner 713d52364f 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 4cd5187f5b 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 c7250faeb1 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 bfe2c24c80 add a note.
llvm-svn: 131863
2011-05-22 18:28:46 +00:00
Chris Lattner 162dfc3e6b add some random notes.
llvm-svn: 131862
2011-05-22 18:26:48 +00:00
Evan Cheng 2a746bfe36 Teach ValueTracking about x86 crc32 intrinsics.
llvm-svn: 131861
2011-05-22 18:25:30 +00:00
Chris Lattner 7c99f19d9f 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 a0c9c75df2 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 c4ca7ab7e7 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 ad964559ef 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 4932e3de1b another typo
llvm-svn: 131854
2011-05-22 15:44:02 +00:00
Chris Lattner 6783871672 fix comment typo
llvm-svn: 131853
2011-05-22 15:34:37 +00:00
Chris Lattner 408cfef6f0 I missed a checking with my GVN change.
llvm-svn: 131851
2011-05-22 07:20:02 +00:00
Chris Lattner c2e8540216 insertvalue takes a variable number of arguments, document this, fixing PR9935.
llvm-svn: 131850
2011-05-22 07:18:08 +00:00
Chris Lattner 1a1acc2191 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 f0d59072de 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 a10327f531 remove a trivial test, make some other tests less trivial.
llvm-svn: 131846
2011-05-22 07:02:43 +00:00
Chris Lattner cc87723178 make this test less trivial.
llvm-svn: 131845
2011-05-22 06:59:33 +00:00
Chris Lattner ef8cf6d421 initialize and finalize function passes, pointed out by Cameron.
llvm-svn: 131843
2011-05-22 06:44:19 +00:00
Chris Lattner 9f1d2ded13 fix a bug for hosts without round, PR8893.
llvm-svn: 131842
2011-05-22 06:03:53 +00:00
Chris Lattner bbc40ac474 move PR9408 here.
llvm-svn: 131841
2011-05-22 05:45:06 +00:00
Nick Lewycky d60e135cfe Commit test change, forgotten as part of r131838.
llvm-svn: 131839
2011-05-22 05:31:47 +00:00
Nick Lewycky a68ec83b36 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 1d068cc0b0 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 0388fb0ee2 tidy some things up.
llvm-svn: 131836
2011-05-22 04:52:24 +00:00
Chris Lattner e8bf2d5ad3 Fix some minor typos and grammar.
llvm-svn: 131835
2011-05-22 04:44:48 +00:00
Charles Davis bc2daa0f93 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 1c8bd5ad7e 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 1c8af13719 Fix grammar in test.
llvm-svn: 131831
2011-05-22 01:16:00 +00:00
Charles Davis e636022b4d 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 6078926e26 random comment cleanups.
llvm-svn: 131829
2011-05-22 00:50:53 +00:00
Chris Lattner 4f12f11517 fix a file system case sensitivity issue.
llvm-svn: 131828
2011-05-22 00:37:51 +00:00
Chris Lattner b5865ded27 remove StandardPasses, it has been replaced with PassManagerBuilder
llvm-svn: 131827
2011-05-22 00:30:45 +00:00
Chris Lattner 3d70addad7 switch opt to using PassManagerBuilder.h
llvm-svn: 131824
2011-05-22 00:21:33 +00:00
Chris Lattner ac99108d36 switch llvm-ld. It has a terrible mechanism that people can add extra
passes, it should be converted to use extension points.

llvm-svn: 131823
2011-05-22 00:21:15 +00:00
Chris Lattner f200a0af58 switch bugpoint and liblto to PassManagerBuilder.
llvm-svn: 131821
2011-05-22 00:20:07 +00:00
Chris Lattner fa9fe70a6a add support for LTO passes.
llvm-svn: 131820
2011-05-22 00:14:20 +00:00
Chris Lattner 04120e9567 eliminate dependence on StandardPasses.h. The code generator's pass pipeline
should eventually convert to PMBuilder, but I don't plan to do this.

llvm-svn: 131819
2011-05-22 00:13:44 +00:00
Charles Davis a8805fd71a Include DataTypes.h from this header to get the uint*_t types.
llvm-svn: 131817
2011-05-22 00:05:26 +00:00
Charles Davis 4ccc861cbc Allow access to the .pdata and .xdata sections through the TargetAsmInfo
class.

llvm-svn: 131816
2011-05-22 00:03:24 +00:00
Chris Lattner 34cc63cd71 add an extension point mechanism that allow plugins to add stuff to
the pass manager.

llvm-svn: 131814
2011-05-21 23:50:37 +00:00
Nick Lewycky babca9aee9 Add CreateLifetimeStart and CreateLifetimeEnd to the IRBuilder, with plans to
use these soon.

llvm-svn: 131812
2011-05-21 23:14:36 +00:00
Duncan Sands 5ec65765e6 Revert commit 131781, to see if it fixes the x86-64 dragonegg buildbot.
Original log message:
When BasicAA can determine that two pointers have the same base but
differ by a dynamic offset, return PartialAlias instead of MayAlias.
See the comment in the code for details. This fixes PR9971.

llvm-svn: 131809
2011-05-21 20:54:46 +00:00
Chris Lattner 790cb34f93 add a new PassManagerBuilder class to replace StandardPasses.h
llvm-svn: 131807
2011-05-21 20:39:42 +00:00
Chris Lattner 4c0d9e2249 add a copy ctor to TargetLibraryInfo.
llvm-svn: 131806
2011-05-21 20:09:13 +00:00
Eli Friedman 3de2ddc578 PR7952: Make isa<> use the same logic as cast<>, so that they both work
consistently.

llvm-svn: 131803
2011-05-21 19:13:10 +00:00
Benjamin Kramer e30b70073a X86: smulo -> add is now done target-independently in DAGCombiner, remove the patterns.
llvm-svn: 131801
2011-05-21 18:32:01 +00:00
Benjamin Kramer 2fd48f2730 Implement mulo x, 2 -> addo x, x in DAGCombiner.
llvm-svn: 131800
2011-05-21 18:31:55 +00:00
Benjamin Kramer e08fb1dce9 Merge and FileCheckize test cases.
llvm-svn: 131799
2011-05-21 18:31:48 +00:00
Benjamin Kramer fda5dc4968 Revert "InstCombine: Turn mul.with.overflow(X, 2) into the cheaper add.with.overflow(X, X)"
It's better to do this in codegen, mul.with.overflow(X, 2) is more canonical because it has only one use on "X".

llvm-svn: 131798
2011-05-21 18:31:42 +00:00
Charles Davis 6879634efd Don't allow .seh_handler and .seh_handlerdata directives inside chained
unwind areas.

llvm-svn: 131795
2011-05-21 17:36:25 +00:00
Charles Davis 8e8f59bdfb A handler for a function in the Win64 EH scheme can be both an unwind handler
and an exception handler. Handle that case.

Also, add an 'Emitted' member to the MCWin64EHUnwindInfo struct. It will be
needed later.

llvm-svn: 131791
2011-05-21 15:57:49 +00:00
Benjamin Kramer 691731eb9c InstCombine: Turn mul.with.overflow(X, 2) into the cheaper add.with.overflow(X, X)
llvm-svn: 131789
2011-05-21 09:22:06 +00:00
Cameron Zwarich faeb520c97 Fix PR9978 by adding RIP to GR64_TC so it can be used as an address in PIC code. It
is already in GR64 for the same reasons. Since it isn't allocatable it can't cause
any problems.

llvm-svn: 131787
2011-05-21 04:13:49 +00:00
Akira Hatanaka 2df6c010aa Use the correct register to access stack frame objects.
llvm-svn: 131785
2011-05-21 03:01:03 +00:00
Akira Hatanaka f084fcd7fe Insert instructions that copy $sp to or from $fp at the right locations.
llvm-svn: 131784
2011-05-21 02:29:26 +00:00
Dan Gohman 8b20187c82 When BasicAA can determine that two pointers have the same base but
differ by a dynamic offset, return PartialAlias instead of MayAlias.
See the comment in the code for details. This fixes PR9971.

llvm-svn: 131781
2011-05-21 01:05:08 +00:00
Andrew Trick d5d0764b3b Have Program::Wait return -2 for crashed and timeouts instead of embedding
info in the error message. Per Dan's request.

llvm-svn: 131780
2011-05-21 00:56:46 +00:00
Charles Davis 54254008ba Set the "LastFrameInst" field when streaming a .seh_setframe directive. This
is needed for an upcoming patch.

llvm-svn: 131772
2011-05-21 00:09:04 +00:00
Cameron Zwarich d7ee0fcac9 Fix PR9962 by properly constraining register classes in RemoveCopyByCommutingDef(). This
actually fixes most of the VerifyCoalescing failures in test-suite.

llvm-svn: 131768
2011-05-20 23:25:36 +00:00
Akira Hatanaka 0837692ac6 Change the order fixed objects are created in MipsTargetLowering::LowerCall in
preparation for reversing StackDirection.

Fixed objects are created in the following order:  
 1. Incoming arguments passed on stack.
 2. va_arg objects (include both arguments that are passed in registers and
    pointer to the location of the first va_arg argument).
 3. $gp restore slot.
 4. Outgoing arguments passed on stack.
 5. Pointer to alloca'd space.

llvm-svn: 131767
2011-05-20 23:22:14 +00:00
Charles Davis 1a1d4777b9 Fix typo. When will I learn?
llvm-svn: 131765
2011-05-20 22:23:34 +00:00
Eli Friedman 60afcc2a6f Add fast-isel support for byval calls on x86.
llvm-svn: 131764
2011-05-20 22:21:04 +00:00
Charles Davis bc1feb1f25 Add .pdata and .xdata sections to the COFF TLOF implementation.
llvm-svn: 131763
2011-05-20 22:13:55 +00:00
Jim Grosbach 8aded86edb No reason not to allow defining the CFA as a reg w/ offset zero.
llvm-svn: 131760
2011-05-20 21:50:09 +00:00
Akira Hatanaka 7c619f174a In CC_MipsO32, allocate a stack space regardless of whether the argument is
passed in register or on the stack.

llvm-svn: 131758
2011-05-20 21:39:54 +00:00
Jim Grosbach 17c1d13ee4 Fix typo.
llvm-svn: 131757
2011-05-20 21:35:39 +00:00
Jim Grosbach 83c4bb157a Add support for frame info use of the .cfi_def_cfa directive.
llvm-svn: 131756
2011-05-20 21:23:17 +00:00
Jim Grosbach 860b03b5f9 Add missing leading \t when printing .cfi_def_cfa in the asmstreamer.
llvm-svn: 131755
2011-05-20 21:22:37 +00:00
Akira Hatanaka cae19e8671 Define functions that get/set maximum call frame size.
llvm-svn: 131752
2011-05-20 20:11:17 +00:00
Rafael Espindola 652bfdb1ab adds some attributes to attribute section when cpu is "xscale"
(this is what used in Android NDK, when architecture is ARMv5)

patch by Koan-Sin Tan

llvm-svn: 131751
2011-05-20 20:10:34 +00:00
Rafael Espindola 1866808384 fixes target address tBL and tBLX and sets relocation type
of tBL/tBLX to R_ARM_THM_CALL (ARM ELF 4.7.1.6)

Patch by koan-sin tan.

llvm-svn: 131748
2011-05-20 20:01:01 +00:00
Argyrios Kyrtzidis ac8bc12cd1 Add asserts in StringRef to make sure we avoid undefined behavior:
-strlen should not be called with NULL. Also guarantee that StringRef's Length is 0 if Data is NULL.
-memcmp should not be called with NULL (even if size is 0)

Patch by Matthieu Monrocq!

llvm-svn: 131747
2011-05-20 19:24:12 +00:00
Stuart Hastings 91f1d24736 Re-commit 131641 with fixes; de-pseudoize MOVSX16rr8 and friends.
rdar://problem/8614450

llvm-svn: 131746
2011-05-20 19:04:40 +00:00
Akira Hatanaka 43407fe633 Make $fp and $ra callee-saved registers and let PrologEpilogInserter handle
saving and restoring them.

llvm-svn: 131745
2011-05-20 18:39:33 +00:00
Andrew Trick f44aadf0fd indvars: Prototyping Sign/ZeroExtend elimination without canonical IVs.
No functionality enabled by default. Use -disable-iv-rewrite.
Extended IVUsers to keep track of the phi that represents the users' IV.
Added the WidenIV transform to replace a narrow IV with a wide IV
by doing a one-for-one replacement of IV users instead of expanding the
SCEV expressions. [sz]exts are removed and truncs are inserted.

llvm-svn: 131744
2011-05-20 18:25:42 +00:00
Charles Davis 9a115a4bd2 Now that they're implemented, make the Win64 EH MCAsmStreamer methods call
super.

llvm-svn: 131743
2011-05-20 18:19:22 +00:00
Chad Rosier ad00f3d0b9 Fixed regression due to commit 131709, which disables vararg tail call optimizations on Win64
llvm-svn: 131740
2011-05-20 17:49:39 +00:00
Evan Cheng 4fcd8250ae Revert accidental commit.
llvm-svn: 131739
2011-05-20 17:38:48 +00:00
Charles Davis 24b31b6b7d "Implement" the HandlerData Win64 EH method in the base MCStreamer.
There's really nothing to implement. All this really does is swap to a
pseudo-section that later gets written to the unwind info struct. That
needs to be implemented in the object streamers.

llvm-svn: 131734
2011-05-20 16:06:22 +00:00
Benjamin Kramer 0bf26746d9 Rename the "sandybridge" subtarget to "corei7-avx", for GCC compatibility.
llvm-svn: 131730
2011-05-20 15:11:26 +00:00
Benjamin Kramer cc7a928885 Remove noisy semicolons.
llvm-svn: 131724
2011-05-20 09:20:25 +00:00
Cameron Zwarich e0a52df6e5 Fix PR9960 by teaching SimpleRegisterCoalescing::AdjustCopiesBackFrom() to preserve
the phikill flag.

llvm-svn: 131717
2011-05-20 03:54:04 +00:00
Andrew Trick b75279cbbd indvars: minor cleanup in preparation for sign/zero extend elimination.
llvm-svn: 131716
2011-05-20 03:37:48 +00:00
Akira Hatanaka fe4f9d5977 Fix bug in which nodes that write to argument registers do not get glued with the JALR node. Patch by Sasa Stankovic
llvm-svn: 131714
2011-05-20 02:30:51 +00:00
Akira Hatanaka 7489faa0c1 Remove code that creates unnecessary frame objects.
llvm-svn: 131711
2011-05-20 01:45:06 +00:00
Akira Hatanaka d738c0f7c9 Define variables and functions in MipsFunctionInfo.
This is the first of a series of patches that attempt to simplify handling of 
stack frame objects. 

llvm-svn: 131710
2011-05-20 01:17:58 +00:00
Chad Rosier 552f8c4819 Don't attempt to tail call optimize for Win64.
llvm-svn: 131709
2011-05-20 00:59:28 +00:00
Evan Cheng e8d2e9eb35 Revert r131664 and fix it in instcombine instead. rdar://9467055
llvm-svn: 131708
2011-05-20 00:54:37 +00:00
Cameron Zwarich 2af60abad8 Fix PR9955 by only attaching load memory operands to load instructions and
similarly for stores. Now "make check" passes with the MachineVerifier forced
on with the VerifyCoalescing option!

llvm-svn: 131705
2011-05-19 23:44:34 +00:00
Eli Friedman 22da799428 Add fast-isel support for zeroext and signext ret instructions on x86.
llvm-svn: 131689
2011-05-19 22:16:13 +00:00
Rafael Espindola 1edfb17bc2 Looks like OS X assemblers (including MC) don't like
foo:
bar = foo
.quad bar

Avoid producing it. Fixes PR9951.

llvm-svn: 131687
2011-05-19 22:05:56 +00:00
Rafael Espindola 8e129296fe Misc code refactorings:
* Remove unnecessary arguments now that ForceExpAbs is a method.
* Use ForceExpAbs in EmitAbsValue.

llvm-svn: 131683
2011-05-19 21:40:34 +00:00
Eric Christopher 4014e5e208 Oddly people want to use the 'r' constraint for fp constants on x86.
Fixes rdar://9218925
Fixes PR9601

llvm-svn: 131682
2011-05-19 21:33:47 +00:00
Charles Davis de745ba396 Implement the EndProlog Win64 EH method on the base MCStreamer.
llvm-svn: 131679
2011-05-19 21:24:54 +00:00
Cameron Zwarich 8b76e01c4b Fix PR9947 by placing OPFL_MemRefs on the node using memory operands rather than
the root if there is only one such node. This leaves only 2 verifier failures in
the entire test suite when running "make check".

llvm-svn: 131677
2011-05-19 21:13:30 +00:00
Eli Friedman e53a77d3a6 Fix up this test to use explicit triples (Win64 passes a different number of arguments in registers).
llvm-svn: 131676
2011-05-19 21:13:08 +00:00
Jason W Kim d0c937d4b2 This fixes one divergence between LLVM and binutils for ARM in the
text section.

Assume the following bit of annotated assembly:

.section	.data.rel.ro,"aw",%progbits
.align	2
.LAlpha:
.long	startval(GOTOFF)

.text
.align	2
.type	main,%function
.align	4

main: ;;; assume "main" starts at offset 0x20
0x0	push	{r11, lr}
0x4	movw	r0, :lower16:(.LAlpha-(.LBeta+8))
;;; ==> (.AddrOf(.LAlpha) - ((.AddrOf(.LBeta) - .AddrOf(".")) + 8)
;;; ==> (??? - ((16-4) + 8) = -20
0x8	movt	r0, :upper16:(.LAlpha-(.LBeta+8))
;;; ==> (.AddrOf(.LAlpha) - ((.AddrOf(.LBeta) - .AddrOf(".")) + 8)
;;; ==> (??? - ((16-8) + 8) = -16
0xc	... blah

.LBeta:
0x10	add	r0, pc, r0
0x14	... blah

.LGamma:
0x18	add	r1, pc, r1

Above snippet results in the following relocs in the .o file for the
first pair of movw/movt instructions

00000024 R_ARM_MOVW_PREL_NC .LAlpha
00000028 R_ARM_MOVT_PREL .LAlpha

And the encoded instructions in the .o file for main: must be

00000020 <main>:
20:	e92d4800 push	{fp, lr}
24:	e30f0fec movw	r0, #65516	; 0xffec i.e. -20
28:	e34f0ff0 movt	r0, #65520	; 0xfff0 i.e. -16

However, llc (prior to this commit) generates the following sequence

00000020 <main>:
20:	e92d4800 push	{fp, lr}
24:	e30f0fec movw	r0, #65516	; 0xffec - i.e. -20
28:	e34f0fff movt	r0, #65535	; 0xffff - i.e. -1

What has to happen in the ArmAsmBackend is that if the relocation is PC
relative, the 16 bits encoded as part of movw and movt must be both addends,
not addresses. It makes sense to encode addresses by right shifting the value
by 16, but the result is incorrect for PIC.
i.e., the right shift by 16 for movt is ONLY valid for the NON-PCRel case.

This change agrees with what GNU as does, and makes the PIC code run.

MC/ARM/elf-movt.s covers this case.

llvm-svn: 131674
2011-05-19 20:55:25 +00:00
Devang Patel 1407fb4bbe Reapply r131605. This time with a fix, which is to use NoFolder.
llvm-svn: 131673
2011-05-19 20:52:46 +00:00
Rafael Espindola 0fc5e89c82 ADD64ri32 sign extends its argument, so we need to use a R_X86_64_32S.
Fixes PR9934.

We really need to start tblgening the relocation info :-(

llvm-svn: 131669
2011-05-19 20:32:34 +00:00
Akira Hatanaka 9e6a8cca5d Align i64 arguments to 64 bit boundaries.
llvm-svn: 131668
2011-05-19 20:29:48 +00:00
Charles Davis 7e6e8951af Implement the Win64 EH prolog instruction methods on the base MCStreamer.
I had to change the API slightly to avoid overloading issues.

llvm-svn: 131666
2011-05-19 19:35:55 +00:00
Eli Friedman d2144a9fb8 Fix up the new StandardPasses to run the same scalarrepl passes as the old one.
llvm-svn: 131665
2011-05-19 19:14:54 +00:00
Evan Cheng 2b9bd38678 crc32 with 64-bit output zeros upper 32-bits. rdar://9467055
llvm-svn: 131664
2011-05-19 18:57:12 +00:00
Stuart Hastings 4a4e5a2b55 Update some currently-disabled code, preparing for eventual use.
llvm-svn: 131663
2011-05-19 18:48:20 +00:00
Akira Hatanaka 05fd5aa1d0 Increase number of available registers when target is MIPS32.
llvm-svn: 131660
2011-05-19 18:25:03 +00:00
Evan Cheng dc867ae1fc Add comment.
llvm-svn: 131659
2011-05-19 18:18:39 +00:00
Akira Hatanaka 92ab6db6c8 Simplify CC_MipsO32 and merge it with CC_MipsO32_VarArgs. Patch by Sasa Stankovic.
llvm-svn: 131657
2011-05-19 18:06:05 +00:00
Joerg Sonnenberger 74ba2623ce Reapply 131644 including the missing header changes:
Introduce -fatal-assembler-warnings for the obvious purpose

llvm-svn: 131655
2011-05-19 18:00:13 +00:00
Stuart Hastings c72240bbd9 Reverting 131641 to investigate 'bot complaint.
llvm-svn: 131654
2011-05-19 17:54:42 +00:00
Eli Friedman 3e2f17499e Revert r131644; it's breaking the build.
llvm-svn: 131653
2011-05-19 17:48:09 +00:00
Charles Davis 4cd8856704 Turns out GAS does have Win64 EH directives. (It also supports WinCE EH.) Make
ours compatible with GAS.

In retrospect, I should have emailed binutils about this earlier. Thanks to
Kai Tietz for pointing out that GAS already had SEH directives.

llvm-svn: 131652
2011-05-19 17:46:39 +00:00
Jim Grosbach eca54e4e6d 80 columns.
llvm-svn: 131649
2011-05-19 17:34:53 +00:00
Joerg Sonnenberger 59b523169f Introduce -fatal-assembler-warnings for the obvious purpose
llvm-svn: 131644
2011-05-19 17:27:01 +00:00
Akira Hatanaka d1465bd68b Fix data layout string. i64 is aligned to 64 bit boundaries.
llvm-svn: 131642
2011-05-19 17:21:09 +00:00
Stuart Hastings b476b0cc9f Revise MOVSX16rr8/MOVZX16rr8 (and rm variants) to no longer be
pseudos.  rdar://problem/8614450

llvm-svn: 131641
2011-05-19 16:59:50 +00:00
Stuart Hastings ae012a7525 Move test to Transforms/InstCombine.
llvm-svn: 131634
2011-05-19 05:53:22 +00:00
Cameron Zwarich 9eb5a410bd Use the correct register class for Cell varargs spilling. This fixes all of the
verifier failures in the CodeGen/CellSPU tests.

llvm-svn: 131631
2011-05-19 04:44:19 +00:00
Mon P Wang 6d9e1c7c2e Fixed sdiv and udiv for <4 x i16>. The test from r125402 still applies for this change.
llvm-svn: 131630
2011-05-19 04:15:07 +00:00
Charles Davis b4222589bf Implement the StartChained and EndChained Win64 EH methods on MCStreamer.
llvm-svn: 131629
2011-05-19 04:04:13 +00:00
Cameron Zwarich 41025dc95b Make CodeGen/PowerPC/2007-09-11-RegCoalescerAssert.ll pass with the verifier.
llvm-svn: 131627
2011-05-19 03:11:06 +00:00
Cameron Zwarich dadd73390f Fix PR8828 by removing the explicit def in MovePCToLR as well as the pointless
piclabel operand. The operand in the tablegen definition doesn't actually turn
into an MI operand, so it just confuses anything checking the TargetInstrDesc
for the number of operands. It suffices to just have an implicit def of LR.

llvm-svn: 131626
2011-05-19 02:56:28 +00:00
Cameron Zwarich 58eafde58b Reuse the TargetInstrDesc.
llvm-svn: 131625
2011-05-19 02:56:23 +00:00
Francois Pichet 68610c1673 Fix the MSVC build.
Use a set of overloaded functions instead of template function for CreatePassFn.

It seems that template deduction for functions type that differs only by return type doesn't work with MSVC. 

llvm-svn: 131624
2011-05-19 02:54:11 +00:00
Charles Davis d991ec4e68 Implement the StartProc and EndProc Win64 EH methods on the base MCStreamer.
Based largely on Rafael Espindola's work on CFI. Other methods soon to follow.

llvm-svn: 131623
2011-05-19 02:49:00 +00:00
Charles Davis 382c065822 Fix build issues with headers, which I discovered by actually using them.
Also, convert all the inline functions on UnwindInfo into methods.

llvm-svn: 131622
2011-05-19 02:47:23 +00:00
Rafael Espindola 3f60a0b411 Add test for PR9946.
llvm-svn: 131621
2011-05-19 02:35:26 +00:00
Rafael Espindola 964602d7ba revert 131605 to fix PR9946.
llvm-svn: 131620
2011-05-19 02:26:30 +00:00
Cameron Zwarich 00b780e280 Correctly constrain a register class when computing frame offsets, as the Thumb2
add instruction takes an rGPR. This fixes the last of PR8825.

llvm-svn: 131619
2011-05-19 02:18:27 +00:00
Cameron Zwarich fe5795a1f6 Revert r128961 because it didn't include a test and causes the verifier to fail
on CodeGen/X86/2007-05-07-InvokeSRet.ll. There is probably a bug here that was
fixed by r128961, but since there is no test or reference to a source file I have
to revert it.

llvm-svn: 131618
2011-05-19 01:56:19 +00:00
Eli Friedman 6efb64ea8e Make the demanded bits/elements optimizations preserve debug line information.
I'm not sure this is quite ideal, but I can't really think of any better way to do it.

llvm-svn: 131616
2011-05-19 01:20:42 +00:00
Jim Grosbach 13733a137c Avoid a Twine that referenced a tmp (which proceded to go out of scope before
the Twine was used).

llvm-svn: 131612
2011-05-19 00:45:05 +00:00
Devang Patel 3015a54813 Use IRBuilder.
llvm-svn: 131609
2011-05-19 00:13:33 +00:00
Rafael Espindola 5dfe17d242 Another try at fixing cmake.
llvm-svn: 131608
2011-05-19 00:13:04 +00:00
Devang Patel 31458a0002 Use IRBuilder while simplifying unreachable.
llvm-svn: 131607
2011-05-19 00:09:21 +00:00
Rafael Espindola f1bda7c90c Revert my previous patch. The cmake build had already been fixed.
llvm-svn: 131606
2011-05-19 00:02:45 +00:00
Devang Patel 4b13f39b77 Use IRBuilder while simplifying conditional branch.
llvm-svn: 131605
2011-05-18 23:59:51 +00:00
Eli Friedman 41e509a33d More instcombine cleanup, towards improving debug line info.
llvm-svn: 131604
2011-05-18 23:58:37 +00:00
Jim Grosbach 6bfca4efd8 Restore sanity to 131601.
llvm-svn: 131603
2011-05-18 23:56:43 +00:00
Rafael Espindola efbdd80d77 Fix the cmake build.
llvm-svn: 131602
2011-05-18 23:56:40 +00:00
Jim Grosbach b098471538 Objective C functions may use a magic '\1' on the name. Handle that when
dealing with them in the MCJIT.

llvm-svn: 131601
2011-05-18 23:53:21 +00:00
Eli Friedman d1b0f0f1b8 Shuffle StandardPasses.cpp into VMCore; add it to CMake.
llvm-svn: 131600
2011-05-18 23:51:11 +00:00
Devang Patel 7de6c4bf75 Use IRBuilder while simplifying branch.
llvm-svn: 131598
2011-05-18 23:18:47 +00:00
Eli Friedman 6fc94dd687 Revert unintentional commit.
llvm-svn: 131597
2011-05-18 23:13:10 +00:00
Eli Friedman 1754a25977 More instcombine simplifications towards better debug locations.
llvm-svn: 131596
2011-05-18 23:11:30 +00:00
Cameron Zwarich b9bef106c6 Add missing mayLoad / mayStore flags to instruction definitions without patterns,
which fixes all of the CodeGen/MBlaze verifier failures.

llvm-svn: 131595
2011-05-18 23:03:10 +00:00
Charles Davis bd5a09d3b2 Add a header patterned after MCDwarf.h for supporting Win64 exception handling
under MC.

llvm-svn: 131593
2011-05-18 22:48:24 +00:00
David Chisnall cb2c7d9186 Some better type safety enforcement in the standard pass list, along with some small tidies and some fixes for bugs that the stricter checking found.
llvm-svn: 131592
2011-05-18 22:46:02 +00:00
Cameron Zwarich 9ddeceff19 Reserve the segment registers on x86 to fix verifier failures in any code that
uses them.

llvm-svn: 131591
2011-05-18 22:24:48 +00:00
Charles Davis 27117af772 Remove comments as Chris requested.
llvm-svn: 131590
2011-05-18 22:13:51 +00:00
Cameron Zwarich 8b2e426555 Reserve r29 on Alpha. This fixes all verifier failures in CodeGen/Alpha.
llvm-svn: 131587
2011-05-18 21:54:32 +00:00
Tanya Lattner 1d11720ae4 Handle perfect shuffle case that generates a vrev for vectors of floats.
Add test case.

llvm-svn: 131582
2011-05-18 21:44:54 +00:00
Eli Friedman fadb03d6cc Third pass at allowing plugins to modify default passes. This time with a tweak so that we don't depend on an uninitialized argument.
llvm-svn: 131581
2011-05-18 21:40:04 +00:00
Devang Patel dd14e0f7fa Use IRBuilder while simplifying return instruction.
llvm-svn: 131580
2011-05-18 21:33:11 +00:00
Cameron Zwarich 492f87de4e Fix an obvious typo in r131572.
llvm-svn: 131579
2011-05-18 21:29:07 +00:00
Cameron Zwarich ec645bf75d Fix more of PR8825. Now all of CodeGen/ARM passes with VerifyCoalescing turned on.
llvm-svn: 131578
2011-05-18 21:25:14 +00:00
Dan Gohman 3268e4d692 When forming an ICmpZero LSRUse, normalize the non-IV operand
of the comparison, so that the resulting expression is fully
normalized. This fixes PR9939.

llvm-svn: 131576
2011-05-18 21:02:18 +00:00