aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Module.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-04-13 09:01:17 +0900
committerGitHub <noreply@github.com>2024-04-13 09:01:17 +0900
commit9e95c4947d31670ddd3abad1051eda06729c96b3 (patch)
tree4cd3d50e7dd575fd47f308b2b24c735a3db744ca /clang/lib/Basic/Module.cpp
parentb9bed1f1106e3116e8bea38806c511b57b956929 (diff)
downloadllvm-9e95c4947d31670ddd3abad1051eda06729c96b3.zip
llvm-9e95c4947d31670ddd3abad1051eda06729c96b3.tar.gz
llvm-9e95c4947d31670ddd3abad1051eda06729c96b3.tar.bz2
[DSE] Fix non-determinism due to address reuse (#84943)
The malloc->calloc fold creates a new MemoryAccess, which may end of at the same address as a previously deleted access inside SkipStores. To the most part, this is not a problem, because SkipStores is normally only used together with MemDefs. Neither the old malloc access nor the new calloc access will be part of MemDefs, so there is no problem here. However, SkipStores is also used in one more place: In the main DSE loop, ToCheck entries are checked against it. Fix this by not using SkipStores here, and instead using a separate set to track deletions inside this loop. This way it is not affected by the calloc optimization that happens outside it. This is all pretty ugly, but I haven't found another good way to fix it. Suggestions welcome. No test case as I don't have a reliable DSE-only test-case for this. Fixes https://github.com/llvm/llvm-project/issues/84458.
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
0 files changed, 0 insertions, 0 deletions