oota-llvm.git
16 years agoAdded memmove to interpreter external functions list. Patch by Daniel Dunbar.
Evan Cheng [Wed, 20 Feb 2008 07:55:26 +0000 (07:55 +0000)]
Added memmove to interpreter external functions list. Patch by Daniel Dunbar.

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

16 years agoMore constification of things. More comments added. No functionality
Bill Wendling [Wed, 20 Feb 2008 07:36:31 +0000 (07:36 +0000)]
More constification of things. More comments added. No functionality
changes. (Sorry for any formatting changes that creeped in.)

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

16 years agoUse getConstant for ConstantInts.
Nick Lewycky [Wed, 20 Feb 2008 06:58:55 +0000 (06:58 +0000)]
Use getConstant for ConstantInts.

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

16 years agoAdd 'umax' similar to 'smax' SCEV. Closes PR2003.
Nick Lewycky [Wed, 20 Feb 2008 06:48:22 +0000 (06:48 +0000)]
Add 'umax' similar to 'smax' SCEV. Closes PR2003.

Parse reversed smax and umax as smin and umin and express them with negative
or binary-not SCEVs (which are really just subtract under the hood).

Parse 'xor %x, -1' as (-1 - %x).

Remove dead code (ConstantInt::get always returns a ConstantInt).

Don't use getIntegerSCEV(-1, Ty). The first value is an int, then it gets
passed into a uint64_t. Instead, create the -1 directly from
ConstantInt::getAllOnesValue().

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

16 years agoFix an incredibly subtle bug exposed by Ted's change to APInt profiling.
Chris Lattner [Wed, 20 Feb 2008 06:28:01 +0000 (06:28 +0000)]
Fix an incredibly subtle bug exposed by Ted's change to APInt profiling.
AddNodeIDNode does profiling for a ConstantSDNode, but so does
SelectionDAG::getConstant.  This profiling should be moved to a common
static function in ConstantSDNode.

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

16 years agoNo functionality change:
Bill Wendling [Wed, 20 Feb 2008 06:10:21 +0000 (06:10 +0000)]
No functionality change:

 - Constified some MachineOperand values.
 - Added/Modified some comments.

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

16 years agoXFAIL this for now.
Evan Cheng [Wed, 20 Feb 2008 02:38:58 +0000 (02:38 +0000)]
XFAIL this for now.

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

16 years agoDisable for now. This is pessimizing code.
Evan Cheng [Wed, 20 Feb 2008 02:29:17 +0000 (02:29 +0000)]
Disable for now. This is pessimizing code.

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

16 years agoAdd some comments to Intrinsic::getDeclaration to clarify how to
Dan Gohman [Wed, 20 Feb 2008 01:07:51 +0000 (01:07 +0000)]
Add some comments to Intrinsic::getDeclaration to clarify how to
get declarations for overloaded intrinsics.

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

16 years agoAdd Alignment field to ParameterAttributes and
Dale Johannesen [Tue, 19 Feb 2008 23:51:49 +0000 (23:51 +0000)]
Add Alignment field to ParameterAttributes and
treat more or less rationally in interface
functions, subject to change.  No functional change.

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

16 years agoAdd hidden option -x86-fold-and-in-test to test the effect the test / and folding...
Evan Cheng [Tue, 19 Feb 2008 23:36:51 +0000 (23:36 +0000)]
Add hidden option -x86-fold-and-in-test to test the effect the test / and folding change.

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

16 years agoregenerate
Devang Patel [Tue, 19 Feb 2008 22:27:01 +0000 (22:27 +0000)]
regenerate

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

16 years agoParse
Devang Patel [Tue, 19 Feb 2008 22:26:37 +0000 (22:26 +0000)]
Parse
 %b = getresult {i32, i32} %a, i32 1

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

16 years agoAdd GetResultInst. First step for multiple return value support.
Devang Patel [Tue, 19 Feb 2008 22:15:16 +0000 (22:15 +0000)]
Add GetResultInst. First step for multiple return value support.

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

16 years agoGenerated files for checkin 47342.
Dale Johannesen [Tue, 19 Feb 2008 21:40:51 +0000 (21:40 +0000)]
Generated files for checkin 47342.

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

16 years agoForgot a file, goes with 47342.
Dale Johannesen [Tue, 19 Feb 2008 21:40:10 +0000 (21:40 +0000)]
Forgot a file, goes with 47342.

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

