Ignore:
Timestamp:
Jan 22, 2015, 3:04:10 PM (5 years ago)
Author:
nmedfort
Message:

Possible fix for segfault issue. CC seems to be generating the same charclass multiple times.

File:
1 edited

Legend:

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

    r4432 r4433  
    55namespace pablo {
    66
    7 bool Assign::isConstant() const {
     7bool Assign::superfluous() const {
    88    if (LLVM_UNLIKELY(isOutputAssignment())) {
     9        // If this Assign is an assignment to an output variable, it cannot be superfluous.
    910        return false;
    1011    }
    11     for (const PabloAST * inst : users()) {
     12    for (const PabloAST * inst : users()) {       
    1213        if (isa<Next>(inst)) {
     14            // If this Assign has a Next node, it cannot be superfluous.
    1315            return false;
    1416        }
    1517        if (isa<If>(inst)) {
    16             // if this Assign is the condition of an If node but not a defined var,
    17             // then this Assign is a "constant".
    18             if (cast<If>(inst)->getCondition() == this) {
    19                 const auto & dv = cast<If>(inst)->getDefined();
    20                 if (LLVM_LIKELY(std::find(dv.begin(), dv.end(), this) == dv.end())) {
    21                     continue;
    22                 }
     18            // If this Assign is a defined variable of an If node, it cannot be superfluous.
     19            const auto & dv = cast<If>(inst)->getDefined();
     20            if (LLVM_UNLIKELY(std::find(dv.begin(), dv.end(), this) != dv.end())) {
     21                return false;
    2322            }
    24             return false;
    2523        }
    2624    }
Note: See TracChangeset for help on using the changeset viewer.