RESOLVED FIXED 193711
[DFG] AvailabilityMap::pruneByLiveness should make non-live operands Availability::unavailable instead of Availability()
https://bugs.webkit.org/show_bug.cgi?id=193711
Summary [DFG] AvailabilityMap::pruneByLiveness should make non-live operands Availabi...
Yusuke Suzuki
Reported 2019-01-23 02:25:46 PST
This clears the lattice during fixed-point calculation.
Attachments
Patch (1.97 KB, patch)
2019-01-23 02:43 PST, Yusuke Suzuki
no flags
Archive of layout-test-results from ews103 for mac-highsierra (2.66 MB, application/zip)
2019-01-23 03:27 PST, EWS Watchlist
no flags
Patch (1.47 KB, patch)
2019-01-23 03:45 PST, Yusuke Suzuki
no flags
ToT log for the given script (176.97 KB, text/plain)
2019-01-23 14:35 PST, Yusuke Suzuki
no flags
Patch (8.78 KB, patch)
2019-01-23 15:12 PST, Yusuke Suzuki
no flags
Patch (8.84 KB, patch)
2019-01-23 15:16 PST, Yusuke Suzuki
saam: review+
Yusuke Suzuki
Comment 1 2019-01-23 02:43:49 PST
Yusuke Suzuki
Comment 2 2019-01-23 02:52:56 PST
I think this is the issue, but I’m not 100% confident. I’ll ensure that tomorrow.
EWS Watchlist
Comment 3 2019-01-23 03:27:54 PST
Comment on attachment 359865 [details] Patch Attachment 359865 [details] did not pass mac-ews (mac): Output: https://webkit-queues.webkit.org/results/10855417 Number of test failures exceeded the failure limit.
EWS Watchlist
Comment 4 2019-01-23 03:27:56 PST
Created attachment 359867 [details] Archive of layout-test-results from ews103 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-highsierra Platform: Mac OS X 10.13.6
Yusuke Suzuki
Comment 5 2019-01-23 03:45:10 PST
Yusuke Suzuki
Comment 6 2019-01-23 12:28:44 PST
Let's consider the following example. BB0 -> BB1 -> BB2 -> BB4 | \ ^ v > BB3 / BB5 And consider about loc1 in FTL. BB0 does nothing head: loc1 is dead tail: loc1 is dead BB1 has MovHint @1, loc1 head: loc1 is dead tail: loc1 is live BB2 does nothing head: loc1 is live tail: loc1 is live BB3 has PutStack @1, loc1 head: loc1 is live tail: loc1 is live BB4 has OSR exit using loc1 head: loc1 is live tail: loc1 is live (in bytecode) BB5 does nothing head: loc1 is dead tail: loc1 is dead In our OSR Availability analysis, we always prune loc1 result in BB1's head since its head says "loc1 is dead". But at that time, we clear the availability for loc1, which makes it DeadFlush, instead of making it Conflicting. So, the flash format of loc1 in each tail of BB is like this. BB0 Conflicting (b/c all the local operands are initialized with Conflicting) BB1 DeadFlush (pruning clears it) BB2 DeadFlush (since it is propagated from BB1) BB3 FlushedJSValue with loc1 (since it has PutStack) BB4 FlushedJSValue with loc1 (since DeadFlush + FlushedJSValue = FlushedJSValue) Then, if we go the path BB0->BB1->BB2->BB4, we read the value from the stack while it is not flushed. I think the correct fix is making availability "unavailable" when pruning based on the bytecode liveness.
Yusuke Suzuki
Comment 7 2019-01-23 14:35:24 PST
Created attachment 359943 [details] ToT log for the given script
Yusuke Suzuki
Comment 8 2019-01-23 15:12:58 PST
Yusuke Suzuki
Comment 9 2019-01-23 15:15:06 PST
Yusuke Suzuki
Comment 10 2019-01-23 15:16:13 PST
Saam Barati
Comment 11 2019-01-23 15:18:46 PST
Comment on attachment 359950 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359950&action=review > Source/JavaScriptCore/ChangeLog:9 > + When pruning OSR Availability based on bytecode liveness, we accidentally clears the Availability instead of making it Availability::unavailable(). Can you describe the difference please? (Also, "clears" => "clear")
Saam Barati
Comment 12 2019-01-23 15:21:49 PST
Comment on attachment 359950 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359950&action=review > Source/JavaScriptCore/ChangeLog:46 > + So, the flash format of loc1 in each tail of BB is like this. flash => flush
Saam Barati
Comment 13 2019-01-23 15:23:13 PST
Comment on attachment 359950 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359950&action=review > Source/JavaScriptCore/ChangeLog:21 > + BB0 does nothing > + head: loc1 is dead > + tail: loc1 is dead I don't think this is interesting for this example to make sense. > Source/JavaScriptCore/ChangeLog:41 > + BB5 does nothing > + head: loc1 is dead > + tail: loc1 is dead This isn't interesting for your example.
Saam Barati
Comment 14 2019-01-23 15:33:41 PST
Comment on attachment 359950 [details] Patch r=me
Saam Barati
Comment 15 2019-01-23 15:34:42 PST
Comment on attachment 359950 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359950&action=review >> Source/JavaScriptCore/ChangeLog:21 >> + tail: loc1 is dead > > I don't think this is interesting for this example to make sense. Ignore me, this is required
Yusuke Suzuki
Comment 16 2019-01-23 15:47:00 PST
Comment on attachment 359950 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=359950&action=review Thank you! >> Source/JavaScriptCore/ChangeLog:9 >> + When pruning OSR Availability based on bytecode liveness, we accidentally clears the Availability instead of making it Availability::unavailable(). > > Can you describe the difference please? > > (Also, "clears" => "clear") Fixed, and I described the difference between DeadFlush and ConflictingFlush. >> Source/JavaScriptCore/ChangeLog:41 >> + tail: loc1 is dead > > This isn't interesting for your example. This BB5 is required to split BB0 and BB1, and make BB1 non-root basic block. (because we do not clear the head's dead availability of the root block). >> Source/JavaScriptCore/ChangeLog:46 >> + So, the flash format of loc1 in each tail of BB is like this. > > flash => flush Fixed.
Yusuke Suzuki
Comment 17 2019-01-23 16:17:20 PST
Note You need to log in before you can comment on or make changes to this bug.