16 years agoExpand ParameterAttributes to 32 bits (in preparation
Dale Johannesen [Tue, 19 Feb 2008 21:38:47 +0000 (21:38 +0000)]
Expand ParameterAttributes to 32 bits (in preparation
for adding alignment info, not there yet).  Clean up
interfaces to reference ParameterAttributes consistently.

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

16 years agoFixed bug in APInt::Profile() where the BitWidth field was not included in the
Ted Kremenek [Tue, 19 Feb 2008 20:50:41 +0000 (20:50 +0000)]
Fixed bug in APInt::Profile() where the BitWidth field was not included in the
profile of the APSInt object. This caused unexpected Profile collisions where
none should have occurred.

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

16 years agofix some byval problems in the cbe. Closes PR2065
Andrew Lenharth [Tue, 19 Feb 2008 19:47:54 +0000 (19:47 +0000)]
fix some byval problems in the cbe.  Closes PR2065

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

16 years agorandom cleanups.
Chris Lattner [Tue, 19 Feb 2008 18:49:08 +0000 (18:49 +0000)]
random cleanups.

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

16 years agothis test requires sse2
Chris Lattner [Tue, 19 Feb 2008 18:07:46 +0000 (18:07 +0000)]
this test requires sse2

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

16 years agoDon't fold and's into test instructions if they have multiple uses.
Chris Lattner [Tue, 19 Feb 2008 17:37:35 +0000 (17:37 +0000)]
Don't fold and's into test instructions if they have multiple uses.
This compiles test-nofold.ll into:

_test:
movl $15, %ecx
andl 4(%esp), %ecx
testl %ecx, %ecx
movl $42, %eax
cmove %ecx, %eax
ret

instead of:
_test:
movl 4(%esp), %eax
movl %eax, %ecx
andl $15, %ecx
testl $15, %eax
movl $42, %eax
cmove %ecx, %eax
ret

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

16 years agorename tests to avoid a test- prefix when they aren't related to the test instruction.
Chris Lattner [Tue, 19 Feb 2008 17:33:52 +0000 (17:33 +0000)]
rename tests to avoid a test- prefix when they aren't related to the test instruction.

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

16 years agoFix a compiler warning.
Duncan Sands [Tue, 19 Feb 2008 09:28:48 +0000 (09:28 +0000)]
Fix a compiler warning.

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

16 years agoRemove llvm-upgrade and update tests.
Tanya Lattner [Tue, 19 Feb 2008 08:07:33 +0000 (08:07 +0000)]
Remove llvm-upgrade and update tests.

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

16 years agodead pass
Chris Lattner [Tue, 19 Feb 2008 07:58:11 +0000 (07:58 +0000)]
dead pass

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

16 years agoremove the LowerSelect pass. The last client was the old Sparc backend, which is...
Chris Lattner [Tue, 19 Feb 2008 07:49:17 +0000 (07:49 +0000)]
remove the LowerSelect pass.  The last client was the old Sparc backend, which is long dead by now.

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

16 years agoremove the lower packed pass. It can never work and even the parts that
Chris Lattner [Tue, 19 Feb 2008 07:39:17 +0000 (07:39 +0000)]
remove the lower packed pass.  It can never work and even the parts that
could work don't work fully.  This fixes PR1705.  Oh yeah, we don't have
packed types anymore either ;-)

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

16 years agoRefactor this method a bit, and correct a test that was completely wrong but happened...
Owen Anderson [Tue, 19 Feb 2008 07:07:51 +0000 (07:07 +0000)]
Refactor this method a bit, and correct a test that was completely wrong but happened to work out anyways. :-)

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

16 years agoisa+cast -> dyncast.
Chris Lattner [Tue, 19 Feb 2008 06:53:20 +0000 (06:53 +0000)]
isa+cast -> dyncast.

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

16 years agosimplify this code again, try 2 :)
Chris Lattner [Tue, 19 Feb 2008 06:52:38 +0000 (06:52 +0000)]
simplify  this code again, try 2 :)

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

16 years agoFix a comment.
Owen Anderson [Tue, 19 Feb 2008 06:51:23 +0000 (06:51 +0000)]
Fix a comment.

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

16 years agoIn addition to arguments passed to it, memcpy (and all other calls) can ModRef pointe...
Owen Anderson [Tue, 19 Feb 2008 06:47:18 +0000 (06:47 +0000)]
In addition to arguments passed to it, memcpy (and all other calls) can ModRef pointers that alias their arguments as well.  This fixes PR2057.

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

