summary refs log tree commit diff
path: root/fold.c
AgeCommit message (Collapse)Author
2016-04-20match jumps/ops with il textQuentin Carbonneaux
2016-04-19use assert for ssa invariants in fold/copyQuentin Carbonneaux
2016-04-19rename only live phi arguments in foldQuentin Carbonneaux
AFL found that.
2016-04-17compute dead phi args correctly in foldQuentin Carbonneaux
The code computing if "the" edge of a phi argument is live or dead was wrong. AFL found that.
2016-04-12cosmetic modification in foldQuentin Carbonneaux
2016-04-12simplify latmerge()Quentin Carbonneaux
2016-04-12the lattice merge has to be used in update()Quentin Carbonneaux
2016-04-12oops, dumb bug in foldingQuentin Carbonneaux
2016-04-12diagnose some undefined usesQuentin Carbonneaux
2016-04-09this can be falseQuentin Carbonneaux
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-09fix wrong assertion in foldQuentin Carbonneaux
2016-04-09oops, forgot to patch phi argumentsQuentin Carbonneaux
2016-04-09more debug tweaks in foldQuentin Carbonneaux
2016-04-09add a proper block deletion routineQuentin Carbonneaux
2016-04-09nicer debug infoQuentin Carbonneaux
2016-04-09quickly hack fold rewritingQuentin Carbonneaux
2016-04-07use cast in czero()Quentin Carbonneaux
2016-04-07inline latmerge() (cross fingers)Quentin Carbonneaux
2016-04-07adjustments in sccpQuentin Carbonneaux
2016-04-07add boring folding codeQuentin Carbonneaux
2016-04-06start work on constant propagationQuentin Carbonneaux