Commit Graph

4 Commits

Author SHA1 Message Date
Pietro Fezzardi 7db2c64f61 MarkForSerialization now ignores duplicated uses
Remove the logic for detecting Instructions with duplicated uses
introduced by control-flow restructuring (the use is duplicated, but the
instruction is not).
By dropping this detection, we'll end up not marking for serialization
some Instructions. Hence, when emitting C code, such Instructions will
just be emitted as inline expressions, without declaring a dedicated
local variable to hold their value. This is somehow suboptimal w.r.t the
fact that the expression will be emitted many times, one for each
duplicated use. However, this is not semantically incorrect, just
verbose.

On the other hand, the logic for detecting Instructions with duplicated
uses has always been subtly broken, because it only looked at the number
of duplicates for a given basic block introduced by control-flow
restructuring.
This information is not enough to detect Instructions with duplicated
uses. Proper detection should actually be based on GHAST.
2022-01-11 15:07:33 +01:00
Pietro Fezzardi b24baaea34 MarkForSerializationPass never changes the IR 2022-01-11 09:47:32 +01:00
Pietro Fezzardi fda2b0042f Drop Beautify dependency on MarkForSerialization 2021-09-22 19:01:44 +02:00
Pietro Fezzardi ce0083a7ff Extract MarkForSerialization in separate library 2021-09-22 15:03:12 +02:00