Ignore:
Timestamp:
Feb 21, 2016, 1:05:57 PM (4 years ago)
Author:
nmedfort
Message:

Check in of misc changes prior to symbol table work.

File:
1 edited

Legend:

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

    r4927 r4937  
    545545 * @brief strengthReduction
    546546 *
    547  * Find and replace any Pablo operations with the less expensive equivalent operations whenever possible.
     547 * Find and replace any Pablo operations with a less expensive equivalent operation whenever possible.
    548548 ** ------------------------------------------------------------------------------------------------------------- */
    549549void Simplifier::strengthReduction(PabloBlock * const block) {
     
    578578                    op->eraseFromParent(false);
    579579                }
    580             }
     580            } else if (isa<And>(scanThru->getOperand(0))) {
     581                // Suppose B is an arbitrary bitstream and A = Advance(B, 1). ScanThru(B ∧ ¬A, B) will leave a marker on the position
     582                // following the end of any run of 1-bits in B. But this is equivalent to computing A ∧ ¬B since A will have exactly
     583                // one 1-bit past the end of any run of 1-bits in B.
     584
     585
     586
     587
     588
     589            }
     590
     591
     592
     593
    581594        }
    582595        stmt = stmt->getNextNode();
     
    592605    PabloVerifier::verify(function, "post-eliminate-redundant-code");
    593606    #endif
     607    strengthReduction(function.getEntryBlock());
     608    #ifndef NDEBUG
     609    PabloVerifier::verify(function, "post-strength-reduction");
     610    #endif
    594611    deadCodeElimination(function.getEntryBlock());
    595612    #ifndef NDEBUG
    596613    PabloVerifier::verify(function, "post-dead-code-elimination");
    597614    #endif
    598     strengthReduction(function.getEntryBlock());
    599     #ifndef NDEBUG
    600     PabloVerifier::verify(function, "post-strength-reduction");
    601     #endif
    602615    return true;
    603616}
Note: See TracChangeset for help on using the changeset viewer.