From: Samuel Pitoiset Date: Wed, 14 Sep 2016 16:57:02 +0000 (+0200) Subject: nv50/ir: optimize SHLADD(a, b, 0x0) to SHL(a, b) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2e008be9a9a4c94564c11718e0f6fc029caa0e44;p=mesa.git nv50/ir: optimize SHLADD(a, b, 0x0) to SHL(a, b) Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index c9d5b5f7d65..cbbe34d1e0b 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -907,6 +907,14 @@ ConstantFolding::opnd3(Instruction *i, ImmediateValue &imm2) return; } break; + case OP_SHLADD: + if (imm2.isInteger(0)) { + i->op = OP_SHL; + i->setSrc(2, NULL); + foldCount++; + return; + } + break; default: return; }