Skip to content

Commit 8d19b38

Browse files
committed
Move later in the pass pipeline
1 parent d4cf45e commit 8d19b38

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/jitlayers.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,6 @@ void addOptimizationPasses(PassManager *PM, int opt_level)
116116
PM->add(createVerifierPass());
117117
#endif
118118

119-
// Due to bugs and missing features LLVM < 5.0, does not properly propagate
120-
// our invariants. We need to do GC rooting here. This reduces the
121-
// effectiveness of the optimization, but should retain correctness.
122-
#if JL_LLVM_VERSION < 50000
123-
PM->add(createLowerExcHandlersPass());
124-
PM->add(createLateLowerGCFramePass());
125-
PM->add(createLowerPTLSPass(imaging_mode));
126-
#endif
127-
128119
#if defined(JL_ASAN_ENABLED)
129120
# if JL_LLVM_VERSION >= 30700 && JL_LLVM_VERSION < 30800
130121
// LLVM 3.7 BUG: ASAN pass doesn't properly initialize its dependencies
@@ -143,13 +134,11 @@ void addOptimizationPasses(PassManager *PM, int opt_level)
143134
#else
144135
PM->add(createAlwaysInlinerPass()); // Respect always_inline
145136
#endif
146-
#if JL_LLVM_VERSION >= 50000
147137
PM->add(createBarrierNoopPass());
148138
PM->add(createLowerExcHandlersPass());
149139
PM->add(createGCInvariantVerifierPass(false));
150140
PM->add(createLateLowerGCFramePass());
151141
PM->add(createLowerPTLSPass(imaging_mode));
152-
#endif
153142
return;
154143
}
155144
#if JL_LLVM_VERSION >= 30700
@@ -173,6 +162,15 @@ void addOptimizationPasses(PassManager *PM, int opt_level)
173162
PM->add(createCFGSimplificationPass()); // Clean up disgusting code
174163
PM->add(createPromoteMemoryToRegisterPass()); // Kill useless allocas
175164

165+
// Due to bugs and missing features LLVM < 5.0, does not properly propagate
166+
// our invariants. We need to do GC rooting here. This reduces the
167+
// effectiveness of the optimization, but should retain correctness.
168+
#if JL_LLVM_VERSION < 50000
169+
PM->add(createLowerExcHandlersPass());
170+
PM->add(createLateLowerGCFramePass());
171+
PM->add(createLowerPTLSPass(imaging_mode));
172+
#endif
173+
176174
// hopefully these functions (from llvmcall) don't try to interact with the Julia runtime
177175
// or have anything that might corrupt the createLowerPTLSPass pass
178176
#if JL_LLVM_VERSION >= 40000

0 commit comments

Comments
 (0)