Skip to content
forked from v8/v8

Commit

Permalink
[compiler] MoveOptimization should only merge identical moves
Browse files Browse the repository at this point in the history
MoveOptimization merged moves based on canonicalized
`InstructionOperand`s, which ignores word representations. This can
lead to issues with tagged and Word32 representations, which could
happen on the same value and are not interchangeable.
This CL removes the canonicalization, only merging completely identical
moves.

Bug: chromium:1468148
Change-Id: I47e533616f7b11be6862e3f06d04636239d536ac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4733512
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#89272}
  • Loading branch information
tebbi authored and V8 LUCI CQ committed Jul 31, 2023
1 parent 525b008 commit 17b0350
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/compiler/backend/move-optimizer.cc
Expand Up @@ -19,10 +19,10 @@ struct MoveKey {

struct MoveKeyCompare {
bool operator()(const MoveKey& a, const MoveKey& b) const {
if (a.source.EqualsCanonicalized(b.source)) {
return a.destination.CompareCanonicalized(b.destination);
if (a.source != b.source) {
return a.source.Compare(b.source);
}
return a.source.CompareCanonicalized(b.source);
return a.destination.Compare(b.destination);
}
};

Expand Down

0 comments on commit 17b0350

Please sign in to comment.