oota-llvm.git
16 years agoHandle multiple return values.
Devang Patel [Sat, 3 May 2008 01:12:15 +0000 (01:12 +0000)]
Handle multiple return values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50604 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImplement operator-> for ImmutableMap iterators.
Ted Kremenek [Sat, 3 May 2008 01:05:46 +0000 (01:05 +0000)]
Implement operator-> for ImmutableMap iterators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50603 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd separate intrinsics for MMX / SSE shifts with i32 integer operands. This allow...
Evan Cheng [Sat, 3 May 2008 00:52:09 +0000 (00:52 +0000)]
Add separate intrinsics for MMX / SSE shifts with i32 integer operands. This allow us to simplify the horribly complicated matching code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50601 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDo not sink getresult.
Devang Patel [Sat, 3 May 2008 00:36:30 +0000 (00:36 +0000)]
Do not sink getresult.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50600 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd assert.
Devang Patel [Fri, 2 May 2008 22:13:33 +0000 (22:13 +0000)]
Add assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50596 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoverify builtin optimization works like gcc.
Chris Lattner [Fri, 2 May 2008 22:07:34 +0000 (22:07 +0000)]
verify builtin optimization works like gcc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50594 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomove libcalls to the same place llvm-gcc has it.
Chris Lattner [Fri, 2 May 2008 22:05:06 +0000 (22:05 +0000)]
move libcalls to the same place llvm-gcc has it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50593 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a mistake in the computation of leading zeros for udiv.
Dan Gohman [Fri, 2 May 2008 21:30:02 +0000 (21:30 +0000)]
Fix a mistake in the computation of leading zeros for udiv.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50591 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSuppress -Wshorten-64-to-32 warnings for 64-bit hosts.
Evan Cheng [Fri, 2 May 2008 21:15:08 +0000 (21:15 +0000)]
Suppress -Wshorten-64-to-32 warnings for 64-bit hosts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50590 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agostrength reduce exp2 into ldexp, rdar://5852514
Chris Lattner [Fri, 2 May 2008 18:43:35 +0000 (18:43 +0000)]
strength reduce exp2 into ldexp, rdar://5852514

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50586 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd a FIXME so we remember to eventually remove this code.
Chris Lattner [Fri, 2 May 2008 17:18:31 +0000 (17:18 +0000)]
add a FIXME so we remember to eventually remove this code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50582 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUndo r50574. We are already ensuring the folded load address is 16-byte aligned.
Evan Cheng [Fri, 2 May 2008 17:01:01 +0000 (17:01 +0000)]
Undo r50574. We are already ensuring the folded load address is 16-byte aligned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50578 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agospecify an arch for non-x86 hosts.
Chris Lattner [Fri, 2 May 2008 15:11:58 +0000 (15:11 +0000)]
specify an arch for non-x86 hosts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50576 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago80 column violation.
Evan Cheng [Fri, 2 May 2008 07:53:32 +0000 (07:53 +0000)]
80 column violation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50575 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoNot safe folding a load + FsXORPSrr into FsXORPSrm. It's loading a FR64 value but...
Evan Cheng [Fri, 2 May 2008 07:50:58 +0000 (07:50 +0000)]
Not safe folding a load + FsXORPSrr into FsXORPSrm. It's loading a FR64 value but the load folding variant expects a 16-byte aligned address.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50574 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPorting r50563 from Tak to mainline.
Bill Wendling [Fri, 2 May 2008 00:43:20 +0000 (00:43 +0000)]
Porting r50563 from Tak to mainline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50564 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a typo in a comment.
Dan Gohman [Fri, 2 May 2008 00:05:03 +0000 (00:05 +0000)]
Fix a typo in a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50562 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse push_back(...) instead of resize(1, ...), per review feedback.
Dan Gohman [Fri, 2 May 2008 00:03:54 +0000 (00:03 +0000)]
Use push_back(...) instead of resize(1, ...), per review feedback.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50561 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate old-style syntax in some "not grep" tests.
Dan Gohman [Thu, 1 May 2008 23:50:07 +0000 (23:50 +0000)]
Update old-style syntax in some "not grep" tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50560 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix uninitialized uses of the FPC variable.
Dan Gohman [Thu, 1 May 2008 23:40:44 +0000 (23:40 +0000)]
Fix uninitialized uses of the FPC variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50558 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoNew test for bug fixed in 50545.
Dale Johannesen [Thu, 1 May 2008 22:50:14 +0000 (22:50 +0000)]
New test for bug fixed in 50545.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50548 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't try to create PHIs of struct types. Fallout
Dale Johannesen [Thu, 1 May 2008 22:27:44 +0000 (22:27 +0000)]
Don't try to create PHIs of struct types.  Fallout
from x86-64 calling convention work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50545 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix an overaggressive SimplifyDemandedBits optimization on urem. This
Dan Gohman [Thu, 1 May 2008 19:13:24 +0000 (19:13 +0000)]
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

