Commit Graph

157 Commits

Author SHA1 Message Date
Chris Lattner 889d934d00 move contents of PR587 to here.
llvm-svn: 33333
2007-01-18 07:34:57 +00:00
Chris Lattner 542dfd5510 Rewrite the branch selector to be correct in the face of large functions.
The algorithm it used before wasn't 100% correct, we now use an iterative
expansion model.  This fixes assembler errors when compiling 403.gcc with
tail merging enabled.

Change the way the branch selector works overall: Now, the isel generates
PPC::BCC instructions (as it used to) directly, and these BCC instructions
are emitted to the output or jitted directly if branches don't need
expansion.  Only if branches need expansion are instructions rewritten
and created.  This should make branch select faster, and eliminates the
Bxx instructions from the .td file.

llvm-svn: 31837
2006-11-18 00:32:03 +00:00
Chris Lattner cd436327f1 add note about ugly codegen with preinc
llvm-svn: 31617
2006-11-10 01:33:53 +00:00
Chris Lattner be7033b346 add a note from viterbi
llvm-svn: 31506
2006-11-07 18:30:21 +00:00
Chris Lattner 28174f5a3a this doesn't occur any more in mason
llvm-svn: 31236
2006-10-27 22:02:19 +00:00
Chris Lattner 4c0cc53da1 the code in question is now:
cmpw cr0, r7, r3
        ble cr0, LBB1_5 ;bb25
LBB1_8: ;bb17
        cmpw cr0, r8, r5
        bgt cr0, LBB1_2 ;bb

which is just as good as crnand.

llvm-svn: 31235
2006-10-27 22:00:55 +00:00
Chris Lattner be131662c3 add note
llvm-svn: 30937
2006-10-13 20:20:58 +00:00
Nate Begeman d31efd190f Fold AND and ROTL more often
llvm-svn: 30577
2006-09-22 05:01:56 +00:00
Chris Lattner fba9e8f422 item done
llvm-svn: 30518
2006-09-20 06:41:56 +00:00
Chris Lattner f62f090ea1 This is already done
llvm-svn: 30512
2006-09-20 04:59:33 +00:00
Chris Lattner aa3926b7ea Two improvements:
1. Codegen this comparison:
     if (X == 0x8000)

as:

        cmplwi cr0, r3, 32768
        bne cr0, LBB1_2 ;cond_next

instead of:

        lis r2, 0
        ori r2, r2, 32768
        cmpw cr0, r3, r2
        bne cr0, LBB1_2 ;cond_next


2. Codegen this comparison:
      if (X == 0x12345678)

as:

        xoris r2, r3, 4660
        cmplwi cr0, r2, 22136
        bne cr0, LBB1_2 ;cond_next

instead of:

        lis r2, 4660
        ori r2, r2, 22136
        cmpw cr0, r3, r2
        bne cr0, LBB1_2 ;cond_next

llvm-svn: 30509
2006-09-20 04:25:47 +00:00
Chris Lattner ab33d350a7 Add a note that we should match rlwnm better
llvm-svn: 30508
2006-09-20 03:59:25 +00:00
Chris Lattner 2aa98e0363 add a note
llvm-svn: 30377
2006-09-14 20:56:30 +00:00
Chris Lattner 950dffaed6 Add a note
llvm-svn: 29139
2006-07-14 04:07:29 +00:00
Chris Lattner a7976d329e Implement Regression/CodeGen/PowerPC/bswap-load-store.ll by folding bswaps
into i16/i32 load/stores.

llvm-svn: 29089
2006-07-10 20:56:58 +00:00
Chris Lattner 6353807fdc Add a note about a note
llvm-svn: 28355
2006-05-17 19:02:25 +00:00
Nate Begeman ce6646c366 Yet more readme updating
llvm-svn: 28172
2006-05-08 20:54:02 +00:00
Nate Begeman 68a45419cc New note about something bad happening in target independent optimizers
llvm-svn: 28170
2006-05-08 20:08:28 +00:00
Nate Begeman 0eb8f2e496 Proving once again that I am not as smart as the compiler
llvm-svn: 28169
2006-05-08 19:09:24 +00:00
Nate Begeman 9b6d4c2968 Fold more shifts into inserts, and update the README
llvm-svn: 28168
2006-05-08 17:38:32 +00:00
Nate Begeman dc996b3f6c Update some stuff now that the new rlwimi code has gone in
llvm-svn: 28162
2006-05-08 02:52:38 +00:00
Chris Lattner 304bbf3b1d New note, Nate, please check to see if I'm full of it :)
llvm-svn: 28118
2006-05-05 05:36:15 +00:00
Chris Lattner 5879efe0c8 add a note, move an altivec todo to the altivec list.
llvm-svn: 27654
2006-04-13 16:48:00 +00:00
Chris Lattner acf1fc8a28 add a note
llvm-svn: 27360
2006-04-02 07:20:00 +00:00
Chris Lattner 22ec3e7b7e Split out altivec notes into their own README
llvm-svn: 27168
2006-03-27 07:04:16 +00:00
Chris Lattner 5d70a7c4a5 #include Intrinsics.h into all dag isels
llvm-svn: 27109
2006-03-25 06:47:10 +00:00
Chris Lattner 9f9b6116e1 add another note
llvm-svn: 27077
2006-03-24 20:04:27 +00:00
Chris Lattner cbcfe46556 add a note
llvm-svn: 27000
2006-03-23 21:28:44 +00:00
Chris Lattner eccf46950c This has been implemented. Tweak it into another note
llvm-svn: 26944
2006-03-22 05:33:23 +00:00
Nate Begeman 013127981a Update readme
llvm-svn: 26924
2006-03-21 18:58:20 +00:00
Chris Lattner f194834161 minor note
llvm-svn: 26912
2006-03-21 00:47:09 +00:00
Chris Lattner 169e6238ad Add a note about the MUL -> FMADD vector bug.
llvm-svn: 26874
2006-03-19 22:08:08 +00:00
Chris Lattner ea6468758d notes
llvm-svn: 26856
2006-03-19 05:33:30 +00:00
Nate Begeman bb01d4f272 Remove BRTWOWAY*
Make the PPC backend not dependent on BRTWOWAY_CC and make the branch
selector smarter about the code it generates, fixing a case in the
readme.

llvm-svn: 26814
2006-03-17 01:40:33 +00:00
Nate Begeman fb0e36fa56 Notes on how to kill the eeevil brtwoway, and make ppc branch selector
more target independant, generate better code, and be less conservative.

llvm-svn: 26809
2006-03-16 22:37:48 +00:00
Chris Lattner 325bb46315 add a note
llvm-svn: 26807
2006-03-16 22:25:55 +00:00
Nate Begeman 32e73f9881 Another case we could do better on.
llvm-svn: 26795
2006-03-16 18:50:44 +00:00
Chris Lattner a8dd636192 add a note
llvm-svn: 26605
2006-03-08 00:25:47 +00:00
Chris Lattner 883cefc656 add a note
llvm-svn: 26585
2006-03-07 04:42:59 +00:00
Chris Lattner 3cb349a068 add a note
llvm-svn: 26448
2006-03-01 06:36:20 +00:00
Chris Lattner 27f5345b1f Compile this:
void foo(float a, int *b) { *b = a; }

to this:

_foo:
        fctiwz f0, f1
        stfiwx f0, 0, r4
        blr

instead of this:

_foo:
        fctiwz f0, f1
        stfd f0, -8(r1)
        lwz r2, -4(r1)
        stw r2, 0(r4)
        blr

This implements CodeGen/PowerPC/stfiwx.ll, and also incidentally does the
right thing for GCC bugzilla 26505.

llvm-svn: 26447
2006-03-01 05:50:56 +00:00
Chris Lattner f418435819 Use a target-specific dag-combine to implement CodeGen/PowerPC/fp-int-fp.ll.
llvm-svn: 26445
2006-03-01 04:57:39 +00:00
Chris Lattner 872810da6c remove implemented item
llvm-svn: 26418
2006-02-28 06:36:04 +00:00
Nate Begeman f918ed2e33 readme updates
llvm-svn: 26405
2006-02-27 22:08:36 +00:00
Chris Lattner b97142eec0 Move emails from nate into public places
llvm-svn: 26051
2006-02-08 06:43:51 +00:00
Chris Lattner c0e48c6c58 add a note
llvm-svn: 25984
2006-02-05 05:27:35 +00:00
Nate Begeman a1e895cf97 Remove some stuff that now works
llvm-svn: 25963
2006-02-04 07:29:35 +00:00
Chris Lattner 81e66abd1e add a note
llvm-svn: 25944
2006-02-03 22:06:45 +00:00
Chris Lattner a23b04acdb remove some target-indep and implemented notes
llvm-svn: 25930
2006-02-03 06:22:11 +00:00
Nate Begeman fc567d85d5 Flesh out a couple of the items in the README
llvm-svn: 25928
2006-02-03 05:17:06 +00:00
Chris Lattner f0a2d66d1c Add a note
llvm-svn: 25921
2006-02-03 01:49:49 +00:00
Chris Lattner 9b178ce225 update a note
llvm-svn: 25918
2006-02-02 23:50:22 +00:00
Chris Lattner 9dd7df7ee7 new example
llvm-svn: 25903
2006-02-02 07:37:11 +00:00
Nate Begeman cd018525f8 Update the README
llvm-svn: 25902
2006-02-02 07:27:56 +00:00
Chris Lattner a983beab37 add a note
llvm-svn: 25876
2006-02-01 17:54:23 +00:00
Nate Begeman 7e7f439f85 Fix some of the stuff in the PPC README file, and clean up legalization
of the SELECT_CC, BR_CC, and BRTWOWAY_CC nodes.

llvm-svn: 25875
2006-02-01 07:19:44 +00:00
Chris Lattner a0527473ac another testcase.
llvm-svn: 25862
2006-02-01 00:28:12 +00:00
Chris Lattner b0fe138b65 example nate pointed out
llvm-svn: 25841
2006-01-31 07:16:34 +00:00
Chris Lattner a9bfca8d1e add the 'lucas' optimization
llvm-svn: 25830
2006-01-31 02:55:28 +00:00
Chris Lattner 0c7b4666a3 add a note about how we should implement this FIXME from the legalizer:
// FIXME: revisit this when we have some kind of mechanism by which targets
    // can decided legality of vector constants, of which there may be very
    // many.

llvm-svn: 25733
2006-01-28 05:40:47 +00:00
Nate Begeman 6c82262289 Add a couple more things to the readme.
llvm-svn: 25724
2006-01-28 01:22:10 +00:00
Chris Lattner c3c27032d0 add a note
llvm-svn: 25439
2006-01-19 02:09:38 +00:00
Chris Lattner 7c76290038 add notes from my *other* email acct.
llvm-svn: 25362
2006-01-16 17:58:54 +00:00
Chris Lattner b2eacf48aa transfer some notes from my email to somewhere useful.
llvm-svn: 25361
2006-01-16 17:53:00 +00:00
Nate Begeman f2b38dbdc7 Remove some redundant stuff out of the readme.
llvm-svn: 25308
2006-01-14 01:24:22 +00:00
Nate Begeman 9aea6e4691 Fix one of the things in the todo file, and get a bit closer to folding
constant offsets from statics into the address arithmetic.

llvm-svn: 24999
2005-12-24 01:00:15 +00:00
Chris Lattner ffe3542726 move some random notes out of my email into someplace useful
llvm-svn: 24956
2005-12-22 17:19:28 +00:00
Chris Lattner 29e6c3dbf9 Add another important case we miss
llvm-svn: 24639
2005-12-08 07:13:28 +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 75fe59c4ea add a case Nate sent me
llvm-svn: 24195
2005-11-05 08:57:56 +00:00
Chris Lattner e507a15184 This is implemented
llvm-svn: 24107
2005-10-30 06:42:12 +00:00
Nate Begeman 00cea9b2e0 New case to handle someday
llvm-svn: 24075
2005-10-28 23:26:57 +00:00
Chris Lattner a0dfc67ae6 a bad case for bitfield insert
llvm-svn: 24051
2005-10-28 00:20:45 +00:00
Nate Begeman ff1796534f Add a note about some bitfield stuff we could be doing better.
llvm-svn: 23994
2005-10-25 23:50:02 +00:00
Chris Lattner 53b9c3ad4c add a case
llvm-svn: 23785
2005-10-18 06:30:51 +00:00
Nate Begeman 6cca84e43c More PPC32 -> PPC changes, as well as merging some classes that were
redundant after the change.

llvm-svn: 23759
2005-10-16 05:39:50 +00:00
Nate Begeman e9e2c6d314 Add note about future optimization noted in the ppc compiler writer's guide
llvm-svn: 23245
2005-09-06 15:30:48 +00:00
Chris Lattner 1e98a330f2 add an idea
llvm-svn: 23020
2005-08-24 18:15:24 +00:00
Chris Lattner 5e3953d761 add a note
llvm-svn: 22982
2005-08-23 06:27:59 +00:00
Nate Begeman 83f6b98c42 Make FP_TO_UINT Illegal. This allows us to generate significantly better
codegen for FP_TO_UINT by using the legalizer's SELECT variant.

Implement a codegen improvement for SELECT_CC, selecting the false node in
the MBB that feeds the phi node.  This allows us to codegen:
void foo(int *a, int b, int c) { int d = (a < b) ? 5 : 9; *a = d; }
as:
_foo:
        li r2, 5
        cmpw cr0, r4, r3
        bgt .LBB_foo_2  ; entry
