search for: cmpconstant

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

Did you mean: cmpconstants
2014 Mar 13
2
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly > . Also, I find it odd that you switch from "L" and "R" to "this" and > "that". Please make those consistent, probably on left and right. > > 0003: > > + int cmpConstants(const Constant *L, const Constant *R); > > Any reason this method isn't const? > > +int FunctionComparator::cmpConstants(const Constant *L, const Constant > *R) { > + > + // Pack null value as one more Value ID > + unsigned LType = L->isNullValue() ? 0 : L->getV...
2014 Feb 27
3
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...uot;Pass is healthless. checkForLosslessBitcast should be twin of " > + "canLosslesslyBitCastTo method, except the case when the last one " > + "returns false, the first one should return -1 or 1"); > + > + // Compare constant contents > + if (cmpConstants(C1, C2) != 0) > + return false; > + > + assert( > + C1 == > + ConstantExpr::getBitCast(const_cast<Constant*>(C2), C1->getType()) && > + "Pass is healthless. cmpConstants should detect *subset* of " > + "equivalent con...
2014 Jan 21
3
[LLVMdev] MergeFunctions: reduce complexity to O(log(N))
...ges. E.g.: + int cmpGEP(const GetElementPtrInst *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)...
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
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