16 years agoMajor improvements to yesterday's return slot optimization. Remove some unneccessary...
Owen Anderson [Tue, 19 Feb 2008 06:35:43 +0000 (06:35 +0000)]
Major improvements to yesterday's return slot optimization.  Remove some unneccessary constraints,
and add some others that should have been in from the first place.  Document the whole thing better.

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

16 years agoFix some minor issues folding undef, PR2052
Chris Lattner [Tue, 19 Feb 2008 06:22:12 +0000 (06:22 +0000)]
Fix some minor issues folding undef, PR2052

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

16 years agofdiv/frem of undef can produce undef, because the undef operand
Chris Lattner [Tue, 19 Feb 2008 06:12:18 +0000 (06:12 +0000)]
fdiv/frem of undef can produce undef, because the undef operand
can be a SNaN.  We could be more aggressive and turn this into
unreachable, but that is less nice, and not really worth it.

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

16 years agoregenerate
Chris Lattner [Tue, 19 Feb 2008 04:36:25 +0000 (04:36 +0000)]
regenerate

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

16 years agoFix PR2060 by rejecting invalid types for integer constants.
Chris Lattner [Tue, 19 Feb 2008 04:36:07 +0000 (04:36 +0000)]
Fix PR2060 by rejecting invalid types for integer constants.

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

16 years agoFactor the profitability check for return slot optimization out into a static function.
Owen Anderson [Tue, 19 Feb 2008 03:27:34 +0000 (03:27 +0000)]
Factor the profitability check for return slot optimization out into a static function.
At some point in the future, this check will become smarter.

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

16 years agoAn sret parameter is required to be the first parameter, so there's no need to loop
Owen Anderson [Tue, 19 Feb 2008 03:15:29 +0000 (03:15 +0000)]
An sret parameter is required to be the first parameter, so there's no need to loop
over all the parameters of the callee looking for it.

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

16 years agoDon't spew stats to stderr.
Nick Lewycky [Tue, 19 Feb 2008 03:11:47 +0000 (03:11 +0000)]
Don't spew stats to stderr.

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

16 years agoCleanup some of my patches from yesterday. Refactor the check for which xform
Owen Anderson [Tue, 19 Feb 2008 03:09:45 +0000 (03:09 +0000)]
Cleanup some of my patches from yesterday.  Refactor the check for which xform
to apply to a memcpy into processInstruction.  Also, fix a bug in the check due to
missing braces.

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

16 years agoFix up the run line for this new test.
Nick Lewycky [Tue, 19 Feb 2008 02:58:36 +0000 (02:58 +0000)]
Fix up the run line for this new test.
llc: for the -info-output-file option:  requires a value!

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

16 years agoFix Transforms/GVN/memcpy.ll, which Chris broke in r47275 by reordering the branches...
Owen Anderson [Tue, 19 Feb 2008 02:53:23 +0000 (02:53 +0000)]
Fix Transforms/GVN/memcpy.ll, which Chris broke in r47275 by reordering the branches.  memcpy's are a kind of CallInst.

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

16 years agoNew test.
Evan Cheng [Tue, 19 Feb 2008 02:09:58 +0000 (02:09 +0000)]
New test.

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

16 years agoPR1909: Tail merging pass ran wild. It makes no sense to merge blocks in order to...
Evan Cheng [Tue, 19 Feb 2008 02:09:37 +0000 (02:09 +0000)]
PR1909: Tail merging pass ran wild. It makes no sense to merge blocks in order to save a single instruction since a branch will be inserted for each BB.

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

16 years agoMe not like duplicated comments.
Evan Cheng [Tue, 19 Feb 2008 02:05:16 +0000 (02:05 +0000)]
Me not like duplicated comments.

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

16 years agoRemove llvm-upgrade and update tests.
Tanya Lattner [Tue, 19 Feb 2008 01:44:26 +0000 (01:44 +0000)]
Remove llvm-upgrade and update tests.

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

16 years agoRemove llvm-upgrade and update tests.
Tanya Lattner [Tue, 19 Feb 2008 01:41:04 +0000 (01:41 +0000)]
Remove llvm-upgrade and update tests.

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

16 years ago- When DAG combiner is folding a bit convert into a BUILD_VECTOR, it should check...
Evan Cheng [Mon, 18 Feb 2008 23:04:32 +0000 (23:04 +0000)]
- When DAG combiner is folding a bit convert into a BUILD_VECTOR, it should check if it's essentially a SCALAR_TO_VECTOR. Avoid turning (v8i16) <10, u, u, u> to <10, 0, u, u, u, u, u, u>. Instead, simply convert it to a SCALAR_TO_VECTOR of the proper type.
- X86 now normalize SCALAR_TO_VECTOR to (BIT_CONVERT (v4i32 SCALAR_TO_VECTOR)). Get rid of X86ISD::S2VEC.

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

