Ignore:
Timestamp:
Nov 6, 2016, 8:37:11 PM (3 years ago)
Author:
nmedfort
Message:

Initial work on adding types to PabloAST and mutable Var objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/passes/factorizedfg.cpp

    r5160 r5202  
    2929 * bicliques" by Alexe et. al. (2003).
    3030 ** ------------------------------------------------------------------------------------------------------------- */
    31 FactorizeDFG::BicliqueSet FactorizeDFG::enumerateFactoringSets(ObjectSet params, PabloBlock * const entryScope, const TypeId typeId) {
     31FactorizeDFG::BicliqueSet FactorizeDFG::enumerateFactoringSets(ObjectSet params, PabloBlock * const entryScope, TypeId typeId) {
    3232    using IntersectionSets = flat_set<ObjectSet>;
    3333
     
    125125        for (PabloAST * user : op->users()) {
    126126            if (user->getClassTypeId() == var->getClassTypeId()) {               
    127                 for (PabloBlock * scope = cast<Variadic>(user)->getParent(); scope; scope = scope->getPredecessor ()) {
     127                for (PabloBlock * scope = cast<Variadic>(user)->getParent(); scope; scope = scope->getPredecessor()) {
    128128                    if (LLVM_UNLIKELY(scope == var->getParent())) {
    129129                        tmp.push_back(user);
     
    196196 ** ------------------------------------------------------------------------------------------------------------- */
    197197template <class Type>
    198 inline bool intersects(const Type & A, const Type & B) {
     198inline bool intersects(Type & A, Type & B) {
    199199    auto first1 = A.begin(), last1 = A.end();
    200200    auto first2 = B.begin(), last2 = B.end();
     
    285285                    assert (nested);
    286286                    value = nested->getBranch();
    287                     nested = nested->getPredecessor ();
     287                    nested = nested->getPredecessor();
    288288                    if (nested == scope) {
    289289                        break;
     
    349349        // the scope tree until both scopes are at the same depth.
    350350        while (depth1 > depth2) {
    351             scope1 = scope1->getPredecessor ();
     351            scope1 = scope1->getPredecessor();
    352352            --depth1;
    353353        }
    354354        while (depth1 < depth2) {
    355             scope2 = scope2->getPredecessor ();
     355            scope2 = scope2->getPredecessor();
    356356            --depth2;
    357357        }
     
    360360        // must be the LCA of our original scopes.
    361361        while (scope1 != scope2) {
    362             scope1 = scope1->getPredecessor ();
    363             scope2 = scope2->getPredecessor ();
     362            scope1 = scope1->getPredecessor();
     363            scope2 = scope2->getPredecessor();
    364364        }
    365365        assert (scope1 && scope2);
     
    375375 * @brief factorize
    376376 ** ------------------------------------------------------------------------------------------------------------- */
    377 inline Variadic * FactorizeDFG::factorize(const TypeId typeId, PabloBlock * const scope, ObjectSet & operands, ObjectSet & users) const {
     377inline Variadic * FactorizeDFG::factorize(TypeId typeId, PabloBlock * const scope, ObjectSet & operands, ObjectSet & users) const {
    378378    Statement * const lastOperand = lastIn(scope, scope->back(), operands);
    379379    Statement * const firstUsage = firstIn(scope, lastOperand, users);
     
    400400 * @brief processFactoringSets
    401401 ** ------------------------------------------------------------------------------------------------------------- */
    402 inline bool FactorizeDFG::processFactoringSets(const TypeId typeId, PabloBlock * const scope, BicliqueSet && factoringSets) const {
     402inline bool FactorizeDFG::processFactoringSets(TypeId typeId, PabloBlock * const scope, BicliqueSet && factoringSets) const {
    403403    const auto S = independentFactoringSets(std::move(factoringSets), 0);
    404404    for (auto i : S) {
     
    411411// * @brief processFactoringSets
    412412// ** ------------------------------------------------------------------------------------------------------------- */
    413 //inline bool FactorizeDFG::processFactoringSets(const TypeId typeId, BicliqueSet && factoringSets, ObjectSet & factorings) const {
     413//inline bool FactorizeDFG::processFactoringSets(TypeId typeId, BicliqueSet && factoringSets, ObjectSet & factorings) const {
    414414//    const auto S = independentFactoringSets(std::move(factoringSets), 0);
    415415//    for (auto i : S) {
     
    443443// * @brief factor
    444444// ** ------------------------------------------------------------------------------------------------------------- */
    445 //void FactorizeDFG::factor(PabloFunction & function, const TypeId typeId) {
     445//void FactorizeDFG::factor(PabloFunction & function, TypeId typeId) {
    446446//    ObjectSet vars;
    447447//    for (unsigned i = 0; i != function.getNumOfParameters(); ++i) {
     
    608608                    }
    609609                    usage = scope->getBranch();
    610                     assert (scope != scope->getPredecessor ());
    611                     scope = scope->getPredecessor ();
     610                    assert (scope != scope->getPredecessor());
     611                    scope = scope->getPredecessor();
    612612                }
    613613            }
     
    836836                    }
    837837                    op = scope->getBranch();
    838                     scope = scope->getPredecessor ();
     838                    scope = scope->getPredecessor();
    839839                }
    840840            }
Note: See TracChangeset for help on using the changeset viewer.