From 0d62dfdf81fb7710c20a46a75ad6166e25e50a12 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 22 May 2016 00:05:06 +0200 Subject: Improve previous fix Do not mark loop var free blocks as reachable after all -- as we can't construct SSA for unreachable blocks, this would cause issues down the line. Instead add an extra UNREACHABLE_FREE flag and retain only the FREE instruction during NOP removal. (If we retain all instructions in the BB we might leave a jump instruction that goes into the nowhere.) --- ext/opcache/Optimizer/zend_cfg.h | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/opcache/Optimizer/zend_cfg.h') diff --git a/ext/opcache/Optimizer/zend_cfg.h b/ext/opcache/Optimizer/zend_cfg.h index de94997dd5..cbf4225a31 100644 --- a/ext/opcache/Optimizer/zend_cfg.h +++ b/ext/opcache/Optimizer/zend_cfg.h @@ -32,6 +32,7 @@ #define ZEND_BB_GEN_VAR (1<<9) /* start of live range */ #define ZEND_BB_KILL_VAR (1<<10) /* end of live range */ #define ZEND_BB_EMPTY (1<<11) +#define ZEND_BB_UNREACHABLE_FREE (1<<12) /* unreachable loop free */ #define ZEND_BB_LOOP_HEADER (1<<16) #define ZEND_BB_IRREDUCIBLE_LOOP (1<<17) -- cgit v1.2.1 From e745b4cad855a70ddee788cb77ef7f470fd2a137 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 18 May 2016 18:03:05 +0200 Subject: Replace BB end with BB len And support empty blocks everywhere. --- ext/opcache/Optimizer/zend_cfg.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ext/opcache/Optimizer/zend_cfg.h') diff --git a/ext/opcache/Optimizer/zend_cfg.h b/ext/opcache/Optimizer/zend_cfg.h index cbf4225a31..244a2ade97 100644 --- a/ext/opcache/Optimizer/zend_cfg.h +++ b/ext/opcache/Optimizer/zend_cfg.h @@ -31,8 +31,7 @@ #define ZEND_BB_FINALLY_END (1<<8) /* end of finally block */ #define ZEND_BB_GEN_VAR (1<<9) /* start of live range */ #define ZEND_BB_KILL_VAR (1<<10) /* end of live range */ -#define ZEND_BB_EMPTY (1<<11) -#define ZEND_BB_UNREACHABLE_FREE (1<<12) /* unreachable loop free */ +#define ZEND_BB_UNREACHABLE_FREE (1<<11) /* unreachable loop free */ #define ZEND_BB_LOOP_HEADER (1<<16) #define ZEND_BB_IRREDUCIBLE_LOOP (1<<17) @@ -44,7 +43,7 @@ typedef struct _zend_basic_block { uint32_t flags; uint32_t start; /* first opcode number */ - uint32_t end; /* last opcode number */ + uint32_t len; /* number of opcodes */ int successors[2]; /* up to 2 successor blocks */ int predecessors_count; /* number of predecessors */ int predecessor_offset; /* offset of 1-st predecessor */ -- cgit v1.2.1 From a19eb8e34abc0b41e821cbf67930bf64fcb9e65d Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 18 May 2016 23:46:20 +0200 Subject: Ensure no entry predecessors for SSA construction --- ext/opcache/Optimizer/zend_cfg.h | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/opcache/Optimizer/zend_cfg.h') diff --git a/ext/opcache/Optimizer/zend_cfg.h b/ext/opcache/Optimizer/zend_cfg.h index 244a2ade97..da908fdbe3 100644 --- a/ext/opcache/Optimizer/zend_cfg.h +++ b/ext/opcache/Optimizer/zend_cfg.h @@ -96,6 +96,7 @@ typedef struct _zend_cfg { #define ZEND_SSA_DEBUG_PHI_PLACEMENT (1<<28) #define ZEND_SSA_RC_INFERENCE (1<<27) #define ZEND_CFG_SPLIT_AT_LIVE_RANGES (1<<26) +#define ZEND_CFG_NO_ENTRY_PREDECESSORS (1<<25) #define CRT_CONSTANT_EX(op_array, node, rt_constants) \ ((rt_constants) ? \ -- cgit v1.2.1