Commit Graph

38505 Commits

Author SHA1 Message Date
Dan Gohman
e85b7585e9 Fix an overaggressive SimplifyDemandedBits optimization on urem. This
fixes the 254.gap regression on x86 and the 403.gcc regression on x86-64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50537 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 19:13:24 +00:00
Bill Wendling
4fd49e4a2f Adding testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50536 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 18:41:09 +00:00
Ted Kremenek
5713604f8e Initialize a local variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50527 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 17:08:00 +00:00
Chris Lattner
6bf30ab347 don't randomly miscompile seto/setuo just because we are in
ffastmath mode.  This fixes rdar://5902801, a miscompilation
of gcc.dg/builtins-8.c.

Bill, please pull this into Tak.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50523 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 07:26:11 +00:00
Chris Lattner
56b4f2bdf6 1) add '-debug' output
2) Return NULL instead of false in several places for tidiness.
3) fix a bug optimizing  sprintf(p, "%c", x)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 06:39:12 +00:00
Chris Lattner
fd1cbbe9cf Delete the IPO simplify-libcalls and completely reimplement it as
a FunctionPass.  This makes it simpler, fixes dozens of bugs, adds
a couple of minor features, and shrinks is considerably: from
2214 to 1437 lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 06:25:24 +00:00
Chris Lattner
2facbddb76 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50519 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 06:16:48 +00:00
Chris Lattner
b1747f0b23 instcombine does memset optzns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50518 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 06:16:38 +00:00
Chris Lattner
330a0c1527 simplifylibcalls doesn't optimize llvm.memmove, instcombine does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50517 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 06:14:24 +00:00
Chris Lattner
042232df74 move some tests from libcall optimizer suite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50516 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 06:13:48 +00:00
Chris Lattner
70100131d1 Add CreateCall3/CreateCall4 at Eric's request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 05:23:45 +00:00
Chris Lattner
4b9f046869 Add a spiffy little "CreateCall2" method, which can be used to make
a function call that takes two Value*'s as arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 05:11:00 +00:00
Chris Lattner
5c5f1095ec fix a bug in my previous patch, a classic =/== bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50483 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 15:27:09 +00:00
Arnold Schwaighofer
d2ef523673 Really commit the test checking the argument lowering behaviour on x86-64 :).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50478 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 09:19:47 +00:00
Arnold Schwaighofer
30e62c098b Tail call optimization improvements:
Move platform independent code (lowering of possibly overwritten
arguments, check for tail call optimization eligibility) from
target X86ISelectionLowering.cpp to TargetLowering.h and
SelectionDAGISel.cpp.

Initial PowerPC tail call implementation:

Support ppc32 implemented and tested (passes my tests and
test-suite llvm-test).  
Support ppc64 implemented and half tested (passes my tests).
On ppc tail call optimization is performed if 
  caller and callee are fastcc
  call is a tail call (in tail call position, call followed by ret)
  no variable argument lists or byval arguments
  option -tailcallopt is enabled
Supported:
 * non pic tail calls on linux/darwin
 * module-local tail calls on linux(PIC/GOT)/darwin(PIC)
 * inter-module tail calls on darwin(PIC)
If constraints are not met a normal call will be emitted.

