llvm-6502/lib
Chris Lattner 0d7d99fd44 1. Refactored handling of integer immediate values for add, or, xor and sub.
New routine: ISel::SelectIntImmediateExpr
  2. Now checking use counts of large constants.  If use count is > 2 then drop
  thru so that the constant gets loaded into a register.
  Source:

int %test1(int %a) {
entry:
       %tmp.1 = add int %a,      123456789      ; <int> [#uses=1]
       %tmp.2 = or  int %tmp.1,  123456789      ; <int> [#uses=1]
       %tmp.3 = xor int %tmp.2,  123456789      ; <int> [#uses=1]
       %tmp.4 = sub int %tmp.3, -123456789      ; <int> [#uses=1]
       ret int %tmp.4
}

Did Emit:

       .machine ppc970


       .text
       .align  2
       .globl  _test1
_test1:
.LBB_test1_0:   ; entry
       addi r2, r3, -13035
       addis r2, r2, 1884
       ori r2, r2, 52501
       oris r2, r2, 1883
       xori r2, r2, 52501
       xoris r2, r2, 1883
       addi r2, r2, 52501
       addis r3, r2, 1883
       blr


Now Emits:

       .machine ppc970


       .text
       .align  2
       .globl  _test1
_test1:
.LBB_test1_0:   ; entry
       lis r2, 1883
       ori r2, r2, 52501
       add r3, r3, r2
       or r3, r3, r2
       xor r3, r3, r2
       add r3, r3, r2
       blr

Patch by Jim Laskey!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22749 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-10 16:34:52 +00:00
..
Analysis Fix an obvious oops 2005-08-10 00:59:40 +00:00
Archive Final Changes For PR495: 2005-07-08 03:08:58 +00:00
AsmParser Fix grammar 2005-06-24 18:00:40 +00:00
Bytecode Eliminate all remaining tabs and trailing spaces. 2005-07-27 06:12:32 +00:00
CodeGen Fix spelling, fix some broken canonicalizations by my last patch 2005-08-09 23:09:05 +00:00
Debugger For PR495: 2005-07-07 23:21:43 +00:00
ExecutionEngine one cannot allocate a global, until one is done initializing the global pointers 2005-08-01 17:35:40 +00:00
Linker For PR495: 2005-07-07 23:21:43 +00:00
Support Allow tools with "consume after" options (like lli) to take more positional 2005-08-08 21:57:27 +00:00
System Fix grammar: it's == "it is". 2005-08-02 16:04:59 +00:00
Target 1. Refactored handling of integer immediate values for add, or, xor and sub. 2005-08-10 16:34:52 +00:00
Transforms Make loop-simplify produce better loops by turning PHI nodes like X = phi [X, Y] 2005-08-10 02:07:32 +00:00
VMCore add new helper function 2005-08-08 05:21:50 +00:00
Makefile Add the Linker library 2004-11-14 21:54:41 +00:00