oota-llvm.git
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

16 years agoTry to clarify which compilers can be used for the
Duncan Sands [Sat, 16 Feb 2008 09:47:41 +0000 (09:47 +0000)]
Try to clarify which compilers can be used for the
build.

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

16 years agoRefactor some code; check if commuteInstruction is able to commute the instruction.
Evan Cheng [Sat, 16 Feb 2008 02:32:17 +0000 (02:32 +0000)]
Refactor some code; check if commuteInstruction is able to commute the instruction.

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

16 years agollvm.memory.barrier, and impl for x86 and alpha
Andrew Lenharth [Sat, 16 Feb 2008 01:24:58 +0000 (01:24 +0000)]
llvm.memory.barrier, and impl for x86 and alpha

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

16 years agoFix typos.
Bill Wendling [Sat, 16 Feb 2008 01:09:25 +0000 (01:09 +0000)]
Fix typos.

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

16 years agoRename CountMemOperands to ComputeMemOperandsEnd to reflect what
Dan Gohman [Sat, 16 Feb 2008 00:36:48 +0000 (00:36 +0000)]
Rename CountMemOperands to ComputeMemOperandsEnd to reflect what
it actually does. Simplify CountOperands a little by reusing
ComputeMemOperandsEnd. And reword some comments for both.

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

16 years agoRevert 47177, which was incorrect.
Dan Gohman [Sat, 16 Feb 2008 00:25:40 +0000 (00:25 +0000)]
Revert 47177, which was incorrect.

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

16 years agoupgrade this test, which wasn't testing the right thing since llvm-upgrade came around.
Chris Lattner [Fri, 15 Feb 2008 23:58:25 +0000 (23:58 +0000)]
upgrade this test, which wasn't testing the right thing since llvm-upgrade came around.

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

16 years agorename llx -> ll
Chris Lattner [Fri, 15 Feb 2008 23:51:48 +0000 (23:51 +0000)]
rename llx -> ll

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

16 years agoThis test is not interesting.
Evan Cheng [Fri, 15 Feb 2008 23:06:21 +0000 (23:06 +0000)]
This test is not interesting.

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

16 years agoMake tblgen a little smarter about constants smaller than i32. Currently,
Scott Michel [Fri, 15 Feb 2008 23:05:48 +0000 (23:05 +0000)]
Make tblgen a little smarter about constants smaller than i32. Currently,
tblgen will complain if a sign-extended constant does not fit into a
data type smaller than i32, e.g., i16. This causes a problem when certain
hex constants are used, such as 0xff for byte masks or immediate xor
values.

tblgen will try the sign-extended value first and, if the sign extended
value would overflow, it tries to see if the unsigned value will fit.
Consequently, a software developer can now safely incant:

(XORHIr16 R16C:$rA, 0xffff)

which is somewhat clearer and more informative than incanting:

(XORHIr16 R16C:$rA, (i16 -1))

even if the two are bitwise equivalent.

Tblgen also outputs the 64-bit unsigned constant in the generated ISel code
when getTargetConstant() is invoked.

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

16 years agosimplify this.
Chris Lattner [Fri, 15 Feb 2008 22:57:17 +0000 (22:57 +0000)]
simplify this.

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

16 years agoModify test to expect improved code.
Dale Johannesen [Fri, 15 Feb 2008 22:05:15 +0000 (22:05 +0000)]
Modify test to expect improved code.

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

16 years agoThe copy instruction being coalesced will be removed, it is not a kill.
Evan Cheng [Fri, 15 Feb 2008 21:36:51 +0000 (21:36 +0000)]
The copy instruction being coalesced will be removed, it is not a kill.

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

16 years agoFixed bug in FoldingSetIteratorImpl where we did not correctly check if
Ted Kremenek [Fri, 15 Feb 2008 21:12:46 +0000 (21:12 +0000)]
Fixed bug in FoldingSetIteratorImpl where we did not correctly check if
we had reached the "fake bucket" after the last bucket, allowing the iterator
in some cases to run off the end of the hashtable.

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

16 years agoSkip over the defs and start at the uses when looking for operands
Dan Gohman [Fri, 15 Feb 2008 20:59:17 +0000 (20:59 +0000)]
Skip over the defs and start at the uses when looking for operands
with the TIED_TO attribute.

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

16 years agoUse the TargetInstrDescr to determine the number of operands
Dan Gohman [Fri, 15 Feb 2008 20:50:13 +0000 (20:50 +0000)]
Use the TargetInstrDescr to determine the number of operands
that should be checked for the TIED_TO attribute instead of
using CountOperands.

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

