Skip to content

Commit

Permalink
[GR-8868] Better identify community configuration.
Browse files Browse the repository at this point in the history
PullRequest: graal/1179
  • Loading branch information
dougxc committed Mar 19, 2018
2 parents 26fc619 + 2b9e5aa commit dc9127a
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 16 deletions.
2 changes: 1 addition & 1 deletion compiler/mx.compiler/mx_graal_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def build_jvmci_vm_variants(raw_name, raw_config_name, extra_args, variants, inc
('limit-truffle-inlining', ['-Dgraal.TruffleMaximumRecursiveInlining=2'], 0),
('no-splitting-limit-truffle-inlining', ['-Dgraal.TruffleSplitting=false', '-Dgraal.TruffleMaximumRecursiveInlining=2'], 0),
]
build_jvmci_vm_variants('server', 'graal-core', ['-server', '-XX:+EnableJVMCI', '-Dgraal.CompilerConfiguration=core', '-Djvmci.Compiler=graal'], _graal_variants, suite=_suite, priority=15)
build_jvmci_vm_variants('server', 'graal-core', ['-server', '-XX:+EnableJVMCI', '-Dgraal.CompilerConfiguration=community', '-Djvmci.Compiler=graal'], _graal_variants, suite=_suite, priority=15)

# On 64 bit systems -client is not supported. Nevertheless, when running with -server, we can
# force the VM to just compile code with C1 but not with C2 by adding option -XX:TieredStopAtLevel=1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
import org.graalvm.compiler.phases.tiers.LowTierContext;
import org.graalvm.compiler.phases.tiers.MidTierContext;

public class CoreCompilerConfiguration implements CompilerConfiguration {
/**
* The default configuration for the community edition of Graal.
*/
public class CommunityCompilerConfiguration implements CompilerConfiguration {

@Override
public PhaseSuite<HighTierContext> createHighTier(OptionValues options) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
import org.graalvm.compiler.phases.tiers.LowTierContext;
import org.graalvm.compiler.phases.tiers.MidTierContext;

/**
* A compiler configuration that performs fewer Graal IR optimizations while using the same backend
* as the {@link CommunityCompilerConfiguration}.
*/
public class EconomyCompilerConfiguration implements CompilerConfiguration {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class AArch64HotSpotBackendFactory implements HotSpotBackendFactory {

@Override
public String getName() {
return "core";
return "community";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class AMD64HotSpotBackendFactory implements HotSpotBackendFactory {

@Override
public String getName() {
return "core";
return "community";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class SPARCHotSpotBackendFactory implements HotSpotBackendFactory {

@Override
public String getName() {
return "core";
return "community";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,30 @@
*/
package org.graalvm.compiler.hotspot;

import org.graalvm.compiler.core.phases.CoreCompilerConfiguration;
import org.graalvm.compiler.core.phases.CommunityCompilerConfiguration;
import org.graalvm.compiler.phases.tiers.CompilerConfiguration;
import org.graalvm.compiler.serviceprovider.ServiceProvider;

/**
* Factory for creating the default configuration for the community edition of Graal.
*/
@ServiceProvider(CompilerConfigurationFactory.class)
public class CoreCompilerConfigurationFactory extends CompilerConfigurationFactory {
public class CommunityCompilerConfigurationFactory extends CompilerConfigurationFactory {

public static final String NAME = "core";
public static final String NAME = "community";

/**
* Must be greater than {@link EconomyCompilerConfigurationFactory#AUTO_SELECTION_PRIORITY}.
*/
public static final int AUTO_SELECTION_PRIORITY = 2;

public CoreCompilerConfigurationFactory() {
public CommunityCompilerConfigurationFactory() {
super(NAME, AUTO_SELECTION_PRIORITY);
assert AUTO_SELECTION_PRIORITY > EconomyCompilerConfigurationFactory.AUTO_SELECTION_PRIORITY;
}

@Override
public CompilerConfiguration createCompilerConfiguration() {
return new CoreCompilerConfiguration();
return new CommunityCompilerConfiguration();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import org.graalvm.compiler.phases.tiers.CompilerConfiguration;
import org.graalvm.compiler.serviceprovider.ServiceProvider;

/**
* Factory that creates a {@link EconomyCompilerConfiguration}.
*/
@ServiceProvider(CompilerConfigurationFactory.class)
public class EconomyCompilerConfigurationFactory extends CompilerConfigurationFactory {

Expand All @@ -44,7 +47,7 @@ public CompilerConfiguration createCompilerConfiguration() {

@Override
public BackendMap createBackendMap() {
// the economy configuration only differs in the frontend, it reuses the "core" backend
return new DefaultBackendMap(CoreCompilerConfigurationFactory.NAME);
// the economy configuration only differs in the frontend, it reuses the "community" backend
return new DefaultBackendMap(CommunityCompilerConfigurationFactory.NAME);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.graalvm.compiler.core.gen.NodeMatchRules;
import org.graalvm.compiler.core.match.MatchRuleRegistry;
import org.graalvm.compiler.core.match.MatchStatement;
import org.graalvm.compiler.core.phases.CoreCompilerConfiguration;
import org.graalvm.compiler.core.phases.CommunityCompilerConfiguration;
import org.graalvm.compiler.core.target.Backend;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.nodes.StructuredGraph;
Expand Down Expand Up @@ -69,7 +69,7 @@ public LoweringProvider createLoweringProvider(MetaAccessProvider metaAccess, Fo
}

public Suites createSuites(OptionValues options, @SuppressWarnings("unused") boolean hosted) {
return Suites.createSuites(new CoreCompilerConfiguration(), options);
return Suites.createSuites(new CommunityCompilerConfiguration(), options);
}

public void populateMatchRuleRegistry(HashMap<Class<? extends NodeMatchRules>, EconomicMap<Class<? extends Node>, List<MatchStatement>>> matchRuleRegistry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
import org.graalvm.compiler.core.common.CompressEncoding;
import org.graalvm.compiler.core.common.GraalOptions;
import org.graalvm.compiler.core.common.spi.ForeignCallsProvider;
import org.graalvm.compiler.core.phases.CoreCompilerConfiguration;
import org.graalvm.compiler.core.phases.CommunityCompilerConfiguration;
import org.graalvm.compiler.core.target.Backend;
import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.debug.DebugDumpScope;
Expand Down Expand Up @@ -1158,7 +1158,7 @@ public static Suites createSuites(FeatureHandler featureHandler, RuntimeConfigur

@SuppressWarnings("unused")
public static LIRSuites createLIRSuites(FeatureHandler featureHandler, Providers providers, boolean hosted) {
LIRSuites lirSuites = Suites.createLIRSuites(new CoreCompilerConfiguration(), hosted ? HostedOptionValues.singleton() : RuntimeOptionValues.singleton());
LIRSuites lirSuites = Suites.createLIRSuites(new CommunityCompilerConfiguration(), hosted ? HostedOptionValues.singleton() : RuntimeOptionValues.singleton());
/* Add phases that just perform assertion checking. */
assert addAssertionLIRPhases(lirSuites, hosted);
return lirSuites;
Expand Down

0 comments on commit dc9127a

Please sign in to comment.