Codegen mul by negative power of two with a shift and negate.
authorChris Lattner <sabre@nondot.org>
Sun, 30 Oct 2005 06:41:49 +0000 (06:41 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 30 Oct 2005 06:41:49 +0000 (06:41 +0000)
commit3e6099b05fa85d9e5d82f04f73722f2af301c772
treefc75ec12026b7ccbec80c98902b3ba4554268202
parent4446e0450949d612b40907cbd016b55c3b226c3d
Codegen mul by negative power of two with a shift and negate.
This implements test/Regression/CodeGen/PowerPC/mul-neg-power-2.ll,
producing:

_foo:
        slwi r2, r3, 1
        subfic r3, r2, 63
        blr

instead of:

_foo:
        mulli r2, r3, -2
        addi r3, r2, 63
        blr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24106 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp