1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-08-01 02:29:30 +00:00

One more optimization.

This commit is contained in:
jespergravgaard 2019-09-07 22:31:24 +02:00
parent 7fb7d3acf6
commit 32ead9cc87
23 changed files with 40 additions and 83 deletions

View File

@ -4,10 +4,7 @@ import dk.camelot64.kickc.model.statements.Statement;
import dk.camelot64.kickc.model.values.*;
import dk.camelot64.kickc.passes.calcs.PassNCalcVariableReferenceInfos;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -280,6 +277,28 @@ public class VariableReferenceInfos {
return stmts;
}
/**
* Get the index of the statement defining a variable
* @param variableRef The variable to look for
* @return Index of the defining statement
*/
public Integer getVarDefineStatement(VariableRef variableRef) {
Collection<ReferenceToSymbolVar> refs = symbolVarReferences.get(variableRef);
LinkedHashSet<Integer> stmts = new LinkedHashSet<>();
if(refs != null) {
Optional<ReferenceToSymbolVar> refDefine = refs.stream()
.filter(referenceToSymbolVar -> referenceToSymbolVar instanceof ReferenceInStatement)
.filter(referenceToSymbolVar -> ReferenceToSymbolVar.ReferenceType.DEFINE.equals(referenceToSymbolVar.getReferenceType()))
.findFirst();
if(refDefine.isPresent()) {
return ((ReferenceInStatement)refDefine.get()).getStatementIdx();
}
}
return null;
}
/**
* Get all statements referencing a variable
*

View File

@ -25,16 +25,23 @@ public class Pass2ConditionalAndOrRewriting extends Pass2SsaOptimization {
@Override
public boolean step() {
VariableRef obsoleteConditionVar = findAndRewriteBooleanCondition();
if(obsoleteConditionVar!=null) {
Collection<VariableRef> obsoleteVars = new ArrayList<>();
obsoleteVars.add(obsoleteConditionVar);
removeAssignments(getGraph(), obsoleteVars);
deleteSymbols(getScope(), obsoleteVars);
return true;
} else {
return false;
Map<LValue, StatementAssignment> assignments = getAllAssignments();
Map<RValue, List<Statement>> usages = getAllUsages();
boolean done = false;
boolean modified = false;
while(!done) {
VariableRef obsoleteConditionVar = findAndRewriteBooleanCondition(assignments, usages);
if(obsoleteConditionVar != null) {
Collection<VariableRef> obsoleteVars = new ArrayList<>();
obsoleteVars.add(obsoleteConditionVar);
removeAssignments(getGraph(), obsoleteVars);
deleteSymbols(getScope(), obsoleteVars);
modified = true;
} else {
done = true;
}
}
return modified;
}
/**
@ -42,10 +49,8 @@ public class Pass2ConditionalAndOrRewriting extends Pass2SsaOptimization {
* When found rewrite it (adding blocks)
* @return Null if no condition was found to rewrite. The now obsolete variable containing the && / || / ! to be removed.
*/
private VariableRef findAndRewriteBooleanCondition() {
private VariableRef findAndRewriteBooleanCondition(Map<LValue, StatementAssignment> assignments, Map<RValue, List<Statement>> usages) {
for(ControlFlowBlock block : getGraph().getAllBlocks()) {
final Map<LValue, StatementAssignment> assignments = getAllAssignments();
final Map<RValue, List<Statement>> usages = getAllUsages();
for(Statement statement : block.getStatements()) {
if(statement instanceof StatementConditionalJump) {
StatementConditionalJump conditional = (StatementConditionalJump) statement;

View File

@ -41,8 +41,6 @@ public class TestPrograms {
compileAndCompare("examples/zpcode/zpcode");
}
// Fix parameter type problem - https://gitlab.com/camelot/kickc/issues/299
/*
@Test

View File

@ -1161,11 +1161,8 @@ Simple Condition (bool~) bitmap_init::$11 [79] if((byte) bitmap_init::y#1!=range
Simple Condition (bool~) irq::$0 [204] if((byte) 0==(byte) frame_cnt#0) goto irq::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [167] (bool~) main::$11 ← ! (bool~) main::$10
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [166] (bool~) main::$10 ← (bool~) main::$8 || (bool~) main::$9
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [173] (bool~) main::$16 ← ! (bool~) main::$15
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [172] (bool~) main::$15 ← (bool~) main::$13 || (bool~) main::$14
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant right-side identified [42] (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) }

View File

@ -2706,7 +2706,6 @@ Simple Condition (bool~) main::$32 [491] if((signed word) main::r#1<(signed word
Simple Condition (bool~) irq::$0 [520] if((byte) 0==(byte) frame_cnt#0) goto irq::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [484] (bool~) main::$30 ← ! (bool~) main::$29
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [483] (bool~) main::$29 ← (bool~) main::$27 && (bool~) main::$28
Successful SSA optimization Pass2ConditionalAndOrRewriting
Negating conditional jump and destination [491] if((signed word) main::r#1>=(signed word)(number) $200*(number) $c+(number) $100) goto main::@17

View File

@ -1639,7 +1639,6 @@ Simple Condition (bool~) sgn_u16::$2 [206] if((byte) 0!=(byte~) sgn_u16::$1) got
Simple Condition (bool~) main::$6 [255] if((byte) main::i#2!=(byte) 8) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [119] (bool~) bitmap_line::$7 ← ! (bool~) bitmap_line::$6
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [118] (bool~) bitmap_line::$6 ← (bool~) bitmap_line::$4 && (bool~) bitmap_line::$5
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant right-side identified [29] (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) }

View File

@ -215,19 +215,12 @@ Alias (bool) bool_const_vars::b2#0 = (bool~) bool_const_vars::$6
Alias (bool) bool_const_vars::b#0 = (bool~) bool_const_vars::$9
Successful SSA optimization Pass2AliasElimination
Rewriting || if()-condition to two if()s [22] (bool) bool_const_vars::b#0 ← (bool~) bool_const_vars::$8 || false
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [21] (bool~) bool_const_vars::$8 ← (bool) bool_const_vars::b1#0 && (bool~) bool_const_vars::$7
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [14] (bool) bool_const_vars::b1#0 ← (bool~) bool_const_vars::$0 || (bool~) bool_const_vars::$2
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [36] (bool~) bool_const_inline::$7 ← (bool~) bool_const_inline::$4 || (bool~) bool_const_inline::$6
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [33] (bool~) bool_const_inline::$4 ← (bool~) bool_const_inline::$0 || (bool~) bool_const_inline::$3
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [20] (bool~) bool_const_vars::$7 ← ! (bool) bool_const_vars::b2#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [18] (bool) bool_const_vars::b2#0 ← (bool~) bool_const_vars::$4 || (bool~) bool_const_vars::$5
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [32] (bool~) bool_const_inline::$3 ← (bool~) bool_const_inline::$1 && (bool~) bool_const_inline::$2
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const byte*) SCREEN#0 = (byte*) 1024

View File

@ -85,7 +85,6 @@ Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$5 [12] if((byte) main::i#1!=rangelast(0,$14)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [7] (bool~) main::$4 ← ! (bool~) main::$3
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [6] (bool~) main::$3 ← (bool~) main::$0 && (bool~) main::$2
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const byte*) main::screen#0 = (byte*) 1024

View File

@ -382,19 +382,12 @@ Simple Condition (bool~) bool_not::$5 [64] if((byte) bool_not::i#1!=rangelast(0,
Simple Condition (bool~) bool_complex::$7 [89] if((byte) bool_complex::i#1!=rangelast(0,$14)) goto bool_complex::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting && if()-condition to two if()s [13] (bool) bool_and::o3#0 ← (bool) bool_and::o1#0 && (bool) bool_and::o2#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [33] (bool) bool_or::o3#0 ← (bool) bool_or::o1#0 || (bool) bool_or::o2#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [54] (bool) bool_not::o3#0 ← ! (bool~) bool_not::$3
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [53] (bool~) bool_not::$3 ← (bool) bool_not::o1#0 || (bool) bool_not::o2#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [79] (bool) bool_complex::o5#0 ← (bool) bool_complex::o3#0 || (bool) bool_complex::o4#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [74] (bool) bool_complex::o3#0 ← (bool) bool_complex::o1#0 && (bool) bool_complex::o2#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [77] (bool) bool_complex::o4#0 ← ! (bool~) bool_complex::$4
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [76] (bool~) bool_complex::$4 ← (bool) bool_complex::o1#0 || (bool) bool_complex::o2#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const byte*) bool_and::screen#0 = (byte*) 1024

View File

@ -81,7 +81,6 @@ Finalized unsigned number type (byte) $40
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Rewriting ! if()-condition to reversed if() [7] (bool~) main::$3 ← ! (bool~) main::$2
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [6] (bool~) main::$2 ← (bool~) main::$0 || (bool~) main::$1
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const byte*) RASTER#0 = (byte*) 53266

View File

@ -3136,17 +3136,11 @@ Simple Condition (bool~) irqTop::$3 [604] if((byte) irqTop::i1#1!=rangelast(0,7)
Simple Condition (bool~) irqBottom::$4 [619] if((byte) irqBottom::i#1!=rangelast(0,4)) goto irqBottom::@5
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting || if()-condition to two if()s [454] (bool~) processChars::$24 ← (bool~) processChars::$22 || (bool~) processChars::$23
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [451] (bool~) processChars::$22 ← (bool~) processChars::$20 || (bool~) processChars::$21
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [448] (bool~) processChars::$20 ← (bool~) processChars::$18 || (bool~) processChars::$19
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [491] (bool~) processChars::$0 ← ! (bool) DEBUG#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [587] (bool~) irqTop::$0 ← ! (bool) DEBUG#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [610] (bool~) irqBottom::$0 ← ! (bool) DEBUG#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [613] (bool~) irqBottom::$2 ← ! (bool) DEBUG#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Negating conditional jump and destination [79] if((byte) atan2_16::i#1==rangelast(0,atan2_16::$16)) goto atan2_16::@17

View File

@ -3892,7 +3892,6 @@ Simple Condition (bool~) show_letter::$19 [578] if((byte) show_letter::i#1!=rang
Simple Condition (bool~) bitmap_plot_spline_8seg::$5 [608] if((byte) bitmap_plot_spline_8seg::n#1!=rangelast(1,8)) goto bitmap_plot_spline_8seg::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [175] (bool~) bitmap_line::$7 ← ! (bool~) bitmap_line::$6
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [174] (bool~) bitmap_line::$6 ← (bool~) bitmap_line::$4 && (bool~) bitmap_line::$5
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant right-side identified [0] (struct SplineVector16[9]) SPLINE_8SEG#0 ← { fill( 9, 0) }

View File

@ -186,7 +186,6 @@ Simple Condition (bool~) main::$4 [35] if((byte) 0==(word) main::i1#2) goto main
Simple Condition (bool~) main::$5 [39] if((word) main::i1#1!=rangelast(0,2)) goto main::@9
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [2] (bool~) main::$0 ← ! (number) 0!=(number) 0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [5] (bool~) main::$1 ← ! (number) 0!=(number) $3e7
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const byte*) SCREEN#0 = (byte*) 1024

View File

@ -192,7 +192,6 @@ Simple Condition (bool~) main::$6 [37] if((byte) 0!=(word) main::i1#2) goto main
Simple Condition (bool~) main::$7 [41] if((word) main::i1#1!=rangelast(0,2)) goto main::@9
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [2] (bool~) main::$0 ← ! !(number) 0!=(number) 0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [5] (bool~) main::$1 ← ! !(number) 0!=(number) $3e7
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const byte*) SCREEN#0 = (byte*) 1024

View File

@ -218,11 +218,8 @@ Simple Condition (bool~) main::$4 [12] if((byte) 0==(byte~) main::$3) goto main:
Simple Condition (bool~) main::$16 [38] if((byte) main::i#1!=rangelast(0,7)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [20] (bool~) main::$9 ← ! (bool~) main::$8
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [19] (bool~) main::$8 ← (byte~) main::$6 && (byte~) main::$7
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [29] (bool~) main::$14 ← ! (bool~) main::$13
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [28] (bool~) main::$13 ← (byte~) main::$11 || (byte~) main::$12
Successful SSA optimization Pass2ConditionalAndOrRewriting
Warning! Adding boolean cast to non-boolean condition (byte~) main::$6

View File

@ -1856,7 +1856,6 @@ Simple Condition (bool~) mulf8s127::$5 [379] if((signed byte) mulf8s127::a#0>=(s
Simple Condition (bool~) mulf8s127::$7 [383] if((signed byte) mulf8s127::b#0>=(signed byte) 0) goto mulf8s127::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [392] (bool~) mulf8s127::$11 ← ! (bool~) mulf8s127::$10
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [391] (bool~) mulf8s127::$10 ← (bool~) mulf8s127::$8 && (bool~) mulf8s127::$9
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const byte*) print_line_cursor#0 = (byte*) 1024

View File

@ -157,7 +157,6 @@ Alias (bool) main::toUpper2_bo#0 = (bool) main::toUpper2_bo#1
Alias (byte) main::toUpper2_return#0 = (byte) main::toUpper2_res#2 (byte) main::toUpper2_return#2 (byte) main::toUpper2_return#1 (byte) main::toUpper2_return#3 (byte~) main::$1
Successful SSA optimization Pass2AliasElimination
Rewriting ! if()-condition to reversed if() [5] (bool~) main::toUpper1_$0#0 ← ! (bool) main::toUpper1_bo#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [20] (bool~) main::toUpper2_$0#0 ← ! (bool) main::toUpper2_bo#0
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const byte*) screen#0 = (byte*) 1024

View File

@ -1606,9 +1606,7 @@ Simple Condition (bool~) plex_irq::$0 [228] if((byte) plex_show_idx#16<(byte) PL
Simple Condition (bool~) loop::$2 [259] if((byte) loop::sy#1!=rangelast(0,loop::$1)) goto loop::@10
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting && if()-condition to two if()s [66] (bool~) plexSort::$8 ← (bool~) plexSort::$6 && (bool~) plexSort::$7
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [223] (bool~) plex_irq::$6 ← (bool~) plex_irq::$3 && (bool~) plex_irq::$5
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [247] (bool~) loop::$0 ← ! (bool) framedone#12
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant right-side identified [24] (byte*) PLEX_SCREEN_PTR#0 ← (byte*)(number) $400+(number) $3f8

View File

@ -3057,39 +3057,22 @@ Simple Condition (bool~) main::$9 [385] if(*((byte*) zp1#0)<(byte) $a) goto main
Simple Condition (bool~) main::$10 [393] if(*((byte*) zp2#0)<(byte) $c8) goto main::@17
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [71] (bool~) utoa::$3 ← ! (bool~) utoa::$2
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [70] (bool~) utoa::$2 ← (bool~) utoa::$0 || (bool~) utoa::$1
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [77] (bool~) utoa::$7 ← ! (bool~) utoa::$6
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [76] (bool~) utoa::$6 ← (bool~) utoa::$4 || (bool~) utoa::$5
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [94] (bool~) utoa::$11 ← ! (bool~) utoa::$10
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [93] (bool~) utoa::$10 ← (bool~) utoa::$8 || (bool~) utoa::$9
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [111] (bool~) utoa::$15 ← ! (bool~) utoa::$14
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [110] (bool~) utoa::$14 ← (bool~) utoa::$12 || (bool~) utoa::$13
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [176] (bool~) myprintf::$8 ← ! (bool~) myprintf::$7
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [175] (bool~) myprintf::$7 ← (bool~) myprintf::$5 && (bool~) myprintf::$6
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [211] (bool~) myprintf::$17 ← ! (bool~) myprintf::$16
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [210] (bool~) myprintf::$16 ← (bool~) myprintf::$14 || (bool~) myprintf::$15
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [250] (bool~) myprintf::$38 ← ! (bool~) myprintf::$37
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [249] (bool~) myprintf::$37 ← (bool~) myprintf::$35 && (bool~) myprintf::$36
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [279] (bool~) myprintf::$48 ← ! (bool~) myprintf::$47
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [278] (bool~) myprintf::$47 ← (bool~) myprintf::$45 && (bool~) myprintf::$46
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [294] (bool~) myprintf::$58 ← ! (bool~) myprintf::$57
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [293] (bool~) myprintf::$57 ← (bool~) myprintf::$55 && (bool~) myprintf::$56
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant right-side identified [52] (byte[$64]) strTemp#0 ← { fill( $64, 0) }

View File

@ -2808,11 +2808,8 @@ Simple Condition (bool~) main::$28 [491] if((word) main::i#10<(word) $514) goto
Simple Condition (bool~) main::$30 [496] if((byte) 0!=*((byte*) sieve#0 + (word) main::i#10)) goto main::@18
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [172] (bool~) utoa::$9 ← ! (bool~) utoa::$8
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [171] (bool~) utoa::$8 ← (byte) utoa::started#2 || (bool~) utoa::$7
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [258] (bool~) ultoa::$9 ← ! (bool~) ultoa::$8
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [257] (bool~) ultoa::$8 ← (byte) ultoa::started#2 || (bool~) ultoa::$7
Successful SSA optimization Pass2ConditionalAndOrRewriting
Warning! Adding boolean cast to non-boolean condition (byte) utoa::started#2

View File

@ -102,7 +102,6 @@ Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$6 [15] if((byte) main::i#1!=rangelast(0,$a)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [9] (bool~) main::$5 ← ! (bool~) main::$4
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [8] (bool~) main::$4 ← (bool~) main::$2 || (bool~) main::$3
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const byte*) main::SCREEN#0 = (byte*) 1024

View File

@ -989,7 +989,6 @@ Simple Condition (bool~) print_str::$0 [92] if((byte) 0!=*((byte*) print_str::st
Simple Condition (bool~) print_ln::$1 [105] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#18) goto print_ln::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [52] (bool~) ultoa::$9 ← ! (bool~) ultoa::$8
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [51] (bool~) ultoa::$8 ← (byte) ultoa::started#2 || (bool~) ultoa::$7
Successful SSA optimization Pass2ConditionalAndOrRewriting
Warning! Adding boolean cast to non-boolean condition (byte) ultoa::started#2

View File

@ -1193,17 +1193,11 @@ Simple Condition (bool~) draw_window::$22 [171] if((byte) draw_window::y3#2<(byt
Simple Condition (bool~) draw_window::$25 [179] if((byte) draw_window::x3#2<(byte) draw_window::x2#0) goto draw_window::@19
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [63] (bool~) textbox::$7 ← ! (bool~) textbox::$6
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting || if()-condition to two if()s [62] (bool~) textbox::$6 ← (bool~) textbox::$4 || (bool~) textbox::$5
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [85] (bool~) textbox::$14 ← (bool~) textbox::$12 && (bool~) textbox::$13
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [96] (bool~) textbox::$20 ← ! (bool~) textbox::$19
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [95] (bool~) textbox::$19 ← (bool~) textbox::$16 && (bool~) textbox::$18
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting ! if()-condition to reversed if() [164] (bool~) draw_window::$11 ← ! (bool~) draw_window::$10
Successful SSA optimization Pass2ConditionalAndOrRewriting
Rewriting && if()-condition to two if()s [163] (bool~) draw_window::$10 ← (bool~) draw_window::$7 && (bool~) draw_window::$9
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant (const byte*) screen#0 = (byte*) 1024