Skip to content

Draft: freedreno/ir3: Propagate the half constant flag

David Heidelberg requested to merge dh/mesa:241003-half-const-propag into main

What does this MR do and why?

When half-const, ir3_cf optimization strips the HALF flag, so first, return the flag to the register (2nd commit).

Second, the half reg flag is now propagated, but we cannot fold, when we feeding to the instruction, which has multiple sources of full type. If we do, then the validation pass will fail. So ensure, we fold only, when the instruction we fold into has sources of the same type (1st commit).

freedreno/ir3: Propagate the half constant flag
    
Fixes piglit CL tests:
program@execute@scalar-arithmetic-short
program@execute@scalar-comparison-ushort
program@execute@scalar-load-short

Signed-off-by: David Heidelberg <david@ixit.cz>
freedreno/ir3: Handle when we collapse half into multi-src non-half instruction

Current validation requires all sources to have same full or half type.
In future, this may be not necessary, but for now, it's what ir3 do.

Needed for following commit fixing half-const propagation.

Signed-off-by: David Heidelberg <david@ixit.cz>
shader-db ``` total instructions in shared programs: 1300792 -> 1300788 (<.01%) instructions in affected programs: 1139 -> 1135 (-0.35%) helped: 1 HURT: 0

total nops in shared programs: 363470 -> 363465 (<.01%) nops in affected programs: 28 -> 23 (-17.86%) helped: 1 HURT: 0

total non-nops in shared programs: 937322 -> 937323 (<.01%) non-nops in affected programs: 1111 -> 1112 (0.09%) helped: 0 HURT: 1

total last-baryf in shared programs: 15679 -> 15680 (<.01%) last-baryf in affected programs: 0 -> 1 helped: 0 HURT: 1

total cat0 in shared programs: 408883 -> 408878 (<.01%) cat0 in affected programs: 29 -> 24 (-17.24%) helped: 1 HURT: 0

total cat2 in shared programs: 435466 -> 435467 (<.01%) cat2 in affected programs: 688 -> 689 (0.15%) helped: 0 HURT: 1

</details>
Edited by David Heidelberg

Merge request reports

Loading