16 years agoCorrectly fold divide-by-constant, even when faced with overflow.
Nick Lewycky [Mon, 18 Feb 2008 22:48:05 +0000 (22:48 +0000)]
Correctly fold divide-by-constant, even when faced with overflow.

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

16 years agoChris pointed out that it's not necessary to set i64 MUL to Expand
Dan Gohman [Mon, 18 Feb 2008 19:34:53 +0000 (19:34 +0000)]
Chris pointed out that it's not necessary to set i64 MUL to Expand
on x86-32 since i64 itself is not a Legal type. And, update some
comments.

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

16 years ago- Remove the previous check which broke coalescer-commute3.ll
Evan Cheng [Mon, 18 Feb 2008 18:56:31 +0000 (18:56 +0000)]
- Remove the previous check which broke coalescer-commute3.ll
- For now, conservatively ignore copy MI whose source is a physical register. Commuting its def MI can cause a physical register live interval to be live through a loop (since we know it's live coming into the def MI).

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

16 years agoupgrade some tests.
Chris Lattner [Mon, 18 Feb 2008 18:46:39 +0000 (18:46 +0000)]
upgrade some tests.

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

16 years agoAdd a note
Nate Begeman [Mon, 18 Feb 2008 18:39:23 +0000 (18:39 +0000)]
Add a note

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

16 years agoAdd a note about sext from i1 plus flags use.
Chris Lattner [Mon, 18 Feb 2008 18:30:13 +0000 (18:30 +0000)]
Add a note about sext from i1 plus flags use.

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

16 years agoDon't mark scalar integer multiplication as Expand on x86, since x86
Dan Gohman [Mon, 18 Feb 2008 17:55:26 +0000 (17:55 +0000)]
Don't mark scalar integer multiplication as Expand on x86, since x86
has plain one-result scalar integer multiplication instructions.
This avoids expanding such instructions into MUL_LOHI sequences that
must be special-cased at isel time, and avoids the problem with that
code that provented memory operands from being folded.

This fixes PR1874, addressesing the most common case. The uncommon
cases of optimizing multiply-high operations will require work
in DAGCombiner.

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

16 years agoTransforming -A + -B --> -(A + B) isn't safe for FP, thanks
Chris Lattner [Mon, 18 Feb 2008 17:50:16 +0000 (17:50 +0000)]
Transforming -A + -B  -->  -(A + B) isn't safe for FP, thanks
to Dale for noticing this!

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

16 years agominor code simplification, no functionality change.
Chris Lattner [Mon, 18 Feb 2008 17:47:29 +0000 (17:47 +0000)]
minor code simplification, no functionality change.

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

16 years agomake this just a bit more strict.
Chris Lattner [Mon, 18 Feb 2008 17:33:10 +0000 (17:33 +0000)]
make this just a bit more strict.

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

16 years agoSimplify caller updating using a CallSite, as
Duncan Sands [Mon, 18 Feb 2008 17:32:13 +0000 (17:32 +0000)]
Simplify caller updating using a CallSite, as
requested by Chris.  While there, do the same
for an existing function committed by someone
called "lattner" :)

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

16 years agodon't bother calling getUnderlyingObject for non-pointers.
Chris Lattner [Mon, 18 Feb 2008 17:28:21 +0000 (17:28 +0000)]
don't bother calling getUnderlyingObject for non-pointers.

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

16 years agoFix a missing space in the description of the find-bugs option.
Dan Gohman [Mon, 18 Feb 2008 17:15:45 +0000 (17:15 +0000)]
Fix a missing space in the description of the find-bugs option.

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

16 years agoSince we're not checking for the more general AllocationInst first, we need to explic...
Owen Anderson [Mon, 18 Feb 2008 10:11:00 +0000 (10:11 +0000)]
Since we're not checking for the more general AllocationInst first, we need to explicitly check
that Object is an Argument before casting it to one.

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

16 years agoNew helper function getMBBFromIndex() that given an index in any instruction of an...
Roman Levenstein [Mon, 18 Feb 2008 09:35:30 +0000 (09:35 +0000)]
New helper function getMBBFromIndex() that given an index in any instruction of an MBB returns a pointer the MBB. Reviewed by Evan.

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

