aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Demangle/RustDemangle.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-05-15 19:05:08 +0200
committerNikita Popov <nikita.ppv@gmail.com>2021-05-15 22:57:56 +0200
commit6e9363c94230a8427c11c2d13b7c65164370ffae (patch)
treec61883ff21ea37155353efc650dcada83dda968b /llvm/lib/Demangle/RustDemangle.cpp
parent0afb10de1449f41d026b3784369297cde011f69e (diff)
downloadllvm-6e9363c94230a8427c11c2d13b7c65164370ffae.zip
llvm-6e9363c94230a8427c11c2d13b7c65164370ffae.tar.gz
llvm-6e9363c94230a8427c11c2d13b7c65164370ffae.tar.bz2
[CaptureTracking] Only check reachability for capture candidates
Reachability queries are very expensive, and currently performed for each instruction we look at, even though most of them will not lead to a capture and are thus ultimately irrelevant. It is more efficient to walk a few unnecessary instructions than to perform unnecessary reachability queries. Theoretically, this may produce worse results, because the additional instructions considered may cause us to hit the use count limit earlier. In practice, this does not appear to be a problem, e.g. on test-suite O3 we report only one more captured-before with this change, with no resulting codegen differences. This makes PointerMayBeCapturedBefore() significantly cheaper in practice, hopefully allowing it to be used in more places.
Diffstat (limited to 'llvm/lib/Demangle/RustDemangle.cpp')
0 files changed, 0 insertions, 0 deletions