Allow optimizer to depend on preloaded symbols#15021
Conversation
|
I double checked, and we can not assume that The flag is added on all symbols compiled during preloading, including ones that are not always added to the persistent symbol tables. This example will generate bad code. When running with However, symbols in Edit: updated example (missing file) |
|
Thanks you Arnaud. I'll look into this more then. |
|
I think it makes sense to check for both - |
09ecf7d to
7e6fefe
Compare
It is safe for the optimizer to rely on preloaded symbols. This can occur when compiling non-preloaded files, referencing preloaded ones.
7e6fefe to
2c18a3c
Compare
This issue was introduced in phpGH-15021. When building the call graph, we can now see preloaded functions. However, building the call graph involves mutating the callee, which we don't want to do for functions not coming from the script, especially because the call graph is released later on. Fixes phpGH-15490
This issue was introduced in phpGH-15021. When building the call graph, we can now see preloaded functions. However, building the call graph involves adding the function to the caller list of the callee, which we don't want to do for functions not coming from the script, given that call graphs are temporary. Fixes phpGH-15490
This issue was introduced in phpGH-15021. When building the call graph, we can now see preloaded functions. However, building the call graph involves adding the function to the caller list of the callee, which we don't want to do for functions not coming from the script. Fixes phpGH-15490
This issue was introduced in phpGH-15021. When building the call graph, we can now see preloaded functions. However, building the call graph involves adding the function to the caller list of the callee, which we don't want to do for functions not coming from the script. Fixes phpGH-15490
This issue was introduced in phpGH-15021. When building the call graph, we can now see preloaded functions. However, building the call graph involves adding the function to the caller list of the callee, which we don't want to do for functions not coming from the script. Fixes phpGH-15490
This issue was introduced in phpGH-15021. When building the call graph, we can now see preloaded functions. However, building the call graph involves adding the function to the caller list of the callee, which we don't want to do for functions not coming from the script. Fixes phpGH-15490
This issue was introduced in phpGH-15021. When building the call graph, we can now see preloaded functions. However, building the call graph involves adding the function to the caller list of the callee, which we don't want to do for functions not coming from the script. Fixes phpGH-15490
Since phpGH-15021 preloaded constants are propagated to compiled scripts. This is problematic for file cache, which assumes all referenced zvals are either persistently allocated or local to the current script. However, preloaded constants live in shm as immutable, but not persistent. To solve this, we'd need to duplicate propagated constants in the optimizer when file cache is used. This is error prone given it needs to happen in many places. It's debatable whether constant propagation is even correct in this case, as running the preloaded script on a restart isn't guaranteed to produce the same result. Hence, avoid the issue for now by just not relying on preloaded symbols when file cache is used. Fixes phpGH-21052
Since phpGH-15021 preloaded constants are propagated to compiled scripts. This is problematic for file cache, which assumes all referenced zvals are either persistently allocated or local to the current script. However, preloaded constants live in shm as immutable, but not persistent. To solve this, we'd need to duplicate propagated constants in the optimizer when file cache is used. This is error prone given it needs to happen in many places. It's debatable whether constant propagation is even correct in this case, as running the preloaded script on a restart isn't guaranteed to produce the same result. Hence, avoid the issue for now by just not relying on preloaded symbols when file cache is used. Fixes phpGH-21052
Since GH-15021 preloaded constants are propagated to compiled scripts. This is problematic for file cache, which assumes all referenced zvals are either persistently allocated or local to the current script. However, preloaded constants live in shm as immutable, but not persistent. To solve this, we'd need to duplicate propagated constants in the optimizer when file cache is used. This is error prone given it needs to happen in many places. It's debatable whether constant propagation is even correct in this case, as running the preloaded script on a restart isn't guaranteed to produce the same result. Hence, avoid the issue for now by just not relying on preloaded symbols when file cache is used. Fixes GH-21052 Closes GH-21281
It is safe for the optimizer to rely on preloaded symbols from other files. This can occur when compiling non-preloaded files, referencing preloaded ones.