16 years agoFix this test on linux, which returns S242
Duncan Sands [Fri, 15 Feb 2008 19:42:13 +0000 (19:42 +0000)]
Fix this test on linux, which returns S242
using sret.

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

16 years agoTeach LegalizeTypes how to promote the flags
Duncan Sands [Fri, 15 Feb 2008 19:34:17 +0000 (19:34 +0000)]
Teach LegalizeTypes how to promote the flags
in a ret node.  These are created as i32 constants
but on some platforms i32 is not legal.  This
fixes 26 "make check" failures, for example
Alpha/2005-07-12-TwoMallocCalls.ll.

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

16 years agoHandle \n's in value names for more targets. The asm printers
Chris Lattner [Fri, 15 Feb 2008 19:04:54 +0000 (19:04 +0000)]
Handle \n's in value names for more targets.  The asm printers
really really really need refactoring :(

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

16 years agoIf the llvm name contains an unprintable character, don't print it in
Chris Lattner [Fri, 15 Feb 2008 18:56:05 +0000 (18:56 +0000)]
If the llvm name contains an unprintable character, don't print it in
the global comment.  This prevents printing things like:

...  # foo
bar

when the name is "foo\nbar".

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

16 years agotargets that support quotes for mangled names still need to escape newlines
Chris Lattner [Fri, 15 Feb 2008 18:54:56 +0000 (18:54 +0000)]
targets that support quotes for mangled names still need to escape newlines
when they occur in the name, just like " is escaped.

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

16 years agoCosmetics.
Dale Johannesen [Fri, 15 Feb 2008 18:40:53 +0000 (18:40 +0000)]
Cosmetics.

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

16 years ago- Removing the infamous r2rMap_ and rep() method. Now the coalescer will update
Evan Cheng [Fri, 15 Feb 2008 18:24:29 +0000 (18:24 +0000)]
- Removing the infamous r2rMap_ and rep() method. Now the coalescer will update
register defs and uses after each successful coalescing.
- Also removed a number of hacks and fixed some subtle kill information bugs.

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

16 years agoAdded CommuteChangesDestination(). This returns true if commuting the specified
Evan Cheng [Fri, 15 Feb 2008 18:21:33 +0000 (18:21 +0000)]
Added CommuteChangesDestination(). This returns true if commuting the specified
machine instr will change its definition register.

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

16 years agoRemove unnecessary #include.
Evan Cheng [Fri, 15 Feb 2008 18:12:09 +0000 (18:12 +0000)]
Remove unnecessary #include.

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

16 years agoUse StoreSDNode::getValue instead of calling getOperand directly
Dan Gohman [Fri, 15 Feb 2008 18:11:59 +0000 (18:11 +0000)]
Use StoreSDNode::getValue instead of calling getOperand directly
with a hard-coded operand number.

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

16 years agoRemove warning about 64-bit code on processor
Dale Johannesen [Fri, 15 Feb 2008 18:09:51 +0000 (18:09 +0000)]
Remove warning about 64-bit code on processor
that doesn't support it.  Per Chris.

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

16 years agoIt is not safe to call fork in PrintStackTrace. Sometimes it freezes the program.
Lauro Ramos Venancio [Fri, 15 Feb 2008 18:05:54 +0000 (18:05 +0000)]
It is not safe to call fork in PrintStackTrace. Sometimes it freezes the program.

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

16 years agoChange MemOperand's size and offset to be 64-bit.
Dan Gohman [Fri, 15 Feb 2008 01:29:57 +0000 (01:29 +0000)]
Change MemOperand's size and offset to be 64-bit.

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

16 years agoFix PR2028
Devang Patel [Fri, 15 Feb 2008 01:24:49 +0000 (01:24 +0000)]
Fix PR2028

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

16 years agonocona, core2 and penryn support 64 bit.
Dale Johannesen [Fri, 15 Feb 2008 01:22:41 +0000 (01:22 +0000)]
nocona, core2 and penryn support 64 bit.

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

16 years agoSupport vector constant zeros, thanks to Zack Rusin for the testcase.
Chris Lattner [Fri, 15 Feb 2008 00:57:28 +0000 (00:57 +0000)]
Support vector constant zeros, thanks to Zack Rusin for the testcase.

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

16 years agoRewrite tblgen handling of subtarget features so
Dale Johannesen [Thu, 14 Feb 2008 23:35:16 +0000 (23:35 +0000)]
Rewrite tblgen handling of subtarget features so
it follows the order of the enum, not alphabetical.
The motivation is to make -mattr=+ssse3,+sse41
select SSE41 as it ought to.  Added "ignored"
enum values of 0 to PPC and SPU to avoid compiler
warnings.

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

16 years agoIf loop header is also loop exiting block then OrigPN is incoming value for B loop...
Devang Patel [Thu, 14 Feb 2008 23:18:47 +0000 (23:18 +0000)]
If loop header is also loop exiting block then OrigPN is incoming value for B loop header.
Fixes PR 2030.

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

16 years agoFix a warning about comparison between signed and unsigned,
Dan Gohman [Thu, 14 Feb 2008 22:38:45 +0000 (22:38 +0000)]
Fix a warning about comparison between signed and unsigned,
being consistent with the rest of the APInt implementation.

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

16 years agoFix PR2029
Chris Lattner [Thu, 14 Feb 2008 19:18:13 +0000 (19:18 +0000)]
Fix PR2029

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

16 years agoFix a miscompilation from Dan's recent apintification.
Chris Lattner [Thu, 14 Feb 2008 18:48:56 +0000 (18:48 +0000)]
Fix a miscompilation from Dan's recent apintification.

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

16 years agoFix single precision FP constants on SPU. They are actually legal,
Nate Begeman [Thu, 14 Feb 2008 18:43:04 +0000 (18:43 +0000)]
Fix single precision FP constants on SPU.  They are actually legal,
which allows us to kill a target-specific node.

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

16 years agoRename CFEBuildInstrs.html to GCCFEBuildInstrs.html.
Duncan Sands [Thu, 14 Feb 2008 17:53:22 +0000 (17:53 +0000)]
Rename CFEBuildInstrs.html to GCCFEBuildInstrs.html.
Update all references to it and place a redirection
page at the old address.

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

16 years agoIn TargetLowering::LowerCallTo, don't assert that
Duncan Sands [Thu, 14 Feb 2008 17:28:50 +0000 (17:28 +0000)]
In TargetLowering::LowerCallTo, don't assert that
the return value is zero-extended if it isn't
sign-extended.  It may also be any-extended.
Also, if a floating point value was returned
in a larger floating point type, pass 1 as the
second operand to FP_ROUND, which tells it
that all the precision is in the original type.
I think this is right but I could be wrong.
Finally, when doing libcalls, set isZExt on
a parameter if it is "unsigned".  Currently
isSExt is set when signed, and nothing is
set otherwise.  This should be right for all
calls to standard library routines.

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

16 years agoChange how FP immediates are handled.
Nate Begeman [Thu, 14 Feb 2008 08:57:00 +0000 (08:57 +0000)]
Change how FP immediates are handled.
1) ConstantFP is now expand by default
2) ConstantFP is not turned into TargetConstantFP during Legalize
   if it is legal.

