nv50/ir: flip shl(add, imm) into add(shl, imm)
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 4 Dec 2015 21:05:56 +0000 (16:05 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 5 Dec 2015 22:50:23 +0000 (17:50 -0500)
commit31fde8fabadcd9240c1e96c8a953b465def9b516
tree1006af1054a7b08d8a4753c67376841f3d4aeb27
parenta4eff86f4afb6618aff488e9da5600e33d97a9c3
nv50/ir: flip shl(add, imm) into add(shl, imm)

This works when the add also has an immediate. This often happens in
address calculations. These addresses can then be inlined as well.

On code targeted to SM35:

total instructions in shared programs : 6223346 -> 6206257 (-0.27%)
total gprs used in shared programs    : 911075 -> 911045 (-0.00%)
total local used in shared programs   : 39072 -> 39072 (0.00%)

                local        gpr       inst      bytes
    helped           0         119        3664        3664
      hurt           0          74          15          15

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp