freedreno/ir3: insert mov if same instruction in the outputs.
authorHyunjun Ko <zzoon@igalia.com>
Thu, 30 Aug 2018 02:58:54 +0000 (11:58 +0900)
committerRob Clark <robdclark@gmail.com>
Wed, 5 Sep 2018 17:38:43 +0000 (13:38 -0400)
commit2454742a8447ef021bfbb17f1e87e59bc8cbfcb6
tree80632b80bebf5a30014f1af605ddb1cfbb802fef
parentb4da2f6667e8fcdd4f8fdd45f3859e036a3b855c
freedreno/ir3: insert mov if same instruction in the outputs.

For example,

    result0 = texture(sampler[indexBase + 5], coords);
    result1 = texture(sampler[indexBase + 0], coords);
    result2 = texture(sampler[indexBase + 0], coords);
    out_result0 = result0;
    out_result1 = result1;
    out_result2 = result2;

In this kind of case we need to insert an extra mov to the outputs
so that the result could be assigned to each register respectively.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c