16 years agoAdd support to GVN for performing sret return slot optimization. This means that...
Owen Anderson [Mon, 18 Feb 2008 09:24:53 +0000 (09:24 +0000)]
Add support to GVN for performing sret return slot optimization.  This means that, if an sret function tail calls
another sret function, it should pass its own sret parameter to the tail callee, allowing it to fill in the correct
return value.  llvm-gcc does not emit this by default.  Instead, it allocates space in the caller for the sret of
the tail call and then uses memcpy to copy the result into the caller's sret parameter.  This optimization detects
and optimizes that case.

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

16 years agoI got the predicate backwards in my last patch. The comment is correct, the code...
Owen Anderson [Mon, 18 Feb 2008 09:22:21 +0000 (09:22 +0000)]
I got the predicate backwards in my last patch.  The comment is correct, the code was not.

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

16 years agoThis check is not correct for mallocs, so exclude them earlier.
Owen Anderson [Mon, 18 Feb 2008 09:11:02 +0000 (09:11 +0000)]
This check is not correct for mallocs, so exclude them earlier.

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

16 years agoFor now, avoid commuting def MI for copy MI's whose source is not killed. That simply...
Evan Cheng [Mon, 18 Feb 2008 08:40:53 +0000 (08:40 +0000)]
For now, avoid commuting def MI for copy MI's whose source is not killed. That simply trade a live interval for another and because only the non-two-address operands can be folded into loads, may end up pessimising code.

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

16 years agoswitch simplifycfg from using vectors for most things to smallvectors,
Chris Lattner [Mon, 18 Feb 2008 07:42:56 +0000 (07:42 +0000)]
switch simplifycfg from using vectors for most things to smallvectors,
this speeds it up 2.3% on eon.

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

16 years agooptimize away stackrestore calls that have no intervening alloca or call.
Chris Lattner [Mon, 18 Feb 2008 06:12:38 +0000 (06:12 +0000)]
optimize away stackrestore calls that have no intervening alloca or call.

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

16 years agoupgrade this test.
Chris Lattner [Mon, 18 Feb 2008 06:11:00 +0000 (06:11 +0000)]
upgrade this test.

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

16 years agoClarify that 'sret' only applies to pointers, and
Duncan Sands [Mon, 18 Feb 2008 04:19:38 +0000 (04:19 +0000)]
Clarify that 'sret' only applies to pointers, and
only applies to the first parameter.

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

16 years agoMake the definition of the noalias attribute clearer.
Owen Anderson [Mon, 18 Feb 2008 04:09:01 +0000 (04:09 +0000)]
Make the definition of the noalias attribute clearer.

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

16 years agoDuncan pointed out that we can fast fail here, because the sret parameter of
Owen Anderson [Mon, 18 Feb 2008 04:06:26 +0000 (04:06 +0000)]
Duncan pointed out that we can fast fail here, because the sret parameter of
a function must be the first parameter.

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

16 years agoFix a comment, and a bug where we weren't applying the tail call logic in cases that...
Owen Anderson [Mon, 18 Feb 2008 03:52:21 +0000 (03:52 +0000)]
Fix a comment, and a bug where we weren't applying the tail call logic in cases that failed the first test.

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

16 years agoFix bugs that Chris noticed in my last patch.
Owen Anderson [Mon, 18 Feb 2008 02:31:23 +0000 (02:31 +0000)]
Fix bugs that Chris noticed in my last patch.

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

16 years agosimplify some code, BreakUpSubtract always returns nonnull now.
Chris Lattner [Mon, 18 Feb 2008 02:18:25 +0000 (02:18 +0000)]
simplify some code, BreakUpSubtract always returns nonnull now.

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

16 years agobitcasts of pointers are always pointers.
Chris Lattner [Mon, 18 Feb 2008 02:11:28 +0000 (02:11 +0000)]
bitcasts of pointers are always pointers.
If we see a memcpy of a pointer, make sure to check later
uses of the pointer as well.

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

16 years agoAdd support for setting parameters to CallSite.
Owen Anderson [Mon, 18 Feb 2008 00:10:55 +0000 (00:10 +0000)]
Add support for setting parameters to CallSite.

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

16 years agoAdd a predicate to Argument to check for the StructRet attribute.
Owen Anderson [Sun, 17 Feb 2008 23:22:28 +0000 (23:22 +0000)]
Add a predicate to Argument to check for the StructRet attribute.

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

