72 try (DebugContext.Scope scope = debug.scope("ConditionalEliminationTest", graph)) { |
72 try (DebugContext.Scope scope = debug.scope("ConditionalEliminationTest", graph)) { |
73 prepareGraph(graph, canonicalizer1, context, applyLowering); |
73 prepareGraph(graph, canonicalizer1, context, applyLowering); |
74 new IterativeConditionalEliminationPhase(canonicalizer, true).apply(graph, context); |
74 new IterativeConditionalEliminationPhase(canonicalizer, true).apply(graph, context); |
75 canonicalizer.apply(graph, context); |
75 canonicalizer.apply(graph, context); |
76 canonicalizer.apply(graph, context); |
76 canonicalizer.apply(graph, context); |
77 new ConvertDeoptimizeToGuardPhase().apply(graph, context); |
|
78 } catch (Throwable t) { |
77 } catch (Throwable t) { |
79 debug.handle(t); |
78 debug.handle(t); |
80 } |
79 } |
81 StructuredGraph referenceGraph = parseEager(referenceSnippet, AllowAssumptions.YES); |
80 StructuredGraph referenceGraph = parseEager(referenceSnippet, AllowAssumptions.YES); |
82 try (DebugContext.Scope scope = debug.scope("ConditionalEliminationTest.ReferenceGraph", referenceGraph)) { |
81 try (DebugContext.Scope scope = debug.scope("ConditionalEliminationTest.ReferenceGraph", referenceGraph)) { |
84 if (applyConditionalEliminationOnReference) { |
83 if (applyConditionalEliminationOnReference) { |
85 new ConditionalEliminationPhase(true).apply(referenceGraph, context); |
84 new ConditionalEliminationPhase(true).apply(referenceGraph, context); |
86 } |
85 } |
87 canonicalizer.apply(referenceGraph, context); |
86 canonicalizer.apply(referenceGraph, context); |
88 canonicalizer.apply(referenceGraph, context); |
87 canonicalizer.apply(referenceGraph, context); |
89 new ConvertDeoptimizeToGuardPhase().apply(graph, context); |
|
90 } catch (Throwable t) { |
88 } catch (Throwable t) { |
91 debug.handle(t); |
89 debug.handle(t); |
92 } |
90 } |
93 assertEquals(referenceGraph, graph); |
91 assertEquals(referenceGraph, graph); |
94 } |
92 } |