Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopEx.java @ 15136:140bd4b4e3c6
Make NodePredicate an interface
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 11 Apr 2014 18:01:21 +0200 |
parents | b6711b514576 |
children | df2ef5204f2b |
rev | line source |
---|---|
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
1 /* |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved. |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
4 * |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
8 * |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
14 * |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
18 * |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
21 * questions. |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
22 */ |
6523
c8763a2deb0c
rename packages in graal.loop to match project name
Doug Simon <doug.simon@oracle.com>
parents:
6522
diff
changeset
|
23 package com.oracle.graal.loop; |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
24 |
5732
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
25 import java.util.*; |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
26 |
5675
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
27 import com.oracle.graal.api.meta.*; |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
28 import com.oracle.graal.debug.*; |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
29 import com.oracle.graal.graph.*; |
5675
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
30 import com.oracle.graal.graph.iterators.*; |
12761
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
31 import com.oracle.graal.loop.InductionVariable.Direction; |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
32 import com.oracle.graal.nodes.*; |
5675
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
33 import com.oracle.graal.nodes.calc.*; |
6529
2e96dc4eb8e2
renamed package: com.oracle.graal.lir.cfg -> com.oracle.graal.nodes.cfg
Doug Simon <doug.simon@oracle.com>
parents:
6523
diff
changeset
|
34 import com.oracle.graal.nodes.cfg.*; |
12761
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
35 import com.oracle.graal.nodes.extended.*; |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
36 |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
37 public class LoopEx { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6537
diff
changeset
|
38 |
15107 | 39 private final Loop<Block> lirLoop; |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
40 private LoopFragmentInside inside; |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
41 private LoopFragmentWhole whole; |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6537
diff
changeset
|
42 private CountedLoopInfo counted; // TODO (gd) detect |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
43 private LoopsData data; |
9446
27733a62ba72
Fixes and improvements for induction variables
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9436
diff
changeset
|
44 private InductionVariables ivs; |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
45 |
15107 | 46 LoopEx(Loop<Block> lirLoop, LoopsData data) { |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
47 this.lirLoop = lirLoop; |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
48 this.data = data; |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
49 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
50 |
15107 | 51 public Loop<Block> lirLoop() { |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
52 return lirLoop; |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
53 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
54 |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
55 public LoopFragmentInside inside() { |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
56 if (inside == null) { |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
57 inside = new LoopFragmentInside(this); |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
58 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
59 return inside; |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
60 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
61 |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
62 public LoopFragmentWhole whole() { |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
63 if (whole == null) { |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
64 whole = new LoopFragmentWhole(this); |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
65 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
66 return whole; |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
67 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
68 |
12750
c61d1f1bbee0
Invalidate cached nodes after canonicalization in full unrolling.
Roland Schatz <roland.schatz@oracle.com>
parents:
12655
diff
changeset
|
69 public void invalidateFragments() { |
c61d1f1bbee0
Invalidate cached nodes after canonicalization in full unrolling.
Roland Schatz <roland.schatz@oracle.com>
parents:
12655
diff
changeset
|
70 inside = null; |
c61d1f1bbee0
Invalidate cached nodes after canonicalization in full unrolling.
Roland Schatz <roland.schatz@oracle.com>
parents:
12655
diff
changeset
|
71 whole = null; |
c61d1f1bbee0
Invalidate cached nodes after canonicalization in full unrolling.
Roland Schatz <roland.schatz@oracle.com>
parents:
12655
diff
changeset
|
72 } |
c61d1f1bbee0
Invalidate cached nodes after canonicalization in full unrolling.
Roland Schatz <roland.schatz@oracle.com>
parents:
12655
diff
changeset
|
73 |
5498
eb0d4946a1ea
Fix compiler warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5489
diff
changeset
|
74 @SuppressWarnings("unused") |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
75 public LoopFragmentInsideFrom insideFrom(FixedNode point) { |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
76 // TODO (gd) |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
77 return null; |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
78 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
79 |
5498
eb0d4946a1ea
Fix compiler warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5489
diff
changeset
|
80 @SuppressWarnings("unused") |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
81 public LoopFragmentInsideBefore insideBefore(FixedNode point) { |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
82 // TODO (gd) |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
83 return null; |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
84 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
85 |
5610
9f3250602d69
Preliminary counted loop detection
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5520
diff
changeset
|
86 public boolean isOutsideLoop(Node n) { |
13320
c258331fdde6
removed support for external nodes (GRAAL-508)
Doug Simon <doug.simon@oracle.com>
parents:
12761
diff
changeset
|
87 return !whole().contains(n); |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
88 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
89 |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
90 public LoopBeginNode loopBegin() { |
15108
b6711b514576
Remove LoopBeginNode loopBegin() from Loop.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
91 return (LoopBeginNode) lirLoop().header.getBeginNode(); |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
92 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
93 |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
94 public FixedNode predecessor() { |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
95 return (FixedNode) loopBegin().forwardEnd().predecessor(); |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
96 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
97 |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
98 public FixedNode entryPoint() { |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
99 return loopBegin().forwardEnd(); |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
100 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
101 |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
102 public boolean isCounted() { |
5610
9f3250602d69
Preliminary counted loop detection
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5520
diff
changeset
|
103 return counted != null; |
9f3250602d69
Preliminary counted loop detection
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5520
diff
changeset
|
104 } |
9f3250602d69
Preliminary counted loop detection
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5520
diff
changeset
|
105 |
9f3250602d69
Preliminary counted loop detection
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5520
diff
changeset
|
106 public CountedLoopInfo counted() { |
9f3250602d69
Preliminary counted loop detection
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5520
diff
changeset
|
107 return counted; |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
108 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
109 |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
110 public LoopEx parent() { |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
111 if (lirLoop.parent == null) { |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
112 return null; |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
113 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
114 return data.loop(lirLoop.parent); |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
115 } |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
116 |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
117 public int size() { |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
118 return whole().nodes().count(); |
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
119 } |
5519
cedae73d9c2a
Fix problem with jython and tmt
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5489
diff
changeset
|
120 |
cedae73d9c2a
Fix problem with jython and tmt
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5489
diff
changeset
|
121 @Override |
cedae73d9c2a
Fix problem with jython and tmt
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5489
diff
changeset
|
122 public String toString() { |
5675
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
123 return (isCounted() ? "CountedLoop [" + counted() + "] " : "Loop ") + "(depth=" + lirLoop().depth + ") " + loopBegin(); |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
124 } |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
125 |
15136
140bd4b4e3c6
Make NodePredicate an interface
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15108
diff
changeset
|
126 private class InvariantPredicate implements NodePredicate { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
6537
diff
changeset
|
127 |
5675
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
128 @Override |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
129 public boolean apply(Node n) { |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
130 return isOutsideLoop(n); |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
131 } |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
132 } |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
133 |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
134 public void reassociateInvariants() { |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
135 InvariantPredicate invariant = new InvariantPredicate(); |
9602
19c5a07c7843
Introduce a graph() method that returns a StructuredGraph, to make many explicit casts unnecessary
Christian Wimmer <christian.wimmer@oracle.com>
parents:
9446
diff
changeset
|
136 StructuredGraph graph = loopBegin().graph(); |
5675
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
137 for (BinaryNode binary : whole().nodes().filter(BinaryNode.class)) { |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
138 if (!BinaryNode.canTryReassociate(binary)) { |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
139 continue; |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
140 } |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
141 BinaryNode result = BinaryNode.reassociate(binary, invariant); |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
142 if (result != binary) { |
6537
14c952ec53a3
Fix NullPointerException when disabling Debug
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6529
diff
changeset
|
143 if (Debug.isLogEnabled()) { |
14708 | 144 Debug.log("%s : Reassociated %s into %s", MetaUtil.format("%H::%n", graph.method()), binary, result); |
6537
14c952ec53a3
Fix NullPointerException when disabling Debug
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6529
diff
changeset
|
145 } |
5675
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
146 graph.replaceFloating(binary, result); |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
147 } |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
148 } |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
149 } |
776366f3a41a
A bit of work on counted loops
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5610
diff
changeset
|
150 |
12761
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
151 public boolean detectCounted() { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
152 LoopBeginNode loopBegin = loopBegin(); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
153 FixedNode next = loopBegin.next(); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
154 while (next instanceof FixedGuardNode || next instanceof ValueAnchorNode) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
155 next = ((FixedWithNextNode) next).next(); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
156 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
157 if (next instanceof IfNode) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
158 IfNode ifNode = (IfNode) next; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
159 boolean negated = false; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
160 if (!loopBegin.isLoopExit(ifNode.falseSuccessor())) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
161 if (!loopBegin.isLoopExit(ifNode.trueSuccessor())) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
162 return false; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
163 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
164 negated = true; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
165 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
166 LogicNode ifTest = ifNode.condition(); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
167 if (!(ifTest instanceof IntegerLessThanNode)) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
168 if (ifTest instanceof IntegerBelowThanNode) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
169 Debug.log("Ignored potential Counted loop at %s with |<|", loopBegin); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
170 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
171 return false; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
172 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
173 IntegerLessThanNode lessThan = (IntegerLessThanNode) ifTest; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
174 Condition condition = null; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
175 InductionVariable iv = null; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
176 ValueNode limit = null; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
177 if (isOutsideLoop(lessThan.x())) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
178 iv = getInductionVariables().get(lessThan.y()); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
179 if (iv != null) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
180 condition = lessThan.condition().mirror(); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
181 limit = lessThan.x(); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
182 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
183 } else if (isOutsideLoop(lessThan.y())) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
184 iv = getInductionVariables().get(lessThan.x()); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
185 if (iv != null) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
186 condition = lessThan.condition(); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
187 limit = lessThan.y(); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
188 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
189 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
190 if (condition == null) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
191 return false; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
192 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
193 if (negated) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
194 condition = condition.negate(); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
195 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
196 boolean oneOff = false; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
197 switch (condition) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
198 case LE: |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
199 oneOff = true; // fall through |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
200 case LT: |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
201 if (iv.direction() != Direction.Up) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
202 return false; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
203 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
204 break; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
205 case GE: |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
206 oneOff = true; // fall through |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
207 case GT: |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
208 if (iv.direction() != Direction.Down) { |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
209 return false; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
210 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
211 break; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
212 default: |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
213 throw GraalInternalError.shouldNotReachHere(); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
214 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
215 counted = new CountedLoopInfo(this, iv, limit, oneOff, negated ? ifNode.falseSuccessor() : ifNode.trueSuccessor()); |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
216 return true; |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
217 } |
8b82bdad798a
Make it possible to run counted loop detection on a single loop.
Roland Schatz <roland.schatz@oracle.com>
parents:
12750
diff
changeset
|
218 return false; |
5519
cedae73d9c2a
Fix problem with jython and tmt
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5489
diff
changeset
|
219 } |
5732
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
220 |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
221 public LoopsData loopsData() { |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
222 return data; |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
223 } |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
224 |
9436
ae815a4c112a
Rename BeginNode => AbstractBeginNode and make abstract. Introduce concrete subclass BeginNode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
225 public NodeBitMap nodesInLoopFrom(AbstractBeginNode point, AbstractBeginNode until) { |
ae815a4c112a
Rename BeginNode => AbstractBeginNode and make abstract. Introduce concrete subclass BeginNode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
226 Collection<AbstractBeginNode> blocks = new LinkedList<>(); |
ae815a4c112a
Rename BeginNode => AbstractBeginNode and make abstract. Introduce concrete subclass BeginNode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
227 Collection<AbstractBeginNode> exits = new LinkedList<>(); |
5732
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
228 Queue<Block> work = new LinkedList<>(); |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
229 ControlFlowGraph cfg = loopsData().controlFlowGraph(); |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
230 work.add(cfg.blockFor(point)); |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
231 Block untilBlock = until != null ? cfg.blockFor(until) : null; |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
232 while (!work.isEmpty()) { |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
233 Block b = work.remove(); |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
234 if (b == untilBlock) { |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
235 continue; |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
236 } |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
237 if (lirLoop().exits.contains(b)) { |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
238 exits.add(b.getBeginNode()); |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
239 } else if (lirLoop().blocks.contains(b)) { |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
240 blocks.add(b.getBeginNode()); |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
241 work.addAll(b.getDominated()); |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
242 } |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
243 } |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
244 return LoopFragment.computeNodes(point.graph(), blocks, exits); |
e1d5c642d022
Started to draft a loop unswitching policy
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5719
diff
changeset
|
245 } |
9446
27733a62ba72
Fixes and improvements for induction variables
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9436
diff
changeset
|
246 |
27733a62ba72
Fixes and improvements for induction variables
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9436
diff
changeset
|
247 public InductionVariables getInductionVariables() { |
27733a62ba72
Fixes and improvements for induction variables
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9436
diff
changeset
|
248 if (ivs == null) { |
27733a62ba72
Fixes and improvements for induction variables
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9436
diff
changeset
|
249 ivs = new InductionVariables(this); |
27733a62ba72
Fixes and improvements for induction variables
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9436
diff
changeset
|
250 } |
27733a62ba72
Fixes and improvements for induction variables
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9436
diff
changeset
|
251 return ivs; |
27733a62ba72
Fixes and improvements for induction variables
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9436
diff
changeset
|
252 } |
5489
5d0d72b37f88
Switch to new loop transformation framework, use it for peeling and full unrolling for snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
diff
changeset
|
253 } |