[php-src] master: Use new abilities or ir_save()

From: Date: Wed, 20 Mar 2024 10:37:04 +0000
Subject: [php-src] master: Use new abilities or ir_save()
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-127808@lists.php.net to get a copy of this message
Author: Dmitry Stogov (dstogov) Date: 2024-03-20T13:22:47+03:00 Commit: https://github.com/php/php-src/commit/fa512dc4cbbe3bfeee14ab2a861dcd0cc8444d0d Raw diff: https://github.com/php/php-src/commit/fa512dc4cbbe3bfeee14ab2a861dcd0cc8444d0d.diff Use new abilities or ir_save() Changed paths: M ext/opcache/jit/zend_jit.h M ext/opcache/jit/zend_jit_ir.c Diff: diff --git a/ext/opcache/jit/zend_jit.h b/ext/opcache/jit/zend_jit.h index 074bf67cf25a..99940cf684ed 100644 --- a/ext/opcache/jit/zend_jit.h +++ b/ext/opcache/jit/zend_jit.h @@ -76,10 +76,10 @@ #define ZEND_JIT_DEBUG_IR_SRC (1<<24) #define ZEND_JIT_DEBUG_IR_FINAL (1<<25) -#define ZEND_JIT_DEBUG_IR_CFG (1<<26) -#define ZEND_JIT_DEBUG_IR_REGS (1<<27) +#define ZEND_JIT_DEBUG_IR_AFTER_SCCP (1<<26) +#define ZEND_JIT_DEBUG_IR_AFTER_CFG (1<<27) -#define ZEND_JIT_DEBUG_IR_AFTER_SCCP (1<<28) +#define ZEND_JIT_DEBUG_IR_AFTER_GCM (1<<28) #define ZEND_JIT_DEBUG_IR_AFTER_SCHEDULE (1<<29) #define ZEND_JIT_DEBUG_IR_AFTER_REGS (1<<30) #define ZEND_JIT_DEBUG_IR_CODEGEN (1U<<31) diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index b14c282c5a43..cb595becb179 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -2737,7 +2737,7 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name) if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_SRC) { if (name) fprintf(stderr, "%s: ; after folding\n", name); - ir_save(ctx, stderr); + ir_save(ctx, 0, stderr); } #if ZEND_DEBUG @@ -2756,28 +2756,30 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name) if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_SCCP) { if (name) fprintf(stderr, "%s: ; after SCCP\n", name); - ir_save(ctx, stderr); + ir_save(ctx, 0, stderr); } ir_build_cfg(ctx); ir_build_dominators_tree(ctx); ir_find_loops(ctx); - if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_SCCP) { - if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_CFG) { - ir_dump_cfg(ctx, stderr); - } + if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_CFG) { + if (name) fprintf(stderr, "%s: ; after CFG\n", name); + ir_save(ctx, IR_SAVE_CFG, stderr); } ir_gcm(ctx); + + if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_GCM) { + if (name) fprintf(stderr, "%s: ; after GCM\n", name); + ir_save(ctx, IR_SAVE_CFG|IR_SAVE_CFG_MAP, stderr); + } + ir_schedule(ctx); if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_SCHEDULE) { if (name) fprintf(stderr, "%s: ; after schedule\n", name); - ir_save(ctx, stderr); - if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_CFG) { - ir_dump_cfg(ctx, stderr); - } + ir_save(ctx, IR_SAVE_CFG, stderr); } ir_match(ctx); @@ -2791,13 +2793,8 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name) if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_AFTER_REGS) { if (name) fprintf(stderr, "%s: ; after register allocation\n", name); - ir_save(ctx, stderr); - if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_CFG) { - ir_dump_cfg(ctx, stderr); - } - if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_REGS) { - ir_dump_live_ranges(ctx, stderr); - } + ir_save(ctx, IR_SAVE_CFG|IR_SAVE_RULES|IR_SAVE_REGS, stderr); + ir_dump_live_ranges(ctx, stderr); } ir_schedule_blocks(ctx); @@ -2808,13 +2805,7 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name) ir_dump_codegen(ctx, stderr); } else { if (name) fprintf(stderr, "%s: ; final\n", name); - ir_save(ctx, stderr); - } - if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_CFG) { - ir_dump_cfg(ctx, stderr); - } - if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_REGS) { - ir_dump_live_ranges(ctx, stderr); + ir_save(ctx, IR_SAVE_CFG|IR_SAVE_RULES|IR_SAVE_REGS, stderr); } } @@ -3322,9 +3313,10 @@ static void zend_jit_setup(void) #endif zend_long debug = JIT_G(debug); if (!(debug & ZEND_JIT_DEBUG_ASM_STUBS)) { - JIT_G(debug) &= ~(ZEND_JIT_DEBUG_IR_SRC|ZEND_JIT_DEBUG_IR_FINAL|ZEND_JIT_DEBUG_IR_CFG|ZEND_JIT_DEBUG_IR_REGS| + JIT_G(debug) &= ~(ZEND_JIT_DEBUG_IR_SRC|ZEND_JIT_DEBUG_IR_FINAL| ZEND_JIT_DEBUG_IR_CODEGEN| - ZEND_JIT_DEBUG_IR_AFTER_SCCP|ZEND_JIT_DEBUG_IR_AFTER_SCHEDULE|ZEND_JIT_DEBUG_IR_AFTER_REGS); + ZEND_JIT_DEBUG_IR_AFTER_SCCP|ZEND_JIT_DEBUG_IR_AFTER_CFG|ZEND_JIT_DEBUG_IR_AFTER_GCM| + ZEND_JIT_DEBUG_IR_AFTER_SCHEDULE|ZEND_JIT_DEBUG_IR_AFTER_REGS); } zend_jit_calc_trace_prologue_size();

« previous php.cvs (#127808) next »