Commit Graph

72679 Commits

Author SHA1 Message Date
Akira Hatanaka
ce98deb9f5 Enable printing of immediates that do not fit in 16-bit. .cprestore can have
offsets that are larger than 0x10000.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132003 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 21:22:21 +00:00
Eli Friedman
b176399339 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131994 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 20:22:24 +00:00
Charles Davis
3b32d0240c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131992 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 20:06:30 +00:00
Akira Hatanaka
f29b9c0734 Fix test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131988 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 19:37:15 +00:00
Akira Hatanaka
26b47fd05b Revision 131986 test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131987 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 19:29:37 +00:00
Akira Hatanaka
4231c7ea6d 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131986 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 19:18:33 +00:00
Eli Friedman
a4d4aeb387 Make instcombine O(N) instead of O(N^2) in code where the same simplifiable constant is used many times.
Part of rdar://9471075.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131979 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 18:52:07 +00:00
Devang Patel
8ec0c1c07b Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131974 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 18:27:52 +00:00
Cameron Zwarich
d05667e703 Fix "make check" in Release by removing debug-only options from an 'opt' invocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131972 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 18:26:09 +00:00
Dan Gohman
9adf151b3d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131971 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 18:24:08 +00:00
Charles Davis
6b918b8466 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 16:57:53 +00:00
Cameron Zwarich
13a16083ab Clean up the lazy initialization of DIBuilder a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131956 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 06:00:08 +00:00
Jakob Stoklund Olesen
dfa178bc2a Work around code generation bug in Visual Studio 2010.
See http://llvm.org/pr9976 for details.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131954 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 03:20:56 +00:00
Cameron Zwarich
c827939046 Make LoadAndStorePromoter preserve debug info and create llvm.dbg.values when
promoting allocas to SSA variables. Fixes <rdar://problem/9479036>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131953 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 03:10:43 +00:00
Rafael Espindola
e665798097 Explain FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131952 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 03:10:31 +00:00
Rafael Espindola
10c3e128ef Fix the defaults for .eh_frame. We were marking it as writable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131951 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 02:50:20 +00:00
Evan Cheng
b5a55d979c - 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131948 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 01:48:22 +00:00
Evan Cheng
4992b03cbd Remove dead option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131947 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 01:43:38 +00:00
Andrew Trick
237f15d91f FileCheck-ize a couple of IV unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131946 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 01:02:49 +00:00
Rafael Espindola
320ce564b3 Fix cmake dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131943 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 00:58:06 +00:00
Akira Hatanaka
b4d8d31e59 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131942 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 00:23:52 +00:00
Devang Patel
a9b324be9c Fix debug info for blocks' variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131940 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 00:22:25 +00:00
Andrew Trick
3a2f557bdc Test case for r130799 - indvars: Added canExpandBackEdgeTakenCount.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131939 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 00:17:53 +00:00
Devang Patel
c481b70a6a Remove unnecessary comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131936 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 23:16:14 +00:00
Akira Hatanaka
46da136ec7 Expand f64 FPOW.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131928 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 22:23:58 +00:00
Akira Hatanaka
f89532f8f6 Add pattern for double-to-integer conversion. Patch by Sasa Stankovic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131927 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 22:16:43 +00:00
Devang Patel
9728ea2447 Revert 121907 (it causes llc crash) and apply original patch from PR9817.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131926 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 22:04:42 +00:00
Akira Hatanaka
bdd2ce9741 Fixes related to coding style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131922 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 21:13:59 +00:00
Dan Gohman
4e9011cbac Document llvm.exp and llvm.pow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131921 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 21:13:03 +00:00
Dan Gohman
1b58d4536a When checking for signed multiplication overflow, watch out for INT_MIN and -1.
This fixes PR9845.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131919 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 21:07:39 +00:00
Jim Grosbach
95ae09afde Propagate error correctly in the MC Asm parser for leading '$' expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131918 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 20:36:04 +00:00
Akira Hatanaka
f8928c07e7 Fix MipsAsmPrinter::printSavedRegsBitmaskChange. Remove functions and variables
in MipsFunctionInfo that are no longer used.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131917 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 20:34:30 +00:00
Chris Lattner
32232fc2b5 clarify this, apparently it is confusing :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131916 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 20:17:44 +00:00
Akira Hatanaka
69c19f7316 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131915 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 20:16:59 +00:00
Devang Patel
26ffad8c49 Test case for r131908.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131909 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 17:49:29 +00:00
Devang Patel
233857537f Preserve debug info during iSel by keeping DanglingDebugInfoMap live until end of function.
Patch by Micah Villmow


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131908 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 17:44:13 +00:00
Devang Patel
35b6994608 While replacing all uses of a SDValue with another value, do not forget to transfer SDDbgValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131907 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 17:35:08 +00:00
Devang Patel
88c62fc1b4 Clear list of instructions without DebugLoc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131906 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 17:34:18 +00:00
Duncan Sands
fcc482e487 The dragonegg option to disable LLVM optimizations changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131903 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 16:50:29 +00:00
Charles Davis
16e1b3fcf6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131899 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 16:43:09 +00:00
Chris Lattner
c10ecd8f23 fix a really nasty basicaa mod/ref calculation bug that was causing miscompilation of
UnitTests/ObjC/messages-2.m with the recent optimizer improvements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131897 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 05:15:43 +00:00
Cameron Zwarich
d34d429401 Fix <rdar://problem/9476260> by having tail calls always generate 32-bit branches
in Darwin Thumb2 code. Tail calls are already disabled on Thumb1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131894 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 01:57:17 +00:00
Chris Lattner
613f1a3994 rearrange two transforms, since one subsumes the other. Make the shift-exactness
xform recurse.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131888 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 00:32:19 +00:00
Chris Lattner
05cd886561 Transform any logical shift of a power of two into an exact/NUW shift when
in a known-non-zero context.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131887 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 00:21:50 +00:00
Bill Wendling
f415d8b646 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131886 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 00:18:33 +00:00
Chris Lattner
6083bb9353 use the valuetracking isPowerOfTwo function, which is more powerful than checking
for a constant directly.  Thanks to Duncan for pointing this out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131885 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 00:09:55 +00:00
Chris Lattner
b3f0673d52 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131884 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 00:03:39 +00:00
Chris Lattner
ae441cc33c add a helper method to get the byval alignment of an argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131883 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 23:57:23 +00:00
Chris Lattner
9db20f3bd8 Eliminate some temporary variables, and don't call getByValTypeAlignment
when we're just going to throw the result away.  No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131880 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 23:23:02 +00:00
Chris Lattner
d521d8bf92 add test from PR9164
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131876 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 22:35:34 +00:00