Ignore:
Timestamp:
Jan 7, 2015, 3:40:23 PM (5 years ago)
Author:
nmedfort
Message:

Changes to support 3-operand form for all instructions. CSE disabled but partially redundant now.

File:
1 edited

Legend:

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

    r4404 r4410  
    1010namespace pablo {
    1111
    12 PabloAST * OptimizeAnd::operator ()(PabloAST * expr1, PabloAST * expr2) {
     12And::And(PabloAST * expr1, PabloAST * expr2, PabloBlock * parent)
     13: Statement(ClassTypeId::And, parent->makeName("and"), parent)
     14, mExprs({{expr1, expr2}})
     15{
     16    expr1->addUser(this);
     17    expr2->addUser(this);
     18}
     19
     20PabloAST * OptimizeAnd::operator ()(PabloAST * expr1, PabloAST * expr2, PabloBlock * pb) {
    1321    if (isa<Ones>(expr1)) {
    1422        return expr2;
     
    2836    else if (Not * pe_not_e1 = dyn_cast<Not>(expr1)) {
    2937        if (Not * pe_not_e2 = dyn_cast<Not>(expr2)) {
    30             return cg.createNot(cg.createOr(pe_not_e1->getExpr(), pe_not_e2->getExpr()));
     38            return pb->createNot(pb->createOr(pe_not_e1->getExpr(), pe_not_e2->getExpr()));
    3139        }
    3240        else if (equals(pe_not_e1->getExpr(), expr2)) {
    33             return cg.createZeroes();
     41            return pb->createZeroes();
    3442        }
    3543    }
    3644    else if (Not * pe_not_e2 = dyn_cast<Not>(expr2)) {
    3745        if (equals(expr1, pe_not_e2->getExpr())) {
    38             return cg.createZeroes();
     46            return pb->createZeroes();
    3947        }
    4048    }
     
    4250        std::swap(expr1, expr2);
    4351    }
    44     return new And(expr1, expr2);
     52    return pb->createAndImm(expr1, expr2);
    4553}
    4654
Note: See TracChangeset for help on using the changeset viewer.