Commit Graph

20997 Commits

Author SHA1 Message Date
Chris Lattner
f124d5e500 add more patterns, patch by Evan Cheng.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24406 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 01:04:42 +00:00
Nate Begeman
69a2cf421b Also add the new vector value type here, for completeness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24405 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 00:53:32 +00:00
Nate Begeman
395cba8d41 Teach the type lowering code about turning packed types into vector types.
Next step: generating vector dag nodes, and legalizing them into scalar
code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24404 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 21:44:42 +00:00
Chris Lattner
9542f9714e only use dyld stubs if not in ppc-static mode. This completes support for
non-static codegen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24403 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 19:40:30 +00:00
Chris Lattner
ceda605fd7 This was checking the wrong GEP expression. Fixing this fixes a gccas crash
compiling mysql reported by Ted Kremenek.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24402 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 19:35:42 +00:00
Chris Lattner
9ba13e4aef refactor call operand handling to eliminate special cases from printOp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24401 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 19:25:59 +00:00
Chris Lattner
3e7f86a037 disentangle call operands from branch operands a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24400 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 19:16:08 +00:00
Chris Lattner
1d05cb47a9 add an option to generate completely non-pic code, corresponding to what
gcc -static produces on PPC.  This is used for building kexts and other things.

With this, materializing the address of a global looks like:

        lis r2, ha16(L_H$non_lazy_ptr)
        la r3, lo16(L_H$non_lazy_ptr)(r2)

we're still emitting stubs for functions, which is wrong.  That is next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24399 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 18:55:48 +00:00
Chris Lattner
1df747867c Fix a bug that resistor on IRC hit where we tried to create token factor
nodes of load results, not of their chain results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24398 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 18:30:17 +00:00
Chris Lattner
3eef4e377c Enable global address legalization, fixing a todo and allowing the removal
of some code.  This exposes the implicit load from the stubs to the DAG, allowing
them to be optimized by the dag combiner.  It also moves darwin specific stuff
out of the isel into the legalizer, and allows more to be moved to the .td file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24397 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 18:26:56 +00:00
Chris Lattner
4f0f86de5f Teach the selector to fold lo(g) into load instruction immediate fields
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24396 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 18:02:16 +00:00
Chris Lattner
490ad08097 Generate LA and ADDIS when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24395 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 17:52:01 +00:00
Chris Lattner
1566613ca4 Use the right accessor to create this node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24394 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 17:51:38 +00:00
Chris Lattner
09c033962b Validate that the input to 'Pat' patterns is sane.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24393 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 17:43:52 +00:00
Chris Lattner
cb8346563b Allow users to specify -Wl,-native* multiple times if they please
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24392 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 16:08:04 +00:00
Chris Lattner
b120a64e13 teach tblgen to be smart enough to handle tglobaladdr nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24391 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 07:39:45 +00:00
Chris Lattner
860e8862c1 Add an initial hack at legalizing GlobalAddress into the appropriate nodes
on Darwin to remove smarts from the isel.  This is currently disabled by
default (uncomment setOperationAction(ISD::GlobalAddress to enable it).
tblgen needs to become smarter about tglobaladdr nodes and bigger patterns
needed to be added to the .td file.  However, we can currently emit stuff like
this:  :)

        li r2, lo16(L_x$non_lazy_ptr)
        lis r3, ha16(L_x$non_lazy_ptr)
        lwzx r2, r3, r2

