Skip to content

Commit a16ffd6

Browse files
author
KristofferC
committed
Revert "Emit safepoints at function entry (#41616)"
This reverts commit 1a7a131.
1 parent eba98e5 commit a16ffd6

File tree

5 files changed

+6
-17
lines changed

5 files changed

+6
-17
lines changed

base/reflection.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,6 @@ struct CodegenParams
10921092
prefer_specsig::Cint
10931093
gnu_pubnames::Cint
10941094
debug_info_kind::Cint
1095-
safepoint_on_entry::Cint
10961095

10971096
lookup::Ptr{Cvoid}
10981097

@@ -1101,14 +1100,12 @@ struct CodegenParams
11011100
function CodegenParams(; track_allocations::Bool=true, code_coverage::Bool=true,
11021101
prefer_specsig::Bool=false,
11031102
gnu_pubnames=true, debug_info_kind::Cint = default_debug_info_kind(),
1104-
safepoint_on_entry::Bool=true,
11051103
lookup::Ptr{Cvoid}=cglobal(:jl_rettype_inferred),
11061104
generic_context = nothing)
11071105
return new(
11081106
Cint(track_allocations), Cint(code_coverage),
11091107
Cint(prefer_specsig),
11101108
Cint(gnu_pubnames), debug_info_kind,
1111-
Cint(safepoint_on_entry),
11121109
lookup, generic_context)
11131110
end
11141111
end

src/cgutils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3896,6 +3896,7 @@ static Value *emit_defer_signal(jl_codectx_t &ctx)
38963896
return ctx.builder.CreateInBoundsGEP(ctx.types().T_sigatomic, ptls, ArrayRef<Value*>(offset), "jl_defer_signal");
38973897
}
38983898

3899+
38993900
#ifndef JL_NDEBUG
39003901
static int compare_cgparams(const jl_cgparams_t *a, const jl_cgparams_t *b)
39013902
{

src/codegen.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,6 @@ extern "C" {
12091209
1,
12101210
#endif
12111211
(int) DICompileUnit::DebugEmissionKind::FullDebug,
1212-
1,
12131212
jl_rettype_inferred, NULL };
12141213
}
12151214

@@ -7464,11 +7463,8 @@ static jl_llvm_functions_t
74647463

74657464
Instruction &prologue_end = ctx.builder.GetInsertBlock()->back();
74667465

7467-
// step 11a. Emit the entry safepoint
7468-
if (JL_FEAT_TEST(ctx, safepoint_on_entry))
7469-
emit_gc_safepoint(ctx.builder, get_current_ptls(ctx), ctx.tbaa().tbaa_const);
74707466

7471-
// step 11b. Do codegen in control flow order
7467+
// step 11. Do codegen in control flow order
74727468
std::vector<int> workstack;
74737469
std::map<int, BasicBlock*> BB;
74747470
std::map<size_t, BasicBlock*> come_from_bb;

src/julia.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,11 +2229,9 @@ typedef struct {
22292229

22302230
// controls the emission of debug-info. mirrors the clang options
22312231
int gnu_pubnames; // can we emit the gnu pubnames debuginfo
2232-
int debug_info_kind; // Enum for line-table-only, line-directives-only,
2232+
int debug_info_kind; // Enum for line-table-only, line-directives-only,
22332233
// limited, standalone
22342234

2235-
int safepoint_on_entry; // Emit a safepoint on entry to each function
2236-
22372235
// Cache access. Default: jl_rettype_inferred.
22382236
jl_codeinstance_lookup_t lookup;
22392237

test/compiler/codegen.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ function libjulia_codegen_name()
1515
is_debug_build ? "libjulia-codegen-debug" : "libjulia-codegen"
1616
end
1717

18-
# The tests below assume a certain format and safepoint_on_entry=true breaks that.
19-
function get_llvm(@nospecialize(f), @nospecialize(t), raw=true, dump_module=false, optimize=true)
20-
params = Base.CodegenParams(safepoint_on_entry=false)
21-
d = InteractiveUtils._dump_function(f, t, false, false, !raw, dump_module, :att, optimize, :none, false, params)
22-
sprint(print, d)
23-
end
18+
# `_dump_function` might be more efficient but it doesn't really matter here...
19+
get_llvm(@nospecialize(f), @nospecialize(t), raw=true, dump_module=false, optimize=true) =
20+
sprint(code_llvm, f, t, raw, dump_module, optimize)
2421

2522
if !is_debug_build && opt_level > 0
2623
# Make sure getptls call is removed at IR level with optimization on

0 commit comments

Comments
 (0)