Skip to content

ir3/cp_postsched: prevent creation of false-deps on future instr

If there is even a single true dependency left on an array-to-ssa mov, then there is no point in updating the dependencies of instructions that have this mov as a false-dep. The mov won't be eliminated in such case and we don't want to mistakenly update dependencies of a true dependency.

Before the fix the next pattern caused false-dep on future instr:

    mov.u32u32 ssa_98, arr[id=1, offset=1, size=20, ssa_91]
    mad.f32 ssa_110, c0.w, ssa_98, c0.y
    absneg.f ssa_117, (neg)ssa_98

Becomes invalid after ir3_cp_postsched:

    mov.u32u32 ssa_98, arr[id=1, offset=1, size=20, ssa_91]
    mad.f32 ssa_110, c0.w, ssa_98, c0.y, false-deps:ssa_117
    absneg.f ssa_117, (neg)arr[id=1, offset=1, size=20, ssa_91]

This later causes infinite recursion during DAG construction.

Such case was observed in "Batman: Arkham City" running through DXVK.

Merge request reports