diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-09 08:56:44 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-12 12:43:02 -0700 |
commit | c690b37d76480e6b8c3a158fc51e7255acf2d841 (patch) | |
tree | ab49ba1c1ce17c4139c33b22bc69c66e59267ec0 /src | |
parent | 15954ab6caa0327702b83d861a88c3c498f6d0f1 (diff) |
pan/midgard: Fix load/store pairing
This used a delicate hack to try to find indirect inputs and skip them
as candidates for pairing. Let's use a better criterion -- no sources --
and pair based on that.
We could do better, but that would require more complex data flow
analysis than we're interested in doing here.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/panfrost/midgard/midgard_schedule.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index 958e109346b..486bb38e049 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -622,18 +622,15 @@ midgard_pair_load_store(compiler_context *ctx, midgard_block *block) if (c->type != TAG_LOAD_STORE_4) continue; - /* Stores cannot be reordered, since they have - * dependencies. For the same reason, indirect - * loads cannot be reordered as their index is - * loaded in r27.w */ + /* We can only reorder if there are no sources */ - if (OP_IS_STORE(c->load_store.op)) continue; + bool deps = false; - /* It appears the 0x8 bit is set whenever a - * load is direct, unset when it is indirect. - * Skip indirect loads. */ + for (unsigned s = 0; s < ARRAY_SIZE(ins->ssa_args.src); ++s) + deps |= (c->ssa_args.src[s] != -1); - if (!(c->load_store.arg_2 & 0x8)) continue; + if (deps) + continue; /* We found one! Move it up to pair and remove it from the old location */ |