v8/test/mjsunit/maglev
Leszek Swirski dc92fe0931 [maglev] Fix result regalloc clobbering inputs
Consider the following

  * A ValueNode has inputs A and B
  * Input A has later uses, input B doesn't
  * The ValueNode's result must be in the same register as A

It can then happen that UpdateUses frees B, and the result allocation
emits a gap move from A's register to B's old register (now free) to
preserve the value of A when the ValueNode writes into its register.
This gap move is emmitted before the ValueNode start, which means that
it clobbers B.

Now, UpdateUses only clears registers _after_ node result allocation, so
that the known free registers are still the ones before updating uses.

Done naively, this would have bad consequences -- in the case where A
has no later uses, it would still force the regalloc to save its value
thinking that it is still live. So, this patch also introduces a concept
of "AllocationStage" where we're either allocating at the start or end
of a Node. Inputs are allocated at the start, results at the end. When
walking registers during an allocation, nodes whose lifetimes end at the
current node are considered to be dead at the "end" allocation stage,
and we are allowed to a) use their registers, and b) drop them without
preserving their value.

Bug: v8:7700
Change-Id: I5ca764ed04b12269f189577e81eb7e2a27cd1b09
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3625978
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80371}
2022-05-05 13:07:16 +00:00
..
00.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
01.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
02.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
03.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
04.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
05.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
06.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
07.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
08.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
09.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
10.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
11.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
12.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
13.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
14.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
15.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
16.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
17.js [maglev] Implement StoreField 2022-03-08 15:09:53 +00:00
18.js [maglev] Basic tiering to Maglev 2022-03-02 13:35:32 +00:00
19.js [maglev] CompactInterpreterFrameState fixes 2022-03-29 13:59:48 +00:00
add-number.js [maglev] Float64 box/unbox elision 2022-04-28 13:17:48 +00:00
add-smi.js [maglev] Addition Smi nodes 2022-04-05 12:34:42 +00:00
argument-over-under-application.js [maglev] Fix over application return stack cleanup 2022-03-29 10:39:28 +00:00
eager-deopt-in-inline.js [maglev] Start implenting inlining 2022-04-21 10:43:35 +00:00
lazy-deopt-with-onstack-activation.js [flags] Rename --opt to --turbofan 2022-05-03 12:10:30 +00:00
lazy-deopt-without-onstack-activation.js [flags] Rename --opt to --turbofan 2022-05-03 12:10:30 +00:00
literals.js [maglev] Add CreateObjectLiteral nodes 2022-04-29 12:20:11 +00:00
load-named.js [maglev] Add LoadDoubleField 2022-04-27 13:12:17 +00:00
lots-of-registers.js [maglev] Drop register values before adding them to the free list 2022-04-27 12:15:41 +00:00
mutable-context-access.js [maglev] Fix result regalloc clobbering inputs 2022-05-05 13:07:16 +00:00
simple-inlining.js [maglev] Start implenting inlining 2022-04-21 10:43:35 +00:00
spill-double.js [maglev] Float64 box/unbox elision 2022-04-28 13:17:48 +00:00