File tree Expand file tree Collapse file tree 1 file changed +10
-17
lines changed
Expand file tree Collapse file tree 1 file changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -188,12 +188,15 @@ bool GlobalDepsAnalyzer::runOnModule( llvm::Module & module )
188188
189189 simplifyCalls (module );
190190
191- if (!llcPass)
192- {
193- for (Function& F : module .getFunctionList ())
191+ bool anyWasmFuncAddrTaken = false ;
192+ // Replace calls like 'printf("Hello!")' with 'puts("Hello!")'.
193+ for (Function& F : module .getFunctionList ()) {
194+ bool asmjs = F.getSection () == StringRef (" asmjs" );
195+ if (asmjs) {
196+ anyWasmFuncAddrTaken |= F.hasAddressTaken ();
197+ }
198+ if (!llcPass)
194199 {
195- // Those intrinsics may come back as result of other optimizations
196- // And we may need the actual functions to lower the intrinsics
197200 const auto builtinID = BuiltinInstr::getMathBuiltin (F);
198201 const auto typedBuiltinID = TypedBuiltinInstr::getMathTypedBuiltin (F);
199202
@@ -204,20 +207,10 @@ bool GlobalDepsAnalyzer::runOnModule( llvm::Module & module )
204207 || F.getName () == " memset"
205208 || F.getName () == " memmove" )
206209 {
207- if (TypedBuiltinInstr::isAlwaysExactNatively (typedBuiltinID))
208- continue ;
209- extendLifetime (&F);
210+ if (!TypedBuiltinInstr::isAlwaysExactNatively (typedBuiltinID))
211+ extendLifetime (&F);
210212 }
211213 }
212- }
213-
214- bool anyWasmFuncAddrTaken = false ;
215- // Replace calls like 'printf("Hello!")' with 'puts("Hello!")'.
216- for (Function& F : module .getFunctionList ()) {
217- bool asmjs = F.getSection () == StringRef (" asmjs" );
218- if (asmjs) {
219- anyWasmFuncAddrTaken |= F.hasAddressTaken ();
220- }
221214 for (BasicBlock& bb : F)
222215 {
223216 bool advance = false ; // Do not advance at the start
You can’t perform that action at this time.
0 commit comments