16 years agoAdding testcase.
Bill Wendling [Thu, 1 May 2008 18:41:09 +0000 (18:41 +0000)]
Adding testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50536 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoInitialize a local variable.
Ted Kremenek [Thu, 1 May 2008 17:08:00 +0000 (17:08 +0000)]
Initialize a local variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50527 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agodon't randomly miscompile seto/setuo just because we are in
Chris Lattner [Thu, 1 May 2008 07:26:11 +0000 (07:26 +0000)]
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

16 years ago1) add '-debug' output
Chris Lattner [Thu, 1 May 2008 06:39:12 +0000 (06:39 +0000)]
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

16 years agoDelete the IPO simplify-libcalls and completely reimplement it as
Chris Lattner [Thu, 1 May 2008 06:25:24 +0000 (06:25 +0000)]
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

16 years agofix typo
Chris Lattner [Thu, 1 May 2008 06:16:48 +0000 (06:16 +0000)]
fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50519 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoinstcombine does memset optzns.
Chris Lattner [Thu, 1 May 2008 06:16:38 +0000 (06:16 +0000)]
instcombine does memset optzns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50518 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agosimplifylibcalls doesn't optimize llvm.memmove, instcombine does.
Chris Lattner [Thu, 1 May 2008 06:14:24 +0000 (06:14 +0000)]
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

16 years agomove some tests from libcall optimizer suite.
Chris Lattner [Thu, 1 May 2008 06:13:48 +0000 (06:13 +0000)]
move some tests from libcall optimizer suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50516 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd CreateCall3/CreateCall4 at Eric's request.
Chris Lattner [Thu, 1 May 2008 05:23:45 +0000 (05:23 +0000)]
Add CreateCall3/CreateCall4 at Eric's request.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50515 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a spiffy little "CreateCall2" method, which can be used to make
Chris Lattner [Thu, 1 May 2008 05:11:00 +0000 (05:11 +0000)]
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

16 years agofix a bug in my previous patch, a classic =/== bug.
Chris Lattner [Wed, 30 Apr 2008 15:27:09 +0000 (15:27 +0000)]
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

16 years agoReally commit the test checking the argument lowering behaviour on x86-64 :).
Arnold Schwaighofer [Wed, 30 Apr 2008 09:19:47 +0000 (09:19 +0000)]
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

16 years agoTail call optimization improvements:
Arnold Schwaighofer [Wed, 30 Apr 2008 09:16:33 +0000 (09:16 +0000)]
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

16 years agoset ignore property
Gabor Greif [Wed, 30 Apr 2008 08:59:22 +0000 (08:59 +0000)]
set ignore property

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50476 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofcntl.h is pretty standard on unix (without the sys/)
Gabor Greif [Wed, 30 Apr 2008 08:53:22 +0000 (08:53 +0000)]
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

16 years agoMove this test to LoopDeletion, where it now passes.
Owen Anderson [Wed, 30 Apr 2008 07:17:22 +0000 (07:17 +0000)]
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

16 years agoThis condition got inverted accidentally.
Owen Anderson [Wed, 30 Apr 2008 07:16:33 +0000 (07:16 +0000)]
This condition got inverted accidentally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50473 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomove lowering of llvm.memset -> store from simplify libcalls
Chris Lattner [Wed, 30 Apr 2008 06:39:11 +0000 (06:39 +0000)]
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

16 years agono reason for simplifylibcalls to simplify intrinsics, instcombine does
Chris Lattner [Wed, 30 Apr 2008 06:12:15 +0000 (06:12 +0000)]
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

