diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-05-15 19:05:08 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-05-15 22:57:56 +0200 |
commit | 6e9363c94230a8427c11c2d13b7c65164370ffae (patch) | |
tree | c61883ff21ea37155353efc650dcada83dda968b /llvm/lib/Demangle/RustDemangle.cpp | |
parent | 0afb10de1449f41d026b3784369297cde011f69e (diff) | |
download | llvm-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