search for: cmpenumerate

Displaying 5 results from an estimated 5 matches for "cmpenumerate".

2014 Jan 21
3
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...xt, markdown or rst) is probably better. - Have you profiled this? What's the speedup? I second Raul's question about whether improving the hashing (or doing secondary hashing) could result in a larger benefit (maybe even with simpler code). - At the beginning of FunctionComparator::cmpEnumerate, you have a comment that you can't introduce an order relation for cross-references, and the following code: // Unfortunately we can't introduce order relation for // cross reference case. It is possible for self-reference only. if (V1 == F1) { if (V2...
2014 Jan 22
2
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...ult was unknown, returning “false” would conservatively consider the functions distinct, so we had no correctness issues. However, with your patch, *everything* must be accurately compared, right? Are there any cases where you can’t accurately order functions? (Is FunctionComparator::cmpEnumerate an example?) If these are problems, maybe you can use the previous ==-style comparison to confirm. > Raul, > > Yes. you right it is O(N*log(N)). And yes, I have some ideas about hashing. > Though in the end of hashing improvement I still see the tree. I'll explain. > &g...
2014 Mar 13
2
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...+ default: // Unknown constant > + return cmpNumbers((uint64_t)L, (uint64_t)R); > > Please assert on unknown constant. > > How are function, global variable and alias reachable here? > > 0004: > > Thanks for the comment on sn_mapL/R! > > +int FunctionComparator::cmpEnumerate(const Value *V1, const Value *V2) { > > "Compare enumerate"? This name doesn't make sense to me. "cmpValue" perhaps? > > + const Constant *C1 = dyn_cast<Constant>(V1); > + const Constant *C2 = dyn_cast<Constant>(V2); > + if (C1 && C2)...
2014 Jan 17
6
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
Hi all, I propose simple improvement for MergeFunctions pass, that reduced its complexity from O(N^2) to O(log(N)), where N is number of functions in module. The idea, is to replace the result of comparison from "bool" to "-1,0,1". In another words: define order relation on functions set. To be sure, that functions could be comparable that way, we have to prove that order
2014 Feb 27
3
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
Hi Nick, I tried to rework changes as you requested. One of patches (0004 with extra assertions) has been removed. > + bool isEquivalentType(Type *Ty1, Type *Ty2) const { > + return cmpType(Ty1, Ty2) == 0; > + } > > Why do we still need isEquivalentType? Can we nuke this? Yup. After applying all the patches isEquivalentType will be totally replaced with cmpType. All