don't allocate an interpreter register for stores

Instructions only need a register if they've got an output.
This more closely mirrors what the JIT does.

Change-Id: I9cddba124a90c3afa698d82b1bb89808a7abd3c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253762
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2019-11-08 15:46:47 -06:00 committed by Skia Commit-Bot
parent 1edd468de3
commit 78441455a3

View File

@ -1543,12 +1543,15 @@ namespace skvm {
if (inst.y != inst.x ) { maybe_recycle_register(inst.y); }
if (inst.z != inst.x && inst.z != inst.y) { maybe_recycle_register(inst.z); }
// Allocate a register if we have to, preferring to reuse anything available.
if (avail.empty()) {
reg[id] = fRegs++;
} else {
reg[id] = avail.back();
avail.pop_back();
// Instructions that die at themselves (stores) don't need a register.
if (inst.death != id) {
// Allocate a register if we have to, preferring to reuse anything available.
if (avail.empty()) {
reg[id] = fRegs++;
} else {
reg[id] = avail.back();
avail.pop_back();
}
}
};