[llvm] r219575 - AssumptionTracker: Don't create temporary CallbackVHs.
David Blaikie
dblaikie at gmail.com
Sun Oct 12 17:51:41 PDT 2014
On Oct 11, 2014 12:24 PM, "Benjamin Kramer" <benny.kra at googlemail.com>
wrote:
>
> Author: d0k
> Date: Sat Oct 11 14:13:01 2014
> New Revision: 219575
>
> URL: http://llvm.org/viewvc/llvm-project?rev=219575&view=rev
> Log:
> AssumptionTracker: Don't create temporary CallbackVHs.
>
> Those are expensive to create in cold cache scenarios. NFC.
>
> Modified:
> llvm/trunk/include/llvm/Analysis/AssumptionTracker.h
> llvm/trunk/lib/Analysis/AssumptionTracker.cpp
>
> Modified: llvm/trunk/include/llvm/Analysis/AssumptionTracker.h
> URL:
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/AssumptionTracker.h?rev=219575&r1=219574&r2=219575&view=diff
>
==============================================================================
> --- llvm/trunk/include/llvm/Analysis/AssumptionTracker.h (original)
> +++ llvm/trunk/include/llvm/Analysis/AssumptionTracker.h Sat Oct 11
14:13:01 2014
> @@ -99,7 +99,7 @@ public:
> typedef iterator_range<assumption_iterator> assumption_range;
>
> inline assumption_range assumptions(Function *F) {
> - FunctionCallsMap::iterator I = CachedAssumeCalls.find(F);
> + FunctionCallsMap::iterator I = CachedAssumeCalls.find_as(F);
> if (I == CachedAssumeCalls.end()) {
> I = scanFunction(F);
> }
>
> Modified: llvm/trunk/lib/Analysis/AssumptionTracker.cpp
> URL:
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AssumptionTracker.cpp?rev=219575&r1=219574&r2=219575&view=diff
>
==============================================================================
> --- llvm/trunk/lib/Analysis/AssumptionTracker.cpp (original)
> +++ llvm/trunk/lib/Analysis/AssumptionTracker.cpp Sat Oct 11 14:13:01 2014
> @@ -29,12 +29,14 @@ void AssumptionTracker::FunctionCallback
> }
>
> void AssumptionTracker::forgetCachedAssumptions(Function *F) {
> - CachedAssumeCalls.erase(F);
> + auto I = CachedAssumeCalls.find_as(F);
> + if (I != CachedAssumeCalls.end())
> + CachedAssumeCalls.erase(I);
Could/should we add an erase_as? (Or is there any way we can avoid having
the *_as variants and just have the basic ones to heterogenous
lookup/removal/etc)
> }
>
> void AssumptionTracker::CallCallbackVH::deleted() {
> assert(F && "delete callback called on dummy handle");
> - FunctionCallsMap::iterator I = AT->CachedAssumeCalls.find(F);
> + FunctionCallsMap::iterator I = AT->CachedAssumeCalls.find_as(F);
> assert(I != AT->CachedAssumeCalls.end() &&
> "Function cleared from the map without removing the values?");
>
> @@ -88,7 +90,7 @@ void AssumptionTracker::registerAssumpti
> Function *F = CI->getParent()->getParent();
> assert(F && "Cannot register @llvm.assume call not in a function");
>
> - FunctionCallsMap::iterator I = CachedAssumeCalls.find(F);
> + FunctionCallsMap::iterator I = CachedAssumeCalls.find_as(F);
> if (I == CachedAssumeCalls.end()) {
> // If this function has not already been scanned, then don't do
anything
> // here. This intrinsic will be found, if it still exists, if the
list of
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141012/5db31918/attachment.html>
More information about the llvm-commits
mailing list