Chris Lattner
3e9e8bd25c
Implement a refinement to the mem2reg algorithm for cases where an alloca
...
has a single def. In this case, look for uses that are dominated by the def
and attempt to rewrite them to directly use the stored value.
This speeds up mem2reg on these values and reduces the number of phi nodes
inserted. This should address PR665.
llvm-svn: 24411
2005-11-18 07:31:42 +00:00
Chris Lattner
31dc3827d3
This needs proper dominance
...
llvm-svn: 24410
2005-11-18 07:29:44 +00:00
Chris Lattner
b14c41378d
post-dom-frontiers requires proper post-dominance
...
llvm-svn: 24409
2005-11-18 07:28:26 +00:00
Chris Lattner
f519d1c6ef
This requires proper dominance
...
llvm-svn: 24408
2005-11-18 07:27:53 +00:00
Chris Lattner
9705c1b655
Fix the dominates method to return true if the two nodes are the same. Add
...
a new properlyDominates method to do what the old one did.
llvm-svn: 24407
2005-11-18 07:27:33 +00:00
Chris Lattner
57ce97862d
add more patterns, patch by Evan Cheng.
...
llvm-svn: 24406
2005-11-18 01:04:42 +00:00
Nate Begeman
227f1bdd2f
Also add the new vector value type here, for completeness.
...
llvm-svn: 24405
2005-11-18 00:53:32 +00:00
Nate Begeman
3c40f074ff
Teach the type lowering code about turning packed types into vector types.
...
Next step: generating vector dag nodes, and legalizing them into scalar
code.
llvm-svn: 24404
2005-11-17 21:44:42 +00:00
Chris Lattner
cdde9990b7
only use dyld stubs if not in ppc-static mode. This completes support for
...
non-static codegen.
llvm-svn: 24403
2005-11-17 19:40:30 +00:00
Chris Lattner
bca0be812d
This was checking the wrong GEP expression. Fixing this fixes a gccas crash
...
compiling mysql reported by Ted Kremenek.
llvm-svn: 24402
2005-11-17 19:35:42 +00:00
Chris Lattner
6ab87fa360
refactor call operand handling to eliminate special cases from printOp.
...
llvm-svn: 24401
2005-11-17 19:25:59 +00:00
Chris Lattner
bd9efdb64c
disentangle call operands from branch operands a bit
...
llvm-svn: 24400
2005-11-17 19:16:08 +00:00
Chris Lattner
3570cf456b
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.
llvm-svn: 24399
2005-11-17 18:55:48 +00:00
Chris Lattner
8f8ed28a64
Fix a bug that resistor on IRC hit where we tried to create token factor
...
nodes of load results, not of their chain results.
llvm-svn: 24398
2005-11-17 18:30:17 +00:00
Chris Lattner
5aba6ae3b3
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.
llvm-svn: 24397
2005-11-17 18:26:56 +00:00
Chris Lattner
0fe88e3f32
Teach the selector to fold lo(g) into load instruction immediate fields
...
llvm-svn: 24396
2005-11-17 18:02:16 +00:00
Chris Lattner
4b11fa284d
Generate LA and ADDIS when possible.
...
llvm-svn: 24395
2005-11-17 17:52:01 +00:00
Chris Lattner
3648c20472
Use the right accessor to create this node
...
llvm-svn: 24394
2005-11-17 17:51:38 +00:00
Chris Lattner
a70c7dff2e
Validate that the input to 'Pat' patterns is sane.
...
llvm-svn: 24393
2005-11-17 17:43:52 +00:00
Chris Lattner
fab12d00c9
Allow users to specify -Wl,-native* multiple times if they please
...
llvm-svn: 24392
2005-11-17 16:08:04 +00:00
Chris Lattner
2a230e1c1a
teach tblgen to be smart enough to handle tglobaladdr nodes
...
llvm-svn: 24391
2005-11-17 07:39:45 +00:00
Chris Lattner
595088aa0f
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.
llvm-svn: 24390
2005-11-17 07:30:41 +00:00
Chris Lattner
840458276c
Add globaladdress and targetglobaladdress nodes for dag patterns
...
llvm-svn: 24389
2005-11-17 07:20:15 +00:00
Chris Lattner
63ed749ce0
LI could theoretically be used for the lo-part of a global address, just like
...
lis can be used for the high part.
llvm-svn: 24388
2005-11-17 07:04:43 +00:00
Chris Lattner
45ca1c0194
Allow targets to custom legalize leaf nodes like GlobalAddress.
...
llvm-svn: 24387
2005-11-17 06:41:44 +00:00
Chris Lattner
b7025749e1
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.
llvm-svn: 24386
2005-11-17 05:56:14 +00:00
Chris Lattner
4ff65ec745
Teach legalize about targetglobaladdress
...
llvm-svn: 24385
2005-11-17 05:52:24 +00:00
Chris Lattner
2bf458af92
Add patterns for some 16-bit immediate instructions, patch contributed by
...
Evan Cheng.
llvm-svn: 24384
2005-11-17 02:01:55 +00:00
Chris Lattner
b22950df6c
fix a tblgen bug that Evan ran into, where we would lose the '$src' name
...
on patterns like "(set R32:$dst, (i32 imm:$src))"
llvm-svn: 24383
2005-11-16 23:14:54 +00:00
Chris Lattner
5930d3df3d
Add patterns for several simple instructions that take i32 immediates.
...
Patch contributed by Evan Cheng!
llvm-svn: 24382
2005-11-16 22:59:19 +00:00
Andrew Lenharth
59eefd4787
who would have thought you would want to write into globals too
...
llvm-svn: 24381
2005-11-16 21:15:53 +00:00
Chris Lattner
b1ded32f3b
This passes on ppc and x86 now
...
llvm-svn: 24378
2005-11-16 07:24:31 +00:00
Chris Lattner
f2b62f317c
when debugging lower dbg intrinsics to calls
...
llvm-svn: 24377
2005-11-16 07:22:30 +00:00
Chris Lattner
168fe79229
tell selectiondag when we're debugging
...
llvm-svn: 24376
2005-11-16 07:21:47 +00:00
Chris Lattner
672f1bac59
add a flag
...
llvm-svn: 24375
2005-11-16 07:21:15 +00:00
Chris Lattner
fdc8b19ad6
indicate when a tool is a debug build.
...
llvm-svn: 24374
2005-11-16 06:36:47 +00:00
Jeff Cohen
4ca13b3f47
Keep Visual Studio building.
...
llvm-svn: 24373
2005-11-16 06:10:53 +00:00
Chris Lattner
6b41edb30f
* 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.
llvm-svn: 24372
2005-11-16 06:09:47 +00:00
Chris Lattner
655e7dfd0d
initial step at adding a dag-to-dag isel for X86 backend. Patch contributed
...
by Evan Cheng!
llvm-svn: 24371
2005-11-16 01:54:32 +00:00
Nate Begeman
a171f6b20c
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.
llvm-svn: 24370
2005-11-16 00:48:01 +00:00
Jeff Cohen
67f6f97aed
Keep Visual Studio informed of new files.
...
llvm-svn: 24366
2005-11-15 16:11:55 +00:00
Chris Lattner
3ea1e255f7
remove these labels, there are now bigger jumps in the graph that are unlabeled
...
llvm-svn: 24365
2005-11-15 06:44:15 +00:00
Chris Lattner
e64d41def3
Fix some typos noticed by Gabor Greif!
...
llvm-svn: 24364
2005-11-15 06:07:55 +00:00
Chris Lattner
63985e2892
Make sure to use SwitchSection to switch sections so that we don't accidentally emit
...
functions into the .const section. Whoops.
llvm-svn: 24363
2005-11-15 01:45:01 +00:00
Chris Lattner
7c727b2736
Fix handling of multiple unnamed globals with the same type
...
llvm-svn: 24362
2005-11-15 01:32:03 +00:00
Chris Lattner
76ac068568
Separate X86ISelLowering stuff out from the X86ISelPattern.cpp file. Patch
...
contributed by Evan Cheng.
llvm-svn: 24358
2005-11-15 00:40:23 +00:00
Chris Lattner
bba9c372c1
Remove extraneous parents around constants when using a constant expr cast.
...
llvm-svn: 24357
2005-11-15 00:03:16 +00:00
Andrew Lenharth
b720e2c29f
this file moved
...
llvm-svn: 24356
2005-11-14 19:32:05 +00:00
Chris Lattner
1a4adc7aee
Handle globals with explicit alignment requests
...
llvm-svn: 24355
2005-11-14 19:00:30 +00:00
Chris Lattner
dd8eeed096
Teach emitAlignment to handle explicit alignment requests by globals.
...
llvm-svn: 24354
2005-11-14 19:00:06 +00:00