From b1c3c9a525763ae9cd6e599bf061d7114d48aab0 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 12 May 2016 21:41:24 +0200 Subject: Explicitly construct phi set during def propagation Previously the phi set was first computed during def propagation and then computed again (per-block) during actual phi placement. This commit changes this to store the phi set computed during def propagation. This makes SSA construction slightly faster (5%), but the main purpose here is to pave the way for the next commit. This also fixes a potential issue with the handling of irreducible loops -- they generated additional phis, but these were not accounted for in def propagation. (Though I'm not sure if we can even have any irreducible loops right now.) --- Zend/zend_bitset.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Zend/zend_bitset.h') diff --git a/Zend/zend_bitset.h b/Zend/zend_bitset.h index fb19b54329..e1a95466b8 100644 --- a/Zend/zend_bitset.h +++ b/Zend/zend_bitset.h @@ -137,6 +137,18 @@ static inline void zend_bitset_union_with_difference(zend_bitset set1, zend_bits } } +static inline zend_bool zend_bitset_subset(zend_bitset set1, zend_bitset set2, uint32_t len) +{ + uint32_t i; + + for (i = 0; i < len; i++) { + if (set1[i] & ~set2[i]) { + return 0; + } + } + return 1; +} + static inline int zend_bitset_first(zend_bitset set, uint32_t len) { uint32_t i; -- cgit v1.2.1