Commit Graph

36924 Commits

Author SHA1 Message Date
Evan Cheng 6200c225e0 - 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.

llvm-svn: 47290
2008-02-18 23:04:32 +00:00
Nick Lewycky fefd0202c9 Correctly fold divide-by-constant, even when faced with overflow.
llvm-svn: 47287
2008-02-18 22:48:05 +00:00
Dan Gohman c589243107 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.

llvm-svn: 47282
2008-02-18 19:34:53 +00:00
Evan Cheng b2e4b7adde - 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).

llvm-svn: 47281
2008-02-18 18:56:31 +00:00
Chris Lattner 6bb6a55f01 upgrade some tests.
llvm-svn: 47280
2008-02-18 18:46:39 +00:00
Nate Begeman 0fddc34485 Add a note
llvm-svn: 47279
2008-02-18 18:39:23 +00:00
Chris Lattner a827205670 Add a note about sext from i1 plus flags use.
llvm-svn: 47278
2008-02-18 18:30:13 +00:00
Dan Gohman a589ee11bb 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.

llvm-svn: 47277
2008-02-18 17:55:26 +00:00
Chris Lattner 1e3c501cb8 Transforming -A + -B --> -(A + B) isn't safe for FP, thanks
to Dale for noticing this!

llvm-svn: 47276
2008-02-18 17:50:16 +00:00
Chris Lattner 0af5601028 minor code simplification, no functionality change.
llvm-svn: 47275
2008-02-18 17:47:29 +00:00
Chris Lattner 23fe6630e3 make this just a bit more strict.
llvm-svn: 47274
2008-02-18 17:33:10 +00:00
Duncan Sands 85fab3a3ad Simplify caller updating using a CallSite, as
requested by Chris.  While there, do the same
for an existing function committed by someone
called "lattner" :)

llvm-svn: 47273
2008-02-18 17:32:13 +00:00
Chris Lattner 8ed77c41d8 don't bother calling getUnderlyingObject for non-pointers.
llvm-svn: 47272
2008-02-18 17:28:21 +00:00
Dan Gohman 02d2bc8d3e Fix a missing space in the description of the find-bugs option.
llvm-svn: 47271
2008-02-18 17:15:45 +00:00
Owen Anderson cc01ebbac6 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.

llvm-svn: 47268
2008-02-18 10:11:00 +00:00
Roman Levenstein 0b2c8858df New helper function getMBBFromIndex() that given an index in any instruction of an MBB returns a pointer the MBB. Reviewed by Evan.
llvm-svn: 47267
2008-02-18 09:35:30 +00:00
Owen Anderson 3549553262 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.

llvm-svn: 47265
2008-02-18 09:24:53 +00:00
Owen Anderson a54570d2d2 I got the predicate backwards in my last patch. The comment is correct, the code was not.
llvm-svn: 47264
2008-02-18 09:22:21 +00:00
Owen Anderson bdf7ed9495 This check is not correct for mallocs, so exclude them earlier.
llvm-svn: 47263
2008-02-18 09:11:02 +00:00
Evan Cheng 8f90724a53 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.
llvm-svn: 47262
2008-02-18 08:40:53 +00:00
Chris Lattner 6b39cb907b switch simplifycfg from using vectors for most things to smallvectors,
this speeds it up 2.3% on eon.

llvm-svn: 47261
2008-02-18 07:42:56 +00:00
Chris Lattner 024f8c8f09 optimize away stackrestore calls that have no intervening alloca or call.
llvm-svn: 47258
2008-02-18 06:12:38 +00:00
Chris Lattner c8ec470b52 upgrade this test.
llvm-svn: 47257
2008-02-18 06:11:00 +00:00
Duncan Sands fa4b673eac Clarify that 'sret' only applies to pointers, and
only applies to the first parameter.

