QBE as an easy-to-embed library https://c9x.me/git/qbe.git
Find a file
Quentin Carbonneaux 3a3c88532c 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.
2016-04-09 22:22:44 -04:00
doc cosmetic fixes in llvm comparison 2016-04-09 19:11:25 -04:00
minic new layout, put LICENSE in root 2016-03-29 10:10:22 -04:00
test add huge mandelbrot brainfuck example 2016-04-01 09:57:14 -04:00
tools get more entropy in callgen.ml 2016-03-29 10:28:21 -04:00
.gitignore new layout, put LICENSE in root 2016-03-29 10:10:22 -04:00
.tag new layout, put LICENSE in root 2016-03-29 10:10:22 -04:00
all.h enable constant folding 2016-04-09 14:32:07 -04:00
copy.c cleanup error handling 2016-03-31 09:15:50 -04:00
emit.c avoid gcc warning in emit 2016-04-08 09:47:00 -04:00
fold.c this can be false 2016-04-09 22:22:44 -04:00
isel.c move abi code in a new file 2016-03-31 17:17:09 -04:00
LICENSE new layout, put LICENSE in root 2016-03-29 10:10:22 -04:00
live.c fat il! 2016-04-04 15:44:43 -04:00
main.c rebuild rpo after fold 2016-04-09 18:41:30 -04:00
Makefile enable constant folding 2016-04-09 14:32:07 -04:00
mem.c reorder instructions 2016-04-04 14:45:49 -04:00
parse.c add a canfold field to opdesc 2016-04-07 14:20:12 -04:00
README typo in readme 2016-04-01 16:53:45 -04:00
rega.c prevent gcc warning in rega 2016-04-08 09:11:56 -04:00
spill.c fix loop header detection bug in spill 2016-04-08 08:33:37 -04:00
ssa.c add a proper block deletion routine 2016-04-09 14:21:56 -04:00
sysv.c simplify a buggy test 2016-04-08 09:41:59 -04:00
util.c did I loose my c? 2016-04-09 18:39:39 -04:00

QBE - Backend Compiler              http://c9x.me/compile/

doc/    Documentation.
minic/  An example C frontend for QBE.
tools/  Miscellaneous tools (testing).
test/   Unit tests.

The LICENSE file applies to all files distributed.