Skip to content

Commit

Permalink
enable div optimization (#95201)
Browse files Browse the repository at this point in the history
  • Loading branch information
saitama951 authored Nov 25, 2023
1 parent bdee729 commit 2f8ef58
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/mono/mono/mini/local-propagation.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ mono_strength_reduction_ins (MonoCompile *cfg, MonoInst *ins, const char **spec)
}
case OP_IDIV_UN_IMM:
case OP_IDIV_IMM: {
if ((!COMPILE_LLVM (cfg)) && (!cfg->backend->optimized_div))
if (!COMPILE_LLVM (cfg))
allocated_vregs = mono_strength_reduction_division (cfg, ins);
break;
}
Expand All @@ -384,7 +384,7 @@ mono_strength_reduction_ins (MonoCompile *cfg, MonoInst *ins, const char **spec)
MONO_INST_NULLIFY_SREGS (ins);
ins->inst_c0 = 0;
} else if ((ins->inst_imm > 0) && (ins->inst_imm < (1LL << 32)) &&
(power != -1) && (!cfg->backend->optimized_div)) {
(power != -1)) {
gboolean is_long = ins->opcode == OP_LREM_IMM;
int compensator_reg = alloc_ireg (cfg);
int intermediate_reg;
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/mini-s390x.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ struct SeqPointInfo {
#define MONO_ARCH_HAVE_OP_GENERIC_CLASS_INIT 1
#define MONO_ARCH_HAVE_SETUP_ASYNC_CALLBACK 1
#define MONO_ARCH_HAVE_TRACK_FPREGS 1
#define MONO_ARCH_HAVE_OPTIMIZED_DIV 1
#define MONO_ARCH_HAVE_OP_TAILCALL_MEMBASE 1
#define MONO_ARCH_HAVE_OP_TAILCALL_REG 1
#define MONO_ARCH_HAVE_SDB_TRAMPOLINES 1
Expand Down
3 changes: 0 additions & 3 deletions src/mono/mono/mini/mini.c
Original file line number Diff line number Diff line change
Expand Up @@ -3021,9 +3021,6 @@ init_backend (MonoBackend *backend)
#ifdef MONO_ARCH_EXPLICIT_NULL_CHECKS
backend->explicit_null_checks = 1;
#endif
#ifdef MONO_ARCH_HAVE_OPTIMIZED_DIV
backend->optimized_div = 1;
#endif
#ifdef MONO_ARCH_HAVE_INIT_MRGCTX
backend->have_init_mrgctx = 1;
#endif
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/mini/mini.h
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,6 @@ typedef struct {
guint no_unaligned_access : 1;
guint disable_div_with_mul : 1;
guint explicit_null_checks : 1;
guint optimized_div : 1;
int monitor_enter_adjustment;
int dyn_call_param_area;
} MonoBackend;
Expand Down

0 comments on commit 2f8ef58

Please sign in to comment.