Mercurial > hg > truffle
annotate ProblemsIdeas.txt @ 3723:6c5f528c7aac
Added a copy of the mxtool to repo.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 16 Dec 2011 16:46:33 +0100 |
parents | 82266dbf5a5a |
children |
rev | line source |
---|---|
3225
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
1 Problems |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
2 ======== |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
3 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
4 * -Xcomp + synchronized method + unresolved type => deopt to bci -1 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
5 Example : try "runfop.sh -G:-Inline -Xcomp" should fail on the compilation of org.apache.xmlgraphics.util.Service.providers(java.lang.Class, boolean) |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
6 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
7 The first bytecode of the method is NEW (java.lang.StringBuffer)it will deopt because java.lang.StringBuffer is not resolved, the logic in append(FixedNode) will go back until the start node, detaching the MonitorEnter from the start node and attaching the Deopt instead. |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
8 Deopt will now get the FrameState generated by LIRGenerator in setOperandsForLocals which is bci -1 for a synchronized method. |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
9 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
10 Can interpreter handle bci -1 for synchronized methods ? if this is the case, the corresponding assert in LIRGenerator.visitDeoptimize should be removed as bci -1 should now only be used for synchronized entry points and not for exception handling or anything else |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
11 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
12 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
13 * Deopt caused by profiling can interfer with later optimisations |
3521
82266dbf5a5a
WIP : updated loop counter detection, added Basic and Derived induction variable framework
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3518
diff
changeset
|
14 Example : have a look to some of the visit methods in avrora.arch.legacy.LegacyInterpreter sometimes if constructs which are used to materialize some booleans have a Deopt branch which prevents us from detecting an opportunity for a MaterilizeNode canonicalization. As long as the MaterializeNode itself doesnt get canonicalized away and in the end translates to jumps in the final assembly this doesnt really matter but it may if we optimise the emitted assembly |
82266dbf5a5a
WIP : updated loop counter detection, added Basic and Derived induction variable framework
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3518
diff
changeset
|
15 |
82266dbf5a5a
WIP : updated loop counter detection, added Basic and Derived induction variable framework
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3518
diff
changeset
|
16 * Canonicalization & DeadCodeElimination should play better together |
82266dbf5a5a
WIP : updated loop counter detection, added Basic and Derived induction variable framework
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3518
diff
changeset
|
17 Somtimes the graph does not get completely canonical after a CanonicalizationPhase followed by a DeadCodeEliminationPhase because DCE can transform some Phi into one of their input value because of the removal of a branch, if this transformation gives a canonicalization opportunity, it will never be used. We could apply Canonicalization followed by BCE until we reach a fixed point but that's probably not very efficient. |
3225
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
18 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
19 Ideas |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
20 ===== |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
21 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
22 * Always inline 'specialization' methods |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
23 Example : |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
24 public void foo(int a) { |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
25 foo(a, 1); // invoke 1 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
26 } |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
27 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
28 public void foo(int a, int b) { |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
29 foo(a, b, false); // invoke 2 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
30 } |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
31 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
32 public void foo(int a, int b, boolean c) { |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
33 // ... |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
34 } |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
35 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
36 Here invoke 1 and 2 should always be inlined regardless of the size of the inlined graph/method size and without increasing the inlining depth |
3227
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
37 specializations should always be inlined if we are in a trivial method, not only he methods with only one invoke, we shoudl also do it for exemple for methods that invoke and only do simple operations on paramteres or result |
3225
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
38 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
39 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
40 * 'computable' slots in Framstates/debug info |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
41 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
42 Framestates/debug info will keep some values live for longer than they should because the values are needed for exemple for a very unlikely Deopt, this increases the pressure on register allocator. |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
43 In the current system Deopt is the unlikely/slow path so maybe we can make it a bit slower to avoid this problem and increase fast path performances. |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
44 An idea would be to insert an 'expression' in some slots instead of value referances, the expression would use values that have to be live at this point for program semantics reasons. |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
45 Expressions would then be evaluated by the runtime when the framestate values are needed. Expression operators probably have to be kept simple (non-trapping arithmetics) |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
46 This could be done by deopting to some deopt handler that will fixup the computable slots, this would probably require less runtime hacking. For exemple an object containing the informations necessary to fixup the framestate could be inserted in one of the framestate solts and then used by a deopt handler called in the same way than the deopt handler example. |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
47 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
48 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
49 * Profilable expressions |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
50 |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
51 Some optimizations may benefit from knowing is some assumption can be done. For exemple some loop optimisations may want to know the likelyhood of 2 values being aliased so that it can know if inserting a deopt-if-aliased guard is really beneficial. |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
52 This kind of information can not always be derived just from branch probabilities and it would be interesting to be able to ask the runtime to profile an expression, the simplest version would be to generate a boolean expression and get the probability for it being true. |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
53 This requires going through the compiler and asking for further profiling there are 2 main options here : |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
54 - Reprofile the method in interpreter with the new profiled expression (we may modify the method bytecode to insert a conditional branch on the expression we want to profile, thus using the classical branch probability infrastructure) |
7610d0b83fd1
Canonicalize Compare if x valueEquals y, make EndNode return an empty list for cfgSux if it has no merge instead of retruning a list conatining null, make runjython executable, add a ProblemsIdeas.txt file
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
diff
changeset
|
55 - insert a profiling snippet in the compiled code and ask runtime to recompile the method after N executions |
3227
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
56 |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
57 |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
58 * Transform some contiguous array accesses into phis when possible |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
59 Example : (most probably found in scientific code, for example relaxation code) |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
60 |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
61 for (int i = 1; i < A.length - 1; i++) { |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
62 vm1 = A[i-1]; |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
63 v0 = A[i]; |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
64 vp1 = A[i+1]; |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
65 // ... |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
66 } |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
67 |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
68 should be transformed into |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
69 vm1 = A[0]; |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
70 v0 = A[1]; |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
71 for (int i = 0; i < A.length - 1; i++) { |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
72 vp1 = A[i+1]; |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
73 // ... |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
74 vm1 = v0; |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
75 v0 = vp1; |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
76 } |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
77 |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
78 This could be done in the context of a more advanced induction varaible analysis to be able to detect such access patterns. In this example we removed 2 array access (2 loads + 2 address computation + 2 bounds checks if not hoisted) while only adding 2 moves (phis) |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
79 |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
80 |
8793d44991fd
Added Verify option to be able to diable graph verification, ideal graph printing now also print string value for colors, removed redundant DCE/Canon phases
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3225
diff
changeset
|
81 * Implement array bounds check elimination |
3229
4a6bda6cfe28
Fix for usages that are phi in rematerialization
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3227
diff
changeset
|
82 |
4a6bda6cfe28
Fix for usages that are phi in rematerialization
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3227
diff
changeset
|
83 * Rematerialize only the nodes that were affected by GVN |
4a6bda6cfe28
Fix for usages that are phi in rematerialization
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3227
diff
changeset
|
84 This will probably require something that tracks changes to the Graph, the cost of such a tracking should be evaluated |
3233
e3d3fd5b638a
Canonicalize Negate(Negate(x)) for int/long remove incorrect canonicalization of FloatSub(0.0, x) to Negate(x)
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3229
diff
changeset
|
85 |
e3d3fd5b638a
Canonicalize Negate(Negate(x)) for int/long remove incorrect canonicalization of FloatSub(0.0, x) to Negate(x)
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3229
diff
changeset
|
86 * Hints on register pressure |
e3d3fd5b638a
Canonicalize Negate(Negate(x)) for int/long remove incorrect canonicalization of FloatSub(0.0, x) to Negate(x)
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3229
diff
changeset
|
87 |
e3d3fd5b638a
Canonicalize Negate(Negate(x)) for int/long remove incorrect canonicalization of FloatSub(0.0, x) to Negate(x)
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3229
diff
changeset
|
88 Sometimes we can make better decisions if we know the register pressure, it would be nice to have a way to know about it. Maybe we have register allocation on SSA we can somehow interact with it and try to lower the pressure in some areas on request? |
3518
0ffcce571d09
Remove a Sysout debug message
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3233
diff
changeset
|
89 |
0ffcce571d09
Remove a Sysout debug message
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3233
diff
changeset
|
90 * Remove <0 check on array allocation when possible |
0ffcce571d09
Remove a Sysout debug message
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3233
diff
changeset
|
91 |
0ffcce571d09
Remove a Sysout debug message
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3233
diff
changeset
|
92 The XIR templates for array allocation check the length argument agaisnt 0, this can be avoided if the arguent is known to be >= 0 |
0ffcce571d09
Remove a Sysout debug message
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3233
diff
changeset
|
93 |
0ffcce571d09
Remove a Sysout debug message
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3233
diff
changeset
|
94 * Fuse Div/Rem that act on the same inputs |
0ffcce571d09
Remove a Sysout debug message
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3233
diff
changeset
|
95 |
0ffcce571d09
Remove a Sysout debug message
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3233
diff
changeset
|
96 Doing it in HIR require a node with 2 outputs which means projections, maybe a special Rem node that takes only the Div as input could do : that would be only one "Projection" node |
0ffcce571d09
Remove a Sysout debug message
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3233
diff
changeset
|
97 |
0ffcce571d09
Remove a Sysout debug message
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3233
diff
changeset
|
98 * Fuse multiple conditional that use the same BooleanNode condition when doing LIRGen |
0ffcce571d09
Remove a Sysout debug message
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3233
diff
changeset
|
99 |
0ffcce571d09
Remove a Sysout debug message
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
3233
diff
changeset
|
100 Would allow to transform conditional constructs more agressively. Fuse them together or if there is a If that uses the condition, emit them in the if branches |