Ignore:
Timestamp:
Jan 6, 2018, 5:03:47 PM (14 months ago)
Author:
nmedfort
Message:

Bug fixes

File:
1 edited

Legend:

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

    r5782 r5821  
    356356            block->setInsertPoint(stmt->getPrevNode());
    357357            return block->createZeroes(stmt->getType());
     358        } else if (LLVM_UNLIKELY(isa<ScanThru>(st->getScanFrom()))) {
     359            ScanThru * const nested = cast<ScanThru>(st->getScanFrom());
     360            if (LLVM_UNLIKELY(st->getScanThru() == nested->getScanThru())) {
     361                return nested;
     362            }
    358363        }
    359364    } else if (isa<MatchStar>(stmt)) {
     
    498503                    continue;
    499504                }
    500             } else if (LLVM_UNLIKELY(isa<ScanThru>(outer->getScanFrom()))) {
    501                 // Replace ScanThru(ScanThru(x, y), z) with ScanThru(x, y | z)
    502                 ScanThru * const inner = cast<ScanThru>(outer->getScanFrom());
    503                 block->setInsertPoint(stmt);
    504                 ScanThru * const scanThru = block->createScanThru(inner->getScanFrom(), block->createOr(inner->getScanThru(), outer->getScanThru()));
    505                 stmt->replaceWith(scanThru);
    506                 stmt = scanThru;
    507                 continue;
     505//            } else if (LLVM_UNLIKELY(isa<ScanThru>(outer->getScanFrom()))) {
     506//                // Replace ScanThru(ScanThru(x, y), z) with ScanThru(x, y | z)
     507//                // TODO: this transformation is valid if and only if there can be no instance of ...yzy... in the (y | z) stream
     508//                // but that degree of reasoning is too complex to perform linearly here
     509//                ScanThru * const inner = cast<ScanThru>(outer->getScanFrom());
     510//                block->setInsertPoint(stmt);
     511//                ScanThru * const scanThru = block->createScanThru(inner->getScanFrom(), block->createOr(inner->getScanThru(), outer->getScanThru()));
     512//                stmt->replaceWith(scanThru);
     513//                stmt = scanThru;
     514//                continue;
    508515            } else if (LLVM_UNLIKELY(isa<And>(outer->getScanFrom()))) {
    509516                // Suppose B is an arbitrary bitstream and A = Advance(B, 1). ScanThru(B ∧ ¬A, B) will leave a marker on the position
Note: See TracChangeset for help on using the changeset viewer.