Skip to content

Commit 03793fc

Browse files
committed
Add macro for LLVM backend
1 parent f37acef commit 03793fc

File tree

7 files changed

+20
-5
lines changed

7 files changed

+20
-5
lines changed

sdk/mx.sdk/mx_sdk_benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def __init__(self, vm: NativeImageVM, bm_suite: BenchmarkSuite | NativeImageBenc
425425
if vm.use_compacting_gc:
426426
base_image_build_args += ['-H:+CompactingOldGen']
427427
if vm.is_llvm:
428-
base_image_build_args += ['--features=org.graalvm.home.HomeFinderFeature'] + ['-H:CompilerBackend=llvm',
428+
base_image_build_args += ['--features=org.graalvm.home.HomeFinderFeature'] + ['--tool:llvm-backend',
429429
'-H:DeadlockWatchdogInterval=0']
430430
if vm.gc:
431431
base_image_build_args += ['--gc=' + vm.gc] + ['-H:+SpawnIsolates']

substratevm/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This changelog summarizes major changes to GraalVM Native Image.
77
* (GR-43070) Add a new API flag `-Werror` to treat warnings as errors.
88
* (GR-69280) Allow use of the `graal.` prefix for options without issuing a warning.
99
* (GR-2092) Add jitdump support for recording run-time compilation metadata for perf (see PerfProfiling.md). Can be enabled with `-g -H:+RuntimeDebugInfo -H:RuntimeDebugInfoFormat=jitdump`.
10+
* (GR-70136) Add a new tool `--tool:llvm` for the LLVM backend of Native Image.
1011

1112
## GraalVM 25
1213
* (GR-52276) (GR-61959) Add support for Arena.ofShared().

substratevm/ci/ci_common/svm-gate.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116

117117
use_llvm:: task_spec({
118118
mxgate_config+::["llvm"],
119-
mxgate_extra_args+: ["--extra-image-builder-arguments=-H:+UnlockExperimentalVMOptions -H:CompilerBackend=llvm -H:-UnlockExperimentalVMOptions"],
119+
mxgate_extra_args+: ["--extra-image-builder-arguments=-H:+UnlockExperimentalVMOptions --tool:llvm-backend -H:-UnlockExperimentalVMOptions"],
120120
}),
121121

122122
use_ecj:: task_spec({

substratevm/mx.substratevm/mx_substratevm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,11 +1546,11 @@ def _native_image_launcher_extra_jvm_args():
15461546
jlink=False,
15471547
))
15481548

1549-
ce_llvm_backend = mx_sdk_vm.GraalVmJreComponent(
1549+
ce_llvm_backend = mx_sdk_vm.GraalVmSvmTool(
15501550
suite=suite,
15511551
name='Native Image LLVM Backend',
15521552
short_name='svml',
1553-
dir_name='svm',
1553+
dir_name='llvm-backend',
15541554
license_files=[],
15551555
third_party_license_files=[],
15561556
dependencies=[
@@ -1564,6 +1564,7 @@ def _native_image_launcher_extra_jvm_args():
15641564
'substratevm:LLVM_PLATFORM_SPECIFIC_SHADOWED',
15651565
'substratevm:JAVACPP_PLATFORM_SPECIFIC_SHADOWED',
15661566
],
1567+
support_distributions=['substratevm:SVM_LLVM_GRAALVM_SUPPORT'],
15671568
stability="experimental-earlyadopter",
15681569
jlink=False,
15691570
)

substratevm/mx.substratevm/suite.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2610,6 +2610,15 @@
26102610
"maven" : False,
26112611
},
26122612

2613+
"SVM_LLVM_GRAALVM_SUPPORT": {
2614+
"native": True,
2615+
"description": "LLVM backend support distribution for SVM",
2616+
"layout": {
2617+
"native-image.properties": "file:mx.substratevm/tool-llvm.properties",
2618+
},
2619+
"maven": False,
2620+
},
2621+
26132622
"SVM_TRUFFLE_TCK" : {
26142623
"subDir" : "src",
26152624
"description" : "Truffle TCK",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ProvidedHostedOptions=IncludeLLVMDebugInfo= DumpLLVMStackMap= LLVMMaxFunctionsPerBatch= CustomLD= BitcodeOptimizations UseLLVMDataSection LLVMDataSectionBatchSizeFactor=
2+
ImageBuilderModulePath=${.}/builder/svm-llvm.jar:${.}/builder/javacpp-shadowed.jar:${.}/builder/javacpp-platform-specific-shadowed.jar:${.}/builder/llvm-wrapper-shadowed.jar:${.}/builder/llvm-platform-specific-shadowed.jar
3+
Args=-H:CompilerBackend=llvm
4+
ExcludeFromAll=true

substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/LLVMBackend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mx --dynamicimports /substratevm build
1111
export JAVA_HOME=$(mx --dynamicimports /substratevm graalvm-home)
1212
```
1313

14-
To enable the LLVM backend, pass the `-H:CompilerBackend=llvm` option to the `native-image` command.
14+
To enable the LLVM backend, pass the `--tool:llvm` option to the `native-image` command.
1515

1616
## Code Generation Options
1717

0 commit comments

Comments
 (0)