Ignore:
Timestamp:
Dec 23, 2015, 4:28:42 PM (3 years ago)
Author:
nmedfort
Message:

Work on lowering + minor bug fixes.

File:
1 edited

Legend:

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

    r4890 r4899  
    202202 ** ------------------------------------------------------------------------------------------------------------- */
    203203inline bool Simplifier::isSuperfluous(const Assign * const assign) {
    204     for (const PabloAST * inst : assign->users()) {
    205         if (isa<Next>(inst) || isa<PabloFunction>(inst) || (isa<If>(inst) && (cast<If>(inst)->getCondition() != assign))) {
     204    for (const PabloAST * user : assign->users()) {
     205        if (LLVM_UNLIKELY(isa<PabloFunction>(user) || isa<Next>(user))) {
     206            return false;
     207        } else if (isa<If>(user)) {
     208            if (LLVM_UNLIKELY(cast<If>(user)->getCondition() == assign)) {
     209                continue;
     210            } else if (isa<Assign>(assign->getExpression())) {
     211                continue;
     212            }
    206213            return false;
    207214        }
     
    318325            // the Assign's expression directly.
    319326            if (isSuperfluous(assign)) {
    320                 stmt = assign->replaceWith(assign->getExpression());
     327                stmt = assign->replaceWith(assign->getExpression());               
    321328                continue;
    322329            }
Note: See TracChangeset for help on using the changeset viewer.