Skip to content

Commit 9132140

Browse files
authored
Remove reference map from another set of midend passes (#4939)
* Remove refmap from NestedStructs Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Remove refmap from CopyStructures Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Remove refmap from FlattenInterfaceStructs Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Remove refmap from EliminateSwitch Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Remove unused refmap from FlattenLogMsg Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Remove refmap from RemoveComplexExpressions Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Remove refmap from hsIndexSimplify Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Remove reference map from LocalCopyPropagation Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Remove reference map from top-level ConstantFolding invocation Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Remove reference map from CheckExternInvocation Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Cleanup unused headers Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Fix DPDK backend bug: DismantleMuxExpressions relies on fresh reference map Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Apply terrible hack to PSA Switch as local copypropagation policy it uses relies on fresh refmap Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> * Simplify Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info> --------- Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
1 parent b8edc2c commit 9132140

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+289
-302
lines changed

backends/bmv2/common/lower.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ const IR::Node *LowerExpressions::postorder(IR::Concat *expression) {
171171

172172
const IR::Node *RemoveComplexExpressions::postorder(IR::MethodCallExpression *expression) {
173173
if (expression->arguments->size() == 0) return expression;
174-
auto mi = P4::MethodInstance::resolve(expression, refMap, typeMap);
174+
auto mi = P4::MethodInstance::resolve(expression, this, typeMap);
175175
if (mi->isApply() || mi->is<P4::BuiltInMethod>()) return expression;
176176

177177
if (auto ef = mi->to<P4::ExternFunction>()) {

backends/bmv2/common/lower.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ class LowerExpressions : public Transform {
5454

5555
class RemoveComplexExpressions : public P4::RemoveComplexExpressions {
5656
public:
57-
RemoveComplexExpressions(P4::ReferenceMap *refMap, P4::TypeMap *typeMap,
58-
P4::RemoveComplexExpressionsPolicy *policy = nullptr)
59-
: P4::RemoveComplexExpressions(refMap, typeMap, policy) {}
57+
explicit RemoveComplexExpressions(P4::TypeMap *typeMap,
58+
P4::RemoveComplexExpressionsPolicy *policy = nullptr)
59+
: P4::RemoveComplexExpressions(typeMap, policy) {}
6060

6161
const IR::Node *postorder(IR::MethodCallExpression *expression) override;
6262
};

backends/bmv2/pna_nic/midend.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ PnaNicMidEnd::PnaNicMidEnd(CompilerOptions &options, std::ostream *outStream)
121121
new P4::TypeChecking(&refMap, &typeMap),
122122
new P4::SimplifyKey(&typeMap,
123123
new P4::OrPolicy(new P4::IsValid(&typeMap), new P4::IsMask())),
124-
new P4::ConstantFolding(&refMap, &typeMap),
124+
new P4::ConstantFolding(&typeMap),
125125
new P4::StrengthReduction(&typeMap),
126126
new P4::SimplifySelectCases(&typeMap, true), // require constant keysets
127127
new P4::ExpandLookahead(&typeMap),
@@ -130,27 +130,27 @@ PnaNicMidEnd::PnaNicMidEnd(CompilerOptions &options, std::ostream *outStream)
130130
new P4::StrengthReduction(&typeMap),
131131
new P4::EliminateTuples(&typeMap),
132132
new P4::SimplifyComparisons(&typeMap),
133-
new P4::CopyStructures(&refMap, &typeMap),
134-
new P4::NestedStructs(&refMap, &typeMap),
133+
new P4::CopyStructures(&typeMap),
134+
new P4::NestedStructs(&typeMap),
135135
new P4::SimplifySelectList(&typeMap),
136136
new P4::RemoveSelectBooleans(&typeMap),
137137
new P4::FlattenHeaders(&typeMap),
138-
new P4::FlattenInterfaceStructs(&refMap, &typeMap),
138+
new P4::FlattenInterfaceStructs(&typeMap),
139139
new P4::ReplaceSelectRange(),
140140
new P4::Predication(),
141141
new P4::MoveDeclarations(), // more may have been introduced
142-
new P4::ConstantFolding(&refMap, &typeMap),
143-
new P4::LocalCopyPropagation(&refMap, &typeMap, nullptr, policy),
142+
new P4::ConstantFolding(&typeMap),
143+
new P4::LocalCopyPropagation(&typeMap, nullptr, policy),
144144
new PassRepeated(
145-
{new P4::ConstantFolding(&refMap, &typeMap), new P4::StrengthReduction(&typeMap)}),
145+
{new P4::ConstantFolding(&typeMap), new P4::StrengthReduction(&typeMap)}),
146146
new P4::MoveDeclarations(),
147147
new P4::ValidateTableProperties({"pna_implementation"_cs, "pna_direct_counter"_cs,
148148
"pna_direct_meter"_cs, "pna_idle_timeout"_cs,
149149
"size"_cs}),
150150
new P4::SimplifyControlFlow(&typeMap),
151151
new P4::CompileTimeOperations(),
152152
new P4::TableHit(&typeMap),
153-
new P4::EliminateSwitch(&refMap, &typeMap),
153+
new P4::EliminateSwitch(&typeMap),
154154
new P4::MoveActionsToTables(&refMap, &typeMap),
155155
new P4::RemoveLeftSlices(&typeMap),
156156
new P4::TypeChecking(&refMap, &typeMap),

backends/bmv2/pna_nic/pnaNic.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,9 @@ void PnaNicBackend::convert(const IR::ToplevelBlock *tlb) {
8888
new P4::TypeChecking(refMap, typeMap),
8989
new P4::SimplifyControlFlow(typeMap),
9090
new LowerExpressions(typeMap),
91-
new PassRepeated(
92-
{new P4::ConstantFolding(refMap, typeMap), new P4::StrengthReduction(typeMap)}),
91+
new PassRepeated({new P4::ConstantFolding(typeMap), new P4::StrengthReduction(typeMap)}),
9392
new P4::TypeChecking(refMap, typeMap),
94-
new P4::RemoveComplexExpressions(refMap, typeMap,
93+
new P4::RemoveComplexExpressions(typeMap,
9594
new ProcessControls(&structure.pipeline_controls)),
9695
new P4::SimplifyControlFlow(typeMap),
9796
new P4::RemoveAllUnusedDeclarations(refMap, P4::RemoveUnusedPolicy()),

backends/bmv2/psa_switch/midend.cpp

+10-8
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ PsaSwitchMidEnd::PsaSwitchMidEnd(CompilerOptions &options, std::ostream *outStre
9898
[=](const Context *, const IR::Expression *e) -> bool {
9999
auto mce = e->to<IR::MethodCallExpression>();
100100
if (mce == nullptr) return true;
101+
// FIXME: Add utility method to resolve declaration given a context
101102
auto mi = P4::MethodInstance::resolve(mce, &refMap, &typeMap);
102103
auto em = mi->to<P4::ExternMethod>();
103104
if (em == nullptr) return true;
@@ -121,7 +122,7 @@ PsaSwitchMidEnd::PsaSwitchMidEnd(CompilerOptions &options, std::ostream *outStre
121122
new P4::TypeChecking(&refMap, &typeMap),
122123
new P4::SimplifyKey(&typeMap,
123124
new P4::OrPolicy(new P4::IsValid(&typeMap), new P4::IsMask())),
124-
new P4::ConstantFolding(&refMap, &typeMap),
125+
new P4::ConstantFolding(&typeMap),
125126
new P4::StrengthReduction(&typeMap),
126127
new P4::SimplifySelectCases(&typeMap, true), // require constant keysets
127128
new P4::ExpandLookahead(&typeMap),
@@ -130,19 +131,20 @@ PsaSwitchMidEnd::PsaSwitchMidEnd(CompilerOptions &options, std::ostream *outStre
130131
new P4::StrengthReduction(&typeMap),
131132
new P4::EliminateTuples(&typeMap),
132133
new P4::SimplifyComparisons(&typeMap),
133-
new P4::CopyStructures(&refMap, &typeMap),
134-
new P4::NestedStructs(&refMap, &typeMap),
134+
new P4::CopyStructures(&typeMap),
135+
new P4::NestedStructs(&typeMap),
135136
new P4::SimplifySelectList(&typeMap),
136137
new P4::RemoveSelectBooleans(&typeMap),
137138
new P4::FlattenHeaders(&typeMap),
138-
new P4::FlattenInterfaceStructs(&refMap, &typeMap),
139+
new P4::FlattenInterfaceStructs(&typeMap),
139140
new P4::ReplaceSelectRange(),
140141
new P4::Predication(),
141142
new P4::MoveDeclarations(), // more may have been introduced
142-
new P4::ConstantFolding(&refMap, &typeMap),
143-
new P4::LocalCopyPropagation(&refMap, &typeMap, nullptr, policy),
143+
new P4::ConstantFolding(&typeMap),
144+
new P4::TypeChecking(&refMap, &typeMap), // policy below relies on fresh refmap
145+
new P4::LocalCopyPropagation(&typeMap, nullptr, policy),
144146
new PassRepeated({
145-
new P4::ConstantFolding(&refMap, &typeMap),
147+
new P4::ConstantFolding(&typeMap),
146148
new P4::StrengthReduction(&typeMap),
147149
}),
148150
new P4::MoveDeclarations(),
@@ -156,7 +158,7 @@ PsaSwitchMidEnd::PsaSwitchMidEnd(CompilerOptions &options, std::ostream *outStre
156158
new P4::SimplifyControlFlow(&typeMap),
157159
new P4::CompileTimeOperations(),
158160
new P4::TableHit(&typeMap),
159-
new P4::EliminateSwitch(&refMap, &typeMap),
161+
new P4::EliminateSwitch(&typeMap),
160162
new P4::MoveActionsToTables(&refMap, &typeMap),
161163
new P4::RemoveLeftSlices(&typeMap),
162164
new P4::TypeChecking(&refMap, &typeMap),

backends/bmv2/psa_switch/psaSwitch.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ void PsaSwitchBackend::convert(const IR::ToplevelBlock *tlb) {
103103
new P4::SimplifyControlFlow(typeMap),
104104
new LowerExpressions(typeMap),
105105
new PassRepeated({
106-
new P4::ConstantFolding(refMap, typeMap),
106+
new P4::ConstantFolding(typeMap),
107107
new P4::StrengthReduction(typeMap),
108108
}),
109109
new P4::TypeChecking(refMap, typeMap),
110-
new P4::RemoveComplexExpressions(refMap, typeMap,
110+
new P4::RemoveComplexExpressions(typeMap,
111111
new ProcessControls(&structure.pipeline_controls)),
112112
new P4::SimplifyControlFlow(typeMap),
113113
new P4::RemoveAllUnusedDeclarations(refMap, P4::RemoveUnusedPolicy()),

backends/bmv2/simple_switch/midend.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ SimpleSwitchMidEnd::SimpleSwitchMidEnd(CompilerOptions &options, std::ostream *o
8989
new P4::TypeChecking(&refMap, &typeMap),
9090
new P4::SimplifyKey(&typeMap,
9191
new P4::OrPolicy(new P4::IsValid(&typeMap), new P4::IsMask())),
92-
new P4::ConstantFolding(&refMap, &typeMap),
92+
new P4::ConstantFolding(&typeMap),
9393
new P4::StrengthReduction(&typeMap),
9494
new P4::SimplifySelectCases(&typeMap, true), // require constant keysets
9595
new P4::ExpandLookahead(&typeMap),
@@ -98,19 +98,19 @@ SimpleSwitchMidEnd::SimpleSwitchMidEnd(CompilerOptions &options, std::ostream *o
9898
new P4::StrengthReduction(&typeMap),
9999
new P4::EliminateTuples(&typeMap),
100100
new P4::SimplifyComparisons(&typeMap),
101-
new P4::CopyStructures(&refMap, &typeMap),
102-
new P4::NestedStructs(&refMap, &typeMap),
101+
new P4::CopyStructures(&typeMap),
102+
new P4::NestedStructs(&typeMap),
103103
new P4::SimplifySelectList(&typeMap),
104104
new P4::RemoveSelectBooleans(&typeMap),
105105
new P4::FlattenHeaders(&typeMap),
106-
new P4::FlattenInterfaceStructs(&refMap, &typeMap),
106+
new P4::FlattenInterfaceStructs(&typeMap),
107107
new P4::ReplaceSelectRange(),
108108
new P4::Predication(),
109109
new P4::MoveDeclarations(), // more may have been introduced
110-
new P4::ConstantFolding(&refMap, &typeMap),
111-
new P4::LocalCopyPropagation(&refMap, &typeMap),
110+
new P4::ConstantFolding(&typeMap),
111+
new P4::LocalCopyPropagation(&typeMap),
112112
new PassRepeated({
113-
new P4::ConstantFolding(&refMap, &typeMap),
113+
new P4::ConstantFolding(&typeMap),
114114
new P4::StrengthReduction(&typeMap),
115115
}),
116116
new P4::SimplifyKey(&typeMap,
@@ -127,7 +127,7 @@ SimpleSwitchMidEnd::SimpleSwitchMidEnd(CompilerOptions &options, std::ostream *o
127127
new P4::EliminateTypedef(&typeMap),
128128
new P4::CompileTimeOperations(),
129129
new P4::TableHit(&typeMap),
130-
new P4::EliminateSwitch(&refMap, &typeMap),
130+
new P4::EliminateSwitch(&typeMap),
131131
new P4::RemoveLeftSlices(&typeMap),
132132
// p4c-bm removed unused action parameters. To produce a compatible
133133
// control plane API, we remove them as well for P4-14 programs.

backends/bmv2/simple_switch/simpleSwitch.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -1178,13 +1178,12 @@ void SimpleSwitchBackend::convert(const IR::ToplevelBlock *tlb) {
11781178
new P4::TypeChecking(refMap, typeMap),
11791179
new P4::SimplifyControlFlow(typeMap),
11801180
new LowerExpressions(typeMap),
1181-
new P4::ConstantFolding(refMap, typeMap, false),
1181+
new P4::ConstantFolding(typeMap, false),
11821182
new P4::TypeChecking(refMap, typeMap),
1183-
new RemoveComplexExpressions(refMap, typeMap,
1184-
new ProcessControls(&structure->pipeline_controls)),
1183+
new RemoveComplexExpressions(typeMap, new ProcessControls(&structure->pipeline_controls)),
11851184
new P4::SimplifyControlFlow(typeMap),
11861185
new P4::RemoveAllUnusedDeclarations(refMap, P4::RemoveUnusedPolicy()),
1187-
new P4::FlattenLogMsg(refMap, typeMap),
1186+
new P4::FlattenLogMsg(typeMap),
11881187
// Converts the DAG into a TREE (at least for expressions)
11891188
// This is important later for conversion to JSON.
11901189
new P4::CloneExpressions(),

backends/dpdk/backend.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ limitations under the License.
2626
#include "dpdkMetadata.h"
2727
#include "dpdkProgram.h"
2828
#include "frontends/p4/moveDeclarations.h"
29+
#include "frontends/p4/typeChecking/typeChecker.h"
2930
#include "ir/dbprint.h"
3031
#include "ir/ir.h"
3132
#include "lib/stringify.h"
@@ -62,10 +63,11 @@ void DpdkBackend::convert(const IR::ToplevelBlock *tlb) {
6263
new P4::TypeChecking(refMap, typeMap),
6364
/// TBD: implement dpdk lowering passes instead of reusing bmv2's lowering pass.
6465
new PassRepeated({new BMV2::LowerExpressions(typeMap, DPDK_MAX_SHIFT_AMOUNT)}, 2),
65-
new P4::RemoveComplexExpressions(refMap, typeMap,
66+
new P4::RemoveComplexExpressions(typeMap,
6667
new DPDK::ProcessControls(&structure.pipeline_controls)),
68+
new TypeChecking(refMap, typeMap), // DismantleMuxExpressions wants fresh refmap
6769
new DismantleMuxExpressions(typeMap, refMap),
68-
new P4::ConstantFolding(refMap, typeMap, false),
70+
new P4::ConstantFolding(typeMap, false),
6971
new EliminateHeaderCopy(refMap, typeMap),
7072
new P4::TypeChecking(refMap, typeMap),
7173
new P4::RemoveAllUnusedDeclarations(refMap, P4::RemoveUnusedPolicy()),
@@ -109,7 +111,7 @@ void DpdkBackend::convert(const IR::ToplevelBlock *tlb) {
109111
new DpdkAddPseudoHeader(refMap, typeMap, is_all_args_header_fields),
110112
new CollectProgramStructure(refMap, typeMap, &structure),
111113
new InspectDpdkProgram(refMap, typeMap, &structure),
112-
new CheckExternInvocation(refMap, typeMap, &structure),
114+
new CheckExternInvocation(typeMap, &structure),
113115
new TypeWidthValidator(),
114116
new DpdkArchLast(),
115117
new VisitFunctor([this, genContextJson] {

backends/dpdk/dpdkArch.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ class CollectLocalStructAndFlatten : public PassManager {
14431443
passes.push_back(new P4::ResolveReferences(refMap));
14441444
passes.push_back(new P4::TypeInference(typeMap, false));
14451445
passes.push_back(new P4::TypeChecking(refMap, typeMap, true));
1446-
passes.push_back(new P4::FlattenInterfaceStructs(refMap, typeMap));
1446+
passes.push_back(new P4::FlattenInterfaceStructs(typeMap));
14471447
}
14481448
};
14491449

backends/dpdk/dpdkCheckExternInvocation.h

+6-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ limitations under the License.
2727
#include "midend/checkExternInvocationCommon.h"
2828

2929
namespace P4 {
30-
class ReferenceMap;
3130
class TypeMap;
3231
} // namespace P4
3332

@@ -137,30 +136,27 @@ class CheckPNAExternInvocation : public P4::CheckExternInvocationCommon {
137136
}
138137

139138
public:
140-
CheckPNAExternInvocation(P4::ReferenceMap *refMap, P4::TypeMap *typeMap,
141-
DpdkProgramStructure *structure)
142-
: P4::CheckExternInvocationCommon(refMap, typeMap), structure(structure) {
139+
CheckPNAExternInvocation(P4::TypeMap *typeMap, DpdkProgramStructure *structure)
140+
: P4::CheckExternInvocationCommon(typeMap), structure(structure) {
143141
initPipeConstraints();
144142
}
145143
};
146144

147145
/// @brief Class which chooses the correct class for checking the constraints for invocations.
148146
/// of extern methods and functions depending on the architecture.
149147
class CheckExternInvocation : public Inspector {
150-
P4::ReferenceMap *refMap;
151148
P4::TypeMap *typeMap;
152149
DpdkProgramStructure *structure;
153150

154151
public:
155-
CheckExternInvocation(P4::ReferenceMap *refMap, P4::TypeMap *typeMap,
156-
DpdkProgramStructure *structure)
157-
: refMap(refMap), typeMap(typeMap), structure(structure) {}
152+
CheckExternInvocation(P4::TypeMap *typeMap, DpdkProgramStructure *structure)
153+
: typeMap(typeMap), structure(structure) {}
158154

159155
bool preorder(const IR::P4Program *program) {
160156
if (structure->isPNA()) {
161157
LOG1("Checking extern invocations for PNA architecture.");
162-
auto checker = new CheckPNAExternInvocation(refMap, typeMap, structure);
163-
program->apply(*checker);
158+
CheckPNAExternInvocation checker(typeMap, structure);
159+
program->apply(checker, getChildContext());
164160
} else if (structure->isPSA()) {
165161
LOG1("Checking extern invocations for PSA architecture.");
166162
// Add class checking PSA constraints here.

backends/dpdk/midend.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ DpdkMidEnd::DpdkMidEnd(CompilerOptions &options, std::ostream *outStream) {
180180
new P4::SimplifyKey(
181181
&typeMap, new P4::OrPolicy(new P4::IsValid(&typeMap), new P4::IsLikeLeftValue())),
182182
new P4::RemoveExits(&typeMap),
183-
new P4::ConstantFolding(&refMap, &typeMap),
183+
new P4::ConstantFolding(&typeMap),
184184
new P4::StrengthReduction(&typeMap),
185185
new P4::SimplifySelectCases(&typeMap, true),
186186
// The lookahead implementation in DPDK target supports only a header instance as
@@ -194,23 +194,23 @@ DpdkMidEnd::DpdkMidEnd(CompilerOptions &options, std::ostream *outStream) {
194194
new P4::StrengthReduction(&typeMap),
195195
new P4::EliminateTuples(&typeMap),
196196
new P4::SimplifyComparisons(&typeMap),
197-
new P4::CopyStructures(&refMap, &typeMap, false /* errorOnMethodCall */),
198-
new P4::NestedStructs(&refMap, &typeMap),
197+
new P4::CopyStructures(&typeMap, false /* errorOnMethodCall */),
198+
new P4::NestedStructs(&typeMap),
199199
new P4::SimplifySelectList(&typeMap),
200200
new P4::RemoveSelectBooleans(&typeMap),
201201
new P4::FlattenHeaders(&typeMap),
202-
new P4::FlattenInterfaceStructs(&refMap, &typeMap),
202+
new P4::FlattenInterfaceStructs(&typeMap),
203203
new P4::EliminateTypedef(&typeMap),
204-
new P4::HSIndexSimplifier(&refMap, &typeMap),
204+
new P4::HSIndexSimplifier(&typeMap),
205205
new P4::ParsersUnroll(true, &refMap, &typeMap),
206206
new P4::FlattenHeaderUnion(&refMap, &typeMap),
207207
new P4::SimplifyControlFlow(&typeMap),
208208
new P4::ReplaceSelectRange(),
209209
new P4::MoveDeclarations(), // more may have been introduced
210-
new P4::ConstantFolding(&refMap, &typeMap),
211-
new P4::LocalCopyPropagation(&refMap, &typeMap, nullptr, policy),
210+
new P4::ConstantFolding(&typeMap),
211+
new P4::LocalCopyPropagation(&typeMap, nullptr, policy),
212212
new PassRepeated({
213-
new P4::ConstantFolding(&refMap, &typeMap),
213+
new P4::ConstantFolding(&typeMap),
214214
new P4::StrengthReduction(&typeMap),
215215
}),
216216
new P4::MoveDeclarations(),

backends/ebpf/midend.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ const IR::ToplevelBlock *MidEnd::run(EbpfOptions &options, const IR::P4Program *
8888
new P4::SimplifyKey(
8989
&typeMap, new P4::OrPolicy(new P4::IsValid(&typeMap), new P4::IsLikeLeftValue())),
9090
new P4::RemoveExits(&typeMap),
91-
new P4::ConstantFolding(&refMap, &typeMap),
91+
new P4::ConstantFolding(&typeMap),
9292
new P4::SimplifySelectCases(&typeMap, false), // accept non-constant keysets
9393
new P4::ExpandEmit(&typeMap),
9494
new P4::HandleNoMatch(),
9595
new P4::SimplifyParsers(),
9696
new PassRepeated({
97-
new P4::ConstantFolding(&refMap, &typeMap),
97+
new P4::ConstantFolding(&typeMap),
9898
new P4::StrengthReduction(&typeMap),
9999
}),
100100
new P4::SimplifyComparisons(&typeMap),
@@ -103,7 +103,7 @@ const IR::ToplevelBlock *MidEnd::run(EbpfOptions &options, const IR::P4Program *
103103
new P4::MoveDeclarations(), // more may have been introduced
104104
new P4::RemoveSelectBooleans(&typeMap),
105105
new P4::SingleArgumentSelect(&typeMap),
106-
new P4::ConstantFolding(&refMap, &typeMap),
106+
new P4::ConstantFolding(&typeMap),
107107
new P4::SimplifyControlFlow(&typeMap),
108108
new P4::TableHit(&typeMap),
109109
new P4::RemoveLeftSlices(&typeMap),

0 commit comments

Comments
 (0)