16 years agoremove redundant check.
Chris Lattner [Wed, 30 Apr 2008 06:06:37 +0000 (06:06 +0000)]
remove redundant check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50469 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd missing #include
Chris Lattner [Wed, 30 Apr 2008 04:56:14 +0000 (04:56 +0000)]
add missing #include

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50468 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd a method for comparing to see if a value has a specified name.
Chris Lattner [Wed, 30 Apr 2008 03:55:40 +0000 (03:55 +0000)]
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

16 years agouse string length computation to generalize several xforms.
Chris Lattner [Wed, 30 Apr 2008 03:07:53 +0000 (03:07 +0000)]
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

16 years agoAdd comments for previous patch as requested.
Dale Johannesen [Wed, 30 Apr 2008 00:43:29 +0000 (00:43 +0000)]
Add comments for previous patch as requested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50463 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoBug fixes and updates for CellSPU, syncing up with trunk. Most notable
Scott Michel [Wed, 30 Apr 2008 00:30:08 +0000 (00:30 +0000)]
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

16 years agoFix custom target lowering for zero/any/sign_extend: make sure that
Scott Michel [Wed, 30 Apr 2008 00:26:38 +0000 (00:26 +0000)]
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

16 years agoMake eh_frame objects by 8-byte aligned on 64-bit
Dale Johannesen [Tue, 29 Apr 2008 22:58:20 +0000 (22:58 +0000)]
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

16 years agoMinor spelling and typo fixes.
John Criswell [Tue, 29 Apr 2008 22:12:40 +0000 (22:12 +0000)]
Minor spelling and typo fixes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50448 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevert r50441. The original code was correct. Add some more comments so that I...
Owen Anderson [Tue, 29 Apr 2008 21:51:00 +0000 (21:51 +0000)]
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

16 years agoFix a bug in memcpyopt where the memcpy-memcpy transform was never being applied...
Owen Anderson [Tue, 29 Apr 2008 21:26:06 +0000 (21:26 +0000)]
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

16 years agoWe should be returning true here since we've changed the function.
Owen Anderson [Tue, 29 Apr 2008 21:02:46 +0000 (21:02 +0000)]
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

16 years agoA lot of cleanups and documentation improvements, as well as a few corner case fixes...
Owen Anderson [Tue, 29 Apr 2008 20:59:33 +0000 (20:59 +0000)]
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

16 years agoRename DeadLoopElimination to LoopDeletion, part 2.
Owen Anderson [Tue, 29 Apr 2008 20:06:54 +0000 (20:06 +0000)]
Rename DeadLoopElimination to LoopDeletion, part 2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50437 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRename DeadLoopElimination to LoopDeletion, part one.
Owen Anderson [Tue, 29 Apr 2008 19:58:07 +0000 (19:58 +0000)]
Rename DeadLoopElimination to LoopDeletion, part one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50436 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't do stupid things: doInitialization(Module&) is not applicable to ModulePass :)
Anton Korobeynikov [Tue, 29 Apr 2008 18:16:22 +0000 (18:16 +0000)]
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

16 years agodon't eliminate load from volatile value on paths where the load is dead.
Chris Lattner [Tue, 29 Apr 2008 17:28:22 +0000 (17:28 +0000)]
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

16 years agomake this test reduced and *valid*
Chris Lattner [Tue, 29 Apr 2008 17:25:32 +0000 (17:25 +0000)]
make this test reduced and *valid*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50429 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix a subtle volatile handling bug.
Chris Lattner [Tue, 29 Apr 2008 17:13:43 +0000 (17:13 +0000)]
fix a subtle volatile handling bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50428 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse std::set instead of std::priority_queue for the RegReductionPriorityQueue.
Roman Levenstein [Tue, 29 Apr 2008 09:07:59 +0000 (09:07 +0000)]
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

16 years agoImplement more aggressive support for analyzing string length. This
Chris Lattner [Tue, 29 Apr 2008 06:56:02 +0000 (06:56 +0000)]
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

16 years agoClarify what we mean by a dead loop.
Owen Anderson [Tue, 29 Apr 2008 06:34:55 +0000 (06:34 +0000)]
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

16 years agonew testcase for PR2094. The inline asms should not pin allocas to the
Chris Lattner [Tue, 29 Apr 2008 05:53:29 +0000 (05:53 +0000)]
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

16 years agodon't delete the last store to an alloca if the store is volatile.
Chris Lattner [Tue, 29 Apr 2008 04:58:38 +0000 (04:58 +0000)]
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

