Skip to content

Commit 6d27bf8

Browse files
committed
[NewPM] Update CodeGenPreparePass reference in CodeGenPassBuilder
1 parent e0c554a commit 6d27bf8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

llvm/include/llvm/CodeGen/CodeGenPassBuilder.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "llvm/Analysis/TargetTransformInfo.h"
2525
#include "llvm/Analysis/TypeBasedAliasAnalysis.h"
2626
#include "llvm/CodeGen/CallBrPrepare.h"
27+
#include "llvm/CodeGen/CodeGenPrepare.h"
2728
#include "llvm/CodeGen/DwarfEHPrepare.h"
2829
#include "llvm/CodeGen/ExpandMemCmp.h"
2930
#include "llvm/CodeGen/ExpandReductions.h"
@@ -727,7 +728,7 @@ void CodeGenPassBuilder<Derived>::addPassesToHandleExceptions(
727728
template <typename Derived>
728729
void CodeGenPassBuilder<Derived>::addCodeGenPrepare(AddIRPass &addPass) const {
729730
if (getOptLevel() != CodeGenOptLevel::None && !Opt.DisableCGP)
730-
addPass(CodeGenPreparePass());
731+
addPass(CodeGenPreparePass(&TM));
731732
// TODO: Default ctor'd RewriteSymbolPass is no-op.
732733
// addPass(RewriteSymbolPass());
733734
}

llvm/include/llvm/CodeGen/MachinePassRegistry.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ FUNCTION_ANALYSIS("targetir", TargetIRAnalysis,
4242
#endif
4343
FUNCTION_PASS("callbrprepare", CallBrPreparePass, ())
4444
FUNCTION_PASS("cfguard", CFGuardPass, ())
45+
FUNCTION_PASS("codegenprepare", CodeGenPreparePass, (TM))
4546
FUNCTION_PASS("consthoist", ConstantHoistingPass, ())
4647
FUNCTION_PASS("dwarf-eh-prepare", DwarfEHPreparePass, (TM))
4748
FUNCTION_PASS("ee-instrument", EntryExitInstrumenterPass, (false))
@@ -131,7 +132,6 @@ MACHINE_FUNCTION_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis,
131132
#define DUMMY_FUNCTION_PASS(NAME, PASS_NAME, CONSTRUCTOR)
132133
#endif
133134
DUMMY_FUNCTION_PASS("atomic-expand", AtomicExpandPass, ())
134-
DUMMY_FUNCTION_PASS("codegenprepare", CodeGenPreparePass, ())
135135
DUMMY_FUNCTION_PASS("gc-lowering", GCLoweringPass, ())
136136
DUMMY_FUNCTION_PASS("shadow-stack-gc-lowering", ShadowStackGCLoweringPass, ())
137137
DUMMY_FUNCTION_PASS("stack-protector", StackProtectorPass, ())

0 commit comments

Comments
 (0)