16 years agoTeach getModRefInfo that memcpy, memmove, and memset don't "capture" memory addresses.
Owen Anderson [Sun, 17 Feb 2008 21:29:08 +0000 (21:29 +0000)]
Teach getModRefInfo that memcpy, memmove, and memset don't "capture" memory addresses.
Also, noalias arguments are be considered "like" stack allocated ones for this purpose, because
the only way they can be modref'ed is if they escape somewhere in the current function.

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

16 years agoFold (-x + -y) -> -(x+y) which promotes better association, fixing
Chris Lattner [Sun, 17 Feb 2008 21:03:36 +0000 (21:03 +0000)]
Fold (-x + -y) -> -(x+y) which promotes better association, fixing
the second half of PR2047

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

16 years agofix pasto
Chris Lattner [Sun, 17 Feb 2008 20:54:40 +0000 (20:54 +0000)]
fix pasto

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

16 years agoSplit up subtracts into add+negate if they have a reassociable use or operand
Chris Lattner [Sun, 17 Feb 2008 20:51:26 +0000 (20:51 +0000)]
Split up subtracts into add+negate if they have a reassociable use or operand
that is also a subtract.  This implements PR2047 and Transforms/Reassociate/subtest2.ll

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

16 years agoupgrade and simplify this test.
Chris Lattner [Sun, 17 Feb 2008 20:48:43 +0000 (20:48 +0000)]
upgrade and simplify this test.

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

16 years agomake the logic for breaking up subtracts more explicit, no
Chris Lattner [Sun, 17 Feb 2008 20:44:51 +0000 (20:44 +0000)]
make the logic for breaking up subtracts more explicit, no
functionality change.

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

16 years agoRemove llvm-upgrade.
Tanya Lattner [Sun, 17 Feb 2008 20:02:20 +0000 (20:02 +0000)]
Remove llvm-upgrade.

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

16 years agomove PR2053 to here.
Chris Lattner [Sun, 17 Feb 2008 19:43:57 +0000 (19:43 +0000)]
move PR2053 to here.

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

16 years agofix this test.
Chris Lattner [Sun, 17 Feb 2008 00:15:25 +0000 (00:15 +0000)]
fix this test.

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

16 years agoRemove llvm-upgrade
Tanya Lattner [Sun, 17 Feb 2008 00:15:09 +0000 (00:15 +0000)]
Remove llvm-upgrade

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

16 years agoRemove llvm-upgrade.
Tanya Lattner [Sun, 17 Feb 2008 00:13:09 +0000 (00:13 +0000)]
Remove llvm-upgrade.

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

16 years agothis test isn't useful since we added @ notation for globals.
Chris Lattner [Sun, 17 Feb 2008 00:12:03 +0000 (00:12 +0000)]
this test isn't useful since we added @ notation for globals.

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

16 years agothis line was commented out.
Chris Lattner [Sun, 17 Feb 2008 00:09:08 +0000 (00:09 +0000)]
this line was commented out.

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

16 years agoRemove llvm-upgrade and update tests.
Tanya Lattner [Sat, 16 Feb 2008 23:55:46 +0000 (23:55 +0000)]
Remove llvm-upgrade and update tests.

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

16 years agoRemoving llvm upgrade, so remove tests specific to llvm-upgrade and update the tests...
Tanya Lattner [Sat, 16 Feb 2008 23:27:24 +0000 (23:27 +0000)]
Removing llvm upgrade, so remove tests specific to llvm-upgrade and update the tests that used it.

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

16 years agoRemove any 'nest' parameter attributes if the function
Duncan Sands [Sat, 16 Feb 2008 20:56:04 +0000 (20:56 +0000)]
Remove any 'nest' parameter attributes if the function
is not passed as an argument to a trampoline intrinsic.

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

16 years agoSome micro-optimizations.
Duncan Sands [Sat, 16 Feb 2008 20:53:06 +0000 (20:53 +0000)]
Some micro-optimizations.

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

16 years agoI cannot find a libgcc function for this builtin. Therefor expanding it to a noop...
Andrew Lenharth [Sat, 16 Feb 2008 14:46:26 +0000 (14:46 +0000)]
I cannot find a libgcc function for this builtin.  Therefor expanding it to a noop (which is how it use to be treated).  If someone who knows the x86 backend better than me could tell me how to get a lock prefix on an instruction, that would be nice to complete x86 support.

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

16 years agoTeach LegalizeTypes how to expand the operands of
Duncan Sands [Sat, 16 Feb 2008 10:29:26 +0000 (10:29 +0000)]
Teach LegalizeTypes how to expand the operands of
br_cc.  This fixes 5 "make check" failures.

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