This allows ConstantFP to be handled like Constant, allowing for
targets that can encode FP immediates as MachineOperands.

As a bonus, fix up Itanium FP constants, which now correctly match,
and match more constants!  Hooray.

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

16 years agoRemove llvm-upgrade
Tanya Lattner [Thu, 14 Feb 2008 07:57:12 +0000 (07:57 +0000)]
Remove llvm-upgrade

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

16 years agoSupport a new type of MachineOperand, MO_FPImmediate, used for holding
Nate Begeman [Thu, 14 Feb 2008 07:39:30 +0000 (07:39 +0000)]
Support a new type of MachineOperand, MO_FPImmediate, used for holding
FP Immediates, crazily enough

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

16 years agosimplify code, no functionality change.
Chris Lattner [Thu, 14 Feb 2008 07:39:01 +0000 (07:39 +0000)]
simplify code, no functionality change.

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

16 years agoMove some useful operands up into the all-targets .td
Nate Begeman [Thu, 14 Feb 2008 07:25:46 +0000 (07:25 +0000)]
Move some useful operands up into the all-targets .td

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

16 years agoNuke dead comment
Nate Begeman [Thu, 14 Feb 2008 07:23:11 +0000 (07:23 +0000)]
Nuke dead comment

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

16 years agoTestcase for PR2032.
Nick Lewycky [Thu, 14 Feb 2008 07:15:11 +0000 (07:15 +0000)]
Testcase for PR2032.

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

16 years agoFix PR2032. Inform the alias analysis of changes to the underlying program.
Nick Lewycky [Thu, 14 Feb 2008 07:11:24 +0000 (07:11 +0000)]
Fix PR2032. Inform the alias analysis of changes to the underlying program.

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

16 years agoRemove llvm-upgrade.
Tanya Lattner [Thu, 14 Feb 2008 06:56:27 +0000 (06:56 +0000)]
Remove llvm-upgrade.

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

16 years agoupgrade some entries, remove stuff that is done.
Chris Lattner [Thu, 14 Feb 2008 06:19:02 +0000 (06:19 +0000)]
upgrade some entries, remove stuff that is done.

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