.LBB_foo_1:     ; entry
        li r2, 9
.LBB_foo_2:     ; entry
        stw r2, 0(r3)
        blr

insted of:
_foo:
        li r2, 5
        li r5, 9
        cmpw cr0, r4, r3
        bgt .LBB_foo_2  ; entry
.LBB_foo_1:     ; entry
        or r2, r5, r5
.LBB_foo_2:     ; entry
        stw r2, 0(r3)
        blr

llvm-svn: 22784
2005-08-14 01:17:16 +00:00
Chris Lattner 54ee86aca7 add a optimization note
llvm-svn: 22732
2005-08-09 22:30:57 +00:00
Chris Lattner 11fc319b5d add a note
llvm-svn: 22681
2005-08-05 19:18:32 +00:00
Nate Begeman 8e2411334c Implement the optimization for the Red Zone on Darwin. This removes the
unnecessary SP manipulation in leaf routines that don't need it.

llvm-svn: 22522
2005-07-27 06:06:29 +00:00
Chris Lattner 1defb7fe80 add a note about the red zone
llvm-svn: 22518
2005-07-26 19:07:51 +00:00
Nate Begeman 7b8733571e Update the PPC readme
llvm-svn: 22516
2005-07-26 18:59:06 +00:00
Nate Begeman 08698cf644 Update PPC readme. Remove things that are done or aren't ppc specific
llvm-svn: 21232
2005-04-11 20:48:57 +00:00
Nate Begeman 0822032c95 Put int the getReg cast optimization from x86 so that we generate fewer
move instructions for the register allocator to coalesce.

llvm-svn: 17608
2004-11-08 02:25:40 +00:00
Nate Begeman 4c6e1d694c Update to-do list
llvm-svn: 17235
2004-10-26 04:10:53 +00:00
Nate Begeman 4bfceb1ed5 All PPC instructions are now auto-printed
32 and 64 bit AsmWriters unified
Darwin and AIX specific features of AsmWriter split out

llvm-svn: 16163
2004-09-04 05:00:00 +00:00
Nate Begeman 8cb6bd5f3c Improvements to int->float cast code for PPC-64
llvm-svn: 16105
2004-08-29 22:02:43 +00:00
Nate Begeman 4483df8b63 Implement the following missing functionality in the PPC backend:
cast fp->bool
cast ulong->fp
algebraic right shift long by non-constant value
These changes tested across most of the test suite.  Fixes Regression/casts

llvm-svn: 16081
2004-08-29 08:19:32 +00:00
Nate Begeman abf3c4d787 remove some things from the todo list.
llvm-svn: 15956
2004-08-20 18:46:54 +00:00
Nate Begeman ab6b08d937 Update the current state of the world
llvm-svn: 15809
2004-08-16 05:06:43 +00:00
Nate Begeman 78862c3717 Add future optimization opportunity
llvm-svn: 15760
2004-08-15 06:43:10 +00:00
Nate Begeman 412602d7d9 Replace PowerPCPEI.cpp with target independant PrologEpilogInserter
llvm-svn: 15746
2004-08-14 22:16:36 +00:00
Nate Begeman 63be70d8f2 Fix casts of float to unsigned long
Replace STDX (store 64 bit int indexed) with STFDX (store double indexed)
Fix latent bug in indexed load generation
Generate indexed loads and stores in many more cases

llvm-svn: 15626
2004-08-10 20:42:36 +00:00
Chris Lattner a8dcf2423e Changes commited for Nate Begeman:
Use a PowerPC specific prolog epilog inserter to control where spilled
callee save regs are placed on the stack.
Get rid of implicit return address stack slot, save return address reg
(LR) in appropriate slot
Improve code generated for functions that don't have calls or access
globals


Note from Chris: PowerPCPEI will eventually be eliminated, once the
functionality is merged into CodeGen/PrologEpilogInserter.cpp

llvm-svn: 15536
2004-08-06 06:58:50 +00:00
Misha Brukman 695d50d030 * Conditional save/restore of LR disabled as it's not quite correct
* sumarray2d fixed: large fixed-size alloca
* make is now compileable
* Re-organized tests to fit them under proper headings

Patch by Nate Begeman.

llvm-svn: 15347
2004-07-30 15:53:09 +00:00
Misha Brukman 7f01b2539b Add notes on bug involving casting ulong -> double, thanks to Nate Begeman.
llvm-svn: 15307
2004-07-28 19:16:10 +00:00
Misha Brukman bd1d7dceb7 Reorganize tests to place them in proper directories.
llvm-svn: 15298
2004-07-28 00:55:12 +00:00