|
16 | 16 | #include "SBFTargetMachine.h" |
17 | 17 | #include "SBFTargetTransformInfo.h" |
18 | 18 | #include "TargetInfo/SBFTargetInfo.h" |
19 | | -#include "llvm/CodeGen/Passes.h" |
20 | 19 | #include "llvm/CodeGen/ExpandMemCmp.h" |
| 20 | +#include "llvm/CodeGen/Passes.h" |
21 | 21 | #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" |
22 | 22 | #include "llvm/CodeGen/TargetPassConfig.h" |
23 | 23 | #include "llvm/IR/PassManager.h" |
24 | 24 | #include "llvm/MC/TargetRegistry.h" |
25 | 25 | #include "llvm/Passes/PassBuilder.h" |
26 | 26 | #include "llvm/Target/TargetOptions.h" |
| 27 | +#include "llvm/Transforms/InstCombine/InstCombine.h" |
27 | 28 | #include "llvm/Transforms/Scalar.h" |
28 | 29 | #include "llvm/Transforms/Scalar/SimplifyCFG.h" |
29 | 30 | #include "llvm/Transforms/Utils/SimplifyCFGOptions.h" |
@@ -114,11 +115,12 @@ void SBFTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) { |
114 | 115 | FPM.addPass(SBFAbstractMemberAccessPass(this)); |
115 | 116 | FPM.addPass(SBFPreserveDITypePass()); |
116 | 117 | FPM.addPass(SBFIRPeepholePass()); |
117 | | - FPM.addPass(ExpandMemCmpPass(this)); |
118 | 118 | MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM))); |
119 | 119 | }); |
120 | 120 | PB.registerPeepholeEPCallback([=](FunctionPassManager &FPM, |
121 | 121 | OptimizationLevel Level) { |
| 122 | + FPM.addPass(ExpandMemCmpPass(this)); |
| 123 | + FPM.addPass(InstCombinePass()); |
122 | 124 | FPM.addPass(SimplifyCFGPass( |
123 | 125 | SimplifyCFGOptions().hoistCommonInsts(true).convertSwitchToLookupTable( |
124 | 126 | true))); |
|
0 commit comments