Add/Sub/Mul are safe to promote here as well. Incrementing a single-bit
authorChris Lattner <sabre@nondot.org>
Sat, 13 May 2006 02:16:08 +0000 (02:16 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 13 May 2006 02:16:08 +0000 (02:16 +0000)
commit033aaaf45157459983ea283275dd0df348eafc8d
tree713a5c04e931ef9b0f5e58cc4595af6f64a95b79
parenta2d079a7763d01922e806e7874553da2ae4006af
Add/Sub/Mul are safe to promote here as well.  Incrementing a single-bit
bitfield now gives this code:

_plus:
        lwz r2, 0(r3)
        rlwimi r2, r2, 0, 1, 31
        xoris r2, r2, 32768
        stw r2, 0(r3)
        blr

instead of this:

_plus:
        lwz r2, 0(r3)
        srwi r4, r2, 31
        slwi r4, r4, 31
        addis r4, r4, -32768
        rlwimi r2, r4, 0, 0, 0
        stw r2, 0(r3)
        blr

this can obviously still be improved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28275 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp