llvm-6502/lib/Transforms/Scalar
Chris Lattner 24c8e38455 Allow folding several instructions into casts, which can simplify a lot
of codes.  For example,
short kernel (short t1) {
  t1 >>= 8; t1 <<= 8;
  return t1;
}

became:

short %kernel(short %t1.1) {
        %tmp.3 = shr short %t1.1, ubyte 8               ; <short> [#uses=1]
        %tmp.5 = cast short %tmp.3 to int               ; <int> [#uses=1]
        %tmp.7 = shl int %tmp.5, ubyte 8                ; <int> [#uses=1]
        %tmp.8 = cast int %tmp.7 to short               ; <short> [#uses=1]
        ret short %tmp.8
}

before, now it becomes:
short %kernel(short %t1.1) {
        %tmp.3 = shr short %t1.1, ubyte 8               ; <short> [#uses=1]
        %tmp.8 = shl short %tmp.3, ubyte 8              ; <short> [#uses=1]
        ret short %tmp.8
}

which will become:
short %kernel(short %t1.1) {
        %tmp.3 = and short %t1.1, 0xFF00
        ret short %tmp.3
}

This implements cast-set.ll:test4 and test5


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7290 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:35:25 +00:00
..
ADCE.cpp Fix bug: ADCE/2003-06-24-BadSuccessor.ll 2003-06-24 23:02:45 +00:00
ConstantProp.cpp Hopefully, the final fix for `[Pp]ropogate'. 2003-05-20 21:01:22 +00:00
CorrelatedExprs.cpp Hopefully, the final fix for `[Pp]ropogate'. 2003-05-20 21:01:22 +00:00
DCE.cpp - Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to 2002-10-21 20:00:28 +00:00
DecomposeMultiDimRefs.cpp Remove unnecesary &*'s 2003-04-23 16:37:45 +00:00
GCSE.cpp Don't corrupt memory when removing an instruction from the program, but 2003-06-17 03:57:18 +00:00
IndVarSimplify.cpp Remove unnecesary &*'s 2003-04-23 16:37:45 +00:00
InstructionCombining.cpp Allow folding several instructions into casts, which can simplify a lot 2003-07-24 17:35:25 +00:00
LICM.cpp Remove unnecesary &*'s 2003-04-23 16:37:45 +00:00
Makefile *** empty log message *** 2002-07-23 17:52:38 +00:00
PiNodeInsertion.cpp - Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to 2002-10-21 20:00:28 +00:00
PRE.cpp Add comment 2003-05-29 20:26:30 +00:00
Reassociate.cpp Fix spelling 2003-05-02 19:26:34 +00:00
ScalarReplAggregates.cpp Simplify code by using ConstantInt::getRawValue instead of checking to see 2003-07-23 15:22:26 +00:00
SCCP.cpp Fix bug: SCCP/2003-06-24-OverdefinedPHIValue.ll 2003-06-24 20:29:52 +00:00
SimplifyCFG.cpp Updates to work with recent Statistic's changes: 2002-10-01 22:38:41 +00:00
SymbolStripping.cpp - Eliminated the deferred symbol table stuff in Module & Function, it really 2002-11-20 18:36:02 +00:00
TailDuplication.cpp Fix bug: TailDup/2003-07-22-InfiniteLoop.ll 2003-07-23 03:32:41 +00:00