34 setName(
"Reassociation");
36 using Transform::postorder;
38 const IR::Node *reassociate(IR::Operation_Binary *root);
40 const IR::Node *postorder(IR::Add *expr)
override {
return reassociate(expr); }
41 const IR::Node *postorder(IR::Mul *expr)
override {
return reassociate(expr); }
42 const IR::Node *postorder(IR::BOr *expr)
override {
return reassociate(expr); }
43 const IR::Node *postorder(IR::BAnd *expr)
override {
return reassociate(expr); }
44 const IR::Node *postorder(IR::BXor *expr)
override {
return reassociate(expr); }
45 const IR::BlockStatement *preorder(IR::BlockStatement *bs)
override {
46 if (bs->annotations->getSingle(
"disable_optimization"_cs)) prune();
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24