summary refs log tree commit diff
path: root/main.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-04-09 22:08:25 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-04-09 22:22:44 -0400
commit3a3c88532c4d1c5fdf89d159cb24706dcbc6fc28 (patch)
tree7fd1a61d453269bafe53f599018562808700d356 /main.c
parentcecf04f009a68e8a3cd8a7ce4945245d177124c9 (diff)
downloadroux-3a3c88532c4d1c5fdf89d159cb24706dcbc6fc28.tar.gz
this can be false
I think I should check for Top when rewriting.
Because for sure, we don't want to replace some
temporary by Top, first, I can't represent it,
and second, it'd mean that it is a temporary
used undefined.

The example that triggered the assertion was like
that:

@b0
  jnz 1, @b1, @b3
@b1
  %x =w phi @b0 10, @b2 %x1
  jnz %x, @b2, @b3
@b2
  %x1 =w sub %x, 1
  jmp @b1
@b3
  %x2 =w phi @b1 %x, @b0 42

So SCCP optimistically assumes %x is 10 when it goes
through @b1, then at the branch, @b1->@b3 is left for
dead.  After that, @b2 is processed and the flow
worklist is empty.  Now uses are processed, %x2 will
get processed regardless if its block is dead or not
(it is at that time), then all the back-edges are dead
so the phi is set to the lattice merge of tops only.
BOOM!

This leads to the question, should phis of dead blocks
be processed?  I'll check that later.
Diffstat (limited to 'main.c')
0 files changed, 0 insertions, 0 deletions