llvm-6502/lib/Transforms/Scalar
Chris Lattner 50af16a97b Simplify handling of shifts to be the same as we do for adds. Add support
for (X * C1) + (X * C2) (where * can be mul or shl), allowing us to fold:

   Y+Y+Y+Y+Y+Y+Y+Y

into
         %tmp.8 = shl long %Y, ubyte 3           ; <long> [#uses=1]

instead of

        %tmp.4 = shl long %Y, ubyte 2           ; <long> [#uses=1]
        %tmp.12 = shl long %Y, ubyte 2          ; <long> [#uses=1]
        %tmp.8 = add long %tmp.4, %tmp.12               ; <long> [#uses=1]

This implements add.ll:test25

Also add support for (X*C1)-(X*C2) -> X*(C1-C2), implementing sub.ll:test18


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17704 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-13 19:50:12 +00:00
..
ADCE.cpp Getting ADCE to interact well with unreachable instructions seems like a nontrivial 2004-10-17 23:45:06 +00:00
BasicBlockPlacement.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
ConstantProp.cpp Prototype these functions more accurately 2004-09-20 04:43:15 +00:00
CorrelatedExprs.cpp Prototype these functions more accurately 2004-09-20 04:43:15 +00:00
DCE.cpp Prototype these functions more accurately 2004-09-20 04:43:15 +00:00
DeadStoreElimination.cpp Prototype these functions more accurately 2004-09-20 04:43:15 +00:00
GCSE.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
IndVarSimplify.cpp Convert 'struct' to 'class' in various places to adhere to the coding standards 2004-10-27 16:14:51 +00:00
InstructionCombining.cpp Simplify handling of shifts to be the same as we do for adds. Add support 2004-11-13 19:50:12 +00:00
LICM.cpp Fix a bug in the previous checkin that broke 255.vortex 2004-09-15 02:34:40 +00:00
LoopStrengthReduce.cpp Initial implementation of the strength reduction for GEP instructions in 2004-10-18 21:08:22 +00:00
LoopUnroll.cpp Correction to allow compilation with Visual C++. 2004-10-18 14:38:48 +00:00
LoopUnswitch.cpp Fixes to make LLVM compile with vc7.1. 2004-09-03 18:19:51 +00:00
LowerConstantExprs.cpp Fix #includes of i*.h => Instructions.h as per PR403. 2004-07-29 17:05:13 +00:00
LowerGC.cpp Initialize with the correct constant type 2004-10-27 03:55:24 +00:00
LowerPacked.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
Makefile Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
PRE.cpp Fix compatibility with MSVC, patch by Morten Ofstad 2004-10-25 18:45:16 +00:00
Reassociate.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
ScalarReplAggregates.cpp Prototype these functions more accurately 2004-09-20 04:43:15 +00:00
SCCP.cpp Convert 'struct' to 'class' in various places to adhere to the coding standards 2004-10-27 16:14:51 +00:00
SimplifyCFG.cpp Hrm, some people complain when the compiler cheerfully tells them what it's 2004-10-19 06:33:16 +00:00
SymbolStripping.cpp Prototype these functions more accurately 2004-09-20 04:43:15 +00:00
TailDuplication.cpp Speed up the tail duplication pass on the testcase below from 68.2s to 1.23s: 2004-11-01 07:05:07 +00:00
TailRecursionElimination.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00