Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/alloc/ControlFlowOptimizer.java @ 2652:6d19b4f476db
Removed more OSR handling stuff.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 11 May 2011 14:51:33 +0200 |
parents | 4a36a0bd6d18 |
children | 6ab73784566a |
comparison
equal
deleted
inserted
replaced
2651:f9ae687657e8 | 2652:6d19b4f476db |
---|---|
43 * @param ir the IR graph that should be optimized | 43 * @param ir the IR graph that should be optimized |
44 */ | 44 */ |
45 public static void optimize(IR ir) { | 45 public static void optimize(IR ir) { |
46 ControlFlowOptimizer optimizer = new ControlFlowOptimizer(ir); | 46 ControlFlowOptimizer optimizer = new ControlFlowOptimizer(ir); |
47 List<BlockBegin> code = ir.linearScanOrder(); | 47 List<BlockBegin> code = ir.linearScanOrder(); |
48 | |
49 // push the OSR entry block to the end so that we're not jumping over it. | |
50 BlockBegin osrEntry = ((Base) code.get(0).end()).osrEntry(); | |
51 if (osrEntry != null) { | |
52 int index = osrEntry.linearScanNumber(); | |
53 assert code.get(index) == osrEntry : "wrong index"; | |
54 code.remove(index); | |
55 code.add(osrEntry); | |
56 } | |
57 | |
58 optimizer.reorderShortLoops(code); | 48 optimizer.reorderShortLoops(code); |
59 optimizer.deleteEmptyBlocks(code); | 49 optimizer.deleteEmptyBlocks(code); |
60 optimizer.deleteUnnecessaryJumps(code); | 50 optimizer.deleteUnnecessaryJumps(code); |
61 optimizer.deleteJumpsToReturn(code); | 51 optimizer.deleteJumpsToReturn(code); |
62 } | 52 } |