common subexpression elimination
Hi all,
I check the name and the code of passes in the frontend and midend. I found some passes which eliminate different structures, especially the passes whose names start with "eliminate" but I am not sure they do common subexpression elimination. Please let me know in which passes you used it (CSE).
The compiler doesn't do cse
There is a pass called "LocalCopyPropagation" that I would in some cases call "common subexpression proliferation", since it can cause common subexpressions to be repeated many times in the code. :-)
See https://github.com/p4lang/p4c/issues/2316 for an example kind of program that can lead to that behavior. Most programs in practice do not have such an effect.
There is a pass called "LocalCopyPropagation" that I would in some cases call "common subexpression proliferation", since it can cause common subexpressions to be repeated many times in the code. :-)
See #2316 for an example kind of program that can lead to that behavior. Most programs in practice do not have such an effect. Thank you, let me know compiler still has a problem with LocalCopyPropagation you mentioned in #2316.
Mohxen wrote: "Thank you, let me know compiler still has a problem with LocalCopyPropagation you mentioned in https://github.com/p4lang/p4c/issues/2316."
As far as I know, yes. The issue is still open, with no PR claiming to address it. The test program named proliferation1.p4.txt (https://github.com/p4lang/p4c/files/4478275/proliferation1.p4.txt) that is attached to the first comment of that issue can easily be tried for compilation using p4c built from the latest version of the p4c source code, to confirm.