16 years agomake the vector conversion magic handle multiple results.
Chris Lattner [Tue, 29 Apr 2008 04:48:56 +0000 (04:48 +0000)]
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

16 years agoadd support for multiple return values in inline asm. This is a step
Chris Lattner [Tue, 29 Apr 2008 04:29:54 +0000 (04:29 +0000)]
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

16 years agoAnother extract_subreg coalescing bug.
Evan Cheng [Tue, 29 Apr 2008 01:41:44 +0000 (01:41 +0000)]
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

16 years agoAdd some more comments.
Owen Anderson [Tue, 29 Apr 2008 00:45:15 +0000 (00:45 +0000)]
Add some more comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50384 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove debugging code.
Owen Anderson [Tue, 29 Apr 2008 00:39:24 +0000 (00:39 +0000)]
Remove debugging code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50383 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd dead loop elimination, which removes dead loops for which we can compute
Owen Anderson [Tue, 29 Apr 2008 00:38:34 +0000 (00:38 +0000)]
Add dead loop elimination, which removes dead loops for which we can compute
the trip count.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50382 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd -march=x86.
Evan Cheng [Mon, 28 Apr 2008 23:31:41 +0000 (23:31 +0000)]
Add -march=x86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50380 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate and_ops.ll according to the recent dagcombiner changes.
Dan Gohman [Mon, 28 Apr 2008 23:26:22 +0000 (23:26 +0000)]
Update and_ops.ll according to the recent dagcombiner changes.
Add a new test, and_ops_more.ll, which is XFAIL'd, to
record the parts of and_ops.ll that were affected by this
change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50379 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTest case.
Evan Cheng [Mon, 28 Apr 2008 22:14:34 +0000 (22:14 +0000)]
Test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50377 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a bug in RegsForValue::getCopyToRegs() that causes cyclical scheduling units...
Evan Cheng [Mon, 28 Apr 2008 22:07:13 +0000 (22:07 +0000)]
Fix a bug in RegsForValue::getCopyToRegs() that causes cyclical scheduling units. If it's creating multiple CopyToReg nodes that are "flagged" together, it should not create a TokenFactor for it's chain outputs:

c1, f1 = CopyToReg
c2, f2 = CopyToReg
c3     = TokenFactor c1, c2
 ...
       = user c3, ..., f2

Now that the two CopyToReg's and the user are "flagged" together. They effectively forms a single scheduling unit. The TokenFactor is now both an operand and a successor of the Flagged nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50376 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCorrect parameter attributes encoding for C bindings.
Anton Korobeynikov [Mon, 28 Apr 2008 21:48:04 +0000 (21:48 +0000)]
Correct parameter attributes encoding for C bindings.
Patch by Anders Johnsen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50375 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd possibility of using arbitrary to to execute stuff from bugpoint.
Anton Korobeynikov [Mon, 28 Apr 2008 20:53:48 +0000 (20:53 +0000)]
Add possibility of using arbitrary to to execute stuff from bugpoint.
Patch by Pekka Jääskeläinen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50373 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a pointer-arithmetic bug that caused 64-bit host pointer values to
Dan Gohman [Mon, 28 Apr 2008 20:25:15 +0000 (20:25 +0000)]
Fix a pointer-arithmetic bug that caused 64-bit host pointer values to
be truncated to 32 bits. This fixes the recent Benchmarks/McCat/09-vor
regression on x86-64, among other things.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50372 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix DSE to not eliminate volatile loads with no uses.
Dan Gohman [Mon, 28 Apr 2008 19:51:27 +0000 (19:51 +0000)]
Fix DSE to not eliminate volatile loads with no uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50370 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't try to convert PPC long double.
Dale Johannesen [Mon, 28 Apr 2008 19:46:58 +0000 (19:46 +0000)]
Don't try to convert PPC long double.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50369 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoEvan pointed out that folding sext to zext may not be correct
Dan Gohman [Mon, 28 Apr 2008 18:47:17 +0000 (18:47 +0000)]
Evan pointed out that folding sext to zext may not be correct
if the zext is not legal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50368 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDelete an unused constructor.
Dan Gohman [Mon, 28 Apr 2008 18:28:49 +0000 (18:28 +0000)]
Delete an unused constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50367 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a comment to CreateRegForValue that clarifies the handling of
Dan Gohman [Mon, 28 Apr 2008 18:19:43 +0000 (18:19 +0000)]
Add a comment to CreateRegForValue that clarifies the handling of
aggregate types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50366 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRewrite the comments for RegsForValue and its members, and
Dan Gohman [Mon, 28 Apr 2008 18:10:39 +0000 (18:10 +0000)]
Rewrite the comments for RegsForValue and its members, and
reorder some of the members for clarity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50365 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd more alignment enums.
Ted Kremenek [Mon, 28 Apr 2008 17:58:20 +0000 (17:58 +0000)]
Add more alignment enums.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50363 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoBug fix in BumpPtrAllocator: don't assume that all objects have the same alignment...
Ted Kremenek [Mon, 28 Apr 2008 17:58:07 +0000 (17:58 +0000)]
Bug fix in BumpPtrAllocator: don't assume that all objects have the same alignment.  "Bump" of the pointer for the next allocated object to be of the specified alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50362 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't call size() on each iteration of the loop.
Dan Gohman [Mon, 28 Apr 2008 17:42:03 +0000 (17:42 +0000)]
Don't call size() on each iteration of the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50361 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoExpose parameter attributes via C bindings.
Gordon Henriksen [Mon, 28 Apr 2008 17:37:06 +0000 (17:37 +0000)]
Expose parameter attributes via C bindings.

