skia2/src
Mike Klein 0f61c12737 add used_in_loop bit to skvm::Builder::Instruction
Most hoisted values are used in the loop body (and that's really the
whole point of hoisting) but some are just temporaries to help produce
other hoisted values.  This used_in_loop bit helps us distinguish the
two, and lets us recycle registers holding temporary hoisted values not
used in the loop.

The can-we-recycle logic now becomes:
   - is this a real value?
   - is it time for it to die?
   - is it either not hoisted or a hoisted temporary?

The set-death-to-infinity approach for hoisted values is now gone.  That
worked great for hoisted values used inside the loop, but was too
conservative for hoisted temporaries.  This lifetime extension was
preventing us from recycling those registers, pinning enough registers
that we run out and fail to JIT.

Small amounts of refactoring to make this clearer:
   - move the Instruction hash function definition near its operator==
   - rename the two "hoist" variables to "can_hoist" for Instructions
     and "try_hoisting" for the JIT approach
   - add ↟ to mark hoisted temporaries, _really_ hoisted values.

There's some redundancy here between tracking the can_hoist bit, the
used_in_loop bit, and lifetime tracking.  I think it should be true, for
instance, that !can_hoist && !used_in_loop implies an instruction is
dead code.  I plan to continue refactoring lifetime analysis (in
particular reordering instructions to decrease register pressure) so
hopefully by the time I'm done that metadata will shake out a little
crisper.

Change-Id: I6460ca96d1cbec0315bed3c9a0774cd88ab5be26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248986
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-10-16 18:29:06 +00:00
..
android Reland "Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"" 2019-10-03 19:14:22 +00:00
atlastext Rename GrColorSpaceInfo -> GrColorInfo 2019-09-30 21:53:24 +00:00
c Revert "add guard to switch to SkPathTypes" 2019-09-14 19:13:44 +00:00
codec Update Wuffs version to 0.2.0-rc.1 2019-10-10 15:12:21 +00:00
core add used_in_loop bit to skvm::Builder::Instruction 2019-10-16 18:29:06 +00:00
effects Plumb GrColorType through all ops/processors that sample textures. 2019-10-15 18:34:37 +00:00
fonts Add SkUNREACHABLE to definition of SK_ABORT. 2019-08-09 20:43:39 +00:00
gpu Switch GrFillInData to use GrColorType instead of GrPixelConfig. 2019-10-16 15:45:36 +00:00
image Plumb GrColorType through all ops/processors that sample textures. 2019-10-15 18:34:37 +00:00
images insist SkPngEncoder's input is initialized 2019-10-14 18:13:37 +00:00
lazy Remove std::move()s from returns of std::unique_ptrs 2019-08-15 23:48:59 +00:00
opts add alternate x-lerp using vpmaddubsw 2019-10-01 17:18:02 +00:00
pathops Revert "add guard to switch to SkPathTypes" 2019-09-14 19:13:44 +00:00
pdf Retain hints when subsetting for PDF. 2019-10-09 14:58:02 +00:00
ports Revert "Hold onto FcConfig in SkFontConfigInterface_direct." 2019-10-03 17:58:21 +00:00
sfnt Add Symbol encoding when renaming a font. 2019-08-07 20:35:28 +00:00
shaders Plumb GrColorType through all ops/processors that sample textures. 2019-10-15 18:34:37 +00:00
sksl Interpreter: Reflect all uniform variables in ByteCode 2019-10-16 15:35:48 +00:00
svg [svgcanvas] Refactor clipping 2019-09-04 14:36:32 +00:00
utils Rename GrColorSpaceInfo -> GrColorInfo 2019-09-30 21:53:24 +00:00
xml [svgcanvas] Add flag to suppress newlines and tabs in XML 2019-08-21 20:17:37 +00:00
xps Basic changes to get XPS drawing text. 2019-08-26 16:20:44 +00:00