search for: cmpnumber

Displaying 6 results from an estimated 6 matches for "cmpnumber".

Did you mean: cmpnumbers
2014 Mar 13
2
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...> > - something that uses isEquivalentType > + something that uses cmpType > > The point is, that "something" that uses isEquivalentType, will be > also replaced with one of next patches in this series. > > > > > > +static int cmpNumbers(uint64_t L, uint64_t R) { > > + if (L < R) return -1; > > + if (L > R) return 1; > > + return 0; > > +} > > > > At a high level, you don't actually need a <=> operator to use a > sort. A > > stri...
2014 Jan 21
3
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...trInst *GEP1, const GetElementPtrInst *GEP2) { - After the FunctionPtr class declaration, you have an extra blank line. There are a few of these scattered through (e.g., at the beginning of FunctionComparator::cmpConstants). - Your new helper functions (such as cmpNumbers) that are local to the file should be declared 'static'. - You use the following pattern throughout: int Res; // ... Res = cmpNumbers(I1->getNumOperands(), I2->getNumOperands()); if (Res != 0) return Res; whereas, since you neve...
2014 Feb 27
3
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...;t removed in 0001 just for keeping patches without extra noise like: - something that uses isEquivalentType + something that uses cmpType The point is, that "something" that uses isEquivalentType, will be also replaced with one of next patches in this series. > > +static int cmpNumbers(uint64_t L, uint64_t R) { > + if (L < R) return -1; > + if (L > R) return 1; > + return 0; > +} > > At a high level, you don't actually need a <=> operator to use a sort. A > strict ordering ( < operator) is sufficient. (Note that for mergefunc, a...
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 Jan 22
2
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
On 2014 Jan 22, at 07:35, Stepan Dyatkovskiy <stpworld at narod.ru> wrote: > Hi Raul and Duncan, > > Duncan, > Thank you for review. I hope to present fixed patch tomorrow. > > First, I would like to show few performance results: > > command: "time opt -mergefunc <test>" > > File: tramp3d-v4.ll, 12963 functions > Current
2014 Feb 03
4
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
Hi all, Previous patch has been split onto series of small changes. On each stage (after each patch) MergeFunctions pass is compilable and stable. Please find patches in attachment for review. To apply all patches at once, use "apply-patches.sh" script as follows: 0. Place "apply-patches.sh" in same directory with patches. 1. cd <llvm-sources-dir> 2. "bash