diff options
author | Rhys Perry <[email protected]> | 2018-06-12 11:43:49 +0100 |
---|---|---|
committer | Karol Herbst <[email protected]> | 2018-07-19 23:34:58 +0200 |
commit | 2afef231db8e52bc1a2222781bdb5809f997f94d (patch) | |
tree | 6304d9f75f10ab278b44437dc07705e1d086614c /src/gallium | |
parent | 3b6edd0b591378bba5c369b13a650239c1cf0e6f (diff) |
nv50/ir: handle SHLADD in IndirectPropagation
An alternative solution to the problem fixed in
0bd83d0 ("nv50/ir: move LateAlgebraicOpt to the very end").
total instructions in shared programs : 5481195 -> 5480808 (-0.01%)
total gprs used in shared programs : 647535 -> 647530 (-0.00%)
total shared used in shared programs : 389120 -> 389120 (0.00%)
total local used in shared programs : 21064 -> 21064 (0.00%)
total bytes used in shared programs : 58555784 -> 58551648 (-0.01%)
local shared gpr inst bytes
helped 0 0 2 34 34
hurt 0 0 0 0 0
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp index 520cbee7c1a..aaa6cacbe60 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp @@ -283,6 +283,8 @@ class IndirectPropagation : public Pass { private: virtual bool visit(BasicBlock *); + + BuildUtil bld; }; bool @@ -294,6 +296,8 @@ IndirectPropagation::visit(BasicBlock *bb) for (Instruction *i = bb->getEntry(); i; i = next) { next = i->next; + bld.setPosition(i, false); + for (int s = 0; i->srcExists(s); ++s) { Instruction *insn; ImmediateValue imm; @@ -325,6 +329,14 @@ IndirectPropagation::visit(BasicBlock *bb) i->setIndirect(s, 0, NULL); i->setSrc(s, cloneShallow(func, i->getSrc(s))); i->src(s).get()->reg.data.offset += imm.reg.data.u32; + } else if (insn->op == OP_SHLADD) { + if (!insn->src(2).getImmediate(imm) || + !targ->insnCanLoadOffset(i, s, imm.reg.data.s32)) + continue; + i->setIndirect(s, 0, bld.mkOp2v( + OP_SHL, TYPE_U32, bld.getSSA(), insn->getSrc(0), insn->getSrc(1))); + i->setSrc(s, cloneShallow(func, i->getSrc(s))); + i->src(s).get()->reg.data.offset += imm.reg.data.u32; } } } |