Mercurial > hg > truffle
annotate graal/GraalCompiler/src/com/sun/c1x/graph/CriticalEdgeFinder.java @ 2796:d6bf240963fb
Rename Goto to Anchor
author | Gilles Duboscq <gilles.duboscq@oracle.com> |
---|---|
date | Fri, 27 May 2011 11:42:16 +0200 |
parents | 50677668afe3 |
children | 2af109bec0c0 |
rev | line source |
---|---|
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
1 /* |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
2 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
4 * |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
8 * |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
13 * accompanied this code). |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
14 * |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
18 * |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
21 * questions. |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
22 */ |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
23 package com.sun.c1x.graph; |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
24 |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
25 import java.util.*; |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
26 |
2779
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
27 import com.oracle.graal.graph.*; |
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
28 import com.sun.c1x.*; |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
29 import com.sun.c1x.debug.*; |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
30 import com.sun.c1x.ir.*; |
2779
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
31 import com.sun.c1x.lir.*; |
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
32 |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
33 /** |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
34 * This class finds and splits "critical" edges in the control flow graph. |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
35 * An edge between two blocks {@code A} and {@code B} is "critical" if {@code A} |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
36 * has more than one successor and {@code B} has more than one predecessor. Such |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
37 * edges are split by adding a block between the two blocks. |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
38 */ |
2779
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
39 public class CriticalEdgeFinder { |
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
40 |
2779
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
41 private final List<LIRBlock> lirBlocks; |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
42 private final Graph graph; |
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
43 |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
44 /** |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
45 * The graph edges represented as a map from source to target nodes. |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
46 * Using a linked hash map makes compilation tracing more deterministic and thus eases debugging. |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
47 */ |
2789
aeccd2af4e9e
Fixes around critical edge split and placeholder removal after goto removal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2788
diff
changeset
|
48 private Map<LIRBlock, List<LIRBlock>> edges = C1XOptions.DetailedAsserts ? |
aeccd2af4e9e
Fixes around critical edge split and placeholder removal after goto removal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2788
diff
changeset
|
49 new LinkedHashMap<LIRBlock, List<LIRBlock>>() : |
aeccd2af4e9e
Fixes around critical edge split and placeholder removal after goto removal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2788
diff
changeset
|
50 new HashMap<LIRBlock, List<LIRBlock>>(); |
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
51 |
2779
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
52 public CriticalEdgeFinder(List<LIRBlock> lirBlocks, Graph graph) { |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
53 this.lirBlocks = lirBlocks; |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
54 this.graph = graph; |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
55 for (LIRBlock block : lirBlocks) { |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
56 apply(block); |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
57 } |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
58 |
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
59 } |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
60 |
2779
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
61 private void apply(LIRBlock block) { |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
62 if (block.numberOfSux() >= 2) { |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
63 for (LIRBlock succ : block.blockSuccessors()) { |
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
64 if (succ.numberOfPreds() >= 2) { |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
65 // TODO: (tw) probably we don't have to make it a critical edge if succ only contains the _same_ predecessor multiple times. |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
66 recordCriticalEdge(block, succ); |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
67 } |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
68 } |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
69 } |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
70 } |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
71 |
2779
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
72 private void recordCriticalEdge(LIRBlock block, LIRBlock succ) { |
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
73 if (!edges.containsKey(block)) { |
2789
aeccd2af4e9e
Fixes around critical edge split and placeholder removal after goto removal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2788
diff
changeset
|
74 edges.put(block, new ArrayList<LIRBlock>()); |
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
75 } |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
76 |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
77 edges.get(block).add(succ); |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
78 } |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
79 |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
80 public void splitCriticalEdges() { |
2789
aeccd2af4e9e
Fixes around critical edge split and placeholder removal after goto removal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2788
diff
changeset
|
81 for (Map.Entry<LIRBlock, List<LIRBlock>> entry : edges.entrySet()) { |
2779
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
82 LIRBlock from = entry.getKey(); |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
83 for (LIRBlock to : entry.getValue()) { |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
84 LIRBlock split = splitEdge(from, to); |
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
85 if (C1XOptions.PrintHIR) { |
2779
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
86 TTY.println("Split edge between block %d and block %d, creating new block %d", from.blockID(), to.blockID(), split.blockID()); |
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
87 } |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
88 } |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
89 } |
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
90 } |
2779
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
91 |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
92 |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
93 /** |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
94 * Creates and inserts a new block between this block and the specified successor, |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
95 * altering the successor and predecessor lists of involved blocks appropriately. |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
96 * @param source the source of the edge |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
97 * @param target the successor before which to insert a block |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
98 * @return the new block inserted |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
99 */ |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
100 public LIRBlock splitEdge(LIRBlock source, LIRBlock target) { |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
101 |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
102 // create new successor and mark it for special block order treatment |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
103 LIRBlock newSucc = new LIRBlock(lirBlocks.size()); |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
104 lirBlocks.add(newSucc); |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
105 |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
106 // This goto is not a safepoint. |
2796
d6bf240963fb
Rename Goto to Anchor
Gilles Duboscq <gilles.duboscq@oracle.com>
parents:
2790
diff
changeset
|
107 Anchor e = new Anchor(null, graph); |
2789
aeccd2af4e9e
Fixes around critical edge split and placeholder removal after goto removal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2788
diff
changeset
|
108 Instruction sourceInstruction = source.getInstructions().get(source.getInstructions().size() - 1); |
aeccd2af4e9e
Fixes around critical edge split and placeholder removal after goto removal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2788
diff
changeset
|
109 Instruction targetInstruction = target.getInstructions().get(0); |
2790
50677668afe3
Towards making goto removal work.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2789
diff
changeset
|
110 int sourceInstructionPredIndex = targetInstruction.predecessors().indexOf(sourceInstruction); |
50677668afe3
Towards making goto removal work.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2789
diff
changeset
|
111 int replacedIndex = targetInstruction.predecessorsIndex().get(sourceInstructionPredIndex); |
2789
aeccd2af4e9e
Fixes around critical edge split and placeholder removal after goto removal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2788
diff
changeset
|
112 assert replacedIndex != -1 && sourceInstruction.successors().get(replacedIndex) != null; |
aeccd2af4e9e
Fixes around critical edge split and placeholder removal after goto removal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2788
diff
changeset
|
113 e.successors().setAndClear(1, sourceInstruction, replacedIndex); |
aeccd2af4e9e
Fixes around critical edge split and placeholder removal after goto removal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2788
diff
changeset
|
114 sourceInstruction.successors().set(replacedIndex, e); |
aeccd2af4e9e
Fixes around critical edge split and placeholder removal after goto removal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2788
diff
changeset
|
115 newSucc.getInstructions().add(e); |
aeccd2af4e9e
Fixes around critical edge split and placeholder removal after goto removal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2788
diff
changeset
|
116 assert e.defaultSuccessor() != null; |
2779
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
117 source.substituteSuccessor(target, newSucc); |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
118 target.substitutePredecessor(source, newSucc); |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
119 newSucc.blockPredecessors().add(source); |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
120 newSucc.blockSuccessors().add(target); |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
121 return newSucc; |
93ec3f067420
Changed CriticalEdgeFinder to use LIRBlock.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2773
diff
changeset
|
122 } |
2507
9ec15d6914ca
Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
123 } |