Commit Graph

21016 Commits

Author SHA1 Message Date
Chris Lattner
3aa2c74e19 Improve Selection DAG printer portability. Patch by Owen Anderson!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24425 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 07:44:09 +00:00
Chris Lattner
65303d6bd7 Teach tblgen about instruction operands that have multiple MachineInstr
operands, digging into them to find register values (used on X86).  Patch
by Evan Cheng!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24424 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 07:05:57 +00:00
Chris Lattner
6adaf79ad7 Teach the x86 backend about the register constraints of its addressing mode.
Patch by Evan Cheng


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24423 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 07:01:30 +00:00
Chris Lattner
be7a2ff2dd Capture more operand info, patch by Evan Cheng
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24422 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 07:00:10 +00:00
Chris Lattner
44fa764355 Teach the graph viewer to handle register operands that are zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24421 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 06:58:46 +00:00
Chris Lattner
b89175feff Silence a bogus warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24420 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 05:51:46 +00:00
Chris Lattner
f9ce9fb49b Add load and other support to the dag-dag isel. Patch contributed by Evan
Cheng!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24419 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 02:11:08 +00:00
Chris Lattner
0fb094fd60 Add some method variants, patch by Evan Cheng
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24418 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 01:44:53 +00:00
Chris Lattner
8f3366ad27 Add two new construction methods, patch by Evan Cheng
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24417 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 01:42:10 +00:00
Nate Begeman
5fbb5d2459 Teach LLVM how to scalarize packed types. Currently, this only works on
packed types with an element count of 1, although more generic support is
coming.  This allows LLVM to turn the following code:

void %foo(<1 x float> * %a) {
entry:
  %tmp1 = load <1 x float> * %a;
  %tmp2 = add <1 x float> %tmp1, %tmp1
  store <1 x float> %tmp2, <1 x float> *%a
  ret void
}

Into:

_foo:
        lfs f0, 0(r3)
        fadds f0, f0, f0
        stfs f0, 0(r3)
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24416 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-19 00:36:38 +00:00
Chris Lattner
06a4043872 testcase for recent indvars patches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24415 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 19:38:15 +00:00
Chris Lattner
1730078d5f Fix a crash building 176.gcc due to my recent patch, which only fixed
half the problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24414 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 18:30:47 +00:00
Andrew Lenharth
f27b6145af prevent latent switch creation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24413 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 13:57:03 +00:00
Nate Begeman
e21ea61588 Split out the shift code from visitBinary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24412 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 07:42:56 +00:00
Chris Lattner
36ba5006df 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24411 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 07:31:42 +00:00
Chris Lattner
fed40df846 This needs proper dominance
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24410 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 07:29:44 +00:00
Chris Lattner
4b5086cc71 post-dom-frontiers requires proper post-dominance
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24409 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 07:28:26 +00:00
Chris Lattner
a1fecc9c26 This requires proper dominance
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24408 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 07:27:53 +00:00
Chris Lattner
a35bef9db2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24407 91177308-0d34-0410-b5e6-96231b3b80d8
2005-11-18 07:27:33 +00:00
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