The obvious improvements will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24390 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 07:30:41 +00:00
Chris Lattner
db40dc2d63 Add globaladdress and targetglobaladdress nodes for dag patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24389 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 07:20:15 +00:00
Chris Lattner
bae5b3c1c6 LI could theoretically be used for the lo-part of a global address, just like
lis can be used for the high part.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24388 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 07:04:43 +00:00
Chris Lattner
0c8fbe33a4 Allow targets to custom legalize leaf nodes like GlobalAddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24387 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 06:41:44 +00:00
Chris Lattner
2823b3e70e When lowering direct calls, lower them to use a targetglobaladress directly
instead of a globaladdress.  This has no effect on the generated code at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24386 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 05:56:14 +00:00
Chris Lattner
b9debbf54c Teach legalize about targetglobaladdress
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24385 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 05:52:24 +00:00
Chris Lattner
78432feff8 Add patterns for some 16-bit immediate instructions, patch contributed by
Evan Cheng.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24384 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-17 02:01:55 +00:00
Chris Lattner
12cf9090a4 fix a tblgen bug that Evan ran into, where we would lose the '$src' name
on patterns like "(set R32:$dst, (i32 imm:$src))"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24383 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 23:14:54 +00:00
Chris Lattner
7a12537843 Add patterns for several simple instructions that take i32 immediates.
Patch contributed by Evan Cheng!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24382 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 22:59:19 +00:00
Andrew Lenharth
81b5a3c387 who would have thought you would want to write into globals too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24381 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 21:15:53 +00:00
Chris Lattner
c8746d7f84 This passes on ppc and x86 now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24378 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 07:24:31 +00:00
Chris Lattner
b1a5a5c4c0 when debugging lower dbg intrinsics to calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24377 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 07:22:30 +00:00
Chris Lattner
b081ccbf56 tell selectiondag when we're debugging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24376 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 07:21:47 +00:00
Chris Lattner
b13b3801fc add a flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24375 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 07:21:15 +00:00
Chris Lattner
d5bd52ca48 indicate when a tool is a debug build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24374 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 06:36:47 +00:00
Jeff Cohen
a560fb6a39 Keep Visual Studio building.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24373 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 06:10:53 +00:00
Chris Lattner
3787c95e86 * Fix DerivedType::dropAllTypeUses to not change the number of types in a
type when it gets refined.  This allows us to hash on this crucial value.
* Fix several issues in TypeMap::RefineAbstractType that prevent it from
  handling hash values that change correctly.
* Define hashTypeStructure to not always return 0.  :)

This last part (which depends on the first two) speeds up gccld time on eon
from 3.78s to 2.75s with a release build (a 28% speedup!).  This resolves
PR474.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24372 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 06:09:47 +00:00
Chris Lattner
c961eea6cb initial step at adding a dag-to-dag isel for X86 backend. Patch contributed
by Evan Cheng!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24371 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 01:54:32 +00:00
Nate Begeman
422b0cee7a Patch to clean up function call pseudos and support the BLA instruction,
which branches to an absolute address.  This is required to support objc
direct dispatch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24370 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-16 00:48:01 +00:00
Jeff Cohen
427189ad51 Keep Visual Studio informed of new files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24366 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-15 16:11:55 +00:00
Chris Lattner
811da6d889 remove these labels, there are now bigger jumps in the graph that are unlabeled
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24365 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-15 06:44:15 +00:00
Chris Lattner
d07c3f4279 Fix some typos noticed by Gabor Greif!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24364 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-15 06:07:55 +00:00
Chris Lattner
2c3d3d2a59 Make sure to use SwitchSection to switch sections so that we don't accidentally emit
functions into the .const section.  Whoops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24363 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-15 01:45:01 +00:00
Chris Lattner
d358cfc1bf Fix handling of multiple unnamed globals with the same type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24362 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-15 01:32:03 +00:00
Chris Lattner
dbdbf0ce2e Separate X86ISelLowering stuff out from the X86ISelPattern.cpp file. Patch
contributed by Evan Cheng.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24358 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-15 00:40:23 +00:00
Chris Lattner
27ecef510f Remove extraneous parents around constants when using a constant expr cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24357 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-15 00:03:16 +00:00
Andrew Lenharth
94f3d1af5f this file moved
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24356 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 19:32:05 +00:00
Chris Lattner
ced704ba60 Handle globals with explicit alignment requests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24355 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 19:00:30 +00:00
Chris Lattner
a1ab72daad Teach emitAlignment to handle explicit alignment requests by globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24354 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 19:00:06 +00:00
Chris Lattner
ac7fd7fcc6 Teach the PPC asmwriter to honor globals with explicit section requests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24353 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 18:52:46 +00:00
Chris Lattner
c590e9afc9 instead of using mstats, use malloc_zone_statistics which returns numbers
that actually make sense.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24352 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 07:27:56 +00:00
Chris Lattner
511f11dccb regenearte
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24351 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 07:25:50 +00:00
Chris Lattner
368c36ff32 add malloc_zone_statistics, remove mstats
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24350 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 07:24:17 +00:00
Chris Lattner
513a9547f5 Teach -track-memory to work on darwin. Looking at sbrk doesn't work because
the default allocator uses mmap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24349 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-14 07:00:29 +00:00