llvm-6502/lib/Transforms/Scalar
Chris Lattner 7203e158da Refactor this code a bit and make it more general. This now compiles:
struct S { unsigned int i : 6, j : 11, k : 15; } b;
void plus2 (unsigned int x) { b.j += x; }

To:

_plus2:
        lis r2, ha16(L_b$non_lazy_ptr)
        lwz r2, lo16(L_b$non_lazy_ptr)(r2)
        lwz r4, 0(r2)
        slwi r3, r3, 6
        add r3, r4, r3
        rlwimi r3, r4, 0, 26, 14
        stw r3, 0(r2)
        blr


instead of:

_plus2:
        lis r2, ha16(L_b$non_lazy_ptr)
        lwz r2, lo16(L_b$non_lazy_ptr)(r2)
        lwz r4, 0(r2)
        rlwinm r5, r4, 26, 21, 31
        add r3, r5, r3
        rlwimi r4, r3, 6, 15, 25
        stw r4, 0(r2)
        blr

by eliminating an 'and'.

I'm pretty sure this is as small as we can go :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23386 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-18 07:22:02 +00:00
..
ADCE.cpp
BasicBlockPlacement.cpp
CondPropagate.cpp Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization into 2005-08-04 23:24:19 +00:00
ConstantProp.cpp
CorrelatedExprs.cpp
DCE.cpp
DeadStoreElimination.cpp
GCSE.cpp
IndVarSimplify.cpp Allow indvar simplify to canonicalize ANY affine IV, not just affine IVs with 2005-08-10 01:12:06 +00:00
InstructionCombining.cpp Refactor this code a bit and make it more general. This now compiles: 2005-09-18 07:22:02 +00:00
LICM.cpp
LoopStrengthReduce.cpp Fix an issue where LSR would miss rewriting a use of an IV expression by a PHI node that is not the original PHI. 2005-09-13 02:09:55 +00:00
LoopUnroll.cpp
LoopUnswitch.cpp
LowerConstantExprs.cpp
LowerGC.cpp
LowerPacked.cpp
Makefile
PRE.cpp
Reassociate.cpp Fix a problem that Dan Berlin noticed, where reassociation would not succeed 2005-09-02 07:07:58 +00:00
ScalarReplAggregates.cpp
SCCP.cpp
SimplifyCFG.cpp
TailDuplication.cpp
TailRecursionElimination.cpp Use the new 'moveBefore' method to simplify some code. Really, which is 2005-08-08 19:11:57 +00:00