Commit Graph

18281 Commits

Author SHA1 Message Date
Chris Lattner
57226fbc7b Convert over DForm and DSForm instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21348 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 04:59:28 +00:00
Chris Lattner
e19d0b1130 Convert XLForm and XForm instructions over to use PPC64 when appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21347 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 04:51:30 +00:00
Chris Lattner
5035cef732 Convert XO XS and XFX forms to use isPPC64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21346 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 04:40:07 +00:00
Chris Lattner
0bdc6f1fd4 Turn PPC64 and VMX into classes that can be added to instructions instead of
bits that must be passed up the inheritance hierarchy.  Convert MForm and AForm
instructions over


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21345 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 04:32:54 +00:00
Chris Lattner
7dda395004 Major change to tblgen: instead of resolving values every time a class is
finished up, only resolve fully when the def is defined.  This allows things
to be changed and all uses to be propagated through.  This implements
TableGen/LazyChange.td and fixes TemplateArgRename.td in the process.

None of the .td files used in LLVM backends are changed at all by this
patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21344 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 03:36:21 +00:00
Chris Lattner
6b43c82378 New testcase for a changing values late and allowing them to propagate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21343 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 03:34:58 +00:00
Chris Lattner
93fc714b1d Make this significantly harder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21342 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 02:58:57 +00:00
Chris Lattner
c6f4fab8e0 Add a real run line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21341 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 02:53:26 +00:00
Chris Lattner
913418a80c fix this testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21340 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 02:52:04 +00:00
Chris Lattner
ac9196093e new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21339 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 02:26:23 +00:00
Chris Lattner
8287bbbb79 add a run line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21338 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 01:37:24 +00:00
Chris Lattner
2347f28cf5 Tell dj to run the tests in this directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21337 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 01:36:41 +00:00
Chris Lattner
577057faaa implementing shifting of literal integers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21336 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 01:17:35 +00:00
Chris Lattner
b9266f880a Add initial lexer and parser support for shifting values. Every use of this
will lead to it being rejected though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21335 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-19 01:11:03 +00:00
Nate Begeman
1cbf3abbb8 Next round of PPC CR optimizations. For the following code:
int %bar(float %a, float %b, float %c, float %d) {
entry:
    %tmp.1 = setlt float %a, %d
    %tmp.2 = setlt float %b, %d
    %or = or bool %tmp.1, %tmp.2
    %tmp.3 = setgt float %c, %d
    %tmp.4 = or bool %or, %tmp.3
    %tmp.5 = and bool %tmp.4, true
    %retval = cast bool %tmp.5 to int
    ret int %retval
}

We now emit:

_bar:
.LBB_bar_0:     ; entry
        fcmpu cr0, f1, f4
        fcmpu cr1, f2, f4
        cror 0, 0, 4
        fcmpu cr1, f3, f4
        cror 28, 0, 5
        mfcr r2
        rlwinm r3, r2, 29, 31, 31
        blr

Instead of:

_bar:
.LBB_bar_0:     ; entry
        fcmpu cr7, f1, f4
        mfcr r2
        rlwinm r2, r2, 29, 31, 31
        fcmpu cr7, f2, f4
        mfcr r3
        rlwinm r3, r3, 29, 31, 31
        or r2, r2, r3
        fcmpu cr7, f3, f4
        mfcr r3
        rlwinm r3, r3, 30, 31, 31
        or r3, r2, r3
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21321 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-18 07:48:09 +00:00
Chris Lattner
ea96b5edbb silence a bogus warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21320 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-18 05:26:21 +00:00
Chris Lattner
fda2b55e1b Fold setcc of MVT::i1 operands into logical operations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21319 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-18 04:48:12 +00:00
Chris Lattner
4a44c8df19 Another minor simplification: handle setcc (zero_extend x), c -> setcc(x, c')
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21318 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-18 04:30:45 +00:00
Chris Lattner
7467c9b086 Another simple xform
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21317 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-18 04:11:19 +00:00
Chris Lattner
706aa9685a Fold:
// (X != 0) | (Y != 0) -> (X|Y != 0)
        // (X == 0) & (Y == 0) -> (X|Y == 0)

Compiling this:

int %bar(int %a, int %b) {
        entry:
        %tmp.1 = setne int %a, 0
        %tmp.2 = setne int %b, 0
        %tmp.3 = or bool %tmp.1, %tmp.2
        %retval = cast bool %tmp.3 to int
        ret int %retval
        }

to this:

_bar:
        or r2, r3, r4
        addic r3, r2, -1
        subfe r3, r3, r2
        blr

instead of:

_bar:
        addic r2, r3, -1
        subfe r2, r2, r3
        addic r3, r4, -1
        subfe r3, r3, r4
        or r3, r2, r3
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21316 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-18 03:59:53 +00:00
Chris Lattner
36019aa5c6 Make the AND elimination operation recursive and significantly more powerful,
eliminating an and for Nate's testcase:

int %bar(int %a, int %b) {
        entry:
        %tmp.1 = setne int %a, 0
        %tmp.2 = setne int %b, 0
        %tmp.3 = or bool %tmp.1, %tmp.2
        %retval = cast bool %tmp.3 to int
        ret int %retval
        }

generating:

_bar:
        addic r2, r3, -1
        subfe r2, r2, r3
        addic r3, r4, -1
        subfe r3, r3, r4
        or r3, r2, r3
        blr

instead of:

_bar:
        addic r2, r3, -1
        subfe r2, r2, r3
        addic r3, r4, -1
        subfe r3, r3, r4
        or r2, r2, r3
        rlwinm r3, r2, 0, 31, 31
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21315 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-18 03:48:41 +00:00
Nate Begeman
16ac709c63 Change codegen for setcc to read the bit directly out of the condition
register.  Added support in the .td file for the g5-specific variant
  of cr -> gpr moves that executes faster, but we currently don't
  generate it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21314 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-18 02:43:24 +00:00
Chris Lattner
d91ff7cd3b Add support for targets that require stubs for external functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21313 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-18 01:44:27 +00:00
Chris Lattner
477d1de9b2 Handle ExternalSymbol operands in the PPC JIT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21312 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-18 00:46:10 +00:00
Nate Begeman
9acc366ae4 Update dejagnu tests to use the new pattern isel flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21311 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-16 04:25:48 +00:00
Jeff Cohen
65a373593c Add CondPropagate.cpp to VC++ Transforms project
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21310 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-16 02:51:44 +00:00
Nate Begeman
f8b02949e3 Make pattern isel default for ppc
Add new ppc beta option related to using condition registers
Make pattern isel control flag (-enable-pattern-isel) global and tristate
  0 == off
  1 == on
  2 == target default


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21309 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-15 22:12:16 +00:00
Chris Lattner
da3f296854 new pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21307 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-15 21:13:16 +00:00
Chris Lattner
36d12733bb a new simple pass, which will be extended to be more useful in the future.
This pass forward branches through conditions when it can show that the
conditions is either always true or false for a predecessor.  This currently
only handles the most simple cases of this, but is successful at threading
across 2489 branches and 65 switch instructions in 176.gcc, which isn't bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21306 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-15 19:28:32 +00:00
Chris Lattner
73459d097b add a new prototype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21305 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-15 19:24:49 +00:00
Chris Lattner
ec656f57f4 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21304 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-15 19:24:36 +00:00
Andrew Lenharth
1e0d9bda62 fix calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21303 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-14 17:34:20 +00:00
Andrew Lenharth
3ae1829fe5 a 21264 fix, and fix the operator precidence on an and -> zap check (should fix hundreds of test cases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21302 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-14 16:24:00 +00:00
Andrew Lenharth
80563ff1a5 added a random and mask test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21301 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-14 16:17:49 +00:00
Duraid Madina
1ce0c015ad print negative 64 bit immediates as negative numbers, makes things a little
easier on the eyes, not that numbers like 18446744073709541376 are bad or
anything


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21300 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-14 10:08:01 +00:00
Duraid Madina
3eb7150c3e oops, this stopped us turning movl r4=0xFFFFFFFF;; and rX, r4 into zxt4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21299 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-14 10:06:35 +00:00
Nate Begeman
7bfba7d5e3 Implement multi-way branches through logical ops on condition registers.
This can generate considerably shorter code, reducing the size of crafty
by almost 1%.  Also fix the printing of mcrf.  The code is currently
disabled until it gets a bit more testing, but should work as-is.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21298 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-14 09:45:08 +00:00
Nate Begeman
72ea281d61 Add a couple missing transforms in getSetCC that were triggering assertions
in the PPC Pattern ISel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21297 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-14 08:56:52 +00:00
Duraid Madina
c4ccc2db6b we have zextloads, not sextloads!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21296 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-14 08:37:32 +00:00
Nate Begeman
ef7288c824 Add the necessary support to codegen condition register logical ops with
register allocated condition registers.  Make sure that the printed
  output is gas compatible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21295 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-14 03:20:38 +00:00
Nate Begeman
1b7f7fbf95 Start allocating condition registers. Almost all explicit uses of CR0 are
now gone.  Next step is to get rid of the remaining ones and then start
allocating bools to CRs where appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21294 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-13 23:15:44 +00:00
Nate Begeman
3664ceffdd Implement the fold shift X, zext(Y) -> shift X, Y at the target level,
where it is safe to do so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21293 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-13 22:14:14 +00:00
Nate Begeman
77a6d9032f Add CodeGen tests for the recent SelectionDAG transforms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21292 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-13 21:45:13 +00:00
Nate Begeman
eea805e74c Disbale the broken fold of shift + sz[ext] for now
Move the transform for select (a < 0) ? b : 0 into the dag from ppc isel
Enable the dag to fold and (setcc, 1) -> setcc for targets where setcc
  always produces zero or one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21291 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-13 21:23:31 +00:00
Chris Lattner
97e001dec7 fix an infinite loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21289 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-13 20:06:29 +00:00
Chris Lattner
fd8d389ede fix some serious miscompiles on ia64, alpha, and ppc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21288 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-13 19:53:40 +00:00
Chris Lattner
51679c430f avoid work when possible, perhaps fix the problem nate and andrew are seeing
with != 0 comparisons vanishing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21287 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-13 19:41:05 +00:00
Andrew Lenharth
c24b537399 WOW, function calls still seem to work after this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21286 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-13 17:17:28 +00:00
Andrew Lenharth
556c44e116 prepare for func call optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21285 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-13 16:19:50 +00:00
Andrew Lenharth
eecbf30e9c regression case for faster call sequence
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21284 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-13 16:16:01 +00:00