@@ -116,15 +116,6 @@ void addOptimizationPasses(PassManager *PM, int opt_level)
116
116
PM->add (createVerifierPass ());
117
117
#endif
118
118
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
-
128
119
#if defined(JL_ASAN_ENABLED)
129
120
# if JL_LLVM_VERSION >= 30700 && JL_LLVM_VERSION < 30800
130
121
// LLVM 3.7 BUG: ASAN pass doesn't properly initialize its dependencies
@@ -143,13 +134,11 @@ void addOptimizationPasses(PassManager *PM, int opt_level)
143
134
#else
144
135
PM->add (createAlwaysInlinerPass ()); // Respect always_inline
145
136
#endif
146
- #if JL_LLVM_VERSION >= 50000
147
137
PM->add (createBarrierNoopPass ());
148
138
PM->add (createLowerExcHandlersPass ());
149
139
PM->add (createGCInvariantVerifierPass (false ));
150
140
PM->add (createLateLowerGCFramePass ());
151
141
PM->add (createLowerPTLSPass (imaging_mode));
152
- #endif
153
142
return ;
154
143
}
155
144
#if JL_LLVM_VERSION >= 30700
@@ -173,6 +162,15 @@ void addOptimizationPasses(PassManager *PM, int opt_level)
173
162
PM->add (createCFGSimplificationPass ()); // Clean up disgusting code
174
163
PM->add (createPromoteMemoryToRegisterPass ()); // Kill useless allocas
175
164
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
+
176
174
// hopefully these functions (from llvmcall) don't try to interact with the Julia runtime
177
175
// or have anything that might corrupt the createLowerPTLSPass pass
178
176
#if JL_LLVM_VERSION >= 40000
0 commit comments