Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Sep 30, 2024
1 parent a801574 commit eb7247e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2416,8 +2416,15 @@ function optimize!(mod::LLVM.Module, tm)
# Globalopt is separated as it can delete functions, which invalidates the Julia hardcoded pointers to
# known functions
ModulePassManager() do pm

add_library_info!(pm, triple(mod))
add_transform_info!(pm, tm)

scoped_no_alias_aa!(pm)
type_based_alias_analysis!(pm)
basic_alias_analysis!(pm)
cpu_features_tm!(pm, tm)

LLVM.API.LLVMAddGlobalOptimizerPass(pm) # Extra
gvn!(pm) # Extra
LLVM.run!(pm, mod)
Expand All @@ -2427,6 +2434,11 @@ function optimize!(mod::LLVM.Module, tm)
add_library_info!(pm, triple(mod))
add_transform_info!(pm, tm)

scoped_no_alias_aa!(pm)
type_based_alias_analysis!(pm)
basic_alias_analysis!(pm)
cpu_features_tm!(pm, tm)

instruction_combining!(pm)
jl_inst_simplify!(pm)
cfgsimplification!(pm)
Expand Down Expand Up @@ -2494,6 +2506,14 @@ function optimize!(mod::LLVM.Module, tm)
# Globalopt is separated as it can delete functions, which invalidates the Julia hardcoded pointers to
# known functions
ModulePassManager() do pm
add_library_info!(pm, triple(mod))
add_transform_info!(pm, tm)

scoped_no_alias_aa!(pm)
type_based_alias_analysis!(pm)
basic_alias_analysis!(pm)
cpu_features_tm!(pm, tm)

LLVM.API.LLVMAddGlobalOptimizerPass(pm) # Exxtra
gvn!(pm) # Exxtra
LLVM.run!(pm, mod)
Expand Down

0 comments on commit eb7247e

Please sign in to comment.