aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/VirtualFileSystemTest.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2020-09-01 20:54:12 +0100
committerFlorian Hahn <flo@fhahn.com>2020-09-01 20:57:41 +0100
commit0d966ae4b2ac0344e15888d0f0a81c322e3d6dd2 (patch)
treed181722dd290880223ed31980ed3d4b81c48d8d0 /llvm/unittests/Support/VirtualFileSystemTest.cpp
parent7139736261e047e9cca030e2ee5912bf2a16f816 (diff)
downloadllvm-0d966ae4b2ac0344e15888d0f0a81c322e3d6dd2.zip
llvm-0d966ae4b2ac0344e15888d0f0a81c322e3d6dd2.tar.gz
llvm-0d966ae4b2ac0344e15888d0f0a81c322e3d6dd2.tar.bz2
[Loads] Add canReplacePointersIfEqual helper.
This patch adds an initial, incomeplete and unsound implementation of canReplacePointersIfEqual to check if a pointer value A can be replaced by another pointer value B, that are deemed to be equivalent through some means (e.g. information from conditions). Note that is in general not sound to blindly replace pointers based on equality, for example if they are based on different underlying objects. LLVM's memory model is not completely settled as of now; see https://bugs.llvm.org/show_bug.cgi?id=34548 for a more detailed discussion. The initial version of canReplacePointersIfEqual only rejects a very specific case: replacing a pointer with a constant expression that is not dereferenceable. Such a replacement is problematic and can be restricted relatively easily without impacting most code. Using it to limit replacements in GVN/SCCP/CVP only results in small differences in 7 programs out of MultiSource/SPEC2000/SPEC2006 on X86 with -O3 -flto. This patch is supposed to be an initial step to improve the current situation and the helper should be made stricter in the future. But this will require careful analysis of the impact on performance. Reviewed By: aqjune Differential Revision: https://reviews.llvm.org/D85524
Diffstat (limited to 'llvm/unittests/Support/VirtualFileSystemTest.cpp')
0 files changed, 0 insertions, 0 deletions