[PATCH 2/3 v4] genmatch: Reduce variability of generated code

2023-08-07 Thread Andrzej Turko via Gcc-patches
So far genmatch has been using an unordered map to store information about functions to be generated. Since corresponding locations from match.pd were used as keys in the map, even small changes to match.pd which caused line number changes would change the order in which the functions are generated

[PATCH 3/3 v4] genmatch: Log line numbers indirectly

2023-08-07 Thread Andrzej Turko via Gcc-patches
Currently fprintf calls logging to a dump file take line numbers in the match.pd file directly as arguments. When match.pd is edited, referenced code changes line numbers, which causes changes to many fprintf calls and, thus, to many (usually all) .cc files generated by genmatch. This forces make t

[PATCH 1/3 v4] Support get_or_insert in ordered_hash_map

2023-08-07 Thread Andrzej Turko via Gcc-patches
Get_or_insert method is already supported by the unordered hash map. Adding it to the ordered map enables us to replace the unordered map with the ordered one in cases where ordering may be useful. Signed-off-by: Andrzej Turko gcc/ChangeLog: * ordered-hash-map.h: Add get_or_insert.

[PATCH 0/3 v4] genmatch: Speed up recompilation after changes to match.pd

2023-08-07 Thread Andrzej Turko via Gcc-patches
The following reduces the number of object files that need to be rebuilt after match.pd has been modified. Right now a change to match.pd which adds/removes a line almost always forces recompilation of all files that genmatch generates from it. This is because of unnecessary changes to the generate

Re: [PATCH 3/3] genmatch: Log line numbers indirectly

2023-08-03 Thread Andrzej Turko via Gcc-patches
decrease the executable size. I described in more detail in the new cover letter. Andrzej On Mon, Jul 31, 2023, 15:49 Richard Biener wrote: > On Mon, Jul 31, 2023 at 1:07 PM Andrzej Turko via Gcc-patches > wrote: > > > > Currently fprintf calls logging to a dump file take line

[PATCH 1/3 v3] Support get_or_insert in ordered_hash_map

2023-08-03 Thread Andrzej Turko via Gcc-patches
Get_or_insert method is already supported by the unordered hash map. Adding it to the ordered map enables us to replace the unordered map with the ordered one in cases where ordering may be useful. Signed-off-by: Andrzej Turko gcc/ChangeLog: * ordered-hash-map.h: Add get_or_insert.

[PATCH 0/3 v3] genmatch: Speed up recompilation after changes to match.pd

2023-08-03 Thread Andrzej Turko via Gcc-patches
The following reduces the number of object files that need to be rebuilt after match.pd has been modified. Right now a change to match.pd which adds/removes a line almost always forces recompilation of all files that genmatch generates from it. This is because of unnecessary changes to the generate

[PATCH 2/3 v3] genmatch: Reduce variability of generated code

2023-08-03 Thread Andrzej Turko via Gcc-patches
So far genmatch has been using an unordered map to store information about functions to be generated. Since corresponding locations from match.pd were used as keys in the map, even small changes to match.pd which caused line number changes would change the order in which the functions are generated

[PATCH 3/3 v3] genmatch: Log line numbers indirectly

2023-08-03 Thread Andrzej Turko via Gcc-patches
Currently fprintf calls logging to a dump file take line numbers in the match.pd file directly as arguments. When match.pd is edited, referenced code changes line numbers, which causes changes to many fprintf calls and, thus, to many (usually all) .cc files generated by genmatch. This forces make t

[PATCH 1/3 v2] Support get_or_insert in ordered_hash_map

2023-08-02 Thread Andrzej Turko via Gcc-patches
Get_or_insert method is already supported by the unordered hash map. Adding it to the ordered map enables us to replace the unordered map with the ordered one in cases where ordering may be useful. Signed-off-by: Andrzej Turko gcc/ChangeLog: * ordered-hash-map.h: Add get_or_insert.

[PATCH 3/3 v2] genmatch: Log line numbers indirectly

2023-08-02 Thread Andrzej Turko via Gcc-patches
Currently fprintf calls logging to a dump file take line numbers in the match.pd file directly as arguments. When match.pd is edited, referenced code changes line numbers, which causes changes to many fprintf calls and, thus, to many (usually all) .cc files generated by genmatch. This forces make t

[PATCH 2/3 v2] genmatch: Reduce variability of generated code

2023-08-02 Thread Andrzej Turko via Gcc-patches
So far genmatch has been using an unordered map to store information about functions to be generated. Since corresponding locations from match.pd were used as keys in the map, even small changes to match.pd which caused line number changes would change the order in which the functions are generated

[PATCH 0/3 v2] genmatch: Speed up recompilation after changes to match.pd

2023-08-02 Thread Andrzej Turko via Gcc-patches
The following reduces the number of object files that need to be rebuilt after match.pd has been modified. Right now a change to match.pd which adds/removes a line almost always forces recompilation of all files that genmatch generates from it. This is because of unnecessary changes to the generate

[PATCH 3/3] genmatch: Log line numbers indirectly

2023-07-31 Thread Andrzej Turko via Gcc-patches
Currently fprintf calls logging to a dump file take line numbers in the match.pd file directly as arguments. When match.pd is edited, referenced code changes line numbers, which causes changes to many fprintf calls and, thus, to many (usually all) .cc files generated by genmatch. This forces make t

[PATCH 0/3] genmatch: Speed up recompilation after changes to match.pd

2023-07-31 Thread Andrzej Turko via Gcc-patches
The following reduces the number of object files that need to be rebuilt after match.pd has been modified. Right now a change to match.pd which adds/removes a line almost always forces recompilation of all files that genmatch generates from it. This is because of unnecessary changes to the generate

[PATCH 1/3] Support get_or_insert in ordered_hash_map

2023-07-31 Thread Andrzej Turko via Gcc-patches
Get_or_insert method is already supported by the unordered hash map. Adding it to the ordered map enables us to replace the unordered map with the ordered one in cases where ordering may be useful. Signed-off-by: Andrzej Turko gcc/ChangeLog: * ordered-hash-map.h: Add get_or_insert.

[PATCH 2/3] genmatch: Reduce variability of generated code

2023-07-31 Thread Andrzej Turko via Gcc-patches
So far genmatch has been using an unordered map to store information about functions to be generated. Since corresponding locations from match.pd were used as keys in the map, even small changes to match.pd which caused line number changes would change the order in which the functions are generated