llvm-6502/lib/Target
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
..
Alpha Update the targets to the new SETCC/CondCodeSDNode interfaces. 2005-08-09 20:21:10 +00:00
CBackend Fixed PR#596: 2005-07-14 19:41:16 +00:00
IA64 sorry!! this is temporary; for some reason the nasty constmul code seems to 2005-08-10 12:38:57 +00:00
PowerPC 1. Refactored handling of integer immediate values for add, or, xor and sub. 2005-08-10 16:34:52 +00:00
Skeleton Refactor the addPassesToEmitAssembly interface into a addPassesToEmitFile 2005-06-25 02:48:37 +00:00
Sparc Eliminate all remaining tabs and trailing spaces. 2005-07-27 06:12:32 +00:00
SparcV8 Eliminate all remaining tabs and trailing spaces. 2005-07-27 06:12:32 +00:00
SparcV9 Update to use the new MathExtras.h support for log2 computation. 2005-08-02 19:26:06 +00:00
X86 Update the targets to the new SETCC/CondCodeSDNode interfaces. 2005-08-09 20:21:10 +00:00
Makefile Implement the --enable-targets= feature of the configure script. The make 2005-04-22 17:20:11 +00:00
MRegisterInfo.cpp Convert tabs to spaces 2005-04-22 17:54:37 +00:00
Target.td Add some bits that can be set for instructions. 2005-01-02 02:27:48 +00:00
TargetData.cpp Update to use the new MathExtras.h support for log2 computation. 2005-08-02 19:26:06 +00:00
TargetFrameInfo.cpp Eliminate all remaining tabs and trailing spaces. 2005-07-27 06:12:32 +00:00
TargetInstrInfo.cpp Convert tabs to spaces 2005-04-22 17:54:37 +00:00
TargetMachine.cpp First round of support for doing scalar FP using the SSE2 ISA extension and 2005-07-06 18:59:04 +00:00
TargetMachineRegistry.cpp Remove trailing whitespace 2005-04-21 22:55:34 +00:00
TargetSchedInfo.cpp Convert tabs to spaces 2005-04-22 17:54:37 +00:00
TargetSubtarget.cpp Eliminate all remaining tabs and trailing spaces. 2005-07-27 06:12:32 +00:00