Skip to content

[DSE] Delay deleting non-memory-defs until end of DSE. (#83411) #8323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

fhahn
Copy link

@fhahn fhahn commented Mar 4, 2024

DSE uses BatchAA, which caches queries using pairs of MemoryLocations. At the moment, DSE may remove instructions that are used as pointers in cached MemoryLocations. If a new instruction used by a new MemoryLoation and this instruction gets allocated at the same address as a previosuly cached and then removed instruction, we may access an incorrect entry in the cache.

To avoid this delay removing all instructions except MemoryDefs until the end of DSE. This should avoid removing any values used in BatchAA's cache.

Test case by @vporpo from
llvm#83181.
(Test not precommitted because the results are non-determinstic - memset only sometimes gets removed)

PR: llvm#83411

DSE uses BatchAA, which caches queries using pairs of MemoryLocations.
At the moment, DSE may remove instructions that are used as pointers in
cached MemoryLocations. If a new instruction used by a new MemoryLoation
and this instruction gets allocated at the same address as a previosuly
cached and then removed instruction, we may access an incorrect entry in
the cache.

To avoid this delay removing all instructions except MemoryDefs until
the end of DSE. This should avoid removing any values used in BatchAA's
cache.

Test case by @vporpo from
llvm#83181.
(Test not precommitted because the results are non-determinstic - memset
only sometimes gets removed)

PR: llvm#83411
@fhahn
Copy link
Author

fhahn commented Mar 4, 2024

@swift-ci please test

@fhahn
Copy link
Author

fhahn commented Mar 4, 2024

@swift-ci please test llvm

@fhahn fhahn merged commit 46f35c9 into swiftlang:stable/20230725 Mar 5, 2024
@fhahn fhahn deleted the dse-fix branch March 5, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant