Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Optimization phases should use the `OptimizationLog` to log transformations. Rea
`Profdiff.md` to learn how to compare performed optimizations in hot compilations of 2 experiments.
* The `-Dgraal.PrintCompilation=true` output now includes stub compilations. For example:
`StubCompilation-57 <stub> exceptionHandler (Object,Word)void | 166us 0B bytecodes 88B codesize 137kB allocated`
* (GR-27475) Add support for the ZGC collector on HotSpot.

## Version 22.3.0
* (GR-19840): An image produced by GraalVM's jlink now includes and uses libgraal by default and its `java -version` output includes GraalVM branding.
Expand Down
15 changes: 14 additions & 1 deletion compiler/ci/ci_common/benchmark-builders.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@
for suite in bench.groups.main_suites
],

local zgc_builds = [
c.weekly + hw.x52 + jdk + cc.libgraal + cc.zgc_mode + suite,
for jdk in cc.bench_jdks
for suite in bench.groups.main_suites
],

local zgc_avx_builds = [
c.monthly + hw.x82 + jdk + cc.libgraal + cc.zgc_mode + avx + suite,
for avx in [cc.avx2_mode, cc.avx3_mode]
for jdk in cc.bench_jdks
for suite in bench.groups.main_suites
],

local no_tiered_builds = [
c.weekly + hw.x52 + jdk + cc.libgraal + cc.no_tiered_comp + suite,
for jdk in cc.bench_jdks
Expand All @@ -76,7 +89,7 @@
],


local all_builds = main_builds + weekly_amd64_forks_builds + weekly_aarch64_forks_builds + profiling_builds + avx_builds + aarch64_builds + no_tiered_builds + no_profile_info_builds,
local all_builds = main_builds + weekly_amd64_forks_builds + weekly_aarch64_forks_builds + profiling_builds + avx_builds + zgc_builds + zgc_avx_builds + aarch64_builds + no_tiered_builds + no_profile_info_builds,
local filtered_builds = [b for b in all_builds if b.is_jdk_supported(b.jdk_version) && b.is_arch_supported(b.arch)],
// adds a "defined_in" field to all builds mentioning the location of this current file
builds:: [{ defined_in: std.thisFile } + b for b in filtered_builds]
Expand Down
7 changes: 7 additions & 0 deletions compiler/ci/ci_common/compiler-common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,12 @@
environment+: {
"JVM_CONFIG"+: "-avx3",
}
},

zgc_mode:: {
platform+:: "-zgc",
environment+: {
"JVM_CONFIG"+: "-zgc",
}
}
}
99 changes: 74 additions & 25 deletions compiler/ci/ci_common/gate.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@
local s = self,
local t(limit) = {timelimit: limit},

local jmh_benchmark_test = {
run+: [
# blackbox jmh test
["mx", "benchmark", "jmh-dist:GRAAL_COMPILER_MICRO_BENCHMARKS",
"--fail-fast",
"--",
"-Djmh.ignoreLock=true",
"--jvm-config=" + jvm_config,
"--jvm=server",
"--",
".*TestJMH.*" ],
# whitebox jmh test
["mx", "benchmark", "jmh-whitebox:*",
"--fail-fast",
"--",
"-Djmh.ignoreLock=true",
"--jvm-config=" + jvm_config,
"--jvm=server",
"--",
".*TestJMH.*" ]
]
},

setup:: {
setup+: [
["cd", "./" + config.compiler.compiler_suite],
Expand Down Expand Up @@ -56,6 +79,8 @@
},

test:: s.base(no_warning_as_error=true),
test_zgc:: s.base(no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),


jacoco_gate_args:: ["--jacoco-omit-excluded", "--jacoco-relativize-paths", "--jacoco-omit-src-gen", "--jacocout", "coverage", "--jacoco-format", "lcov"],
upload_coverage:: ["mx", "sversions", "--print-repositories", "--json", "|", "coverage-uploader.py", "--associated-repos", "-"],
Expand Down Expand Up @@ -91,38 +116,31 @@
logs+: ["*/*_compilation.log"]
},

truffle_xcomp_zgc:: s.base("build,unittest",
extra_vm_args="-Dpolyglot.engine.AllowExperimentalOptions=true " +
"-Dpolyglot.engine.CompileImmediately=true " +
"-Dpolyglot.engine.BackgroundCompilation=false " +
"-Dtck.inlineVerifierInstrument=false " +
"-XX:+UseZGC",
extra_unittest_args="--very-verbose truffle") + {
environment+: {"TRACE_COMPILATION": "true"},
logs+: ["*/*_compilation.log"]
},

ctw:: s.base("build,ctw", no_warning_as_error=true),
ctw_zgc:: s.base("build,ctw", no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),

ctw_economy:: s.base("build,ctweconomy", extra_vm_args="-Dgraal.CompilerConfiguration=economy"),
ctw_phaseplan_fuzzing:: s.base("build,ctwphaseplanfuzzing"),

# Runs some benchmarks as tests
benchmarktest:: s.base("build,benchmarktest") + {
run+: [
# blackbox jmh test
["mx", "benchmark", "jmh-dist:GRAAL_COMPILER_MICRO_BENCHMARKS",
"--fail-fast",
"--",
"-Djmh.ignoreLock=true",
"--jvm-config=" + jvm_config,
"--jvm=server",
"--",
".*TestJMH.*" ],
# whitebox jmh test
["mx", "benchmark", "jmh-whitebox:*",
"--fail-fast",
"--",
"-Djmh.ignoreLock=true",
"--jvm-config=" + jvm_config,
"--jvm=server",
"--",
".*TestJMH.*" ]
]
},
benchmarktest:: s.base("build,benchmarktest") + jmh_benchmark_test,
benchmarktest_zgc:: s.base("build,benchmarktest", extra_vm_args="-XX:+UseZGC") + jmh_benchmark_test,

bootstrap:: s.base("build,bootstrap", no_warning_as_error=true),
bootstrap_lite:: s.base("build,bootstraplite", no_warning_as_error=true),
bootstrap_full:: s.base("build,bootstrapfullverify", no_warning_as_error=true),
bootstrap_full_zgc:: s.base("build,bootstrapfullverify", no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),
bootstrap_economy:: s.base("build,bootstrapeconomy", no_warning_as_error=true, extra_vm_args="-Dgraal.CompilerConfiguration=economy"),

style:: c.deps.eclipse + c.deps.jdt + s.base("style,fullbuild,javadoc"),
Expand Down Expand Up @@ -163,26 +181,34 @@
# fields of the denoted build.
local gates = {
"gate-compiler-test-labsjdk-20-linux-amd64": t("1:00:00") + c.mach5_target,
"gate-compiler-test-labsjdk-17-linux-amd64": t("1:00:00"),
"gate-compiler-test-labsjdk-20-linux-aarch64": t("1:50:00"),
"gate-compiler-test-labsjdk-20-darwin-amd64": t("1:00:00") + c.mach5_target,
"gate-compiler-test-labsjdk-20-darwin-aarch64": t("1:00:00"),
"gate-compiler-test-labsjdk-20-windows-amd64": t("55:00") + c.mach5_target,
"gate-compiler-test_zgc-labsjdk-20-linux-amd64": t("1:00:00") + c.mach5_target,
"gate-compiler-test_zgc-labsjdk-20-linux-aarch64": t("1:50:00"),
"gate-compiler-test_zgc-labsjdk-20-darwin-amd64": t("1:00:00") + c.mach5_target,
"gate-compiler-test_zgc-labsjdk-20-darwin-aarch64": t("1:00:00"),

"gate-compiler-style-labsjdk-20-linux-amd64": t("45:00"),

"gate-compiler-ctw-labsjdk-20-linux-amd64": c.mach5_target,
"gate-compiler-ctw-labsjdk-20-windows-amd64": t("1:50:00"),
"gate-compiler-ctw_zgc-labsjdk-20-linux-amd64": c.mach5_target,

"gate-compiler-ctw_economy-labsjdk-20-linux-amd64": {},
"gate-compiler-ctw_economy-labsjdk-20-windows-amd64": t("1:50:00"),

"gate-compiler-benchmarktest-labsjdk-20-linux-amd64": {},
"gate-compiler-benchmarktest_zgc-labsjdk-20-linux-amd64": {},

"gate-compiler-truffle_xcomp-labsjdk-20-linux-amd64": t("1:30:00"),
"gate-compiler-truffle_xcomp_zgc-labsjdk-20-linux-amd64": t("1:30:00"),

"gate-compiler-bootstrap_lite-labsjdk-20-darwin-amd64": t("1:00:00") + c.mach5_target,

"gate-compiler-bootstrap_full-labsjdk-20-linux-amd64": s.many_cores + c.mach5_target
"gate-compiler-bootstrap_full-labsjdk-20-linux-amd64": s.many_cores + c.mach5_target,
"gate-compiler-bootstrap_full_zgc-labsjdk-20-linux-amd64": s.many_cores + c.mach5_target
},

# This map defines the builders that run daily. Each key in this map
Expand Down Expand Up @@ -211,7 +237,6 @@
notify_emails: ["[email protected]"],
},

"weekly-compiler-test-labsjdk-17-linux-amd64": {},
"weekly-compiler-test-labsjdk-17-linux-aarch64": {},
"weekly-compiler-test-labsjdk-17-windows-amd64": {},
"weekly-compiler-test-labsjdk-17-darwin-amd64": {},
Expand All @@ -220,6 +245,7 @@
"weekly-compiler-test_vec16-labsjdk-20-linux-amd64": {},
"weekly-compiler-test_avx0-labsjdk-20-linux-amd64": {},
"weekly-compiler-test_avx1-labsjdk-20-linux-amd64": {},

"weekly-compiler-test_jtt_phaseplan_fuzzing-labsjdk-20-linux-amd64": {
notify_groups: [],
notify_emails: ["[email protected]"],
Expand Down Expand Up @@ -345,6 +371,28 @@
]
],

# Test ZGC on support platforms. Windows requires version 1083 or later which will
# probably require adding some capabilities.
local all_zgc_builds = [self.make_build(jdk, os_arch, task).build
for jdk in [
"17",
"20"
]
for os_arch in [
"linux-amd64",
"linux-aarch64",
"darwin-amd64",
"darwin-aarch64"
]
for task in [
"test_zgc",
"truffle_xcomp_zgc",
"ctw_zgc",
"benchmarktest_zgc",
"bootstrap_full_zgc"
]
],

# Builds run on only on linux-amd64-jdk20
local linux_amd64_jdk20_builds = [self.make_build("20", "linux-amd64", task).build
for task in [
Expand All @@ -370,6 +418,7 @@
# Complete set of builds defined in this file
local all_builds =
all_platforms_builds +
all_zgc_builds +
linux_amd64_jdk20_builds +
linux_amd64_jdk20Debug_builds,

Expand Down
10 changes: 9 additions & 1 deletion compiler/ci/ci_includes/baseline-benchmarks.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,17 @@
for suite in bench.groups.main_suites
]),

local zgc_builds = std.flattenArrays([
[
c.weekly + hw.x52 + jdk + cc.c2 + cc.zgc_mode + suite,
]
for jdk in cc.bench_jdks
for suite in bench.groups.main_suites
]),
local all_builds = hotspot_amd64_builds + hotspot_aarch64_builds + hotspot_profiling_builds +
weekly_forks_amd64_builds + weekly_forks_aarch64_builds + daily_economy_builds + weekly_economy_builds + no_tiered_builds,
weekly_forks_amd64_builds + weekly_forks_aarch64_builds + daily_economy_builds + weekly_economy_builds + no_tiered_builds + zgc_builds,
local filtered_builds = [b for b in all_builds if b.is_jdk_supported(b.jdk_version) && b.is_arch_supported(b.arch)],

// adds a "defined_in" field to all builds mentioning the location of this current file
builds:: [{ defined_in: std.thisFile } + b for b in filtered_builds]
}
8 changes: 5 additions & 3 deletions compiler/mx.compiler/mx_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,12 @@ class GraalTags:
doc = ['javadoc']
phaseplan_fuzz_jtt_tests = ['phaseplan-fuzz-jtt-tests']

def _remove_empty_entries(a):
def _remove_empty_entries(a, filter_gcs=False):
"""Removes empty entries. Return value is always a list."""
if not a:
return []
if filter_gcs:
a = [x for x in a if not x.endswith('GC') or not x.startswith('-XX:+Use')]
return [x for x in a if x]

def _compiler_error_options(default_compilation_failure_action='ExitVM', vmargs=None, prefix='-Dgraal.'):
Expand Down Expand Up @@ -392,7 +394,7 @@ def _gate_dacapo(name, iterations, extraVMarguments=None, force_serial_gc=True,
vmargs = ['-XX:+UseSerialGC'] if force_serial_gc else []
if set_start_heap_size:
vmargs += ['-Xms2g']
vmargs += ['-XX:-UseCompressedOops', '-Djava.net.preferIPv4Stack=true'] + _compiler_error_options() + _remove_empty_entries(extraVMarguments)
vmargs += ['-XX:-UseCompressedOops', '-Djava.net.preferIPv4Stack=true'] + _compiler_error_options() + _remove_empty_entries(extraVMarguments, filter_gcs=force_serial_gc)
args = ['-n', str(iterations), '--preserve']
if threads is not None:
args += ['-t', str(threads)]
Expand All @@ -406,7 +408,7 @@ def jdk_includes_corba(jdk):
def _gate_scala_dacapo(name, iterations, extraVMarguments=None):
if iterations == -1:
return
vmargs = ['-Xms2g', '-XX:+UseSerialGC', '-XX:-UseCompressedOops'] + _compiler_error_options() + _remove_empty_entries(extraVMarguments)
vmargs = ['-Xms2g', '-XX:+UseSerialGC', '-XX:-UseCompressedOops'] + _compiler_error_options() + _remove_empty_entries(extraVMarguments, filter_gcs=True)
args = ['-n', str(iterations), '--preserve']
return _run_benchmark('scala-dacapo', name, args, vmargs)

Expand Down
4 changes: 4 additions & 0 deletions compiler/mx.compiler/mx_graal_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def build_jvmci_vm_variants(raw_name, raw_config_name, extra_args, variants, inc
('economy', [], 0, 'economy'),
('economy-no-tiered-comp', ['-XX:-TieredCompilation'], 0, 'economy'),
('g1gc', ['-XX:+UseG1GC'], 12),
('zgc', ['-XX:+UseZGC'], 12),
('zgc-avx2', ['-XX:+UseZGC', '-XX:UseAVX=2'], 12),
('zgc-avx3', ['-XX:+UseZGC', '-XX:UseAVX=3'], 12),
('no-comp-oops', ['-XX:-UseCompressedOops'], 0),
('no-profile-info', ['-Djvmci.UseProfilingInformation=false'], 0),
('no-splitting', ['-Dpolyglot.engine.Splitting=false'], 0),
Expand All @@ -148,6 +151,7 @@ def build_jvmci_vm_variants(raw_name, raw_config_name, extra_args, variants, inc


mx_benchmark.add_java_vm(JvmciJdkVm('server', 'default', ['-server', '-XX:-EnableJVMCI']), _suite, 2)
mx_benchmark.add_java_vm(JvmciJdkVm('server', 'default-zgc', ['-server', '-XX:-EnableJVMCI', '-XX:+UseZGC']), _suite, 2)
mx_benchmark.add_java_vm(JvmciJdkVm('server', 'default-no-tiered-comp', ['-server', '-XX:-EnableJVMCI', '-XX:-TieredCompilation']), _suite, 2)
mx_benchmark.add_java_vm(JvmciJdkVm('server', 'hosted', ['-server', '-XX:+EnableJVMCI']), _suite, 3)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ protected void clrex() {
public void align(int modulus) {
}

@Override
public void halt() {
}

@Override
public void jmp(Label l) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,18 @@ public AddressingMode getAddressingMode() {
return addressingMode;
}

public boolean isBaseRegisterOnly() {
switch (getAddressingMode()) {
case IMMEDIATE_UNSIGNED_SCALED:
case IMMEDIATE_SIGNED_UNSCALED:
return immediate == 0;
case BASE_REGISTER_ONLY:
return true;
default:
return false;
}
}

@Override
public String toString() {
String addressEncoding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1984,6 +1984,11 @@ public void align(int modulus) {
}
}

@Override
public void halt() {
illegal();
}

/**
* Patches jump targets when label gets bound.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2812,6 +2812,11 @@ public final int jmp(int jumpTarget, boolean forceDisp32) {
return pos;
}

@Override
public void halt() {
hlt();
}

@Override
public final void jmp(Label l) {
if (l.isBound()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,10 @@ public final int cmpqAndJcc(Register src1, AMD64Address src2, ConditionFlag cc,
return applyRMOpAndJcc(CMP.getRMOpcode(QWORD), QWORD, src1, src2, cc, branchTarget, isShortJmp, null);
}

public final int cmpqAndJcc(Register src1, AMD64Address src2, ConditionFlag cc, Label branchTarget, boolean isShortJmp, IntConsumer applyBeforeFusedPair) {
return applyRMOpAndJcc(CMP.getRMOpcode(QWORD), QWORD, src1, src2, cc, branchTarget, isShortJmp, applyBeforeFusedPair);
}

public final void cmpAndJcc(OperandSize size, Register src1, Supplier<AMD64Address> src2, ConditionFlag cc, Label branchTarget) {
AMD64Address placeHolder = getPlaceholder(position());
final AMD64RMOp op = CMP.getRMOpcode(size);
Expand Down
Loading