Patch by Anders Johnsen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50360 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix the SVOffset values for loads and stores produced by
Dan Gohman [Mon, 28 Apr 2008 17:15:20 +0000 (17:15 +0000)]
Fix the SVOffset values for loads and stores produced by
memcpy/memset expansion. It was a bug for the SVOffset value
to be used in the actual address calculations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50359 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTeach InstCombine's ComputeMaskedBits what SelectionDAG's
Dan Gohman [Mon, 28 Apr 2008 17:02:21 +0000 (17:02 +0000)]
Teach InstCombine's ComputeMaskedBits what SelectionDAG's
ComputeMaskedBits knows about cttz, ctlz, and ctpop. Teach
SelectionDAG's ComputeMaskedBits what InstCombine's knows
about SRem. And teach them both some things about high bits
in Mul, UDiv, URem, and Sub. This allows instcombine and
dagcombine to eliminate sign-extension operations in
several new cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50358 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTeach DAGCombine to convert (sext x) to (zext x) when the
Dan Gohman [Mon, 28 Apr 2008 16:58:24 +0000 (16:58 +0000)]
Teach DAGCombine to convert (sext x) to (zext x) when the
sign-bit of x is known to be zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50357 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd support for response files to the CommandLine library.
Mikhail Glushenkov [Mon, 28 Apr 2008 16:44:25 +0000 (16:44 +0000)]
Add support for response files to the CommandLine library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50355 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix FP return for Win64 ABI
Anton Korobeynikov [Mon, 28 Apr 2008 07:40:07 +0000 (07:40 +0000)]
Fix FP return for Win64 ABI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50342 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAnother collection of random cleanups. No functionality change.
Chris Lattner [Mon, 28 Apr 2008 07:16:35 +0000 (07:16 +0000)]
Another collection of random cleanups.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50341 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove the SmallVector ctor that converts from a SmallVectorImpl. This
Chris Lattner [Mon, 28 Apr 2008 06:44:42 +0000 (06:44 +0000)]
Remove the SmallVector ctor that converts from a SmallVectorImpl.  This
conversion open the door for many nasty implicit conversion issues, and
can be easily solved by initializing with (V.begin(), V.end()) when
needed.

This patch includes many small cleanups for sdisel also.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50340 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorestore the copy ctor in SmallVector. This fixes serious
Chris Lattner [Mon, 28 Apr 2008 06:32:08 +0000 (06:32 +0000)]
restore the copy ctor in SmallVector.  This fixes serious
errors I introduced in my last patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50338 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoswitch RegsForValue::Regs to be a SmallVector to avoid
Chris Lattner [Mon, 28 Apr 2008 06:02:19 +0000 (06:02 +0000)]
switch RegsForValue::Regs to be a SmallVector to avoid
heap thrash on tiny (usually single-element) vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50335 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agogeneralize SmallVector copy ctor, there is no requirement for
Chris Lattner [Mon, 28 Apr 2008 06:01:06 +0000 (06:01 +0000)]
generalize SmallVector copy ctor, there is no requirement for
the initialization vector to have the same fixed size, just the
same element type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50334 91177308-0d34-0410-b5e6-96231b3b80d8