17#ifndef P4_STRENGTHREDUCTION_H_ 
   18#define P4_STRENGTHREDUCTION_H_ 
   20#include "frontends/common/resolveReferences/referenceMap.h" 
   21#include "frontends/p4/sideEffects.h" 
   22#include "frontends/p4/typeChecking/typeChecker.h" 
   23#include "frontends/p4/typeMap.h" 
   28using namespace literals;
 
   54    bool isOne(
const IR::Expression *expr) 
const;
 
   56    bool isZero(
const IR::Expression *expr) 
const;
 
   58    bool isTrue(
const IR::Expression *expr) 
const;
 
   60    bool isFalse(
const IR::Expression *expr) 
const;
 
   62    bool isAllOnes(
const IR::Expression *expr) 
const;
 
   65    int isPowerOf2(
const IR::Expression *expr) 
const;
 
   77        setName(
"StrengthReduction");
 
   83        DoStrengthReduction();
 
   86    using Transform::postorder;
 
  112    const IR::BlockStatement *preorder(IR::BlockStatement *bs)
 override {
 
  113        if (bs->annotations->getSingle(
"disable_optimization"_cs)) prune();
 
 
  121                               bool enableSubConstToAddTransform = 
true) {
 
  122        if (typeMap != 
nullptr) {
 
  123            if (!typeChecking) typeChecking = 
new TypeChecking(
nullptr, typeMap, 
true);
 
  124            passes.push_back(typeChecking);
 
 
Definition strengthReduction.h:47
 
const IR::Node * postorder(IR::Cmpl *expr) override
Definition strengthReduction.cpp:71
 
bool isZero(const IR::Expression *expr) const
Definition strengthReduction.cpp:29
 
bool isFalse(const IR::Expression *expr) const
Definition strengthReduction.cpp:44
 
bool isAllOnes(const IR::Expression *expr) const
Definition strengthReduction.cpp:60
 
bool isTrue(const IR::Expression *expr) const
Definition strengthReduction.cpp:38
 
bool isOne(const IR::Expression *expr) const
Definition strengthReduction.cpp:23
 
bool hasSideEffects(const IR::Expression *expr) const
Definition strengthReduction.h:70
 
int isPowerOf2(const IR::Expression *expr) const
Definition strengthReduction.cpp:50
 
bool enableSubConstToAddTransform
Definition strengthReduction.h:51
 
static bool check(const IR::Expression *expression, const Visitor *calledBy, DeclarationLookup *refMap, TypeMap *typeMap, const Visitor::Context *ctxt=nullptr)
Definition sideEffects.h:106
 
Definition strengthReduction.h:118
 
Definition typeChecker.h:55
 
Definition pass_manager.h:38
 
Definition applyOptionsPragmas.cpp:24