summary refs log tree commit diff
path: root/fold.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2022-11-21 11:29:22 +0100
committerQuentin Carbonneaux <quentin@c9x.me>2022-11-21 11:53:00 +0100
commit0db06dad63e02b619671bfb3dd25fc92c0856319 (patch)
tree0a37b3bf581b4918516686a31f0ae2d002d140f2 /fold.c
parent674901b71834739cccf3f8665833dc125d1172b7 (diff)
downloadroux-0db06dad63e02b619671bfb3dd25fc92c0856319.tar.gz
recognize some phis as copies
The copy elimination pass is not
complete. This patch improves
things a bit, but I think we still
have quite a bit of incompleteness.

We now consistently mark phis with
all arguments identical as copies.
Previously, they were inconsistently
eliminated by phisimpl(). An example
where they were not eliminated is
the following:

    @blk2
        %a = phi @blk0 %x, @blk1 %x
	jnz ?, @blk3, @blk4
    @blk3
        %b = copy %x
    @blk4
        %c = phi @blk2 %a, @blk3 %b

In this example, neither %c nor %a
were marked as copies of %x because,
when phisimpl() is called, the copy
information for %b is not available.

The incompleteness is still present
and can be observed by modifying
the example above so that %a takes
a copy of %x through a back-edge.
Then, phisimpl()'s lack of copy
information about %b will prevent
optimization.
Diffstat (limited to 'fold.c')
0 files changed, 0 insertions, 0 deletions