search for: pendingcache

Displaying 9 results from an estimated 9 matches for "pendingcache".

2018 Feb 11
2
[SCEV] Inconsistent SCEV formation for zext
...ed familiarity with ScalarEvolution code I would like to propose a solution that may work- Have two levels of caching for data structures for which infinite recursion is possible (like Value -> SCEV, Value->Predicate, Loop->BackedgeTakenCount etc). The first level of caching is the 'PendingCache' and the second one is the 'FinalCache'. PendingCache is similar to PendingLoopPredicates. It is used to break infinite recursion. In addition we keep a Boolean class member 'PessimisticMode' (common to all caches). The lookup logic for the cache is something like this- If (P...
2018 Feb 20
0
[SCEV] Inconsistent SCEV formation for zext
...iedSCEVs.find(AlreadyPresent)) { return Simplified; } return AlreadyPresent; } ... // We discovered zext(s) can be simplified to t UniqueSCEVs.insert({kZeroExtend, S}, t); SimplifiedSCEVs[s] = t; return t; } > The first level of caching is the 'PendingCache' and the second one is the 'FinalCache'. PendingCache is similar to PendingLoopPredicates. It is used to break infinite recursion. In addition we keep a Boolean class member 'PessimisticMode' (common to all caches). > > The lookup logic for the cache is something like this...
2018 Feb 26
2
[SCEV] Inconsistent SCEV formation for zext
...d by the same 'IsTopCall' approach. > > ScalarEvolution::getSCEVImpl (Value *V, bool IsTopCall = false) { > // Look up in cache using logic described above > If (S = getExistingSCEV()) > return S; > > if (IsTopCall) { > PessimisticMode = false; > PendingCache.clear(); > PendingCache.insert(V, getUnknown(V)); >> Can this be assert(!PessimisticMode && !PendingCache.empty()) since on a "top call" we could not have hit self recursion yet? Yes, if we reset them before exiting 'IsTopCall'. I wasn't doing that :)...
2018 Mar 13
2
[SCEV] Inconsistent SCEV formation for zext
...ch. > >> >> ScalarEvolution::getSCEVImpl (Value *V, bool IsTopCall = false) { >> // Look up in cache using logic described above >> If (S = getExistingSCEV()) >> return S; >> >> if (IsTopCall) { >> PessimisticMode = false; >> PendingCache.clear(); >> PendingCache.insert(V, getUnknown(V)); > >>> Can this be assert(!PessimisticMode && !PendingCache.empty()) since on a "top call" we could not have hit self recursion yet? > > > Yes, if we reset them before exiting 'IsTopCall'. I wa...
2018 Mar 12
0
[SCEV] Inconsistent SCEV formation for zext
...d by the same 'IsTopCall' approach. > > ScalarEvolution::getSCEVImpl (Value *V, bool IsTopCall = false) { > // Look up in cache using logic described above > If (S = getExistingSCEV()) > return S; > > if (IsTopCall) { > PessimisticMode = false; > PendingCache.clear(); > PendingCache.insert(V, getUnknown(V)); >> Can this be assert(!PessimisticMode && !PendingCache.empty()) since on a "top call" we could not have hit self recursion yet? Yes, if we reset them before exiting 'IsTopCall'. I wasn't doing that :)...
2018 Feb 10
0
[SCEV] Inconsistent SCEV formation for zext
Hi, +CC Max, Serguei This looks like a textbook case of why caching is hard. We first call getZeroExtendExpr on %dec, and this call does end up returning an add rec. However, in the process of simplifying the zext, it also calls into isLoopBackedgeGuardedByCond which in turn calls getZeroExtendExpr(%dec) again. However, this second (recursive) time, we don't simplify the zext and cache a
2018 Mar 13
0
[SCEV] Inconsistent SCEV formation for zext
...ch. > >> >> ScalarEvolution::getSCEVImpl (Value *V, bool IsTopCall = false) { >> // Look up in cache using logic described above >> If (S = getExistingSCEV()) >> return S; >> >> if (IsTopCall) { >> PessimisticMode = false; >> PendingCache.clear(); >> PendingCache.insert(V, getUnknown(V)); > >>> Can this be assert(!PessimisticMode && !PendingCache.empty()) since on a "top call" we could not have hit self recursion yet? > > > Yes, if we reset them before exiting 'IsTopCall'. I wa...
2018 Feb 08
2
[SCEV] Inconsistent SCEV formation for zext
Hi Sanjoy, SCEV is behaving inconsistently when forming SCEV for this zext instruction in the attached test case- %conv5 = zext i32 %dec to i64 If we request a SCEV for the instruction, it returns- (zext i32 {{-1,+,1}<nw><%for.body>,+,-1}<nw><%for.body7> to i64) This can be seen by invoking- $ opt -analyze -scalar-evolution inconsistent-scev-zext.ll But when computing
2018 Mar 13
1
[SCEV] Inconsistent SCEV formation for zext
...calarEvolution::getSCEVImpl (Value *V, bool IsTopCall = false) { >>> // Look up in cache using logic described above >>> If (S = getExistingSCEV()) >>> return S; >>> >>> if (IsTopCall) { >>> PessimisticMode = false; >>> PendingCache.clear(); >>> PendingCache.insert(V, getUnknown(V)); >> >>>> Can this be assert(!PessimisticMode && !PendingCache.empty()) since on a "top call" we could not have hit self recursion yet? >> >> >> Yes, if we reset them before exiting &...