pan/bi: Scalarize bi_lower_swizzle
Reduces memory footprint. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16585>
This commit is contained in:
parent
5b1c642cee
commit
187dd382cb
|
@ -223,7 +223,7 @@ bi_instr_replicates(bi_instr *I, BITSET_WORD *replicates_16)
|
|||
|
||||
/* Replicated values */
|
||||
if (bi_is_ssa(I->src[s]) &&
|
||||
BITSET_TEST(replicates_16, bi_word_node(I->src[s])))
|
||||
BITSET_TEST(replicates_16, I->src[s].value))
|
||||
continue;
|
||||
|
||||
/* Replicated constants */
|
||||
|
@ -248,14 +248,14 @@ bi_lower_swizzle(bi_context *ctx)
|
|||
}
|
||||
|
||||
/* Now that we've lowered swizzles, clean up the mess */
|
||||
BITSET_WORD *replicates_16 = calloc(sizeof(bi_index), ((ctx->ssa_alloc + 1) << 2));
|
||||
BITSET_WORD *replicates_16 = calloc(sizeof(bi_index), ctx->ssa_alloc);
|
||||
|
||||
bi_foreach_instr_global(ctx, ins) {
|
||||
if (bi_is_ssa(ins->dest[0]) && bi_instr_replicates(ins, replicates_16))
|
||||
BITSET_SET(replicates_16, bi_word_node(ins->dest[0]));
|
||||
BITSET_SET(replicates_16, ins->dest[0].value);
|
||||
|
||||
if (ins->op == BI_OPCODE_SWZ_V2I16 && bi_is_ssa(ins->src[0]) &&
|
||||
BITSET_TEST(replicates_16, bi_word_node(ins->src[0]))) {
|
||||
BITSET_TEST(replicates_16, ins->src[0].value)) {
|
||||
ins->op = BI_OPCODE_MOV_I32;
|
||||
ins->src[0].swizzle = BI_SWIZZLE_H01;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue