1 USING: compiler.cfg.instructions help.markup help.syntax kernel ;
2 IN: compiler.cfg.alias-analysis
6 { "insn" "a " { $link ##compare } " instruction" }
9 { $description "Checks if the comparison instruction is required." } ;
11 ARTICLE: "compiler.cfg.alias-analysis"
12 "Alias analysis for stack operations, array elements and tuple slots"
13 "We try to eliminate redundant slot operations using some simple heuristics."
15 "All heap-allocated objects which are loaded from the stack, or other object slots are pessimistically assumed to belong to the same alias class."
17 "Freshly-allocated objects get their own alias class."
19 "Simple pseudo-C example showing load elimination:"
21 "int *x, *y, z: inputs"
22 "int a, b, c, d, e: locals"
24 "Before alias analysis:"
34 "After alias analysis:"
37 "b = a /* ELIMINATED */"
40 "d = x[2] /* if x=y, d=z, if x!=y, d=b; NOT ELIMINATED */"
41 "e = z /* ELIMINATED */"
42 "f = c /* ELIMINATED */"
44 "Simple pseudo-C example showing store elimination:"
46 "Before alias analysis:"
55 "After alias analysis:"
57 "x[0] = a /* dead if n = 0, live otherwise; NOT ELIMINATED */"
60 "/* x[1] = d */ /* ELIMINATED */"
65 ABOUT: "compiler.cfg.alias-analysis"