Skip to content

Commit 7bc0a67

Browse files
LeszekSwirskiV8 LUCI CQ
authored andcommitted
[turbofan] Weaken alias analysis in store-store elimination
Bug: 420636529 Change-Id: I7c5a8f47960708cecbb27d811eedc7f754933deb Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6594051 Reviewed-by: Shu-yu Guo <[email protected]> Auto-Submit: Leszek Swirski <[email protected]> Commit-Queue: Leszek Swirski <[email protected]> Cr-Commit-Position: refs/heads/main@{#100530}
1 parent 5c19883 commit 7bc0a67

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

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)