Skip to content

Commit

Permalink
Merge with 'master'.
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhaeubl committed Jun 29, 2022
2 parents 0f28f0e + 87827e1 commit eaa586b
Show file tree
Hide file tree
Showing 235 changed files with 6,185 additions and 8,300 deletions.
6 changes: 2 additions & 4 deletions compiler/ci_common/benchmark-builders.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
c.weekly + hw.x52 + jdk + cc.jargraal + bench.specjbb2015,
c.weekly + hw.x52 + jdk + cc.libgraal + bench.specjbb2015_full_machine,
c.monthly + hw.x52 + jdk + cc.jargraal + bench.specjbb2015_full_machine,
c.weekly + hw.x52 + jdk + cc.libgraal + bench.renaissance_0_10,
c.monthly + hw.x52 + jdk + cc.jargraal + bench.renaissance_0_10,
c.daily + hw.x52 + jdk + cc.libgraal + bench.renaissance_0_13,
c.weekly + hw.x52 + jdk + cc.jargraal + bench.renaissance_0_13,
c.weekly + hw.x52 + jdk + cc.libgraal + bench.renaissance_0_11,
c.monthly + hw.x52 + jdk + cc.jargraal + bench.renaissance_0_11,
c.daily + hw.x52 + jdk + cc.libgraal + bench.awfy,
c.daily + hw.x52 + jdk + cc.jargraal + bench.awfy,
c.daily + hw.x52 + jdk + cc.libgraal + bench.microservice_benchmarks,
Expand Down
60 changes: 25 additions & 35 deletions compiler/ci_common/benchmark-suites.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@
local bc = (import '../../bench-common.libsonnet'),
local cc = (import 'compiler-common.libsonnet'),

local uniq_key(o) = o['suite'],
local _suite_key(a) = a['suite'],
local unique_suites(arr) = std.set(arr, keyF=_suite_key),

// convenient sets of benchmark suites for easy reuse
groups:: {
open_suites:: std.set([$.awfy, $.dacapo, $.scala_dacapo, $.renaissance, $.renaissance_0_13], keyF=uniq_key),
spec_suites:: std.set([$.specjvm2008, $.specjbb2015], keyF=uniq_key),
legacy_and_secondary_suites:: std.set([$.renaissance_legacy], keyF=uniq_key),
jmh_micros_suites:: std.set([$.micros_graal_dist, $.micros_misc_graal_dist , $.micros_shootout_graal_dist], keyF=uniq_key),
graal_internals_suites:: std.set([$.micros_graal_whitebox], keyF=uniq_key),
special_suites:: std.set([$.renaissance_0_10, $.dacapo_size_variants, $.scala_dacapo_size_variants, $.specjbb2015_full_machine], keyF=uniq_key),
microservice_suites:: std.set([$.microservice_benchmarks], keyF=uniq_key),
open_suites:: unique_suites([$.awfy, $.dacapo, $.scala_dacapo, $.renaissance]),
spec_suites:: unique_suites([$.specjvm2008, $.specjbb2015]),
legacy_and_secondary_suites:: unique_suites([$.renaissance_0_11, $.renaissance_legacy]),
jmh_micros_suites:: unique_suites([$.micros_graal_dist, $.micros_misc_graal_dist , $.micros_shootout_graal_dist]),
graal_internals_suites:: unique_suites([$.micros_graal_whitebox]),
special_suites:: unique_suites([$.renaissance, $.dacapo_size_variants, $.scala_dacapo_size_variants, $.specjbb2015_full_machine]),
microservice_suites:: unique_suites([$.microservice_benchmarks]),

main_suites:: std.set([$.specjvm2008] + self.open_suites + self.legacy_and_secondary_suites, keyF=uniq_key),
all_suites:: std.set(self.main_suites + self.spec_suites + self.jmh_micros_suites + self.special_suites + self.microservice_suites, keyF=uniq_key),
main_suites:: unique_suites([$.specjvm2008] + self.open_suites + self.legacy_and_secondary_suites),
all_suites:: unique_suites(self.main_suites + self.spec_suites + self.jmh_micros_suites + self.special_suites + self.microservice_suites),

weekly_forks_suites:: std.set([$.renaissance_0_13] + self.main_suites, keyF=uniq_key),
profiled_suites:: std.setDiff(self.main_suites, [$.specjbb2015], keyF=uniq_key),
all_but_main_suites:: std.setDiff(self.all_suites, self.main_suites, keyF=uniq_key),
weekly_forks_suites:: self.main_suites,
profiled_suites:: std.setDiff(self.main_suites, [$.specjbb2015], keyF=_suite_key),
all_but_main_suites:: std.setDiff(self.all_suites, self.main_suites, keyF=_suite_key),
},

// suite definitions
Expand Down Expand Up @@ -118,37 +120,25 @@
max_jdk_version:: null
},

renaissance: cc.compiler_benchmark + c.heap.default + {
suite:: "renaissance",
environment+: {
"SPARK_LOCAL_IP": "127.0.0.1"
},
renaissance_template(suite_version=null, suite_name="renaissance", max_jdk_version=null):: cc.compiler_benchmark + c.heap.default + {
suite:: suite_name,
local suite_version_args = if suite_version != null then ["--bench-suite-version=" + suite_version] else [],
run+: [
self.benchmark_cmd + ["renaissance:*", "--bench-suite-version=$RENAISSANCE_VERSION", "--"] + self.extra_vm_args
self.benchmark_cmd + ["renaissance:*"] + suite_version_args + ["--"] + self.extra_vm_args
],
timelimit: "3:00:00",
timelimit: "4:00:00",
forks_batches:: 4,
forks_timelimit:: "06:30:00",
min_jdk_version:: 8,
max_jdk_version:: 11
max_jdk_version:: max_jdk_version
},

renaissance_0_10: self.renaissance + {
suite:: "renaissance-0-10",
environment+: {
"RENAISSANCE_VERSION": "0.10.0"
},
min_jdk_version:: 8,
max_jdk_version:: 11
},
renaissance: self.renaissance_template(),

renaissance_0_13: self.renaissance + {
suite:: "renaissance-0-13",
renaissance_0_11: self.renaissance_template(suite_version="0.11.0", suite_name="renaissance-0-11", max_jdk_version=11) + {
environment+: {
"RENAISSANCE_VERSION": "0.13.0"
},
min_jdk_version:: 8,
max_jdk_version:: null
"SPARK_LOCAL_IP": "127.0.0.1"
}
},

renaissance_legacy: cc.compiler_benchmark + c.heap.default + {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.graalvm.compiler.core.common.LIRKind;
import org.graalvm.compiler.core.common.NumUtil;
import org.graalvm.compiler.core.common.calc.FloatConvert;
import org.graalvm.compiler.core.common.memory.MemoryExtendKind;
import org.graalvm.compiler.core.common.memory.MemoryOrderMode;
import org.graalvm.compiler.core.common.spi.ForeignCallLinkage;
import org.graalvm.compiler.debug.GraalError;
Expand Down Expand Up @@ -116,19 +117,6 @@ protected Variable emitSub(LIRKind resultKind, Value a, Value b, boolean setFlag
}
}

public Value emitExtendMemory(boolean isSigned, AArch64Kind accessKind, int resultBits, AArch64AddressValue address, LIRFrameState state) {
/*
* Issue an extending load of the proper bit size and set the result to the proper kind.
*/
GraalError.guarantee(accessKind.isInteger(), "can only extend integer kinds");
AArch64Kind resultKind = resultBits <= 32 ? AArch64Kind.DWORD : AArch64Kind.QWORD;
Variable result = getLIRGen().newVariable(LIRKind.value(resultKind));

AArch64Move.ExtendKind extend = isSigned ? AArch64Move.ExtendKind.SIGN_EXTEND : AArch64Move.ExtendKind.ZERO_EXTEND;
getLIRGen().append(new AArch64Move.LoadOp(accessKind, resultKind.getSizeInBytes() * Byte.SIZE, extend, result, address, state));
return result;
}

@Override
public Value emitMul(Value a, Value b, boolean setFlags) {
AArch64ArithmeticOp intOp = setFlags ? AArch64ArithmeticOp.MULVS : AArch64ArithmeticOp.MUL;
Expand Down Expand Up @@ -586,26 +574,40 @@ private AArch64ArithmeticOp getOpCode(Value val, AArch64ArithmeticOp intOp, AArc
}

@Override
public Variable emitLoad(LIRKind lirKind, Value address, LIRFrameState state) {
AArch64Kind kind = (AArch64Kind) lirKind.getPlatformKind();
Variable result = getLIRGen().newVariable(getLIRGen().toRegisterKind(lirKind));
AArch64AddressValue loadAddress = getLIRGen().asAddressValue(address, kind.getSizeInBytes() * Byte.SIZE);
getLIRGen().append(new LoadOp(kind, result, loadAddress, state));
public Variable emitLoad(LIRKind loadKind, Value address, LIRFrameState state, MemoryExtendKind extendKind) {
AArch64Kind readKind = (AArch64Kind) loadKind.getPlatformKind();
Variable result;
if (extendKind.isNotExtended()) {
result = getLIRGen().newVariable(getLIRGen().toRegisterKind(loadKind));
} else {
assert loadKind.isValue();
AArch64Kind resultKind = extendKind.getExtendedBitSize() / Byte.SIZE > AArch64Kind.DWORD.getSizeInBytes() ? AArch64Kind.QWORD : AArch64Kind.DWORD;
result = getLIRGen().newVariable(LIRKind.value(resultKind));
}
AArch64AddressValue loadAddress = getLIRGen().asAddressValue(address, readKind.getSizeInBytes() * Byte.SIZE);
getLIRGen().append(new LoadOp(readKind, extendKind, result, loadAddress, state));
return result;
}

@Override
public Variable emitOrderedLoad(LIRKind lirKind, Value address, LIRFrameState state, MemoryOrderMode memoryOrder) {
public Variable emitOrderedLoad(LIRKind loadKind, Value address, LIRFrameState state, MemoryOrderMode memoryOrder, MemoryExtendKind extendKind) {
switch (memoryOrder) {
case OPAQUE:
// no fences are needed for opaque memory accesses
return emitLoad(lirKind, address, state);
return emitLoad(loadKind, address, state, extendKind);
case ACQUIRE:
case VOLATILE:
AArch64Kind kind = (AArch64Kind) lirKind.getPlatformKind();
Variable result = getLIRGen().newVariable(getLIRGen().toRegisterKind(lirKind));
AArch64AddressValue loadAddress = getLIRGen().asAddressValue(address, kind.getSizeInBytes() * Byte.SIZE);
getLIRGen().append(new AArch64Move.LoadAcquireOp(kind, result, loadAddress, state));
AArch64Kind readKind = (AArch64Kind) loadKind.getPlatformKind();
Variable result;
if (extendKind.isNotExtended()) {
result = getLIRGen().newVariable(getLIRGen().toRegisterKind(loadKind));
} else {
assert loadKind.isValue();
AArch64Kind resultKind = extendKind.getExtendedBitSize() / Byte.SIZE > AArch64Kind.DWORD.getSizeInBytes() ? AArch64Kind.QWORD : AArch64Kind.DWORD;
result = getLIRGen().newVariable(LIRKind.value(resultKind));
}
AArch64AddressValue loadAddress = getLIRGen().asAddressValue(address, readKind.getSizeInBytes() * Byte.SIZE);
getLIRGen().append(new AArch64Move.LoadAcquireOp(readKind, extendKind, result, loadAddress, state));
return result;
default:
throw GraalError.shouldNotReachHere("Unexpected memory order");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@

package org.graalvm.compiler.core.aarch64;

import org.graalvm.compiler.core.common.memory.MemoryExtendKind;
import org.graalvm.compiler.core.common.memory.MemoryOrderMode;
import org.graalvm.compiler.nodes.memory.ExtendableMemoryAccess;
import org.graalvm.compiler.nodes.memory.ReadNode;
import org.graalvm.compiler.nodes.spi.LoweringProvider;

public interface AArch64LoweringProviderMixin extends LoweringProvider {
Expand Down Expand Up @@ -54,4 +58,35 @@ default boolean writesStronglyOrdered() {
/* AArch64 only requires a weak memory model. */
return false;
}

@Override
default boolean narrowsUseCastValue() {
return true;
}

@Override
default boolean supportsFoldingExtendIntoAccess(ExtendableMemoryAccess access, MemoryExtendKind extendKind) {
if (!access.isCompatibleWithExtend(extendKind)) {
return false;
}

boolean supportsSigned = false;
boolean supportsZero = false;
if (access instanceof ReadNode) {
supportsZero = true;
supportsSigned = !MemoryOrderMode.ordersMemoryAccesses(((ReadNode) access).getMemoryOrder());
}

switch (extendKind) {
case ZERO_16:
case ZERO_32:
case ZERO_64:
return supportsZero;
case SIGN_16:
case SIGN_32:
case SIGN_64:
return supportsSigned;
}
return false;
}
}

This file was deleted.

Loading

0 comments on commit eaa586b

Please sign in to comment.