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/schedulingprepass.cpp

    r5160 r5202  
    6666 * @brief resolveNestedUsages
    6767 ** ------------------------------------------------------------------------------------------------------------- */
    68 static void resolveNestedUsages(Statement * const root, Statement * const stmt, DependencyGraph & G, Map & M, PabloBlock * const block) {
    69     for (PabloAST * use : stmt->users()) {
     68static void resolveNestedUsages(Statement * const root, PabloAST * const expr, DependencyGraph & G, Map & M, PabloBlock * const block) {
     69    for (PabloAST * use : expr->users()) {
    7070        if (LLVM_LIKELY(isa<Statement>(use))) {
    7171            const PabloBlock * scope = cast<Statement>(use)->getParent();
    7272            if (scope != block) {
    73                 for (PabloBlock * prior = scope->getPredecessor (); prior; scope = prior, prior = prior->getPredecessor ()) {
     73                for (PabloBlock * prior = scope->getPredecessor(); prior; scope = prior, prior = prior->getPredecessor()) {
    7474                    if (prior == block) {
    7575                        assert (scope->getBranch());
     
    111111                    assert (v->second != u);
    112112                    add_edge(v->second, u, G);
    113                 } else if (isa<Assign>(op) || isa<Next>(op)) {
     113                } else if (isa<Assign>(op)) {
    114114                    // if this statement isn't an Assign or Next node, it cannot come from a nested scope
    115115                    // unless the function is invalid.
    116                     for (PabloBlock * prior = scope->getPredecessor (); prior; scope = prior, prior = prior->getPredecessor ()) {
     116                    for (PabloBlock * prior = scope->getPredecessor(); prior; scope = prior, prior = prior->getPredecessor()) {
    117117                        // Was this instruction computed by a nested block?
    118118                        if (prior == block) {
     
    132132    // Do a second pass to ensure that we've accounted for any nested usage of an If or While statement
    133133    for (Statement * stmt : *block) {
    134         if (LLVM_UNLIKELY(isa<If>(stmt))) {
    135             for (Assign * def : cast<If>(stmt)->getDefined()) {
    136                 resolveNestedUsages(stmt, def, G, M, block);
    137             }
    138         } else if (LLVM_UNLIKELY(isa<While>(stmt))) {
    139             for (Next * var : cast<While>(stmt)->getVariants()) {
     134        if (LLVM_UNLIKELY(isa<Branch>(stmt))) {
     135            for (Var * var : cast<Branch>(stmt)->getEscaped()) {
    140136                resolveNestedUsages(stmt, var, G, M, block);
    141137            }
Note: See TracChangeset for help on using the changeset viewer.