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/optimizers/distributivepass.cpp

    r5160 r5202  
    3131 ** ------------------------------------------------------------------------------------------------------------- */
    3232template <class Type>
    33 inline bool intersects(const Type & A, const Type & B) {
     33inline bool intersects(Type & A, Type & B) {
    3434    auto first1 = A.begin(), last1 = A.end();
    3535    auto first2 = B.begin(), last2 = B.end();
     
    239239inline unsigned scopeDepthOf(const PabloBlock * block) {
    240240    unsigned depth = 0;
    241     for (; block; ++depth, block = block->getPredecessor ());
     241    for (; block; ++depth, block = block->getPredecessor());
    242242    return depth;
    243243}
     
    267267        // the scope tree until both scopes are at the same depth.
    268268        while (depth1 > depth2) {
    269             scope1 = scope1->getPredecessor ();
     269            scope1 = scope1->getPredecessor();
    270270            --depth1;
    271271        }
    272272        while (depth1 < depth2) {
    273             scope2 = scope2->getPredecessor ();
     273            scope2 = scope2->getPredecessor();
    274274            --depth2;
    275275        }
     
    278278        // the LCA of our original pair.
    279279        while (scope1 != scope2) {
    280             scope1 = scope1->getPredecessor ();
    281             scope2 = scope2->getPredecessor ();
     280            scope1 = scope1->getPredecessor();
     281            scope2 = scope2->getPredecessor();
    282282        }
    283283        assert (scope1 && scope2);
     
    297297            assert (scope);
    298298            user = scope->getBranch();
    299             scope = scope->getPredecessor ();
     299            scope = scope->getPredecessor();
    300300        }
    301301        usages.insert(user);
     
    318318static inline void computeDistributionGraph(Variadic * const expr, Graph & G, VertexSet & A) {
    319319
    320     const TypeId outerTypeId = expr->getClassTypeId();
    321     const TypeId innerTypeId = (outerTypeId == TypeId::And) ? TypeId::Or : TypeId::And;
     320    TypeId outerTypeId = expr->getClassTypeId();
     321    TypeId innerTypeId = (outerTypeId == TypeId::And) ? TypeId::Or : TypeId::And;
    322322
    323323    assert (isa<And>(expr) || isa<Or>(expr));
Note: See TracChangeset for help on using the changeset viewer.