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 preserve calling conventions when hacking on code 2005-05-14 12:25:32 +00:00
BasicBlockPlacement.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
CondPropagate.cpp Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization into 2005-08-04 23:24:19 +00:00
ConstantProp.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
CorrelatedExprs.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
DCE.cpp clean up and modernize this pass. 2005-05-08 18:45:26 +00:00
DeadStoreElimination.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
GCSE.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
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 prevent va_arg from being hoisted from a loop 2005-06-20 13:36:33 +00:00
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 Eliminate tabs and trailing spaces 2005-04-23 21:38:35 +00:00
LoopUnswitch.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
LowerConstantExprs.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
LowerGC.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
LowerPacked.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
Makefile Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
PRE.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
Reassociate.cpp Fix a problem that Dan Berlin noticed, where reassociation would not succeed 2005-09-02 07:07:58 +00:00
ScalarReplAggregates.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
SCCP.cpp Eliminate tabs and trailing spaces 2005-04-23 21:38:35 +00:00
SimplifyCFG.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
TailDuplication.cpp Remove trailing whitespace 2005-04-21 23:48:37 +00:00
TailRecursionElimination.cpp Use the new 'moveBefore' method to simplify some code. Really, which is 2005-08-08 19:11:57 +00:00