A test checking the argument lowering behaviour on x86-64 was added.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50477 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 09:16:33 +00:00
Gabor Greif
4f06a0f6d5 set ignore property
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50476 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 08:59:22 +00:00
Gabor Greif
8811080a65 fcntl.h is pretty standard on unix (without the sys/)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50475 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 08:53:22 +00:00
Owen Anderson
0cad8444cc Move this test to LoopDeletion, where it now passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50474 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 07:17:22 +00:00
Owen Anderson
5023aa58ca This condition got inverted accidentally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50473 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 07:16:33 +00:00
Chris Lattner
69ea9d2308 move lowering of llvm.memset -> store from simplify libcalls
to instcombine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50472 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 06:39:11 +00:00
Chris Lattner
4103bb9fc6 no reason for simplifylibcalls to simplify intrinsics, instcombine does
a fine job.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50470 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 06:12:15 +00:00
Chris Lattner
0c58cacb7a remove redundant check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50469 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 06:06:37 +00:00
Chris Lattner
deae48ee99 add missing #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 04:56:14 +00:00
Chris Lattner
12e6d20059 add a method for comparing to see if a value has a specified name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 03:55:40 +00:00
Chris Lattner
ea8650cddf use string length computation to generalize several xforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 03:07:53 +00:00
Dale Johannesen
21d972ad04 Add comments for previous patch as requested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50463 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 00:43:29 +00:00
Scott Michel
203b2d6eed Bug fixes and updates for CellSPU, syncing up with trunk. Most notable
fixes are target-specific lowering of frame indices, fix constants generated
for the FSMBI instruction, and fixing SPUTargetLowering::computeMaskedBitsFor-
TargetNode().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50462 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 00:30:08 +00:00
Scott Michel
82747a5484 Fix custom target lowering for zero/any/sign_extend: make sure that
DAG.UpdateNodeOperands() is called before (not after) the call to
TLI.LowerOperation().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 00:26:38 +00:00
Dale Johannesen
7b251e0474 Make eh_frame objects by 8-byte aligned on 64-bit
targets.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50451 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 22:58:20 +00:00
John Criswell
3d8c358456 Minor spelling and typo fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50448 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 22:12:40 +00:00
Owen Anderson
02e9988020 Revert r50441. The original code was correct. Add some more comments so that I don't make the same mistake in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50446 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 21:51:00 +00:00
Owen Anderson
9dcace3caf Fix a bug in memcpyopt where the memcpy-memcpy transform was never being applied because
we were checking for it in the wrong order.  This caused a miscompilation because the
return slot optimization assumes that the call it is dealing with is NOT a memcpy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50444 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 21:26:06 +00:00
Owen Anderson
7b6fafaa8d We should be returning true here since we've changed the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50442 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 21:02:46 +00:00
Owen Anderson
9862f31533 A lot of cleanups and documentation improvements, as well as a few corner case fixes. Most
of this was suggested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50441 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 20:59:33 +00:00
Owen Anderson
0396cd33ca Rename DeadLoopElimination to LoopDeletion, part 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50437 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 20:06:54 +00:00
Owen Anderson
d6864fee97 Rename DeadLoopElimination to LoopDeletion, part one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50436 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 19:58:07 +00:00
Anton Korobeynikov
966e7997b5 Don't do stupid things: doInitialization(Module&) is not applicable to ModulePass :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50433 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 18:16:22 +00:00
Chris Lattner
40700fe683 don't eliminate load from volatile value on paths where the load is dead.
This fixes the second half of PR2262


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50430 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 17:28:22 +00:00
Chris Lattner
68608e4dd0 make this test reduced and *valid*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 17:25:32 +00:00
Chris Lattner
54545ac023 fix a subtle volatile handling bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50428 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 17:13:43 +00:00
Roman Levenstein
a0201d5204 Use std::set instead of std::priority_queue for the RegReductionPriorityQueue.
This removes the existing bottleneck related to the removal of elements from 
the middle of the queue.

Also fixes a subtle bug in ScheduleDAGRRList::CapturePred:
It was updating the state of the SUnit before removing it. As a result, the
comparison operators were working incorrectly and this SUnit could not be removed 
from the queue properly.

Reviewed by Evan and Dan. Approved by Dan.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50412 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 09:07:59 +00:00
Chris Lattner
5b222d748a Implement more aggressive support for analyzing string length. This
generalizes the previous code to handle the case when the string is not
an immediate to the strlen call (for example, crazy stuff like 
strlen(c ? "foo" : "bart"+1) -> 3).  This implements 
gcc.c-torture/execute/builtins/strlen-2.c.  I will generalize other
cases in simplifylibcalls to use the same routine later.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50408 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 06:56:02 +00:00
Owen Anderson
5f8b344255 Clarify what we mean by a dead loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 06:34:55 +00:00
Chris Lattner
00487995ea new testcase for PR2094. The inline asms should not pin allocas to the
stack anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50397 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 05:53:29 +00:00
Chris Lattner
cea1fdd174 don't delete the last store to an alloca if the store is volatile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 04:58:38 +00:00
Chris Lattner
3fb2968f2f make the vector conversion magic handle multiple results.
We now compile test2/test3 to:

_test2:
	## InlineAsm Start
	set %xmm0, %xmm1
	## InlineAsm End
	addps	%xmm1, %xmm0
	ret
_test3:
	## InlineAsm Start
	set %xmm0, %xmm1
	## InlineAsm End
	paddd	%xmm1, %xmm0
	ret

as expected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 04:48:56 +00:00
Chris Lattner
41f6259a4b add support for multiple return values in inline asm. This is a step
towards PR2094.  It now compiles the attached .ll file to:

_sad16_sse2:
	movslq	%ecx, %rax
	## InlineAsm Start
	%ecx %rdx %rax %rax %r8d %rdx %rsi
	## InlineAsm End
	## InlineAsm Start
	set %eax
	## InlineAsm End
	ret

which is pretty decent for a 3 output, 4 input asm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50386 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 04:29:54 +00:00
Evan Cheng
8509fcf8eb Another extract_subreg coalescing bug.
e.g.
vr1024<2> extract_subreg vr1025, 2
If vr1024 do not have the same register class as vr1025, it's not safe to coalesce this away. For example, vr1024 might be a GPR32 while vr1025 might be a GPR64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50385 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 01:41:44 +00:00
Owen Anderson
e54cfdb32a Add some more comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 00:45:15 +00:00
Owen Anderson
d3d5b888d9 Remove debugging code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50383 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 00:39:24 +00:00