Skip to content

Commit 8efa07e

Browse files
LeszekSwirskiV8 LUCI CQ
authored andcommitted
Merged: [turbofan] Weaken alias analysis in store-store elimination
Bug: 420636529 (cherry picked from commit 7bc0a67) Change-Id: If7bf1a55a0ee814c85ae943acd264fe41fd1d5c9 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6594911 Reviewed-by: Deepti Gandluri <[email protected]> Auto-Submit: Shu-yu Guo <[email protected]> Commit-Queue: Shu-yu Guo <[email protected]> Cr-Commit-Position: refs/branch-heads/13.8@{#4} Cr-Branched-From: 61ddd47-refs/heads/13.8.258@{#1} Cr-Branched-From: fdb5de2-refs/heads/main@{#100480}
1 parent 76c83c6 commit 8efa07e

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/compiler/turboshaft/store-store-elimination-reducer-inl.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,11 @@ class RedundantStoreAnalysis {
325325
// TODO(nicohartmann@): Use the new effect flags to distinguish heap
326326
// access once available.
327327
const bool is_on_heap_store = store.kind.tagged_base;
328-
const bool is_field_store = !store.index().valid();
328+
const bool is_fixed_offset_store = !store.index().valid();
329329
const uint8_t size = store.stored_rep.SizeInBytes();
330-
// For now we consider only stores of fields of objects on the heap.
331-
if (is_on_heap_store && is_field_store) {
330+
// For now we consider only stores of fixed offsets of objects on the
331+
// heap.
332+
if (is_on_heap_store && is_fixed_offset_store) {
332333
bool is_eliminable_store = false;
333334
switch (table_.GetObservability(store.base(), store.offset, size)) {
334335
case StoreObservability::kUnobservable:
@@ -415,11 +416,16 @@ class RedundantStoreAnalysis {
415416
// TODO(nicohartmann@): Use the new effect flags to distinguish heap
416417
// access once available.
417418
const bool is_on_heap_load = load.kind.tagged_base;
418-
const bool is_field_load = !load.index().valid();
419+
const bool is_fixed_offset_load = !load.index().valid();
419420
// For now we consider only loads of fields of objects on the heap.
420-
if (is_on_heap_load && is_field_load) {
421-
table_.MarkPotentiallyAliasingStoresAsObservable(load.base(),
422-
load.offset);
421+
if (is_on_heap_load) {
422+
if (is_fixed_offset_load) {
423+
table_.MarkPotentiallyAliasingStoresAsObservable(load.base(),
424+
load.offset);
425+
} else {
426+
// A dynamically indexed load might alias any fixed offset.
427+
table_.MarkAllStoresAsObservable();
428+
}
423429
}
424430
break;
425431
}

0 commit comments

Comments
 (0)