diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-08-30 04:20:23 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-03-18 19:02:28 +0100 |
| commit | 1609176c9dbddd280c20a49fce81c9e1dd9b9c78 (patch) | |
| tree | 8a22908818b9ab131f815b8a48febe0fc72b15e0 /validation/linear/degen-function.c | |
| parent | a9a56d3994dfd86dbb5b74ab85b3709e4c3d4cee (diff) | |
| download | sparse-dev-1609176c9dbddd280c20a49fce81c9e1dd9b9c78.tar.gz | |
fix-return: remove special case for single return
During the linearization of a function, returns are directly
linearized as phi-sources and the exit BB contains the
corresponding phi-node and the unique OP_RET.
There is also a kind of optimization that is done if there is
only a single a return statement and thus a single phi-source:
the phi-source and the phi-node is simply ignored and the
unique value is directly used by the OP_RET instruction.
While this optimization make sense it also has some cons:
- the phi-node and the phi-source are created anyway and will
need to be removed during cleanup.
- the corresponding optimization need to be done anyway during
simplification
- it's only a tiny special case which save very litte.
So, keep things simple and generic and leave this sort of
simplification for the cleanup/simplification phase.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/linear/degen-function.c')
| -rw-r--r-- | validation/linear/degen-function.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/validation/linear/degen-function.c b/validation/linear/degen-function.c index 4fb2d564..a7cff443 100644 --- a/validation/linear/degen-function.c +++ b/validation/linear/degen-function.c @@ -20,7 +20,7 @@ fa: .L1: phi.64 %r2 <- %phi1(return) - ret.64 %r1 + ret.64 %r2 f0: @@ -32,7 +32,7 @@ f0: .L3: phi.64 %r4 <- %phi2(return) - ret.64 %r3 + ret.64 %r4 f1: @@ -44,7 +44,7 @@ f1: .L5: phi.64 %r6 <- %phi3(return) - ret.64 %r5 + ret.64 %r6 * check-output-end |
