aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/CaptureTracking.cpp
AgeCommit message (Collapse)AuthorFilesLines
12 days[CaptureTracking] Fix handling for non-returning read-only calls (#158979)Nikita Popov1-9/+9
We currently infer `captures(none)` for calls that are read-only, nounwind and willreturn. As pointed out in https://github.com/llvm/llvm-project/issues/129090, this is not correct even with this set of pre-conditions, because the function could conditionally cause UB depending on the address. As such, change this logic to instead report `captures(address)`. This also allows dropping the nounwind and willreturn checks, as these can also only capture the address.
2025-08-22[llvm] Remove unused includes of SmallSet.h (NFC) (#154893)Kazu Hirata1-1/+0
We just replaced SmallSet<T *, N> with SmallPtrSet<T *, N>, bypassing the redirection found in SmallSet.h. With that, we no longer need to include SmallSet.h in many files.
2025-08-18[llvm] Replace SmallSet with SmallPtrSet (NFC) (#154068)Kazu Hirata1-1/+1
This patch replaces SmallSet<T *, N> with SmallPtrSet<T *, N>. Note that SmallSet.h "redirects" SmallSet to SmallPtrSet for pointer element types: template <typename PointeeType, unsigned N> class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N> {}; We only have 140 instances that rely on this "redirection", with the vast majority of them under llvm/. Since relying on the redirection doesn't improve readability, this patch replaces SmallSet with SmallPtrSet for pointer element types.
2025-08-08[CaptureTracking] Handle ptrtoaddrAlexander Richardson1-0/+6
Unlike ptrtoint, ptrtoaddr does not capture provenance, only the address. Note: As defined by the LangRef, we always treat `ptrtoaddr` as a location-independent address capture since it is a direct inspection of the pointer address. Reviewed By: nikic Pull Request: https://github.com/llvm/llvm-project/pull/152221
2025-06-12[AA] Take read-only provenance captures into account (#143097)Nikita Popov1-6/+5
Update the AA CaptureAnalysis providers to return CaptureComponents, so we can distinguish between full provenance and read-only provenance captures. Use this to restrict "other" memory effects on call from ModRef to Ref. Ideally we would also apply the same reasoning for escape sources, but the current API cannot actually convey the necessary information (we can only say NoAlias or MayAlias, not MayAlias but only via Ref).
2025-06-06[AA] Merge isNonEscapingLocalObject() into SimpleCaptureAnalysis (NFC) (#142971)Nikita Popov1-24/+0
isNonEscapingLocalObject() is only used by SimpleCaptureAnalysis and tightly integrated with its implementation (in particular its cache), so inline and simplify the implementation.
2025-04-17[CaptureTracking] Remove dereferenceable_or_null special case (#135613)Nikita Popov1-31/+2
Remove the special case where comparing a dereferenceable_or_null pointer with null results in captures(none) instead of captures(address_is_null). This special case is not entirely correct. Let's say we have an allocated object of size 2 at address 1 and have a pointer `%p` pointing either to address 1 or 2. Then passing `gep p, -1` to a `dereferenceable_or_null(1)` function is well-defined, and allows us to distinguish between the two possible pointers, capturing information about the address. Now that we ignore address captures in alias analysis, I think we're ready to drop this special case. Additionally, if there are regressions in other places, the fact that this is inferred as address_is_null should allow us to easily address them if necessary.
2025-03-13[CaptureTracking][AA] Only consider provenance captures (#130777)Nikita Popov1-63/+81
For the purposes of alias analysis, we should only consider provenance captures, not address captures. To support this, change (or add) CaptureTracking APIs to accept a Mask and StopFn argument. The Mask determines which components we are interested in (for AA that would be Provenance). The StopFn determines when we can abort the walk early. Currently, we want to do this as soon as any of the components in the Mask is captured. The purpose of making this a separate predicate is that in the future we will also want to distinguish between capturing full provenance and read-only provenance. In that case, we can only stop early once full provenance is captured. The earliest escape analysis does not get a StopFn, because it must always inspect all captures.
2025-02-28[CaptureTracking] Take non-willreturn calls into accountNikita Popov1-3/+3
We can leak one bit of information about the address by either diverging or not. Part of https://github.com/llvm/llvm-project/issues/129090.
2025-02-27Reapply [CaptureTracking][FunctionAttrs] Add support for CaptureInfo ↵Nikita Popov1-51/+70
(#125880) (#128020) Relative to the previous attempt this includes two fixes: * Adjust callCapturesBefore() to not skip captures(ret: address, provenance) arguments, as these will not count as a capture at the call-site. * When visiting uses during stack slot optimization, don't skip the ModRef check for passthru captures. Calls can both modref and be passthru for captures. ------ This extends CaptureTracking to support inferring non-trivial CaptureInfos. The focus of this patch is to only support FunctionAttrs, other users of CaptureTracking will be updated in followups. The key API changes here are: * DetermineUseCaptureKind() now returns a UseCaptureInfo where the UseCC component specifies what is captured at that Use and the ResultCC component specifies what may be captured via the return value of the User. Usually only one or the other will be used (corresponding to previous MAY_CAPTURE or PASSTHROUGH results), but both may be set for call captures. * The CaptureTracking::captures() extension point is passed this UseCaptureInfo as well and then can decide what to do with it by returning an Action, which is one of: Stop: stop traversal. ContinueIgnoringReturn: continue traversal but don't follow the instruction return value. Continue: continue traversal and follow the instruction return value if it has additional CaptureComponents. For now, this patch retains the (unsound) special logic for comparison of null with a dereferenceable pointer. I'd like to switch key code to take advantage of address/address_is_null before dropping it. This PR mainly intends to introduce necessary API changes and basic inference support, there are various possible improvements marked with TODOs.
2025-02-24[CaptureTracking] Remove StoreCaptures parameter (NFC)Nikita Popov1-25/+6
The implementation doesn't use it, and is unlikely to use it in the future. The places that do set StoreCaptures=false, do so incorrectly and would be broken if the parameter actually did anything.
2025-02-20[CaptureTracking] Check for equality predicate for null comparisonsNikita Popov1-2/+3
The logic here is not valid for non-equality comparisons. E.g. using slt will leak the sign bit, regardless of whether the pointer is dereferenceable. This fix is split out from https://github.com/llvm/llvm-project/pull/125880.
2025-02-19Revert "Reapply [CaptureTracking][FunctionAttrs] Add support for CaptureInfo ↵Nico Weber1-74/+53
(#125880)" This reverts commit 0fab404ee874bc5b0c442d1841c7d2005c3f8729. Seems to break LTO builds of clang on Windows, see comments on https://github.com/llvm/llvm-project/pull/125880
2025-02-14Reapply [CaptureTracking][FunctionAttrs] Add support for CaptureInfo (#125880)Nikita Popov1-53/+74
Relative to the previous attempt, this adjusts isEscapeSource() to not treat calls with captures(ret: address, provenance) or similar arguments as escape sources. This addresses the miscompile reported at: https://github.com/llvm/llvm-project/pull/125880#issuecomment-2656632577 The implementation uses a helper function on CallBase to make this check a bit more efficient (e.g. by skipping the byval checks) as checking attributes on all arguments if fairly expensive. ------ This extends CaptureTracking to support inferring non-trivial CaptureInfos. The focus of this patch is to only support FunctionAttrs, other users of CaptureTracking will be updated in followups. The key API changes here are: * DetermineUseCaptureKind() now returns a UseCaptureInfo where the UseCC component specifies what is captured at that Use and the ResultCC component specifies what may be captured via the return value of the User. Usually only one or the other will be used (corresponding to previous MAY_CAPTURE or PASSTHROUGH results), but both may be set for call captures. * The CaptureTracking::captures() extension point is passed this UseCaptureInfo as well and then can decide what to do with it by returning an Action, which is one of: Stop: stop traversal. ContinueIgnoringReturn: continue traversal but don't follow the instruction return value. Continue: continue traversal and follow the instruction return value if it has additional CaptureComponents. For now, this patch retains the (unsound) special logic for comparison of null with a dereferenceable pointer. I'd like to switch key code to take advantage of address/address_is_null before dropping it. This PR mainly intends to introduce necessary API changes and basic inference support, there are various possible improvements marked with TODOs.
2025-02-13Revert "[CaptureTracking][FunctionAttrs] Add support for CaptureInfo (#125880)"Nikita Popov1-74/+53
This reverts commit ee655ca27aad466bcc54f6eba03f7e564940ad5a. A miscompilation has been reported at: https://github.com/llvm/llvm-project/pull/125880#issuecomment-2656632577
2025-02-13[CaptureTracking][FunctionAttrs] Add support for CaptureInfo (#125880)Nikita Popov1-53/+74
This extends CaptureTracking to support inferring non-trivial CaptureInfos. The focus of this patch is to only support FunctionAttrs, other users of CaptureTracking will be updated in followups. The key API changes here are: * DetermineUseCaptureKind() now returns a UseCaptureInfo where the UseCC component specifies what is captured at that Use and the ResultCC component specifies what may be captured via the return value of the User. Usually only one or the other will be used (corresponding to previous MAY_CAPTURE or PASSTHROUGH results), but both may be set for call captures. * The CaptureTracking::captures() extension point is passed this UseCaptureInfo as well and then can decide what to do with it by returning an Action, which is one of: Stop: stop traversal. ContinueIgnoringReturn: continue traversal but don't follow the instruction return value. Continue: continue traversal and follow the instruction return value if it has additional CaptureComponents. For now, this patch retains the (unsound) special logic for comparison of null with a dereferenceable pointer. I'd like to switch key code to take advantage of address/address_is_null before dropping it. This PR mainly intends to introduce necessary API changes and basic inference support, there are various possible improvements marked with TODOs.
2025-01-30[CaptureTracking] Convert check to assertion (NFC)Nikita Popov1-2/+2
If it's not the callee operand, it must be a data operand.
2024-06-27[IR] Add getDataLayout() helpers to BasicBlock and Instruction (#96902)Nikita Popov1-1/+1
This is a helper to avoid writing `getModule()->getDataLayout()`. I regularly try to use this method only to remember it doesn't exist... `getModule()->getDataLayout()` is also a common (the most common?) reason why code has to include the Module.h header.
2024-06-21[llvm] format and terminate namespaces with closing comment (#94917)Mohammed Keyvanzadeh1-92/+92
Namespaces are terminated with a closing comment in the majority of the codebase so do the same here for consistency. Also format code within some namespaces to make clang-format happy.
2023-12-05[CaptureTracking] Treat vector GEPs as capturesNikita Popov1-1/+6
Because AA does not support vectors of pointers, we have to treat pointers that are inserted into a vector as captures. We mostly already do so, but missed the case where getelementptr is used to produce a vector.
2023-11-02Revert "[CaptureTracking] Ignore ephemeral values when determining po… ↵Florian Hahn1-36/+10
(#71066) Unfortunately the commit (D123162) introduced a mis-compile (https://github.com/llvm/llvm-project/issues/70547), which wasn't fixed by the alternative fix (c0de28b92e98acbeb73) I think as long as the call considered as ephemeral is not removed, we need to be conservative. To address the correctness issue quickly, I think we should revert the patch (as this patch does, it doens't revert cleanly) This reverts commit 17fdaccccfad9b143e4aadbcdda7f645de127153. Fixes https://github.com/llvm/llvm-project/issues/70547
2023-10-20[AA] Make LI and EphValues option in EarliestEscapeInfo (NFC)Nikita Popov1-5/+4
To allow using it in places where these may not be available.
2023-09-01[Core][FIX] Do not assume instruction users in DetermineUseCaptureKindJohannes Doerfert1-1/+5
2023-07-06[CaptureTracking] Don't consider comparison of inbounds GEP with nonnull ↵Nikita Popov1-11/+10
non-capturing This is required to bring CaptureTracking in line with the new semantics from D154051, as gep inbounds p, 0 is now always non-poison. There are many ways in which the inbounds special case could be preserved: If the index is known non-zero, or there is an inbounds chain down to an identified object, etc. However, I have opted to drop the special case entirely, as it appears to be low value: In cases where we can determine such things (e.g. the affected test cases) we would end up removing the compare via isGEPKnownNonNull() logic anyway. Differential Revision: https://reviews.llvm.org/D154054
2023-03-15[NFC] Add some debug printouts to CaptureTrackingMax Kazantsev1-2/+11
2023-02-21[InstSimplify][CaptureTracking] Reduce scope of special caseNikita Popov1-6/+1
As described in PR54002, the "icmp of load from global" special case in CaptureTracking is incorrect, as is the InstSimplify code that makes use of it. This moves the special case from CaptureTracking into InstSimplify to limit its scope to the buggy transform only, and not affect other code using CaptureTracking as well.
2023-01-10Reapply [Dominators] Add findNearestCommonDominator() for Instructions (NFC)Nikita Popov1-18/+3
Reapply with checks for instructions in unreachable blocks. A test case for this was added in 1ee4a93b15bb. ----- This is a recurring pattern: We want to find the nearest common dominator (instruction) for two instructions, but currently only provide an API for the nearest common dominator of two basic blocks. Add an overload that accepts and return instructions.
2023-01-06Revert "[Dominator] Add findNearestCommonDominator() for Instructions (NFC)"Nikita Popov1-3/+18
This reverts commit 7f0de9573f758f5f9108795850337a5acbd17eef. This is missing handling for !isReachableFromEntry() blocks, which may be relevant for some callers. Revert for now.
2023-01-06[Dominator] Add findNearestCommonDominator() for Instructions (NFC)Nikita Popov1-18/+3
This is a recurring pattern: We want to find the nearest common dominator (instruction) for two instructions, but currently only provide an API for the nearest common dominator of two basic blocks. Add an overload that accepts and return instructions.
2022-06-02[CaptureTracking] Increase limit and use it for all visited uses.Florian Hahn1-5/+4
Currently the MaxUsesToExplore limit only applies to the number of users per value, not the total number of users to explore. The current limit of 20 pessimizes IR with opaque pointers in some cases. Without opaque pointers, we have deeper pointer def-use chains in general due to extra bitcasts and geps for structs with index 0. With opaque pointers the def-use chain is not as deep but wider, due to bitcasts & 0-geps missing. To improve the situation for opaque pointers, this patch does 2 things: 1. Apply the limit to the total number of uses visited. From the wording in the description of the option it seems like this may be the original intention. With the current implementation we could still end up walking a lot of uses. 2. Increase the limit to 100. This is quite arbitrary, but enables a good number of additional optimizations. Those adjustments have a noticeable compile-time impact though. In part that is likely due to additional transformations (and conversely the current baseline misses optimizations after switching to opaque pointers). This recovers some regressions that showed up after enabling opaque pointers. Limit=100: * NewPM-O3: +0.21% * NewPM-ReleaseThinLTO: +0.87% * NewPM-ReleaseLTO-g: +0.46% https://llvm-compile-time-tracker.com/compare.php?from=2e50ecb2ef4e1da1aeab05bcf66380068e680991&to=7e6fbe519d958d09f32f01d5d44a622f551e2031&stat=instructions Limit=60: * NewPM-O3: +0.14% * NewPM-ReleaseThinLTO: +0.41% * NewPM-ReleaseLTO-g: +0.21% https://llvm-compile-time-tracker.com/compare.php?from=aeb19817d66f1a15754163c7f48e01e9ebdd6d45&to=520563fdc146319aae90d06f88d87f2e9e1247b7&stat=instructions Limit=40: * NewPM-O3: +0.11% * NewPM-ReleaseThinLTO: +0.12% * NewPM-ReleaseLTO-g: +0.09% https://llvm-compile-time-tracker.com/compare.php?from=aeb19817d66f1a15754163c7f48e01e9ebdd6d45&to=c9182576e9fe3f1c84a71479665aef91a416318c&stat=instructions Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D126236
2022-04-08[CaptureTracking] Ignore ephemeral values in EarliestEscapeInfoArthur Eubanks1-7/+15
And thread DSE's ephemeral values to EarliestEscapeInfo. This allows more precise analysis in DSEState::isReadClobber() via BatchAA. Followup to D123162. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D123342
2022-04-07[CaptureTracking] Ignore ephemeral values when determining pointer escapenessArthur Eubanks1-5/+23
Ephemeral values cannot cause a pointer to escape. No change in compile time: https://llvm-compile-time-tracker.com/compare.php?from=4371710085ba1c376a094948b806ddd3b88319de&to=c5ddbcc4866f38026737762ee8d7b9b00395d4f4&stat=instructions This partially fixes some regressions caused by more calls to `__builtin_assume` (D122397). Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D123162
2022-03-11[CaptureTracking][NFCI] Expose capture tracking logicJohannes Doerfert1-133/+137
The logic exposed by this patch via `llvm::DetermineUseCaptureKind` was part of `llvm::PointerMayBeCaptured`. In the Attributor we want to keep track of the work list items but still reuse the logic if a use might capture a value. A follow up for the Attributor removes ~100 lines of code and complexity while making future handling of simplified values possible. Differential Revision: https://reviews.llvm.org/D121272
2022-02-06[llvm] Use = default (NFC)Kazu Hirata1-1/+1
2022-01-23[Analysis] Use default member initialization (NFC)Kazu Hirata1-6/+6
Identified with modernize-use-default-member-init.
2021-12-17[capturetracking] Explicitly check for callee operand [NFC]Philip Reames1-2/+5
Pull out an explicit check rather than relying on the fact that the callee operand is not a data operand. The only real value is it gives us a clear place to move the comment, and makes the code slightly more understandable.
2021-09-24Recommit "[DSE] Track earliest escape, use for loads in isReadClobber."Florian Hahn1-0/+76
This reverts the revert commit df56fc6ebbee6c458b0473185277b7860f7e3408. This version of the patch adjusts the location where the EarliestEscapes cache is cleared when an instruction gets removed. The earliest escaping instruction does not have to be a memory instruction. It could be a ptrtoint instruction like in the added test @earliest_escape_ptrtoint, which subsequently gets removed. We need to invalidate the EarliestEscape entry referring to the ptrtoint when deleting it. This fixes the crash mentioned in https://bugs.chromium.org/p/chromium/issues/detail?id=1252762#c6
2021-09-24Revert "[DSE] Track earliest escape, use for loads in isReadClobber."Nico Weber1-76/+0
This reverts commit 5ce89279c0986d0bcbe526dce52f91dd0c16427c. Makes clang crash, see comments on https://reviews.llvm.org/D109844
2021-09-23[DSE] Track earliest escape, use for loads in isReadClobber.Florian Hahn1-0/+76
At the moment, DSE only considers whether a pointer may be captured at all in a function. This leads to cases where we fail to remove stores to local objects because we do not check if they escape before potential read-clobbers or after. Doing context-sensitive escape queries in isReadClobber has been removed a while ago in d1a1cce5b130 to save compile-time. See PR50220 for more context. This patch introduces a new capture tracker, which keeps track of the 'earliest' capture. An instruction A is considered earlier than instruction B, if A dominates B. If 2 escapes do not dominate each other, the terminator of the common dominator is chosen. If not all uses cannot be analyzed, the earliest escape is set to the first instruction in the function entry block. If the query instruction dominates the earliest escape and is not in a cycle, then pointer does not escape before the query instruction. This patch uses this information when checking if a load of a loaded underlying object may alias a write to a stack object. If the stack object does not escape before the load, they do not alias. I will share a follow-up patch to also use the information for call instructions to fix PR50220. In terms of compile-time, the impact is low in general, NewPM-O3: +0.05% NewPM-ReleaseThinLTO: +0.05% NewPM-ReleaseLTO-g: +0.03 with the largest change being tramp3d-v4 (+0.30%) http://llvm-compile-time-tracker.com/compare.php?from=1a3b3301d7aa9ab25a8bdf045c77298b087e3930&to=bc6c6899cae757c3480f4ad4874a76fc1eafb0be&stat=instructions Compared to always computing the capture information on demand, we get the following benefits from the caching: NewPM-O3: -0.03% NewPM-ReleaseThinLTO: -0.08% NewPM-ReleaseLTO-g: -0.04% The biggest speedup is tramp3d-v4 (-0.21%). http://llvm-compile-time-tracker.com/compare.php?from=0b0c99177d1511469c633282ef67f20c851f58b1&to=bc6c6899cae757c3480f4ad4874a76fc1eafb0be&stat=instructions Overall there is a small, but noticeable benefit from caching. I am not entirely sure if the speedups warrant the extra complexity of caching. The way the caching works also means that we might miss a few cases, as it is less precise. Also, there may be a better way to cache things. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D109844
2021-09-20[CaptureTracking] Allow passing LI to PointerMayBeCapturedBefore (NFC).Florian Hahn1-7/+10
isPotentiallyReachable can use LoopInfo to return earlier. This patch allows passing an optional LI to PointerMayBeCapturedBefore. Used in D109844. Reviewed By: nikic, asbirlea Differential Revision: https://reviews.llvm.org/D109978
2021-05-16[CaptureTracking] Simplify reachability check (NFCI)Nikita Popov1-30/+1
This code was re-implementing the same-BB case of isPotentiallyReachable(). Historically, this was done because CaptureTracking used additional caching for local dominance queries. Now that it is no longer needed, the code is effectively the same as isPotentiallyReachable(). The only difference are extra checks for invoke/phis. These are misleading checks related to dominance in the value availability sense that are not relevant for control reachability. The invoke check was correct but redundant in that invokes are always terminators, so `I` could never come before the invoke. The phi check is a matter of interpretation (should an earlier phi node be considered reachable from a later phi node in the same block?) but ultimately doesn't matter because phis don't capture anyway.
2021-05-16Reapply [CaptureTracking] Do not check dominationNikita Popov1-7/+1
Reapply after adjusting the synchronized.m test case, where the TODO is now resolved. The pointer is only captured on the exception handling path. ----- For the CapturesBefore tracker, it is sufficient to check that I can not reach BeforeHere. This does not necessarily require that BeforeHere dominates I, it can also occur if the capture happens on an entirely disjoint path. This change was previously accepted in D90688, but had to be reverted due to large compile-time impact in some cases: It increases the number of reachability queries that are performed. After recent changes, the compile-time impact is largely mitigated, so I'm reapplying this patch. The remaining compile-time impact is largely proportional to changes in code-size.
2021-05-16Revert "[CaptureTracking] Do not check domination"Nikita Popov1-1/+7
This reverts commit 6b8b43e7af3074124e3c9e429e1fb08165799be4. This causes clang test to fail (CodeGenObjC/synchronized.m). Revert until I can figure out whether that's an expected change.
2021-05-16[CaptureTracking] Do not check dominationNikita Popov1-7/+1
For the CapturesBefore tracker, it is sufficient to check that I can not reach BeforeHere. This does not necessarily require that BeforeHere dominates I, it can also occur if the capture happens on an entirely disjoint path. This change was previously accepted in D90688, but had to be reverted due to large compile-time impact in some cases: It increases the number of reachability queries that are performed. After recent changes, the compile-time impact is largely mitigated, so I'm reapplying this patch. The remaining compile-time impact is largely proportional to changes in code-size.
2021-05-15[CaptureTracking] Only check reachability for capture candidatesNikita Popov1-10/+9
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.
2021-05-15[IR] Add BasicBlock::isEntryBlock() (NFC)Nikita Popov1-2/+1
This is a recurring and somewhat awkward pattern. Add a helper method for it.
2021-05-15[CaptureTracking] Clean up same instruction check (NFC)Nikita Popov1-9/+8
Check the BeforeHere == I case once in shouldExplore, instead of handling it in four different places.
2021-05-13[CaptureTracking] Use isIdentifiedFunctionLocal() (NFC)Nikita Popov1-16/+2
These conditions together exactly match isIdentifiedFunctionLocal(), and this is also what we logically want to check for here.
2021-03-19Update basic deref API to account for possiblity of free [NFC]Philip Reames1-2/+2
This patch is plumbing to support work towards the goal outlined in the recent llvm-dev post "[llvm-dev] RFC: Decomposing deref(N) into deref(N) + nofree". The point of this change is purely to simplify iteration on other pieces on way to making the switch. Rebuilding with a change to Value.h is slow and painful, so I want to get the API change landed. Once that's done, I plan to more closely audit each caller, add the inference rules in their own patch, then post a patch with the langref changes and test diffs. The value of the command line flag is that we can exercise the inference logic in standalone patches without needing the whole switch ready to go just yet. Differential Revision: https://reviews.llvm.org/D98908
2020-11-07[CaptureTracking] Add statistics (NFC)Nikita Popov1-0/+16
Add basic statistics on the number of pointers that have been determined to maybe capture / not capture.