llvm-6502/lib/Transforms
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
..
Hello Initial checkin of the "Hello World" Pass. 2002-08-08 20:10:38 +00:00
Instrumentation Added check for inlinable function 2003-07-18 20:55:26 +00:00
IPO Fix bug: FunctionResolve/2003-07-23-CPR-Reference.ll 2003-07-23 22:03:18 +00:00
Scalar Allow folding several instructions into casts, which can simplify a lot 2003-07-24 17:35:25 +00:00
Utils Fix bug: Mem2Reg/2003-06-26-IterativePromote.ll 2003-06-25 14:58:56 +00:00
ExprTypeConvert.cpp Minor cleanups 2003-07-24 17:31:56 +00:00
LevelRaise.cpp Hopefully, the final fix for `[Pp]ropogate'. 2003-05-20 21:01:22 +00:00
Makefile Convert DIRS to PARALLEL_DIRS. They can be built independently. 2002-09-29 11:52:14 +00:00
TransformInternals.cpp avoid dividing by zero when dealing with zero sized types (like [0 x double]) 2003-06-23 17:36:49 +00:00
TransformInternals.h Simplify code by using ConstantInt::getRawValue instead of checking to see 2003-07-23 15:22:26 +00:00