pan/midgard: Improve scheduling

Make scalar scheduling onto vector units more aggressive (it can only
help while we schedule strictly in order). Also, allow imov on VLUT.

total bundles in shared programs: 2176 -> 2117 (-2.71%)
bundles in affected programs: 901 -> 842 (-6.55%)
helped: 24
HURT: 0
helped stats (abs) min: 1 max: 18 x̄: 2.46 x̃: 2
helped stats (rel) min: 2.08% max: 20.00% x̄: 8.68% x̃: 5.94%
95% mean confidence interval for bundles value: -3.93 -0.99
95% mean confidence interval for bundles %-change: -10.92% -6.45%
Bundles are helped.

total quadwords in shared programs: 3605 -> 3566 (-1.08%)
quadwords in affected programs: 1984 -> 1945 (-1.97%)
helped: 28
HURT: 5
helped stats (abs) min: 1 max: 3 x̄: 1.68 x̃: 2
helped stats (rel) min: 1.02% max: 14.29% x̄: 5.12% x̃: 2.94%
HURT stats (abs)   min: 1 max: 3 x̄: 1.60 x̃: 1
HURT stats (rel)   min: 0.57% max: 9.09% x̄: 6.40% x̃: 9.09%
95% mean confidence interval for quadwords value: -1.67 -0.69
95% mean confidence interval for quadwords %-change: -5.37% -1.37%
Quadwords are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig 2019-07-26 10:28:46 -07:00
parent 94e281b9e0
commit f8c71d7632
2 changed files with 9 additions and 5 deletions

View file

@ -73,7 +73,7 @@ struct mir_op_props alu_opcode_props[256] = {
[midgard_alu_op_isubsat] = {"isubsat", UNITS_MOST},
[midgard_alu_op_usubsat] = {"usubsat", UNITS_MOST},
[midgard_alu_op_imul] = {"imul", UNITS_MUL | OP_COMMUTES},
[midgard_alu_op_imov] = {"imov", UNITS_MOST | QUIRK_FLIPPED_R24},
[midgard_alu_op_imov] = {"imov", UNITS_ALL | QUIRK_FLIPPED_R24},
/* For vector comparisons, use ball etc */
[midgard_alu_op_feq] = {"feq", UNITS_MOST | OP_TYPE_CONVERT | OP_COMMUTES},

View file

@ -327,12 +327,16 @@ schedule_bundle(compiler_context *ctx, midgard_block *block, midgard_instruction
else
break;
} else {
if ((units & UNIT_SADD) && !(control & UNIT_SADD) && !midgard_has_hazard(segment, segment_size, ains))
if ((units & UNIT_VMUL) && (last_unit < UNIT_VMUL))
unit = UNIT_VMUL;
else if ((units & UNIT_SADD) && !(control & UNIT_SADD) && !midgard_has_hazard(segment, segment_size, ains))
unit = UNIT_SADD;
else if (units & UNIT_SMUL)
unit = ((units & UNIT_VMUL) && !(last_unit >= UNIT_VMUL)) ? UNIT_VMUL : UNIT_SMUL;
else if ((units & UNIT_VADD) && !(control & UNIT_VADD))
else if (units & UNIT_VADD)
unit = UNIT_VADD;
else if (units & UNIT_SMUL)
unit = UNIT_SMUL;
else if (units & UNIT_VLUT)
unit = UNIT_VLUT;
else
break;
}