Commit 585f021
committed
Go CFG: merge parameter 'arg' node into 'param-init'
Each parameter previously created two additional nodes: an 'arg:i'
node (ReadArgumentInstruction) holding the incoming argument value, and
a 'param-init:i' node (InitParameterInstruction) writing it to the
parameter's SSA variable. The 'arg' node existed only to be the RHS of
the param-init write; the ParameterNode and inter-procedural flow are
already anchored on param-init.
Make InitParameterInstruction its own RHS and drop the 'arg:i' node,
halving the per-parameter node count. DeadStoreOfLocal now excludes
InitParameterInstruction (instead of ReadArgumentInstruction). The
data-flow changes are pure relabelings (arg -> param-init) with no flow
loss.1 parent 06bc989 commit 585f021
6 files changed
Lines changed: 106 additions & 205 deletions
File tree
- go/ql
- lib/semmle/go/controlflow
- src/RedundantCode
- test/library-tests/semmle/go
- controlflow/ControlFlowGraph
- dataflow
- FlowSteps
- SSA
Lines changed: 10 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | | - | |
| 564 | + | |
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
569 | | - | |
| 569 | + | |
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
| |||
1729 | 1729 | | |
1730 | 1730 | | |
1731 | 1731 | | |
1732 | | - | |
1733 | | - | |
| 1732 | + | |
| 1733 | + | |
1734 | 1734 | | |
1735 | 1735 | | |
1736 | 1736 | | |
| |||
1773 | 1773 | | |
1774 | 1774 | | |
1775 | 1775 | | |
1776 | | - | |
1777 | | - | |
| 1776 | + | |
| 1777 | + | |
1778 | 1778 | | |
1779 | | - | |
| 1779 | + | |
1780 | 1780 | | |
1781 | 1781 | | |
1782 | | - | |
| 1782 | + | |
1783 | 1783 | | |
1784 | 1784 | | |
1785 | 1785 | | |
| |||
1792 | 1792 | | |
1793 | 1793 | | |
1794 | 1794 | | |
1795 | | - | |
1796 | | - | |
1797 | | - | |
1798 | | - | |
1799 | | - | |
1800 | | - | |
1801 | | - | |
| 1795 | + | |
1802 | 1796 | | |
1803 | 1797 | | |
1804 | 1798 | | |
1805 | 1799 | | |
1806 | 1800 | | |
1807 | | - | |
| 1801 | + | |
1808 | 1802 | | |
1809 | 1803 | | |
1810 | 1804 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
203 | | - | |
204 | 202 | | |
205 | 203 | | |
206 | 204 | | |
| |||
1033 | 1031 | | |
1034 | 1032 | | |
1035 | 1033 | | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
| 1034 | + | |
1053 | 1035 | | |
1054 | 1036 | | |
1055 | 1037 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments