@@ -158,17 +158,16 @@ void EVMTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
158
158
PB.registerOptimizerLastEPCallback (
159
159
[](ModulePassManager &PM, OptimizationLevel Level) {
160
160
if (Level != OptimizationLevel::O0) {
161
- PM.addPass (GlobalDCEPass ());
162
161
FunctionPassManager FPM;
163
- FPM.addPass (EarlyCSEPass (true /* Enable mem-ssa. */ ));
164
- FPM.addPass (NewGVNPass ());
162
+ // FPM.addPass(EarlyCSEPass(true /* Enable mem-ssa. */));
163
+ // FPM.addPass(NewGVNPass());
165
164
FPM.addPass (DSEPass ());
166
- FPM. addPass ( MergeIdenticalBBPass ());
167
- FPM.addPass (SimplifyCFGPass (SimplifyCFGOptions ()
168
- .convertSwitchRangeToICmp (true )
169
- .hoistCommonInsts (true )
170
- .sinkCommonInsts (true )));
171
- FPM. addPass ( InstCombinePass ());
165
+ /*
166
+ FPM.addPass(SimplifyCFGPass(SimplifyCFGOptions()
167
+ .convertSwitchRangeToICmp(true)
168
+ .hoistCommonInsts(true)
169
+ .sinkCommonInsts(true)));
170
+ */
172
171
PM.addPass (createModuleToFunctionPassAdaptor (std::move (FPM), true ));
173
172
}
174
173
});
@@ -243,6 +242,14 @@ class EVMPassConfig final : public TargetPassConfig {
243
242
void EVMPassConfig::addIRPasses () {
244
243
addPass (createEVMLowerIntrinsicsPass ());
245
244
if (TM->getOptLevel () != CodeGenOptLevel::None) {
245
+ addPass (createNewGVNPass ());
246
+ addPass (createNaryReassociatePass ());
247
+ addPass (createEarlyCSEPass (true ));
248
+ addPass (createCFGSimplificationPass (SimplifyCFGOptions ()
249
+ .convertSwitchRangeToICmp (true )
250
+ .hoistCommonInsts (true )
251
+ .sinkCommonInsts (true )));
252
+
246
253
addPass (createEVMAAWrapperPass ());
247
254
addPass (createEVMExternalAAWrapperPass ());
248
255
}
0 commit comments