llvm-svn: 47256
2008-02-18 04:19:38 +00:00
Owen Anderson 6110128ed5 Make the definition of the noalias attribute clearer.
llvm-svn: 47255
2008-02-18 04:09:01 +00:00
Owen Anderson c66655e14c Duncan pointed out that we can fast fail here, because the sret parameter of
a function must be the first parameter.

llvm-svn: 47254
2008-02-18 04:06:26 +00:00
Owen Anderson 57a98b7f4b Fix a comment, and a bug where we weren't applying the tail call logic in cases that failed the first test.
llvm-svn: 47253
2008-02-18 03:52:21 +00:00
Owen Anderson fa2ba5352f Fix bugs that Chris noticed in my last patch.
llvm-svn: 47252
2008-02-18 02:31:23 +00:00
Chris Lattner 0e7fd2f1a8 simplify some code, BreakUpSubtract always returns nonnull now.
llvm-svn: 47251
2008-02-18 02:18:25 +00:00
Chris Lattner 8432cc662f 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.

llvm-svn: 47250
2008-02-18 02:11:28 +00:00
Owen Anderson e41efc7a6d Add support for setting parameters to CallSite.
llvm-svn: 47249
2008-02-18 00:10:55 +00:00
Owen Anderson c64dfb4317 Add a predicate to Argument to check for the StructRet attribute.
llvm-svn: 47248
2008-02-17 23:22:28 +00:00
Owen Anderson 2e3edf193a 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.

llvm-svn: 47247
2008-02-17 21:29:08 +00:00
Chris Lattner cc22601bc3 Fold (-x + -y) -> -(x+y) which promotes better association, fixing
the second half of PR2047

llvm-svn: 47244
2008-02-17 21:03:36 +00:00
Chris Lattner 5f08ec854f fix pasto
llvm-svn: 47242
2008-02-17 20:54:40 +00:00
Chris Lattner a70d138457 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 

llvm-svn: 47241
2008-02-17 20:51:26 +00:00
Chris Lattner 2de8c2d41f upgrade and simplify this test.
llvm-svn: 47240
2008-02-17 20:48:43 +00:00
Chris Lattner 902537cd8d make the logic for breaking up subtracts more explicit, no
functionality change.

llvm-svn: 47239
2008-02-17 20:44:51 +00:00
Tanya Lattner f697c03883 Remove llvm-upgrade.
llvm-svn: 47238
2008-02-17 20:02:20 +00:00
Chris Lattner 1f6520842c move PR2053 to here.
llvm-svn: 47237
2008-02-17 19:43:57 +00:00
Chris Lattner aec0914c80 fix this test.
llvm-svn: 47232
2008-02-17 00:15:25 +00:00
Tanya Lattner 087ed9fcad Remove llvm-upgrade
llvm-svn: 47231
2008-02-17 00:15:09 +00:00
Tanya Lattner c36fefedf5 Remove llvm-upgrade.
llvm-svn: 47230
2008-02-17 00:13:09 +00:00
Chris Lattner 8a67d349fe this test isn't useful since we added @ notation for globals.
llvm-svn: 47229
2008-02-17 00:12:03 +00:00
Chris Lattner 0d43732cd0 this line was commented out.
llvm-svn: 47228
2008-02-17 00:09:08 +00:00
Tanya Lattner 47f0a20f8f Remove llvm-upgrade and update tests.
llvm-svn: 47227
2008-02-16 23:55:46 +00:00
Tanya Lattner 231fe4746b Removing llvm upgrade, so remove tests specific to llvm-upgrade and update the tests that used it.
llvm-svn: 47225
2008-02-16 23:27:24 +00:00
Duncan Sands 573b3f89e4 Remove any 'nest' parameter attributes if the function
is not passed as an argument to a trampoline intrinsic.

llvm-svn: 47220
2008-02-16 20:56:04 +00:00
Duncan Sands 2efbc7f9e8 Some micro-optimizations.
llvm-svn: 47219
2008-02-16 20:53:06 +00:00
Andrew Lenharth fedcf477b5 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.
llvm-svn: 47213
2008-02-16 14:46:26 +00:00