annotate graal/com.oracle.graal.java/src/com/oracle/graal/java/DefaultSuitesProvider.java @ 19231:df89224ee04a

Add LowLevelSuites to SuitesProvider.
author Josef Eisl <josef.eisl@jku.at>
date Tue, 10 Feb 2015 10:29:39 +0100
parents 12c6c5a5bd88
children 9c921eb127ba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13638
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 /*
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 *
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 *
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 * accompanied this code).
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 *
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 *
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 * questions.
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 */
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.java;
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
18126
12c6c5a5bd88 avoid lambdas in HotSpotGraalRuntime initialization path
Doug Simon <doug.simon@oracle.com>
parents: 16871
diff changeset
25 import java.util.function.*;
12c6c5a5bd88 avoid lambdas in HotSpotGraalRuntime initialization path
Doug Simon <doug.simon@oracle.com>
parents: 16871
diff changeset
26
19231
df89224ee04a Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents: 18126
diff changeset
27 import com.oracle.graal.lir.phases.*;
16871
e728b9d4905c Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents: 13638
diff changeset
28 import com.oracle.graal.options.*;
13638
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
29 import com.oracle.graal.phases.*;
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
30 import com.oracle.graal.phases.tiers.*;
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
31
18126
12c6c5a5bd88 avoid lambdas in HotSpotGraalRuntime initialization path
Doug Simon <doug.simon@oracle.com>
parents: 16871
diff changeset
32 public class DefaultSuitesProvider implements SuitesProvider, Supplier<Suites> {
13638
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
33
16871
e728b9d4905c Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents: 13638
diff changeset
34 private final DerivedOptionValue<Suites> defaultSuites;
13638
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
35 private final PhaseSuite<HighTierContext> defaultGraphBuilderSuite;
19231
df89224ee04a Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents: 18126
diff changeset
36 private final DerivedOptionValue<LowLevelSuites> defaultLowLevelSuites;
13638
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
37
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
38 public DefaultSuitesProvider() {
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
39 this.defaultGraphBuilderSuite = createGraphBuilderSuite();
16871
e728b9d4905c Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents: 13638
diff changeset
40 this.defaultSuites = new DerivedOptionValue<>(this::createSuites);
19231
df89224ee04a Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents: 18126
diff changeset
41 this.defaultLowLevelSuites = new DerivedOptionValue<>(this::createLowLevelSuites);
13638
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
42 }
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
43
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
44 public Suites getDefaultSuites() {
16871
e728b9d4905c Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents: 13638
diff changeset
45 return defaultSuites.getValue();
13638
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
46 }
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
47
18126
12c6c5a5bd88 avoid lambdas in HotSpotGraalRuntime initialization path
Doug Simon <doug.simon@oracle.com>
parents: 16871
diff changeset
48 public Suites get() {
12c6c5a5bd88 avoid lambdas in HotSpotGraalRuntime initialization path
Doug Simon <doug.simon@oracle.com>
parents: 16871
diff changeset
49 return createSuites();
12c6c5a5bd88 avoid lambdas in HotSpotGraalRuntime initialization path
Doug Simon <doug.simon@oracle.com>
parents: 16871
diff changeset
50 }
12c6c5a5bd88 avoid lambdas in HotSpotGraalRuntime initialization path
Doug Simon <doug.simon@oracle.com>
parents: 16871
diff changeset
51
13638
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
52 public Suites createSuites() {
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
53 return Suites.createDefaultSuites();
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
54 }
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
55
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
56 public PhaseSuite<HighTierContext> getDefaultGraphBuilderSuite() {
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
57 return defaultGraphBuilderSuite;
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
58 }
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
59
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
60 protected PhaseSuite<HighTierContext> createGraphBuilderSuite() {
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
61 PhaseSuite<HighTierContext> suite = new PhaseSuite<>();
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
62 suite.appendPhase(new GraphBuilderPhase(GraphBuilderConfiguration.getDefault()));
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
63 return suite;
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
64 }
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
65
19231
df89224ee04a Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents: 18126
diff changeset
66 public LowLevelSuites getDefaultLowLevelSuites() {
df89224ee04a Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents: 18126
diff changeset
67 return defaultLowLevelSuites.getValue();
df89224ee04a Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents: 18126
diff changeset
68 }
df89224ee04a Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents: 18126
diff changeset
69
df89224ee04a Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents: 18126
diff changeset
70 public LowLevelSuites createLowLevelSuites() {
df89224ee04a Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents: 18126
diff changeset
71 return Suites.createDefaultLowLevelSuites();
df89224ee04a Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents: 18126
diff changeset
72 }
df89224ee04a Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents: 18126
diff changeset
73
13638
1dabd01a73bd PTX backend can alter compilation pipeline to offload selected code to the GPU
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
74 }