llvm-6502/lib
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
..
Analysis Simplify code by using ConstantInt::getRawValue instead of checking to see 2003-07-23 15:22:26 +00:00
Archive Merged in autoconf branch. This provides configuration via the autoconf 2003-06-30 21:59:07 +00:00
AsmParser Remove redundant const qualifiers from cast<> expressions 2003-07-23 15:30:06 +00:00
Bytecode Remove redundant const qualifiers from cast<> expressions 2003-07-23 15:30:06 +00:00
CodeGen Remove unnecessary casts 2003-07-23 15:17:51 +00:00
ExecutionEngine Fix space 2003-07-23 20:21:06 +00:00
Linker Fix Bug: Linker/2003-05-15-TypeProblem.ll 2003-05-15 16:30:55 +00:00
Support Simplify code by using ConstantInt::getRawValue instead of checking to see 2003-07-23 15:22:26 +00:00
Target Constify most methods. We could have constified doInitialization and 2003-07-24 17:30:45 +00:00
Transforms Allow folding several instructions into casts, which can simplify a lot 2003-07-24 17:35:25 +00:00
VMCore Make Module::getNamedFunction prefer non-external functions if there is more than 2003-07-23 20:21:30 +00:00
Makefile Merged in autoconf branch. This provides configuration via the autoconf 2003-06-30 21:59:07 +00:00