diff --git a/Makefile b/Makefile index 23a16dbda8..1cd12ea969 100644 --- a/Makefile +++ b/Makefile @@ -4,23 +4,23 @@ all: build # make BACKEND= BACKEND ?= opencl -build jdk21: - bin/compile --jdk jdk21 --backend $(BACKEND) +build jdk23: + bin/compile --jdk jdk23 --backend $(BACKEND) -rebuild-deps-jdk21: - bin/compile --jdk jdk21 --rebuild --backend $(BACKEND) +rebuild-deps-jdk23: + bin/compile --jdk jdk23 --rebuild --backend $(BACKEND) -graal-jdk-21: - bin/compile --jdk graal-jdk-21 --backend $(BACKEND) +graal-jdk-23: + bin/compile --jdk graal-jdk-23 --backend $(BACKEND) polyglot: - bin/compile --jdk graal-jdk-21 --backend $(BACKEND) --polyglot + bin/compile --jdk graal-jdk-23 --backend $(BACKEND) --polyglot ptx: - bin/compile --jdk jdk21 --backend ptx,opencl + bin/compile --jdk jdk23 --backend ptx,opencl spirv: - bin/compile --jdk jdk21 --backend spirv,ptx,opencl + bin/compile --jdk jdk23 --backend spirv,ptx,opencl # Variable passed for the preparation of the Xilinx FPGA emulated target device. The default device is `xilinx_u50_gen3x16_xdma_201920_3`. # make xilinx_emulation FPGA_PLATFORM= NUM_OF_FPGA_DEVICES= @@ -42,15 +42,15 @@ example: tests: rm -f tornado_unittests.log tornado --devices - tornado-test --ea --verbose - tornado-test --ea -V -J"-Dtornado.device.memory=1MB" uk.ac.manchester.tornado.unittests.fails.HeapFail#test03 + tornado-test --verbose + tornado-test -V -J"-Dtornado.device.memory=1MB" uk.ac.manchester.tornado.unittests.fails.HeapFail#test03 test-native.sh fast-tests: rm -f tornado_unittests.log tornado --devices - tornado-test --ea --verbose --quickPass - tornado-test --ea -V -J"-Dtornado.device.memory=1MB" uk.ac.manchester.tornado.unittests.fails.HeapFail#test03 + tornado-test --verbose --quickPass + tornado-test -V -J"-Dtornado.device.memory=1MB" uk.ac.manchester.tornado.unittests.fails.HeapFail#test03 test-native.sh tests-spirv-levelzero: diff --git a/bin/compile b/bin/compile index 877f029b19..1e93bc833b 100755 --- a/bin/compile +++ b/bin/compile @@ -68,7 +68,7 @@ def pull_graal_jars_if_needed(graal_jars_status): def should_handle_graal_jars(jdk): java_version_output = check_java_version() - return jdk == "jdk21" and "GraalVM" not in java_version_output + return jdk == "jdk23" and "GraalVM" not in java_version_output def maven_cleanup(): @@ -360,7 +360,7 @@ def post_installation_actions(backend_profiles, mvn_build_result, jdk, graal_jar with open(backend_file_path, "w") as backend_file: backend_file.write(f"tornado.backends={backend_profiles}") - # Place the Graal jars in the TornadoVM distribution only if the JDK 21 rule is used + # Place the Graal jars in the TornadoVM distribution only if the JDK 23 rule is used if graal_jars_status: graal_jars_src_dir = os.path.join(os.getcwd(), "graalJars") graal_jars_dst_dir = os.path.join(f"{os.environ['TORNADO_SDK']}", "share", "java", "graalJars") @@ -381,7 +381,7 @@ def parse_args(): """ parser = argparse.ArgumentParser(description="Tool to compile TornadoVM") parser.add_argument( - "--jdk", help="JDK version (e.g., jdk21, graal-jdk-21)" + "--jdk", help="JDK version (e.g., jdk23, graal-jdk-23)" ) parser.add_argument("--backend", help="e.g., opencl,ptx,spirv") parser.add_argument( diff --git a/bin/installer_config.py b/bin/installer_config.py index 7dd94e9799..598dbb2776 100644 --- a/bin/installer_config.py +++ b/bin/installer_config.py @@ -26,14 +26,15 @@ __APPLE__ = "darwin" __WINDOWS__ = "windows" -__JDK21__ = "jdk21" -__GRAALVM21__ = "graal-jdk-21" -__MANDREL21__ = "mandrel-jdk-21" -__CORRETTO21__ = "corretto-jdk-21" -__MICROSOFT21__ = "microsoft-jdk-21" -__ZULU21__ = "zulu-jdk-21" -__TEMURIN21__ = "temurin-jdk-21" -__SAPMACHINE21__ = "sapmachine-jdk-21" +__JDK22__ = "jdk22" +__GRAALVM22__ = "graal-jdk-22" +__MANDREL22__ = "mandrel-jdk-22" +__CORRETTO22__ = "corretto-jdk-22" +__MICROSOFT22__ = "microsoft-jdk-22" +__ZULU22__ = "zulu-jdk-22" +__TEMURIN22__ = "temurin-jdk-22" +__SAPMACHINE22__ = "sapmachine-jdk-22" + ## cmake CMAKE = { @@ -69,115 +70,115 @@ ## JDK JDK = { - __JDK21__: { + __JDK22__: { __LINUX__: { - __X86_64__: "https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz", - __ARM__: "https://download.oracle.com/java/21/latest/jdk-21_linux-aarch64_bin.tar.gz", + __X86_64__: "https://download.oracle.com/java/22/latest/jdk-22_linux-x64_bin.tar.gz", + __ARM__: "https://download.oracle.com/java/22/latest/jdk-22_linux-aarch64_bin.tar.gz", }, __APPLE__: { - __X86_64__: "https://download.oracle.com/java/21/latest/jdk-21_macos-x64_bin.tar.gz", - __ARM__: "https://download.oracle.com/java/21/latest/jdk-21_macos-aarch64_bin.tar.gz", + __X86_64__: "https://download.oracle.com/java/22/latest/jdk-22_macos-x64_bin.tar.gz", + __ARM__: "https://download.oracle.com/java/22/latest/jdk-22_macos-aarch64_bin.tar.gz", }, __WINDOWS__: { - __X86_64__: "https://download.oracle.com/java/21/archive/jdk-21.0.1_windows-x64_bin.zip", + __X86_64__: "https://download.oracle.com/java/22/archive/jdk-22.0.2_windows-x64_bin.zip", __ARM__: None, }, }, - __GRAALVM21__: { + __GRAALVM22__: { __LINUX__: { - __X86_64__: "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.1/graalvm-community-jdk-21.0.1_linux-x64_bin.tar.gz", - __ARM__: "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.1/graalvm-community-jdk-21.0.1_linux-aarch64_bin.tar.gz", + __X86_64__: "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-22.0.2/graalvm-community-jdk-22.0.2_linux-x64_bin.tar.gz", + __ARM__: "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-22.0.2/graalvm-community-jdk-22.0.2_linux-aarch64_bin.tar.gz", }, __APPLE__: { - __X86_64__: "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.1/graalvm-community-jdk-21.0.1_macos-x64_bin.tar.gz", - __ARM__: "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.1/graalvm-community-jdk-21.0.1_macos-aarch64_bin.tar.gz", + __X86_64__: "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-22.0.2/graalvm-community-jdk-22.0.2_macos-x64_bin.tar.gz", + __ARM__: "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-22.0.2/graalvm-community-jdk-22.0.2_macos-aarch64_bin.tar.gz", }, __WINDOWS__: { - __X86_64__: "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.1/graalvm-community-jdk-21.0.1_windows-x64_bin.zip", + __X86_64__: "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-22.0.2/graalvm-community-jdk-22.0.2_windows-x64_bin.zip", __ARM__: None, }, }, - __CORRETTO21__: { + __CORRETTO22__: { __LINUX__: { - __X86_64__: "https://corretto.aws/downloads/latest/amazon-corretto-21-x64-linux-jdk.tar.gz", - __ARM__: "https://corretto.aws/downloads/latest/amazon-corretto-21-aarch64-linux-jdk.tar.gz", + __X86_64__: "https://corretto.aws/downloads/latest/amazon-corretto-22-x64-linux-jdk.tar.gz", + __ARM__: "https://corretto.aws/downloads/latest/amazon-corretto-22-aarch64-linux-jdk.tar.gz", }, __APPLE__: { - __X86_64__: "https://corretto.aws/downloads/latest/amazon-corretto-21-x64-macos-jdk.tar.gz", - __ARM__: "https://corretto.aws/downloads/latest/amazon-corretto-21-aarch64-macos-jdk.tar.gz", + __X86_64__: "https://corretto.aws/downloads/latest/amazon-corretto-22-x64-macos-jdk.tar.gz", + __ARM__: "https://corretto.aws/downloads/latest/amazon-corretto-22-aarch64-macos-jdk.tar.gz", }, __WINDOWS__: { - __X86_64__: None, + __X86_64__: "https://corretto.aws/downloads/latest/amazon-corretto-22-x64-windows-jdk.zip", __ARM__: None, }, }, - __MANDREL21__: { + __MANDREL22__: { __LINUX__: { - __X86_64__: "https://github.com/graalvm/mandrel/releases/download/mandrel-23.1.0.0-Final/mandrel-java21-linux-amd64-23.1.0.0-Final.tar.gz", - __ARM__: "https://github.com/graalvm/mandrel/releases/download/mandrel-23.1.0.0-Final/mandrel-java21-linux-aarch64-23.1.0.0-Final.tar.gz", + __X86_64__: "https://github.com/graalvm/mandrel/releases/download/mandrel-24.0.2.0-Final/mandrel-java22-linux-amd64-24.0.2.0-Final.tar.gz", + __ARM__: "https://github.com/graalvm/mandrel/releases/download/mandrel-24.0.2.0-Final/mandrel-java22-linux-aarch64-24.0.2.0-Final.tar.gz", }, __APPLE__: { __X86_64__: None, - __ARM__: None, + __ARM__: "https://github.com/graalvm/mandrel/releases/download/mandrel-24.0.2.0-Final/mandrel-java22-macos-aarch64-24.0.2.0-Final.tar.gz", }, __WINDOWS__: { - __X86_64__: None, + __X86_64__: "https://github.com/graalvm/mandrel/releases/download/mandrel-24.0.2.0-Final/mandrel-java22-windows-amd64-24.0.2.0-Final.zip", __ARM__: None, }, }, - __MICROSOFT21__: { + __MICROSOFT22__: { __LINUX__: { - __X86_64__: "https://aka.ms/download-jdk/microsoft-jdk-21.0.3-linux-x64.tar.gz", - __ARM__: "https://aka.ms/download-jdk/microsoft-jdk-21.0.3-linux-aarch64.tar.gz", + __X86_64__: None, + __ARM__: None, }, __APPLE__: { - __X86_64__: "https://aka.ms/download-jdk/microsoft-jdk-21.0.3-macos-x64.tar.gz", - __ARM__: "https://aka.ms/download-jdk/microsoft-jdk-21.0.3-macos-aarch64.tar.gz", + __X86_64__: None, + __ARM__: None, }, __WINDOWS__: { - __X86_64__: "https://aka.ms/download-jdk/microsoft-jdk-21.0.3-windows-x64.zip", - __ARM__: "https://aka.ms/download-jdk/microsoft-jdk-21.0.3-windows-aarch64.zip", + __X86_64__: None, + __ARM__: None, }, }, - __ZULU21__: { + __ZULU22__: { __LINUX__: { - __X86_64__: "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_x64.tar.gz", - __ARM__: "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_aarch64.tar.gz", + __X86_64__: "https://cdn.azul.com/zulu/bin/zulu22.32.15-ca-jdk22.0.2-linux_x64.tar.gz", + __ARM__: "https://cdn.azul.com/zulu/bin/zulu22.32.15-ca-jdk22.0.2-linux_aarch64.tar.gz", }, __APPLE__: { - __X86_64__: "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_x64.tar.gz", - __ARM__: "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_aarch64.tar.gz", + __X86_64__: "https://cdn.azul.com/zulu/bin/zulu22.32.15-ca-jdk22.0.2-macosx_x64.tar.gz", + __ARM__: "https://cdn.azul.com/zulu/bin/zulu22.32.15-ca-jdk22.0.2-macosx_aarch64.tar.gz", }, __WINDOWS__: { __X86_64__: None, __ARM__: None, }, }, - __TEMURIN21__: { + __TEMURIN22__: { __LINUX__: { - __X86_64__: "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_x64_linux_hotspot_21.0.1_12.tar.gz", - __ARM__: "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.1_12.tar.gz", + __X86_64__: "https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.1%2B8/OpenJDK22U-jdk_x64_linux_hotspot_22.0.1_8.tar.gz", + __ARM__: "https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.1%2B8/OpenJDK22U-jdk_aarch64_linux_hotspot_22.0.1_8.tar.gz", }, __APPLE__: { - __X86_64__: "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_x64_mac_hotspot_21.0.1_12.tar.gz", - __ARM__: "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/OpenJDK21U-jdk_aarch64_mac_hotspot_21.0.1_12.tar.gz", + __X86_64__: "https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.1%2B8/OpenJDK22U-jdk_x64_mac_hotspot_22.0.1_8.tar.gz", + __ARM__: "https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.1%2B8/OpenJDK22U-jdk_aarch64_mac_hotspot_22.0.1_8.tar.gz", }, __WINDOWS__: { - __X86_64__: "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/OpenJDK21U-jdk_x64_windows_hotspot_21.0.3_9.zip", + __X86_64__: "https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.1%2B8/OpenJDK22U-jdk_x64_windows_hotspot_22.0.1_8.zip", __ARM__: None, }, }, - __SAPMACHINE21__: { + __SAPMACHINE22__: { __LINUX__: { - __X86_64__: "https://github.com/SAP/SapMachine/releases/download/sapmachine-21.0.3/sapmachine-jdk-21.0.3_linux-x64_bin.tar.gz", - __ARM__: "https://github.com/SAP/SapMachine/releases/download/sapmachine-21.0.3/sapmachine-jdk-21.0.3_linux-aarch64_bin.tar.gz", + __X86_64__: "https://github.com/SAP/SapMachine/releases/download/sapmachine-22.0.2/sapmachine-jdk-22.0.2_linux-x64_bin.tar.gz", + __ARM__: "https://github.com/SAP/SapMachine/releases/download/sapmachine-22.0.2/sapmachine-jdk-22.0.2_linux-aarch64_bin.tar.gz", }, __APPLE__: { - __X86_64__: "https://github.com/SAP/SapMachine/releases/download/sapmachine-21.0.3/sapmachine-jdk-21.0.3_macos-x64_bin.tar.gz", - __ARM__: "https://github.com/SAP/SapMachine/releases/download/sapmachine-21.0.3/sapmachine-jdk-21.0.3_macos-aarch64_bin.tar.gz", + __X86_64__: "https://github.com/SAP/SapMachine/releases/download/sapmachine-22.0.2/sapmachine-jdk-22.0.2_macos-x64_bin.tar.gz", + __ARM__: "https://github.com/SAP/SapMachine/releases/download/sapmachine-22.0.2/sapmachine-jdk-22.0.2_macos-aarch64_bin.tar.gz", }, __WINDOWS__: { - __X86_64__: "https://github.com/SAP/SapMachine/releases/download/sapmachine-21.0.3/sapmachine-jdk-21.0.3_windows-x64_bin.zip", + __X86_64__: "https://github.com/SAP/SapMachine/releases/download/sapmachine-22.0.2/sapmachine-jdk-22.0.2_windows-x64_bin.zip", __ARM__: None, }, }, diff --git a/bin/pull_graal_jars.py b/bin/pull_graal_jars.py index 319231b2d1..0808c9b689 100755 --- a/bin/pull_graal_jars.py +++ b/bin/pull_graal_jars.py @@ -26,7 +26,7 @@ # Constants TARGET_DIR = "graalJars" -VERSION = "23.1.0" +VERSION = "24.1.0" BASE_URL = "https://repo1.maven.org/maven2/org/graalvm" GRAAL_JARS = [ f"compiler/compiler/{VERSION}/compiler-{VERSION}.jar", diff --git a/bin/tornadovm-installer b/bin/tornadovm-installer index 13c8bdf655..783c23560d 100755 --- a/bin/tornadovm-installer +++ b/bin/tornadovm-installer @@ -39,14 +39,14 @@ __DIRECTORY_DEPENDENCIES__ = os.path.join("etc", "dependencies") __VERSION__ = "v1.0.7-dev" __SUPPORTED_JDKS__ = [ - config.__JDK21__, - config.__GRAALVM21__, - config.__CORRETTO21__, - config.__MICROSOFT21__, - config.__MANDREL21__, - config.__ZULU21__, - config.__TEMURIN21__, - config.__SAPMACHINE21__, + config.__JDK22__, + config.__GRAALVM22__, + config.__CORRETTO22__, + config.__MICROSOFT22__, + config.__MANDREL22__, + config.__ZULU22__, + config.__TEMURIN22__, + config.__SAPMACHINE22__, ] __SUPPORTED_BACKENDS__ = ["opencl", "spirv", "ptx"] @@ -343,10 +343,10 @@ class TornadoInstaller: backend = self.composeBackendOption(args) - makeJDK = "jdk21" + makeJDK = "jdk22" polyglotOption = "" if (args.javaHome != None and "graal" in args.javaHome) or (args.jdk != None and "graal" in args.jdk): - makeJDK = "graal-jdk-21" + makeJDK = "graal-jdk-22" polyglotOption = self.composePolyglotOption(args) if args.javaHome != None: @@ -375,14 +375,14 @@ def listSupportedJDKs(): """ TornadoVM Installer - Select a JDK implementation to install with TornadoVM: - jdk21 : Install TornadoVM with OpenJDK 21 (Oracle OpenJDK) - graal-jdk-21 : Install TornadoVM with GraalVM and JDK 21 (GraalVM 23.1.0) - mandrel-jdk-21 : Install TornadoVM with Mandrel and JDK 21 (GraalVM 23.1.0) - corretto-jdk-21 : Install TornadoVM with Corretto JDK 21 - microsoft-jdk-21 : Install TornadoVM with Microsoft JDK 21 - zulu-jdk-21 : Install TornadoVM with Azul Zulu JDK 21 - temurin-jdk-21 : Install TornadoVM with Eclipse Temurin JDK 21 - sapmachine-jdk-21 : Install TornadoVM with SapMachine OpenJDK 21 + jdk22 : Install TornadoVM with OpenJDK 22 (Oracle OpenJDK) + graal-jdk-22 : Install TornadoVM with GraalVM and JDK 22 (GraalVM 24.0.2) + mandrel-jdk-22 : Install TornadoVM with Mandrel and JDK 22 (GraalVM 24.0.2) + corretto-jdk-22 : Install TornadoVM with Corretto JDK 22 + microsoft-jdk-22 : Install TornadoVM with Microsoft JDK 22 + zulu-jdk-22 : Install TornadoVM with Azul Zulu JDK 22 + temurin-jdk-22 : Install TornadoVM with Eclipse Temurin JDK 22 + sapmachine-jdk-22 : Install TornadoVM with SapMachine OpenJDK 22 Usage: $ ./bin/tornadovm-installer --jdk --backend diff --git a/pom.xml b/pom.xml index 8a28eff761..65ec66891f 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ ${project.version} - 23.1.0 + 24.1.0 UTF-8 ${platform} false @@ -201,7 +201,7 @@ - jdk21 + jdk23 false @@ -223,11 +223,11 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.13.0 true - 21 - 21 + 23 + 23 true @@ -245,430 +245,432 @@ ${user.dir}/graalJars --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.cfg=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.cfg=tornado.runtime --add-exports - jdk.internal.vm.ci/jdk.vm.ci.common=jdk.internal.vm.compiler + jdk.internal.vm.ci/jdk.vm.ci.common=jdk.graal.compiler --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.meta=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.hotspot.meta=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.lir=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.runtime,tornado.annotation,tornado.drivers.common,jdk.internal.vm.compiler + jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.runtime,tornado.annotation,tornado.drivers.common,jdk.graal.compiler --add-exports - jdk.internal.vm.ci/jdk.vm.ci.code=tornado.runtime,tornado.drivers.common,jdk.internal.vm.compiler + jdk.internal.vm.ci/jdk.vm.ci.code=tornado.runtime,tornado.drivers.common,jdk.graal.compiler --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.graph=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.spi=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.graph.spi=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.gen=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.lir.gen=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodeinfo=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.spi=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.api.runtime=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.api.runtime=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.code=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.code=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.core=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.target=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.core.target=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.debug=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.debug=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.java=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.java=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.asm=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.lir.asm=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.graphbuilderconf=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.options=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.phases=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.printer=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.printer=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.runtime=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.runtime=tornado.runtime --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.bytecode=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.bytecode=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.spi=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.core.common.spi=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.api.replacements=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.api.replacements=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.replacements=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.phases=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.core.phases=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.type=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.core.common.type=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining.info=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining.info=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining.policy=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining.policy=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining.walker=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining.walker=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.memory=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.virtual=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.virtual=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.constopt=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.lir.constopt=tornado.runtime --add-opens jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.runtime --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.gc=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.gc=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.options=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.virtual=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.virtual=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory.address=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.memory.address=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements.nodes=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.replacements.nodes=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.word=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.word=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.framemap=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.alloc=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.core.common.alloc=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.memory=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.core.common.memory=tornado.drivers.common --add-opens + java.base/jdk.internal.foreign=tornado.drivers.opencl + --add-opens java.base/java.lang=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.common=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.meta=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.hotspot.meta=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements.classfile=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.replacements.classfile=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.alloc=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.alloc=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.cfg=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.cfg=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.lir=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.framemap=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.graph=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.spi=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.graph.spi=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.gen=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.lir.gen=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodeinfo=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.spi=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.code=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.code=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.debug=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.debug=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.java=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.java=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.asm=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.lir.asm=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.graphbuilderconf=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.options=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.printer=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.printer=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.bytecode=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.bytecode=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.spi=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.spi=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.api.replacements=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.api.replacements=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.replacements=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.phases=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.phases=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.type=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.type=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.memory=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.drivers.opencl --add-opens jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.asm=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.asm=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.cfg=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.cfg=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.schedule=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.schedule=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.virtual.phases.ea=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.virtual.phases.ea=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.ssa=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.lir.ssa=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.calc=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.calc=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.gen=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.gen=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.match=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.match=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory.address=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.memory.address=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.type=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.type=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.word=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.word=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.memory=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.memory=tornado.drivers.opencl --add-opens @@ -678,173 +680,172 @@ --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.meta=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.hotspot.meta=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements.classfile=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.replacements.classfile=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.alloc=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common.alloc=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.cfg=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common.cfg=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.lir=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.framemap=tornado.drivers.ptx - + jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.graph=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.spi=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.graph.spi=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.gen=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.lir.gen=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodeinfo=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.spi=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.code=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.code=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.debug=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.debug=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.java=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.java=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.asm=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.lir.asm=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.graphbuilderconf=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.options=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.printer=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.printer=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.bytecode=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.bytecode=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.spi=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common.spi=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.api.replacements=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.api.replacements=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.replacements=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.phases=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.phases=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.type=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common.type=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.memory=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.drivers.ptx --add-opens jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.asm=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.asm=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.cfg=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.cfg=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.schedule=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.schedule=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.virtual.phases.ea=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.virtual.phases.ea=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.ssa=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.lir.ssa=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.calc=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common.calc=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.gen=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.gen=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.match=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.match=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory.address=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.memory.address=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.type=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.type=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.word=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.word=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.memory=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common.memory=tornado.drivers.ptx --add-opens @@ -854,190 +855,190 @@ --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.meta=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.hotspot.meta=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements.classfile=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.replacements.classfile=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.alloc=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.alloc=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.cfg=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.cfg=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.lir=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.framemap=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.graph=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.spi=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.graph.spi=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.gen=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.lir.gen=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodeinfo=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.spi=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.code=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.code=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.debug=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.debug=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.java=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.java=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.asm=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.lir.asm=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.graphbuilderconf=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.options=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.printer=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.printer=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.bytecode=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.bytecode=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.spi=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.spi=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.api.replacements=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.api.replacements=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.replacements=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.phases=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.phases=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.type=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.type=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.memory=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.drivers.spirv --add-opens jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.asm=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.asm=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.cfg=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.cfg=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.schedule=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.schedule=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.virtual.phases.ea=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.virtual.phases.ea=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.ssa=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.lir.ssa=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.calc=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.calc=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.gen=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.gen=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.match=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.match=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory.address=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.memory.address=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.type=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.type=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.word=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.word=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.memory=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.memory=tornado.drivers.spirv @@ -1060,7 +1061,7 @@ - graal-jdk-21 + graal-jdk-23 false @@ -1072,8 +1073,8 @@ 3.11.0 true - 21 - 21 + 23 + 23 true @@ -1088,226 +1089,258 @@ ALL-SYSTEM --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.cfg=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.cfg=tornado.runtime --add-exports - jdk.internal.vm.ci/jdk.vm.ci.common=jdk.internal.vm.compiler + jdk.internal.vm.ci/jdk.vm.ci.common=jdk.graal.compiler --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.meta=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.hotspot.meta=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.lir=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.runtime,tornado.annotation,tornado.drivers.common,jdk.internal.vm.compiler + jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.ci/jdk.vm.ci.code=tornado.runtime,tornado.drivers.common,jdk.internal.vm.compiler + jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.spi=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.gen=tornado.runtime + + jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.runtime + --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodeinfo=tornado.runtime + + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.runtime + --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.runtime + + jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.runtime,tornado.annotation,tornado.drivers.common,jdk.graal.compiler + --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.spi=tornado.runtime,tornado.drivers.common + jdk.internal.vm.ci/jdk.vm.ci.code=tornado.runtime,tornado.drivers.common,jdk.graal.compiler --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.api.runtime=tornado.runtime + + jdk.graal.compiler/jdk.graal.compiler.graph=tornado.runtime,tornado.drivers.common + --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.code=tornado.runtime + + jdk.graal.compiler/jdk.graal.compiler.graph.spi=tornado.runtime,tornado.drivers.common + --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core=tornado.runtime + + jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.drivers.common + + --add-exports + jdk.graal.compiler/jdk.graal.compiler.lir.gen=tornado.runtime + --add-exports + jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.target=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.debug=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.api.runtime=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.java=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.code=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.asm=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.core=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases=tornado.runtime + + jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.runtime,tornado.drivers.common + + --add-exports + jdk.graal.compiler/jdk.graal.compiler.core.target=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.debug=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.runtime + --add-exports + jdk.graal.compiler/jdk.graal.compiler.java=tornado.runtime + --add-exports + jdk.graal.compiler/jdk.graal.compiler.lir.asm=tornado.runtime + --add-exports + jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.graphbuilderconf=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.options=tornado.runtime + --add-exports + + jdk.graal.compiler/jdk.graal.compiler.phases=tornado.runtime,tornado.drivers.common + + --add-exports + jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.printer=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.printer=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.runtime=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.runtime=tornado.runtime --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.bytecode=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.bytecode=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.spi=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.core.common.spi=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.api.replacements=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.api.replacements=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.replacements=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.phases=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.core.phases=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.type=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.core.common.type=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining.info=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining.info=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining.policy=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining.policy=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining.walker=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining.walker=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.memory=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.virtual=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.nodes.virtual=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.constopt=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.lir.constopt=tornado.runtime --add-opens jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.runtime --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.gc=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.gc=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.options=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.virtual=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.virtual=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory.address=tornado.runtime,tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.nodes.memory.address=tornado.runtime,tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements.nodes=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.replacements.nodes=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.word=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.word=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.framemap=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.alloc=tornado.runtime + jdk.graal.compiler/jdk.graal.compiler.core.common.alloc=tornado.runtime --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.memory=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.core.common.memory=tornado.drivers.common --add-opens @@ -1317,201 +1350,201 @@ --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.meta=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.hotspot.meta=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements.classfile=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.replacements.classfile=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.alloc=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.alloc=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.cfg=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.cfg=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.lir=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.framemap=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.graph=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.spi=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.graph.spi=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.gen=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.lir.gen=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodeinfo=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.spi=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.code=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.code=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.debug=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.debug=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.java=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.java=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.asm=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.lir.asm=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.graphbuilderconf=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.options=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.printer=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.printer=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.bytecode=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.bytecode=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.drivers.common + jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.drivers.common --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.spi=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.spi=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.api.replacements=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.api.replacements=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.replacements=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.phases=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.phases=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.type=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.type=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.memory=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.drivers.opencl --add-opens jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.asm=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.asm=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.cfg=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.cfg=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.schedule=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.schedule=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.virtual.phases.ea=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.virtual.phases.ea=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.ssa=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.lir.ssa=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.calc=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.calc=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.gen=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.gen=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.match=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.match=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory.address=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.memory.address=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.type=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.nodes.type=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.word=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.word=tornado.drivers.opencl --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.memory=tornado.drivers.opencl + jdk.graal.compiler/jdk.graal.compiler.core.common.memory=tornado.drivers.opencl --add-opens @@ -1521,173 +1554,165 @@ --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.meta=tornado.drivers.ptx - + jdk.graal.compiler/jdk.graal.compiler.hotspot.meta=tornado.drivers.ptx --add-exports - - jdk.internal.vm.compiler/org.graalvm.compiler.replacements.classfile=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.replacements.classfile=tornado.drivers.ptx --add-exports - - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.alloc=tornado.drivers.ptx - + jdk.graal.compiler/jdk.graal.compiler.core.common.alloc=tornado.drivers.ptx --add-exports - - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.drivers.ptx - + jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.cfg=tornado.drivers.ptx - + jdk.graal.compiler/jdk.graal.compiler.core.common.cfg=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.lir=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.framemap=tornado.drivers.ptx - + jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.graph=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.spi=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.graph.spi=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.gen=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.lir.gen=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodeinfo=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.spi=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.code=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.code=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.debug=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.debug=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.java=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.java=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.asm=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.lir.asm=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.graphbuilderconf=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.options=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.printer=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.printer=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.bytecode=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.bytecode=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.spi=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common.spi=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.api.replacements=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.api.replacements=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.replacements=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.phases=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.phases=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.type=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common.type=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.memory=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.drivers.ptx --add-opens jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.asm=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.asm=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.cfg=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.cfg=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.schedule=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.schedule=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.virtual.phases.ea=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.virtual.phases.ea=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.ssa=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.lir.ssa=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.calc=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common.calc=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.gen=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.gen=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.match=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.match=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory.address=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.memory.address=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.type=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.nodes.type=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.word=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.word=tornado.drivers.ptx --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.memory=tornado.drivers.ptx + jdk.graal.compiler/jdk.graal.compiler.core.common.memory=tornado.drivers.ptx --add-opens @@ -1697,190 +1722,188 @@ --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.meta=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.hotspot.meta=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements.classfile=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.replacements.classfile=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.alloc=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.alloc=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.cfg=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.cfg=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.lir=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.framemap=tornado.drivers.spirv - + jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.graph=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.spi=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.graph.spi=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.gen=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.lir.gen=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodeinfo=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.spi=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.code=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.code=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.debug=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.debug=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.hotspot=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.java=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.java=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.asm=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.lir.asm=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.graphbuilderconf=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.options=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.printer=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.printer=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.bytecode=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.bytecode=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.spi=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.spi=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.api.replacements=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.api.replacements=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.replacements=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.replacements=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.phases=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.phases=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.type=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.type=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.memory=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.drivers.spirv --add-opens jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.asm=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.asm=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.cfg=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.cfg=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.schedule=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.schedule=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.virtual.phases.ea=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.virtual.phases.ea=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.lir.ssa=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.lir.ssa=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.calc=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.calc=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.gen=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.gen=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.core.match=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.match=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory.address=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.memory.address=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.nodes.type=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.nodes.type=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.spirv --add-exports - jdk.internal.vm.compiler/org.graalvm.compiler.word=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.word=tornado.drivers.spirv --add-exports - - jdk.internal.vm.compiler/org.graalvm.compiler.core.common.memory=tornado.drivers.spirv + jdk.graal.compiler/jdk.graal.compiler.core.common.memory=tornado.drivers.spirv diff --git a/tornado-annotation/pom.xml b/tornado-annotation/pom.xml index ae91eaa063..18e1509c45 100644 --- a/tornado-annotation/pom.xml +++ b/tornado-annotation/pom.xml @@ -21,7 +21,7 @@ org.ow2.asm asm - 9.5 + 9.7 diff --git a/tornado-api/pom.xml b/tornado-api/pom.xml index 18f0598589..7273075741 100644 --- a/tornado-api/pom.xml +++ b/tornado-api/pom.xml @@ -14,5 +14,17 @@ tornado-api https://tornadovm.org + + + + org.apache.maven.plugins + maven-compiler-plugin + + 23 + 23 + + + + diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/ByteArray.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/ByteArray.java index 213f68fb2d..7a32a94c2c 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/ByteArray.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/ByteArray.java @@ -17,10 +17,6 @@ */ package uk.ac.manchester.tornado.api.types.arrays; -import static java.lang.foreign.ValueLayout.JAVA_BYTE; -import static java.lang.foreign.ValueLayout.JAVA_INT; - -import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.nio.ByteBuffer; import java.util.Arrays; @@ -37,7 +33,7 @@ @SegmentElementSize(size = 1) public final class ByteArray extends TornadoNativeArray { private static final int BYTE_BYTES = 1; - private MemorySegment segment; + private TornadoMemorySegment segment; private int numberOfElements; private int arrayHeaderSize; @@ -56,9 +52,7 @@ public ByteArray(int numberOfElements) { arrayHeaderSize = (int) TornadoNativeArray.ARRAY_HEADER; baseIndex = arrayHeaderSize / BYTE_BYTES; segmentByteSize = numberOfElements * BYTE_BYTES + arrayHeaderSize; - - segment = Arena.ofAuto().allocate(segmentByteSize, 1); - segment.setAtIndex(JAVA_INT, 0, numberOfElements); + segment = new TornadoMemorySegment(segmentByteSize, baseIndex, numberOfElements); } /** @@ -119,7 +113,7 @@ public static ByteArray fromSegment(MemorySegment segment) { long byteSize = segment.byteSize(); int numElements = (int) (byteSize / BYTE_BYTES); ByteArray byteArray = new ByteArray(numElements); - MemorySegment.copy(segment, 0, byteArray.segment, byteArray.baseIndex * BYTE_BYTES, byteSize); + MemorySegment.copy(segment, 0, byteArray.segment.getSegment(), byteArray.baseIndex * BYTE_BYTES, byteSize); return byteArray; } @@ -137,6 +131,39 @@ public static ByteArray fromByteBuffer(ByteBuffer buffer) { return byteArray; } + /** + * Factory method to initialize a {@link ByteArray}. This method can be invoked from a Task-Graph. + * + * @param array + * Input Array. + * @param value + * The float value to initialize the {@code ByteArray} instance with. + */ + public static void initialize(ByteArray array, byte value) { + for (@Parallel int i = 0; i < array.getSize(); i++) { + array.set(i, value); + } + } + + /** + * Concatenates multiple {@link ByteArray} instances into a single {@link ByteArray}. + * + * @param arrays + * Variable number of {@link ByteArray} objects to be concatenated. + * @return A new {@link ByteArray} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static ByteArray concat(ByteArray... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(ByteArray::getSize).sum(); + ByteArray concatArray = new ByteArray(newSize); + long currentPositionBytes = 0; + for (ByteArray array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + /** * Converts the byte data from off-heap to on-heap, by copying the values of a {@link ByteArray} * instance into a new on-heap array. @@ -160,7 +187,7 @@ public byte[] toHeapArray() { * The byte value to store at the specified index. */ public void set(int index, byte value) { - segment.setAtIndex(JAVA_BYTE, baseIndex + index, value); + segment.setAtIndex(index, value, baseIndex); } /** @@ -171,7 +198,7 @@ public void set(int index, byte value) { * @return en element byte of the off-heap array */ public byte get(int index) { - return segment.getAtIndex(JAVA_BYTE, baseIndex + index); + return segment.getByteAtIndex(index, baseIndex); } /** @@ -195,7 +222,7 @@ public int getElementSize() { */ public void init(byte value) { for (int i = 0; i < getSize(); i++) { - segment.setAtIndex(JAVA_BYTE, baseIndex + i, value); + segment.setAtIndex(i, value, baseIndex); } } @@ -215,7 +242,7 @@ public int getSize() { */ @Override public MemorySegment getSegment() { - return segment.asSlice(TornadoNativeArray.ARRAY_HEADER); + return segment.getSegment().asSlice(TornadoNativeArray.ARRAY_HEADER); } /** @@ -225,7 +252,7 @@ public MemorySegment getSegment() { */ @Override public MemorySegment getSegmentWithHeader() { - return segment; + return segment.getSegment(); } /** @@ -249,39 +276,6 @@ public long getNumBytesOfSegment() { return segmentByteSize - TornadoNativeArray.ARRAY_HEADER; } - /** - * Factory method to initialize a {@link ByteArray}. This method can be invoked from a Task-Graph. - * - * @param array - * Input Array. - * @param value - * The float value to initialize the {@code ByteArray} instance with. - */ - public static void initialize(ByteArray array, byte value) { - for (@Parallel int i = 0; i < array.getSize(); i++) { - array.set(i, value); - } - } - - /** - * Concatenates multiple {@link ByteArray} instances into a single {@link ByteArray}. - * - * @param arrays - * Variable number of {@link ByteArray} objects to be concatenated. - * @return A new {@link ByteArray} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static ByteArray concat(ByteArray... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(ByteArray::getSize).sum(); - ByteArray concatArray = new ByteArray(newSize); - long currentPositionBytes = 0; - for (ByteArray array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } - /** * Extracts a slice of elements from a given {@link ByteArray}, creating a new {@link ByteArray} instance. * @@ -301,7 +295,7 @@ public ByteArray slice(int offset, int length) { long sliceOffsetInBytes = TornadoNativeArray.ARRAY_HEADER + offset * BYTE_BYTES; long sliceByteLength = length * BYTE_BYTES; - MemorySegment sliceSegment = segment.asSlice(sliceOffsetInBytes, sliceByteLength); + MemorySegment sliceSegment = segment.getSegment().asSlice(sliceOffsetInBytes, sliceByteLength); ByteArray slice = fromSegment(sliceSegment); return slice; } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/CharArray.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/CharArray.java index d4a4b70008..c1f4f4b2ce 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/CharArray.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/CharArray.java @@ -17,10 +17,6 @@ */ package uk.ac.manchester.tornado.api.types.arrays; -import static java.lang.foreign.ValueLayout.JAVA_CHAR; -import static java.lang.foreign.ValueLayout.JAVA_INT; - -import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.nio.CharBuffer; import java.util.Arrays; @@ -37,7 +33,7 @@ @SegmentElementSize(size = 2) public final class CharArray extends TornadoNativeArray { private static final int CHAR_BYTES = 2; - private MemorySegment segment; + private TornadoMemorySegment segment; private int numberOfElements; private int arrayHeaderSize; @@ -56,9 +52,7 @@ public CharArray(int numberOfElements) { arrayHeaderSize = (int) TornadoNativeArray.ARRAY_HEADER; baseIndex = arrayHeaderSize / CHAR_BYTES; segmentByteSize = numberOfElements * CHAR_BYTES + arrayHeaderSize; - - segment = Arena.ofAuto().allocate(segmentByteSize, 1); - segment.setAtIndex(JAVA_INT, 0, numberOfElements); + segment = new TornadoMemorySegment(segmentByteSize, baseIndex, numberOfElements); } /** @@ -119,7 +113,7 @@ public static CharArray fromSegment(MemorySegment segment) { long byteSize = segment.byteSize(); int numElements = (int) (byteSize / CHAR_BYTES); CharArray charArray = new CharArray(numElements); - MemorySegment.copy(segment, 0, charArray.segment, charArray.baseIndex * CHAR_BYTES, byteSize); + MemorySegment.copy(segment, 0, charArray.segment.getSegment(), charArray.baseIndex * CHAR_BYTES, byteSize); return charArray; } @@ -137,6 +131,39 @@ public static CharArray fromCharBuffer(CharBuffer buffer) { return charArray; } + /** + * Factory method to initialize a {@link CharArray}. This method can be invoked from a Task-Graph. + * + * @param array + * Input Array. + * @param value + * The float value to initialize the {@code CharArray} instance with. + */ + public static void initialize(CharArray array, char value) { + for (@Parallel int i = 0; i < array.getSize(); i++) { + array.set(i, value); + } + } + + /** + * Concatenates multiple {@link CharArray} instances into a single {@link CharArray}. + * + * @param arrays + * Variable number of {@link CharArray} objects to be concatenated. + * @return A new {@link CharArray} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static CharArray concat(CharArray... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(CharArray::getSize).sum(); + CharArray concatArray = new CharArray(newSize); + long currentPositionBytes = 0; + for (CharArray array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + /** * Sets all the values of the {@link CharArray} instance to \u0000, the default char value. */ @@ -173,7 +200,7 @@ public char[] toHeapArray() { * The char value to store at the specified index. */ public void set(int index, char value) { - segment.setAtIndex(JAVA_CHAR, baseIndex + index, value); + segment.setAtIndex(index, value, baseIndex); } /** @@ -184,7 +211,7 @@ public void set(int index, char value) { * @return */ public char get(int index) { - return segment.getAtIndex(JAVA_CHAR, baseIndex + index); + return segment.getCharAtIndex(index, baseIndex); } /** @@ -195,7 +222,7 @@ public char get(int index) { */ public void init(char value) { for (int i = 0; i < getSize(); i++) { - segment.setAtIndex(JAVA_CHAR, baseIndex + i, value); + segment.setAtIndex(i, value, baseIndex); } } @@ -216,7 +243,7 @@ public int getSize() { */ @Override public MemorySegment getSegment() { - return segment.asSlice(TornadoNativeArray.ARRAY_HEADER); + return segment.getSegment().asSlice(TornadoNativeArray.ARRAY_HEADER); } /** @@ -226,7 +253,7 @@ public MemorySegment getSegment() { */ @Override public MemorySegment getSegmentWithHeader() { - return segment; + return segment.getSegment(); } /** @@ -250,39 +277,6 @@ public long getNumBytesOfSegment() { return segmentByteSize - TornadoNativeArray.ARRAY_HEADER; } - /** - * Factory method to initialize a {@link CharArray}. This method can be invoked from a Task-Graph. - * - * @param array - * Input Array. - * @param value - * The float value to initialize the {@code CharArray} instance with. - */ - public static void initialize(CharArray array, char value) { - for (@Parallel int i = 0; i < array.getSize(); i++) { - array.set(i, value); - } - } - - /** - * Concatenates multiple {@link CharArray} instances into a single {@link CharArray}. - * - * @param arrays - * Variable number of {@link CharArray} objects to be concatenated. - * @return A new {@link CharArray} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static CharArray concat(CharArray... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(CharArray::getSize).sum(); - CharArray concatArray = new CharArray(newSize); - long currentPositionBytes = 0; - for (CharArray array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } - /** * Extracts a slice of elements from a given {@link CharArray}, creating a new {@link CharArray} instance. * @@ -302,7 +296,7 @@ public CharArray slice(int offset, int length) { long sliceOffsetInBytes = TornadoNativeArray.ARRAY_HEADER + offset * CHAR_BYTES; long sliceByteLength = length * CHAR_BYTES; - MemorySegment sliceSegment = segment.asSlice(sliceOffsetInBytes, sliceByteLength); + MemorySegment sliceSegment = segment.getSegment().asSlice(sliceOffsetInBytes, sliceByteLength); CharArray slice = fromSegment(sliceSegment); return slice; } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/DoubleArray.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/DoubleArray.java index 5674350261..a272acf541 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/DoubleArray.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/DoubleArray.java @@ -17,10 +17,6 @@ */ package uk.ac.manchester.tornado.api.types.arrays; -import static java.lang.foreign.ValueLayout.JAVA_DOUBLE; -import static java.lang.foreign.ValueLayout.JAVA_INT; - -import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.nio.DoubleBuffer; import java.util.Arrays; @@ -37,7 +33,7 @@ @SegmentElementSize(size = 8) public final class DoubleArray extends TornadoNativeArray { private static final int DOUBLE_BYTES = 8; - private MemorySegment segment; + private TornadoMemorySegment segment; private int numberOfElements; private int arrayHeaderSize; @@ -58,9 +54,7 @@ public DoubleArray(int numberOfElements) { assert arrayHeaderSize >= 8; baseIndex = arrayHeaderSize / DOUBLE_BYTES; segmentByteSize = numberOfElements * DOUBLE_BYTES + arrayHeaderSize; - - segment = Arena.ofAuto().allocate(segmentByteSize, 1); - segment.setAtIndex(JAVA_INT, 0, numberOfElements); + segment = new TornadoMemorySegment(segmentByteSize, baseIndex, numberOfElements); } /** @@ -121,7 +115,7 @@ public static DoubleArray fromSegment(MemorySegment segment) { long byteSize = segment.byteSize(); int numElements = (int) (byteSize / DOUBLE_BYTES); DoubleArray doubleArray = new DoubleArray(numElements); - MemorySegment.copy(segment, 0, doubleArray.segment, doubleArray.baseIndex * DOUBLE_BYTES, byteSize); + MemorySegment.copy(segment, 0, doubleArray.segment.getSegment(), doubleArray.baseIndex * DOUBLE_BYTES, byteSize); return doubleArray; } @@ -139,6 +133,39 @@ public static DoubleArray fromDoubleBuffer(DoubleBuffer buffer) { return doubleArray; } + /** + * Factory method to initialize a {@link DoubleArray}. This method can be invoked from a Task-Graph. + * + * @param array + * Input Array. + * @param value + * The float value to initialize the {@code DoubleArray} instance with. + */ + public static void initialize(DoubleArray array, double value) { + for (@Parallel int i = 0; i < array.getSize(); i++) { + array.set(i, value); + } + } + + /** + * Concatenates multiple {@link DoubleArray} instances into a single {@link DoubleArray}. + * + * @param arrays + * Variable number of {@link DoubleArray} objects to be concatenated. + * @return A new {@link DoubleArray} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static DoubleArray concat(DoubleArray... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(DoubleArray::getSize).sum(); + DoubleArray concatArray = new DoubleArray(newSize); + long currentPositionBytes = 0; + for (DoubleArray array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + /** * Converts the double data from off-heap to on-heap, by copying the values of a {@link DoubleArray} * instance into a new on-heap array. @@ -162,7 +189,7 @@ public double[] toHeapArray() { * The double value to store at the specified index. */ public void set(int index, double value) { - segment.setAtIndex(JAVA_DOUBLE, baseIndex + index, value); + segment.setAtIndex(index, value, baseIndex); } /** @@ -173,7 +200,7 @@ public void set(int index, double value) { * @return */ public double get(int index) { - return segment.getAtIndex(JAVA_DOUBLE, baseIndex + index); + return segment.getDoubleAtIndex(index, baseIndex); } /** @@ -197,7 +224,7 @@ public int getElementSize() { */ public void init(double value) { for (int i = 0; i < getSize(); i++) { - segment.setAtIndex(JAVA_DOUBLE, baseIndex + i, value); + segment.setAtIndex(i, value, baseIndex); } } @@ -218,7 +245,7 @@ public int getSize() { */ @Override public MemorySegment getSegment() { - return segment.asSlice(TornadoNativeArray.ARRAY_HEADER); + return segment.getSegment().asSlice(TornadoNativeArray.ARRAY_HEADER); } /** @@ -228,7 +255,7 @@ public MemorySegment getSegment() { */ @Override public MemorySegment getSegmentWithHeader() { - return segment; + return segment.getSegment(); } /** @@ -252,39 +279,6 @@ public long getNumBytesOfSegment() { return segmentByteSize - TornadoNativeArray.ARRAY_HEADER; } - /** - * Factory method to initialize a {@link DoubleArray}. This method can be invoked from a Task-Graph. - * - * @param array - * Input Array. - * @param value - * The float value to initialize the {@code DoubleArray} instance with. - */ - public static void initialize(DoubleArray array, double value) { - for (@Parallel int i = 0; i < array.getSize(); i++) { - array.set(i, value); - } - } - - /** - * Concatenates multiple {@link DoubleArray} instances into a single {@link DoubleArray}. - * - * @param arrays - * Variable number of {@link DoubleArray} objects to be concatenated. - * @return A new {@link DoubleArray} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static DoubleArray concat(DoubleArray... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(DoubleArray::getSize).sum(); - DoubleArray concatArray = new DoubleArray(newSize); - long currentPositionBytes = 0; - for (DoubleArray array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } - /** * Extracts a slice of elements from a given {@link DoubleArray}, creating a new {@link DoubleArray} instance. * @@ -304,7 +298,7 @@ public DoubleArray slice(int offset, int length) { long sliceOffsetInBytes = TornadoNativeArray.ARRAY_HEADER + offset * DOUBLE_BYTES; long sliceByteLength = length * DOUBLE_BYTES; - MemorySegment sliceSegment = segment.asSlice(sliceOffsetInBytes, sliceByteLength); + MemorySegment sliceSegment = segment.getSegment().asSlice(sliceOffsetInBytes, sliceByteLength); DoubleArray slice = fromSegment(sliceSegment); return slice; } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/FloatArray.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/FloatArray.java index 2b54f7a0d8..85527696ce 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/FloatArray.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/FloatArray.java @@ -17,10 +17,6 @@ */ package uk.ac.manchester.tornado.api.types.arrays; -import static java.lang.foreign.ValueLayout.JAVA_FLOAT; -import static java.lang.foreign.ValueLayout.JAVA_INT; - -import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.nio.FloatBuffer; import java.util.Arrays; @@ -37,7 +33,7 @@ @SegmentElementSize(size = 4) public final class FloatArray extends TornadoNativeArray { private static final int FLOAT_BYTES = 4; - private MemorySegment segment; + private TornadoMemorySegment segment; private int numberOfElements; @@ -58,9 +54,7 @@ public FloatArray(int numberOfElements) { arrayHeaderSize = (int) TornadoNativeArray.ARRAY_HEADER; baseIndex = arrayHeaderSize / FLOAT_BYTES; segmentByteSize = numberOfElements * FLOAT_BYTES + arrayHeaderSize; - - segment = Arena.ofAuto().allocate(segmentByteSize, 1); - segment.setAtIndex(JAVA_INT, 0, numberOfElements); + segment = new TornadoMemorySegment(segmentByteSize, baseIndex, numberOfElements); } /** @@ -121,7 +115,7 @@ public static FloatArray fromSegment(MemorySegment segment) { long byteSize = segment.byteSize(); int numElements = (int) (byteSize / FLOAT_BYTES); FloatArray floatArray = new FloatArray(numElements); - MemorySegment.copy(segment, 0, floatArray.segment, floatArray.baseIndex * FLOAT_BYTES, byteSize); + MemorySegment.copy(segment, 0, floatArray.segment.getSegment(), floatArray.baseIndex * FLOAT_BYTES, byteSize); return floatArray; } @@ -139,6 +133,39 @@ public static FloatArray fromFloatBuffer(FloatBuffer buffer) { return floatArray; } + /** + * Factory method to initialize a {@link FloatArray}. This method can be invoked from a Task-Graph. + * + * @param array + * Input Array. + * @param value + * The float value to initialize the {@code FloatArray} instance with. + */ + public static void initialize(FloatArray array, float value) { + for (@Parallel int i = 0; i < array.getSize(); i++) { + array.set(i, value); + } + } + + /** + * Concatenates multiple {@link FloatArray} instances into a single {@link FloatArray}. + * + * @param arrays + * Variable number of {@link FloatArray} objects to be concatenated. + * @return A new {@link FloatArray} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static FloatArray concat(FloatArray... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(FloatArray::getSize).sum(); + FloatArray concatArray = new FloatArray(newSize); + long currentPositionBytes = 0; + for (FloatArray array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + /** * Converts the float data from off-heap to on-heap, by copying the values of a {@link FloatArray} * instance into a new on-heap array. @@ -162,7 +189,7 @@ public float[] toHeapArray() { * The float value to store at the specified index. */ public void set(int index, float value) { - segment.setAtIndex(JAVA_FLOAT, baseIndex + index, value); + segment.setAtIndex(index, value, baseIndex); } /** @@ -173,7 +200,7 @@ public void set(int index, float value) { * @return */ public float get(int index) { - return segment.getAtIndex(JAVA_FLOAT, baseIndex + index); + return segment.getFloatAtIndex(index, baseIndex); } /** @@ -197,7 +224,7 @@ public int getElementSize() { */ public void init(float value) { for (int i = 0; i < getSize(); i++) { - segment.setAtIndex(JAVA_FLOAT, baseIndex + i, value); + segment.setAtIndex(i, value, baseIndex); } } @@ -218,7 +245,7 @@ public int getSize() { */ @Override public MemorySegment getSegment() { - return segment.asSlice(TornadoNativeArray.ARRAY_HEADER); + return segment.getSegment().asSlice(TornadoNativeArray.ARRAY_HEADER); } /** @@ -228,7 +255,7 @@ public MemorySegment getSegment() { */ @Override public MemorySegment getSegmentWithHeader() { - return segment; + return segment.getSegment(); } /** @@ -252,39 +279,6 @@ public long getNumBytesOfSegment() { return segmentByteSize - TornadoNativeArray.ARRAY_HEADER; } - /** - * Factory method to initialize a {@link FloatArray}. This method can be invoked from a Task-Graph. - * - * @param array - * Input Array. - * @param value - * The float value to initialize the {@code FloatArray} instance with. - */ - public static void initialize(FloatArray array, float value) { - for (@Parallel int i = 0; i < array.getSize(); i++) { - array.set(i, value); - } - } - - /** - * Concatenates multiple {@link FloatArray} instances into a single {@link FloatArray}. - * - * @param arrays - * Variable number of {@link FloatArray} objects to be concatenated. - * @return A new {@link FloatArray} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static FloatArray concat(FloatArray... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(FloatArray::getSize).sum(); - FloatArray concatArray = new FloatArray(newSize); - long currentPositionBytes = 0; - for (FloatArray array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } - /** * Extracts a slice of elements from a given {@link FloatArray}, creating a new {@link FloatArray} instance. * @@ -304,7 +298,7 @@ public FloatArray slice(int offset, int length) { long sliceOffsetInBytes = TornadoNativeArray.ARRAY_HEADER + offset * FLOAT_BYTES; long sliceByteLength = length * FLOAT_BYTES; - MemorySegment sliceSegment = segment.asSlice(sliceOffsetInBytes, sliceByteLength); + MemorySegment sliceSegment = segment.getSegment().asSlice(sliceOffsetInBytes, sliceByteLength); FloatArray slice = fromSegment(sliceSegment); return slice; } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/HalfFloatArray.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/HalfFloatArray.java index f53a164811..92eb6f90c0 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/HalfFloatArray.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/HalfFloatArray.java @@ -17,10 +17,6 @@ */ package uk.ac.manchester.tornado.api.types.arrays; -import static java.lang.foreign.ValueLayout.JAVA_INT; -import static java.lang.foreign.ValueLayout.JAVA_SHORT; - -import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.util.Arrays; @@ -38,7 +34,7 @@ public final class HalfFloatArray extends TornadoNativeArray { private static final int HALF_FLOAT_BYTES = 2; - private MemorySegment segment; + private TornadoMemorySegment segment; private int numberOfElements; @@ -59,9 +55,7 @@ public HalfFloatArray(int numberOfElements) { arrayHeaderSize = (int) TornadoNativeArray.ARRAY_HEADER; baseIndex = arrayHeaderSize / HALF_FLOAT_BYTES; segmentByteSize = numberOfElements * HALF_FLOAT_BYTES + arrayHeaderSize; - - segment = Arena.ofAuto().allocate(segmentByteSize, 1); - segment.setAtIndex(JAVA_INT, 0, numberOfElements); + segment = new TornadoMemorySegment(segmentByteSize, baseIndex, numberOfElements); } /** @@ -122,10 +116,43 @@ public static HalfFloatArray fromSegment(MemorySegment segment) { long byteSize = segment.byteSize(); int numElements = (int) (byteSize / HALF_FLOAT_BYTES); HalfFloatArray halfFloatArray = new HalfFloatArray(numElements); - MemorySegment.copy(segment, 0, halfFloatArray.segment, (long) halfFloatArray.baseIndex * HALF_FLOAT_BYTES, byteSize); + MemorySegment.copy(segment, 0, halfFloatArray.segment.getSegment(), (long) halfFloatArray.baseIndex * HALF_FLOAT_BYTES, byteSize); return halfFloatArray; } + /** + * Factory method to initialize a {@link HalfFloatArray}. This method can be invoked from a Task-Graph. + * + * @param array + * Input Array. + * @param value + * The float value to initialize the {@code HalfFloatArray} instance with. + */ + public static void initialize(HalfFloatArray array, HalfFloat value) { + for (@Parallel int i = 0; i < array.getSize(); i++) { + array.set(i, value); + } + } + + /** + * Concatenates multiple {@link HalfFloatArray} instances into a single {@link HalfFloatArray}. + * + * @param arrays + * Variable number of {@link HalfFloatArray} objects to be concatenated. + * @return A new {@link HalfFloatArray} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static HalfFloatArray concat(HalfFloatArray... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(HalfFloatArray::getSize).sum(); + HalfFloatArray concatArray = new HalfFloatArray(newSize); + long currentPositionBytes = 0; + for (HalfFloatArray array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + /** * Converts the {@link HalfFloat} data from off-heap to on-heap, by copying the values of a {@link HalfFloatArray} * instance into a new on-heap {@link HalfFloat}. @@ -164,7 +191,7 @@ public short[] toShortArray() { * The {@link HalfFloat} value to store at the specified index. */ public void set(int index, HalfFloat value) { - segment.setAtIndex(JAVA_SHORT, baseIndex + index, value.getHalfFloatValue()); + segment.setAtIndex(index, value.getHalfFloatValue(), baseIndex); } /** @@ -175,7 +202,7 @@ public void set(int index, HalfFloat value) { * @return */ public HalfFloat get(int index) { - short halfFloatValue = segment.getAtIndex(JAVA_SHORT, baseIndex + index); + short halfFloatValue = segment.getShortAtIndex(index, baseIndex); return new HalfFloat(halfFloatValue); } @@ -200,7 +227,7 @@ public int getElementSize() { */ public void init(HalfFloat value) { for (int i = 0; i < getSize(); i++) { - segment.setAtIndex(JAVA_SHORT, baseIndex + i, value.getHalfFloatValue()); + segment.setAtIndex(i, value.getHalfFloatValue(), baseIndex); } } @@ -221,7 +248,7 @@ public int getSize() { */ @Override public MemorySegment getSegment() { - return segment.asSlice(TornadoNativeArray.ARRAY_HEADER); + return segment.getSegment().asSlice(TornadoNativeArray.ARRAY_HEADER); } /** @@ -231,7 +258,7 @@ public MemorySegment getSegment() { */ @Override public MemorySegment getSegmentWithHeader() { - return segment; + return segment.getSegment(); } /** @@ -255,39 +282,6 @@ public long getNumBytesOfSegment() { return segmentByteSize - TornadoNativeArray.ARRAY_HEADER; } - /** - * Factory method to initialize a {@link HalfFloatArray}. This method can be invoked from a Task-Graph. - * - * @param array - * Input Array. - * @param value - * The float value to initialize the {@code HalfFloatArray} instance with. - */ - public static void initialize(HalfFloatArray array, HalfFloat value) { - for (@Parallel int i = 0; i < array.getSize(); i++) { - array.set(i, value); - } - } - - /** - * Concatenates multiple {@link HalfFloatArray} instances into a single {@link HalfFloatArray}. - * - * @param arrays - * Variable number of {@link HalfFloatArray} objects to be concatenated. - * @return A new {@link HalfFloatArray} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static HalfFloatArray concat(HalfFloatArray... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(HalfFloatArray::getSize).sum(); - HalfFloatArray concatArray = new HalfFloatArray(newSize); - long currentPositionBytes = 0; - for (HalfFloatArray array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } - /** * Extracts a slice of elements from a given {@linkHalfFloatArray}, creating a new {@linkHalfFloatArray} instance. * @@ -307,7 +301,7 @@ public HalfFloatArray slice(int offset, int length) { long sliceOffsetInBytes = TornadoNativeArray.ARRAY_HEADER + offset * HALF_FLOAT_BYTES; long sliceByteLength = length * HALF_FLOAT_BYTES; - MemorySegment sliceSegment = segment.asSlice(sliceOffsetInBytes, sliceByteLength); + MemorySegment sliceSegment = segment.getSegment().asSlice(sliceOffsetInBytes, sliceByteLength); HalfFloatArray slice = fromSegment(sliceSegment); return slice; } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/IntArray.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/IntArray.java index ffbf25c4db..46be448de6 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/IntArray.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/IntArray.java @@ -17,9 +17,6 @@ */ package uk.ac.manchester.tornado.api.types.arrays; -import static java.lang.foreign.ValueLayout.JAVA_INT; - -import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.nio.IntBuffer; import java.util.Arrays; @@ -37,7 +34,7 @@ public final class IntArray extends TornadoNativeArray { private static final int INT_BYTES = 4; private int numberOfElements; - private MemorySegment segment; + private TornadoMemorySegment segment; private int arrayHeaderSize; private int baseIndex; @@ -55,9 +52,7 @@ public IntArray(int numberOfElements) { arrayHeaderSize = (int) TornadoNativeArray.ARRAY_HEADER; baseIndex = arrayHeaderSize / INT_BYTES; segmentByteSize = numberOfElements * INT_BYTES + arrayHeaderSize; - - segment = Arena.ofAuto().allocate(segmentByteSize, 1); - segment.setAtIndex(JAVA_INT, 0, numberOfElements); + segment = new TornadoMemorySegment(segmentByteSize, baseIndex, numberOfElements); } /** @@ -118,7 +113,7 @@ public static IntArray fromSegment(MemorySegment segment) { long byteSize = segment.byteSize(); int numElements = (int) (byteSize / INT_BYTES); IntArray intArray = new IntArray(numElements); - MemorySegment.copy(segment, 0, intArray.segment, intArray.baseIndex * INT_BYTES, byteSize); + MemorySegment.copy(segment, 0, intArray.segment.getSegment(), intArray.baseIndex * INT_BYTES, byteSize); return intArray; } @@ -136,6 +131,39 @@ public static IntArray fromIntBuffer(IntBuffer buffer) { return intArray; } + /** + * Factory method to initialize a {@link IntArray}. This method can be invoked from a Task-Graph. + * + * @param array + * Input Array. + * @param value + * The float value to initialize the {@code IntArray} instance with. + */ + public static void initialize(IntArray array, int value) { + for (@Parallel int i = 0; i < array.getSize(); i++) { + array.set(i, value); + } + } + + /** + * Concatenates multiple {@link IntArray} instances into a single {@link IntArray}. + * + * @param arrays + * Variable number of {@link IntArray} objects to be concatenated. + * @return A new {@link IntArray} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static IntArray concat(IntArray... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(IntArray::getSize).sum(); + IntArray concatArray = new IntArray(newSize); + long currentPositionBytes = 0; + for (IntArray array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + /** * Converts the int data from off-heap to on-heap, by copying the values of a {@link IntArray} * instance into a new on-heap array. @@ -159,7 +187,7 @@ public int[] toHeapArray() { * The int value to store at the specified index. */ public void set(int index, int value) { - segment.setAtIndex(JAVA_INT, baseIndex + index, value); + segment.setAtIndex(index, value, baseIndex); } /** @@ -170,7 +198,7 @@ public void set(int index, int value) { * @return */ public int get(int index) { - return segment.getAtIndex(JAVA_INT, baseIndex + index); + return segment.getIntAtIndex(index, baseIndex); } /** @@ -194,7 +222,7 @@ public int getElementSize() { */ public void init(int value) { for (int i = 0; i < getSize(); i++) { - segment.setAtIndex(JAVA_INT, baseIndex + i, value); + segment.setAtIndex(i, value, baseIndex); } } @@ -236,7 +264,7 @@ public long getNumBytesOfSegment() { */ @Override public MemorySegment getSegment() { - return segment.asSlice(TornadoNativeArray.ARRAY_HEADER); + return segment.getSegment().asSlice(TornadoNativeArray.ARRAY_HEADER); } /** @@ -246,40 +274,7 @@ public MemorySegment getSegment() { */ @Override public MemorySegment getSegmentWithHeader() { - return segment; - } - - /** - * Factory method to initialize a {@link IntArray}. This method can be invoked from a Task-Graph. - * - * @param array - * Input Array. - * @param value - * The float value to initialize the {@code IntArray} instance with. - */ - public static void initialize(IntArray array, int value) { - for (@Parallel int i = 0; i < array.getSize(); i++) { - array.set(i, value); - } - } - - /** - * Concatenates multiple {@link IntArray} instances into a single {@link IntArray}. - * - * @param arrays - * Variable number of {@link IntArray} objects to be concatenated. - * @return A new {@link IntArray} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static IntArray concat(IntArray... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(IntArray::getSize).sum(); - IntArray concatArray = new IntArray(newSize); - long currentPositionBytes = 0; - for (IntArray array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; + return segment.getSegment(); } /** @@ -301,7 +296,7 @@ public IntArray slice(int offset, int length) { long sliceOffsetInBytes = TornadoNativeArray.ARRAY_HEADER + offset * INT_BYTES; long sliceByteLength = length * INT_BYTES; - MemorySegment sliceSegment = segment.asSlice(sliceOffsetInBytes, sliceByteLength); + MemorySegment sliceSegment = segment.getSegment().asSlice(sliceOffsetInBytes, sliceByteLength); IntArray slice = fromSegment(sliceSegment); return slice; } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/LongArray.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/LongArray.java index f945bf667b..931319624d 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/LongArray.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/LongArray.java @@ -17,10 +17,6 @@ */ package uk.ac.manchester.tornado.api.types.arrays; -import static java.lang.foreign.ValueLayout.JAVA_INT; -import static java.lang.foreign.ValueLayout.JAVA_LONG; - -import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.nio.LongBuffer; import java.util.Arrays; @@ -37,7 +33,7 @@ @SegmentElementSize(size = 8) public final class LongArray extends TornadoNativeArray { private static final int LONG_BYTES = 8; - private MemorySegment segment; + private TornadoMemorySegment segment; private int numberOfElements; private int arrayHeaderSize; @@ -55,10 +51,8 @@ public LongArray(int numberOfElements) { this.numberOfElements = numberOfElements; arrayHeaderSize = (int) TornadoNativeArray.ARRAY_HEADER; baseIndex = arrayHeaderSize / LONG_BYTES; - segmentByteSize = numberOfElements * LONG_BYTES + arrayHeaderSize; - segment = Arena.ofAuto().allocate(segmentByteSize, 1); - segment.setAtIndex(JAVA_INT, 0, numberOfElements); + segment = new TornadoMemorySegment(segmentByteSize, baseIndex, numberOfElements); } /** @@ -119,7 +113,7 @@ public static LongArray fromSegment(MemorySegment segment) { long byteSize = segment.byteSize(); int numElements = (int) (byteSize / LONG_BYTES); LongArray longArray = new LongArray(numElements); - MemorySegment.copy(segment, 0, longArray.segment, longArray.baseIndex * LONG_BYTES, byteSize); + MemorySegment.copy(segment, 0, longArray.segment.getSegment(), longArray.baseIndex * LONG_BYTES, byteSize); return longArray; } @@ -137,6 +131,39 @@ public static LongArray fromLongBuffer(LongBuffer buffer) { return longArray; } + /** + * Factory method to initialize a {@link LongArray}. This method can be invoked from a Task-Graph. + * + * @param array + * Input Array. + * @param value + * The float value to initialize the {@code LongArray} instance with. + */ + public static void initialize(LongArray array, long value) { + for (@Parallel int i = 0; i < array.getSize(); i++) { + array.set(i, value); + } + } + + /** + * Concatenates multiple {@link LongArray} instances into a single {@link LongArray}. + * + * @param arrays + * Variable number of {@link LongArray} objects to be concatenated. + * @return A new {@link LongArray} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static LongArray concat(LongArray... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(LongArray::getSize).sum(); + LongArray concatArray = new LongArray(newSize); + long currentPositionBytes = 0; + for (LongArray array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + /** * Converts the long data from off-heap to on-heap, by copying the values of a {@link LongArray} * instance into a new on-heap array. @@ -160,7 +187,7 @@ public long[] toHeapArray() { * The long value to store at the specified index. */ public void set(int index, long value) { - segment.setAtIndex(JAVA_LONG, baseIndex + index, value); + segment.setAtIndex(index, value, baseIndex); } /** @@ -171,7 +198,7 @@ public void set(int index, long value) { * @return */ public long get(int index) { - return segment.getAtIndex(JAVA_LONG, baseIndex + index); + return segment.getLongAtIndex(index, baseIndex); } /** @@ -195,7 +222,7 @@ public int getElementSize() { */ public void init(long value) { for (int i = 0; i < getSize(); i++) { - segment.setAtIndex(JAVA_LONG, baseIndex + i, value); + segment.setAtIndex(i, value, baseIndex); } } @@ -216,7 +243,7 @@ public int getSize() { */ @Override public MemorySegment getSegment() { - return segment.asSlice(TornadoNativeArray.ARRAY_HEADER); + return segment.getSegment().asSlice(TornadoNativeArray.ARRAY_HEADER); } /** @@ -226,7 +253,7 @@ public MemorySegment getSegment() { */ @Override public MemorySegment getSegmentWithHeader() { - return segment; + return segment.getSegment(); } /** @@ -250,39 +277,6 @@ public long getNumBytesOfSegment() { return segmentByteSize - TornadoNativeArray.ARRAY_HEADER; } - /** - * Factory method to initialize a {@link LongArray}. This method can be invoked from a Task-Graph. - * - * @param array - * Input Array. - * @param value - * The float value to initialize the {@code LongArray} instance with. - */ - public static void initialize(LongArray array, long value) { - for (@Parallel int i = 0; i < array.getSize(); i++) { - array.set(i, value); - } - } - - /** - * Concatenates multiple {@link LongArray} instances into a single {@link LongArray}. - * - * @param arrays - * Variable number of {@link LongArray} objects to be concatenated. - * @return A new {@link LongArray} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static LongArray concat(LongArray... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(LongArray::getSize).sum(); - LongArray concatArray = new LongArray(newSize); - long currentPositionBytes = 0; - for (LongArray array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } - /** * Extracts a slice of elements from a given {@link LongArray}, creating a new {@link LongArray} instance. * @@ -302,7 +296,7 @@ public LongArray slice(int offset, int length) { long sliceOffsetInBytes = TornadoNativeArray.ARRAY_HEADER + offset * LONG_BYTES; long sliceByteLength = length * LONG_BYTES; - MemorySegment sliceSegment = segment.asSlice(sliceOffsetInBytes, sliceByteLength); + MemorySegment sliceSegment = segment.getSegment().asSlice(sliceOffsetInBytes, sliceByteLength); LongArray slice = fromSegment(sliceSegment); return slice; } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/ShortArray.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/ShortArray.java index c29df7836f..aa1cfeb2ad 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/ShortArray.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/ShortArray.java @@ -17,10 +17,6 @@ */ package uk.ac.manchester.tornado.api.types.arrays; -import static java.lang.foreign.ValueLayout.JAVA_INT; -import static java.lang.foreign.ValueLayout.JAVA_SHORT; - -import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; import java.nio.ShortBuffer; import java.util.Arrays; @@ -37,7 +33,7 @@ @SegmentElementSize(size = 2) public final class ShortArray extends TornadoNativeArray { private static final int SHORT_BYTES = 2; - private MemorySegment segment; + private TornadoMemorySegment segment; private int numberOfElements; private int arrayHeaderSize; @@ -57,9 +53,7 @@ public ShortArray(int numberOfElements) { assert arrayHeaderSize >= 4; baseIndex = arrayHeaderSize / SHORT_BYTES; segmentByteSize = numberOfElements * SHORT_BYTES + arrayHeaderSize; - - segment = Arena.ofAuto().allocate(segmentByteSize, 1); - segment.setAtIndex(JAVA_INT, 0, numberOfElements); + segment = new TornadoMemorySegment(segmentByteSize, baseIndex, numberOfElements); } /** @@ -120,7 +114,7 @@ public static ShortArray fromSegment(MemorySegment segment) { long byteSize = segment.byteSize(); int numElements = (int) (byteSize / SHORT_BYTES); ShortArray shortArray = new ShortArray(numElements); - MemorySegment.copy(segment, 0, shortArray.segment, shortArray.baseIndex * SHORT_BYTES, byteSize); + MemorySegment.copy(segment, 0, shortArray.segment.getSegment(), shortArray.baseIndex * SHORT_BYTES, byteSize); return shortArray; } @@ -138,6 +132,39 @@ public static ShortArray fromShortBuffer(ShortBuffer buffer) { return shortArray; } + /** + * Factory method to initialize a {@link ShortArray}. This method can be invoked from a Task-Graph. + * + * @param array + * Input Array. + * @param value + * The float value to initialize the {@code ShortArray} instance with. + */ + public static void initialize(ShortArray array, short value) { + for (@Parallel int i = 0; i < array.getSize(); i++) { + array.set(i, value); + } + } + + /** + * Concatenates multiple {@link ShortArray} instances into a single {@link ShortArray}. + * + * @param arrays + * Variable number of {@link ShortArray} objects to be concatenated. + * @return A new {@link ShortArray} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static ShortArray concat(ShortArray... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(ShortArray::getSize).sum(); + ShortArray concatArray = new ShortArray(newSize); + long currentPositionBytes = 0; + for (ShortArray array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + /** * Converts the short data from off-heap to on-heap, by copying the values of a {@link ShortArray} * instance into a new on-heap array. @@ -161,7 +188,7 @@ public short[] toHeapArray() { * The short value to store at the specified index. */ public void set(int index, short value) { - segment.setAtIndex(JAVA_SHORT, baseIndex + index, value); + segment.setAtIndex(index, value, baseIndex); } /** @@ -172,7 +199,7 @@ public void set(int index, short value) { * @return */ public short get(int index) { - return segment.getAtIndex(JAVA_SHORT, baseIndex + index); + return segment.getShortAtIndex(index, baseIndex); } /** @@ -196,7 +223,7 @@ public int getElementSize() { */ public void init(short value) { for (int i = 0; i < getSize(); i++) { - segment.setAtIndex(JAVA_SHORT, baseIndex + i, value); + segment.setAtIndex(i, value, baseIndex); } } @@ -217,7 +244,7 @@ public int getSize() { */ @Override public MemorySegment getSegment() { - return segment.asSlice(TornadoNativeArray.ARRAY_HEADER); + return segment.getSegment().asSlice(TornadoNativeArray.ARRAY_HEADER); } /** @@ -227,7 +254,7 @@ public MemorySegment getSegment() { */ @Override public MemorySegment getSegmentWithHeader() { - return segment; + return segment.getSegment(); } /** @@ -251,39 +278,6 @@ public long getNumBytesOfSegment() { return segmentByteSize - TornadoNativeArray.ARRAY_HEADER; } - /** - * Factory method to initialize a {@link ShortArray}. This method can be invoked from a Task-Graph. - * - * @param array - * Input Array. - * @param value - * The float value to initialize the {@code ShortArray} instance with. - */ - public static void initialize(ShortArray array, short value) { - for (@Parallel int i = 0; i < array.getSize(); i++) { - array.set(i, value); - } - } - - /** - * Concatenates multiple {@link ShortArray} instances into a single {@link ShortArray}. - * - * @param arrays - * Variable number of {@link ShortArray} objects to be concatenated. - * @return A new {@link ShortArray} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static ShortArray concat(ShortArray... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(ShortArray::getSize).sum(); - ShortArray concatArray = new ShortArray(newSize); - long currentPositionBytes = 0; - for (ShortArray array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } - /** * Extracts a slice of elements from a given {@link ShortArray}, creating a new {@link ShortArray} instance. * @@ -302,7 +296,7 @@ public ShortArray slice(int offset, int length) { long sliceOffsetInBytes = TornadoNativeArray.ARRAY_HEADER + offset * SHORT_BYTES; long sliceByteLength = length * SHORT_BYTES; - MemorySegment sliceSegment = segment.asSlice(sliceOffsetInBytes, sliceByteLength); + MemorySegment sliceSegment = segment.getSegment().asSlice(sliceOffsetInBytes, sliceByteLength); ShortArray slice = fromSegment(sliceSegment); return slice; } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/TornadoMemorySegment.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/TornadoMemorySegment.java new file mode 100644 index 0000000000..d81ca6dd8e --- /dev/null +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/TornadoMemorySegment.java @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2024, APT Group, Department of Computer Science, + * The University of Manchester. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package uk.ac.manchester.tornado.api.types.arrays; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.ValueLayout; + +/** + * The {@code TornadoMemorySegment} class provides a high-level interface for managing a + * {@link MemorySegment} with support for different data types. + *

+ * This class allows the allocation of a memory segment with a specific size, and provides + * methods to set and get values of various types at specific indices relative to a base index. + *

+ */ +public class TornadoMemorySegment { + private MemorySegment segment; + private int baseIndex; + + /** + * Constructs a {@code TornadoMemorySegment} with a specified byte size and base index. + *

+ * This constructor allocates a new memory segment of the specified byte size and + * initializes it with a given number of elements. + *

+ * + * @param segmentByteSize + * the size of the memory segment in bytes + * @param baseIndex + * the base index used for calculating the actual index in the memory segment + * @param numElements + * the number of elements to initialize in the segment + */ + public TornadoMemorySegment(long segmentByteSize, int baseIndex, int numElements) { + this.segment = Arena.ofAuto().allocate(segmentByteSize, 1); + this.baseIndex = baseIndex; + segment.setAtIndex(ValueLayout.JAVA_INT, 0, numElements); + } + + /** + * Returns the underlying {@link MemorySegment}. + * + * @return the memory segment + */ + public MemorySegment getSegment() { + return segment; + } + + /** + * Sets a {@code float} value at the specified index. + * + * @param index + * the index where the value will be set + * @param value + * the {@code float} value to set + * @param baseIndex + * the base index used for calculating the actual index + */ + public void setAtIndex(int index, float value, int baseIndex) { + segment.setAtIndex(ValueLayout.JAVA_FLOAT, baseIndex + index, value); + } + + /** + * Returns the {@code float} value at the specified index. + * + * @param index + * the index from which the value will be retrieved + * @param baseIndex + * the base index used for calculating the actual index + * @return the {@code float} value at the specified index + */ + public float getFloatAtIndex(int index, int baseIndex) { + return segment.getAtIndex(ValueLayout.JAVA_FLOAT, baseIndex + index); + } + + /** + * Sets a {@code double} value at the specified index. + * + * @param index + * the index where the value will be set + * @param value + * the {@code double} value to set + * @param baseIndex + * the base index used for calculating the actual index + */ + public void setAtIndex(int index, double value, int baseIndex) { + segment.setAtIndex(ValueLayout.JAVA_DOUBLE, baseIndex + index, value); + } + + /** + * Returns the {@code double} value at the specified index. + * + * @param index + * the index from which the value will be retrieved + * @param baseIndex + * the base index used for calculating the actual index + * @return the {@code double} value at the specified index + */ + public double getDoubleAtIndex(int index, int baseIndex) { + return segment.getAtIndex(ValueLayout.JAVA_DOUBLE, baseIndex + index); + } + + /** + * Sets a {@code byte} value at the specified index. + * + * @param index + * the index where the value will be set + * @param value + * the {@code byte} value to set + * @param baseIndex + * the base index used for calculating the actual index + */ + public void setAtIndex(int index, byte value, int baseIndex) { + segment.setAtIndex(ValueLayout.JAVA_BYTE, baseIndex + index, value); + } + + /** + * Returns the {@code byte} value at the specified index. + * + * @param index + * the index from which the value will be retrieved + * @param baseIndex + * the base index used for calculating the actual index + * @return the {@code byte} value at the specified index + */ + public byte getByteAtIndex(int index, int baseIndex) { + return segment.getAtIndex(ValueLayout.JAVA_BYTE, baseIndex + index); + } + + /** + * Sets a {@code char} value at the specified index. + * + * @param index + * the index where the value will be set + * @param value + * the {@code char} value to set + * @param baseIndex + * the base index used for calculating the actual index + */ + public void setAtIndex(int index, char value, int baseIndex) { + segment.setAtIndex(ValueLayout.JAVA_CHAR, baseIndex + index, value); + } + + /** + * Returns the {@code char} value at the specified index. + * + * @param index + * the index from which the value will be retrieved + * @param baseIndex + * the base index used for calculating the actual index + * @return the {@code char} value at the specified index + */ + public char getCharAtIndex(int index, int baseIndex) { + return segment.getAtIndex(ValueLayout.JAVA_CHAR, baseIndex + index); + } + + /** + * Sets an {@code int} value at the specified index. + * + * @param index + * the index where the value will be set + * @param value + * the {@code int} value to set + * @param baseIndex + * the base index used for calculating the actual index + */ + public void setAtIndex(int index, int value, int baseIndex) { + segment.setAtIndex(ValueLayout.JAVA_INT, baseIndex + index, value); + } + + /** + * Returns the {@code int} value at the specified index. + * + * @param index + * the index from which the value will be retrieved + * @param baseIndex + * the base index used for calculating the actual index + * @return the {@code int} value at the specified index + */ + public int getIntAtIndex(int index, int baseIndex) { + return segment.getAtIndex(ValueLayout.JAVA_INT, baseIndex + index); + } + + /** + * Sets a {@code long} value at the specified index. + * + * @param index + * the index where the value will be set + * @param value + * the {@code long} value to set + * @param baseIndex + * the base index used for calculating the actual index + */ + public void setAtIndex(int index, long value, int baseIndex) { + segment.setAtIndex(ValueLayout.JAVA_LONG, baseIndex + index, value); + } + + /** + * Returns the {@code long} value at the specified index. + * + * @param index + * the index from which the value will be retrieved + * @param baseIndex + * the base index used for calculating the actual index + * @return the {@code long} value at the specified index + */ + public long getLongAtIndex(int index, int baseIndex) { + return segment.getAtIndex(ValueLayout.JAVA_LONG, baseIndex + index); + } + + /** + * Sets a {@code short} value at the specified index. + * + * @param index + * the index where the value will be set + * @param value + * the {@code short} value to set + * @param baseIndex + * the base index used for calculating the actual index + */ + public void setAtIndex(int index, short value, int baseIndex) { + segment.setAtIndex(ValueLayout.JAVA_SHORT, baseIndex + index, value); + } + + /** + * Returns the {@code short} value at the specified index. + * + * @param index + * the index from which the value will be retrieved + * @param baseIndex + * the base index used for calculating the actual index + * @return the {@code short} value at the specified index + */ + public short getShortAtIndex(int index, int baseIndex) { + return segment.getAtIndex(ValueLayout.JAVA_SHORT, baseIndex + index); + } +} diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/TornadoNativeArray.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/TornadoNativeArray.java index 8577c322f1..354e7694fd 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/TornadoNativeArray.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/arrays/TornadoNativeArray.java @@ -41,7 +41,7 @@ public abstract sealed class TornadoNativeArray // LongArray, ShortArray, Tensor { /** - * The size of the header in bytes. The default value is 24, but it can be configurable through + * The size of the header in bytes. The default value is 20, but it can be configurable through * the "tornado.panama.objectHeader" system property. */ public static final long ARRAY_HEADER = Long.parseLong(System.getProperty("tornado.panama.objectHeader", "24")); diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorByte.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorByte.java index 7cc5c48bf9..6041ea5950 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorByte.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorByte.java @@ -17,14 +17,13 @@ */ package uk.ac.manchester.tornado.api.types.tensors; -import uk.ac.manchester.tornado.api.internal.annotations.SegmentElementSize; -import uk.ac.manchester.tornado.api.types.arrays.ByteArray; -import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; - import java.lang.foreign.MemorySegment; import java.util.Arrays; -import static java.lang.foreign.ValueLayout.JAVA_BYTE; +import uk.ac.manchester.tornado.api.internal.annotations.SegmentElementSize; +import uk.ac.manchester.tornado.api.types.arrays.ByteArray; +import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; +import uk.ac.manchester.tornado.api.types.tensors.Shape; @SegmentElementSize(size = 1) public final class TensorByte extends Tensor { @@ -55,14 +54,33 @@ public TensorByte(Shape shape) { this.tensorStorage = new ByteArray(numberOfElements); } + /** + * Concatenates multiple {@link TensorByte} instances into a single {@link TensorByte}. + * + * @param arrays + * Variable number of {@link TensorByte} objects to be concatenated. + * @return A new {@link TensorByte} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static TensorByte concat(TensorByte... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(TensorByte::getSize).sum(); + TensorByte concatArray = new TensorByte(new Shape(newSize)); + long currentPositionBytes = 0; + for (TensorByte array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + public void init(byte value) { for (int i = 0; i < getSize(); i++) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_BYTE, getBaseIndex() + i, value); + tensorStorage.set(i, value); } } public void set(int index, byte value) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_BYTE, getBaseIndex() + index, value); + tensorStorage.set(index, value); } private long getBaseIndex() { @@ -77,7 +95,7 @@ private long getBaseIndex() { * @return */ public byte get(int index) { - return tensorStorage.getSegmentWithHeader().getAtIndex(JAVA_BYTE, getBaseIndex() + index); + return tensorStorage.get(index); } @Override @@ -129,23 +147,4 @@ public String getDTypeAsString() { public DType getDType() { return dType; } - - /** - * Concatenates multiple {@link TensorByte} instances into a single {@link TensorByte}. - * - * @param arrays - * Variable number of {@link TensorByte} objects to be concatenated. - * @return A new {@link TensorByte} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static TensorByte concat(TensorByte... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(TensorByte::getSize).sum(); - TensorByte concatArray = new TensorByte(new Shape(newSize)); - long currentPositionBytes = 0; - for (TensorByte array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorFP16.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorFP16.java index 6cb90356c4..fbce7588e7 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorFP16.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorFP16.java @@ -17,16 +17,15 @@ */ package uk.ac.manchester.tornado.api.types.tensors; +import java.lang.foreign.MemorySegment; +import java.util.Arrays; + import uk.ac.manchester.tornado.api.annotations.Parallel; import uk.ac.manchester.tornado.api.internal.annotations.SegmentElementSize; import uk.ac.manchester.tornado.api.types.HalfFloat; import uk.ac.manchester.tornado.api.types.arrays.HalfFloatArray; import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; - -import java.lang.foreign.MemorySegment; -import java.util.Arrays; - -import static java.lang.foreign.ValueLayout.JAVA_SHORT; +import uk.ac.manchester.tornado.api.types.tensors.Shape; @SegmentElementSize(size = 2) public final class TensorFP16 extends Tensor { @@ -56,14 +55,39 @@ public TensorFP16(Shape shape) { this.tensorStorage = new HalfFloatArray(numberOfElements); } + public static void initialize(TensorFP16 tensor, HalfFloat value) { + for (@Parallel int i = 0; i < tensor.getSize(); i++) { + tensor.set(i, value); + } + } + + /** + * Concatenates multiple {@link TensorFP16} instances into a single {@link TensorFP16}. + * + * @param arrays + * Variable number of {@link TensorFP16} objects to be concatenated. + * @return A new {@link TensorFP16} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static TensorFP16 concat(TensorFP16... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(TensorFP16::getSize).sum(); + TensorFP16 concatArray = new TensorFP16(new Shape(newSize)); + long currentPositionBytes = 0; + for (TensorFP16 array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + public void init(HalfFloat value) { for (int i = 0; i < getSize(); i++) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_SHORT, getBaseIndex() + i, value.getHalfFloatValue()); + tensorStorage.set(i, value); } } public void set(int index, HalfFloat value) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_SHORT, getBaseIndex() + index, value.getHalfFloatValue()); + tensorStorage.set(index, value); } private long getBaseIndex() { @@ -78,7 +102,7 @@ private long getBaseIndex() { * @return */ public HalfFloat get(int index) { - short halfFloatValue = tensorStorage.getSegmentWithHeader().getAtIndex(JAVA_SHORT, getBaseIndex() + index); + short halfFloatValue = tensorStorage.get(index).getHalfFloatValue(); return new HalfFloat(halfFloatValue); } @@ -131,29 +155,4 @@ public String getDTypeAsString() { public DType getDType() { return dType; } - - public static void initialize(TensorFP16 tensor, HalfFloat value) { - for (@Parallel int i = 0; i < tensor.getSize(); i++) { - tensor.set(i, value); - } - } - - /** - * Concatenates multiple {@link TensorFP16} instances into a single {@link TensorFP16}. - * - * @param arrays - * Variable number of {@link TensorFP16} objects to be concatenated. - * @return A new {@link TensorFP16} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static TensorFP16 concat(TensorFP16... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(TensorFP16::getSize).sum(); - TensorFP16 concatArray = new TensorFP16(new Shape(newSize)); - long currentPositionBytes = 0; - for (TensorFP16 array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorFP32.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorFP32.java index ca5616500b..23f4d17fed 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorFP32.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorFP32.java @@ -17,16 +17,15 @@ */ package uk.ac.manchester.tornado.api.types.tensors; -import uk.ac.manchester.tornado.api.annotations.Parallel; -import uk.ac.manchester.tornado.api.internal.annotations.SegmentElementSize; -import uk.ac.manchester.tornado.api.types.arrays.FloatArray; -import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; - import java.lang.foreign.MemorySegment; import java.nio.FloatBuffer; import java.util.Arrays; -import static java.lang.foreign.ValueLayout.JAVA_FLOAT; +import uk.ac.manchester.tornado.api.annotations.Parallel; +import uk.ac.manchester.tornado.api.internal.annotations.SegmentElementSize; +import uk.ac.manchester.tornado.api.types.arrays.FloatArray; +import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; +import uk.ac.manchester.tornado.api.types.tensors.Shape; @SegmentElementSize(size = 4) public final class TensorFP32 extends Tensor { @@ -57,14 +56,39 @@ public TensorFP32(Shape shape) { this.tensorStorage = new FloatArray(numberOfElements); } + public static void initialize(TensorFP32 tensor, short value) { + for (@Parallel int i = 0; i < tensor.getSize(); i++) { + tensor.set(i, value); + } + } + + /** + * Concatenates multiple {@link TensorFP32} instances into a single {@link TensorFP32}. + * + * @param arrays + * Variable number of {@link TensorFP32} objects to be concatenated. + * @return A new {@link TensorFP32} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static TensorFP32 concat(TensorFP32... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(TensorFP32::getSize).sum(); + TensorFP32 concatArray = new TensorFP32(new Shape(newSize)); + long currentPositionBytes = 0; + for (TensorFP32 array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + public void init(float value) { for (int i = 0; i < getSize(); i++) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_FLOAT, getBaseIndex() + i, value); + tensorStorage.set(i, value); } } public void set(int index, float value) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_FLOAT, getBaseIndex() + index, value); + tensorStorage.set(index, value); } private long getBaseIndex() { @@ -79,7 +103,7 @@ private long getBaseIndex() { * @return */ public float get(int index) { - return tensorStorage.getSegmentWithHeader().getAtIndex(JAVA_FLOAT, getBaseIndex() + index); + return tensorStorage.get(index); } @Override @@ -143,29 +167,4 @@ public float[] toHeapArray() { public FloatBuffer getFloatBuffer() { return getSegment().asByteBuffer().asFloatBuffer(); } - - public static void initialize(TensorFP32 tensor, short value) { - for (@Parallel int i = 0; i < tensor.getSize(); i++) { - tensor.set(i, value); - } - } - - /** - * Concatenates multiple {@link TensorFP32} instances into a single {@link TensorFP32}. - * - * @param arrays - * Variable number of {@link TensorFP32} objects to be concatenated. - * @return A new {@link TensorFP32} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static TensorFP32 concat(TensorFP32... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(TensorFP32::getSize).sum(); - TensorFP32 concatArray = new TensorFP32(new Shape(newSize)); - long currentPositionBytes = 0; - for (TensorFP32 array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorFP64.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorFP64.java index ef2022ae10..f75a74b95a 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorFP64.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorFP64.java @@ -17,16 +17,15 @@ */ package uk.ac.manchester.tornado.api.types.tensors; -import uk.ac.manchester.tornado.api.annotations.Parallel; -import uk.ac.manchester.tornado.api.internal.annotations.SegmentElementSize; -import uk.ac.manchester.tornado.api.types.arrays.DoubleArray; -import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; - import java.lang.foreign.MemorySegment; import java.nio.DoubleBuffer; import java.util.Arrays; -import static java.lang.foreign.ValueLayout.JAVA_DOUBLE; +import uk.ac.manchester.tornado.api.annotations.Parallel; +import uk.ac.manchester.tornado.api.internal.annotations.SegmentElementSize; +import uk.ac.manchester.tornado.api.types.arrays.DoubleArray; +import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; +import uk.ac.manchester.tornado.api.types.tensors.Shape; @SegmentElementSize(size = 8) public final class TensorFP64 extends Tensor { @@ -57,14 +56,39 @@ public TensorFP64(Shape shape) { this.tensorStorage = new DoubleArray(numberOfElements); } + public static void initialize(TensorFP64 tensor, short value) { + for (@Parallel int i = 0; i < tensor.getSize(); i++) { + tensor.set(i, value); + } + } + + /** + * Concatenates multiple {@link TensorFP64} instances into a single {@link TensorFP64}. + * + * @param arrays + * Variable number of {@link TensorFP64} objects to be concatenated. + * @return A new {@link TensorFP64} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static TensorFP64 concat(TensorFP64... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(TensorFP64::getSize).sum(); + TensorFP64 concatArray = new TensorFP64(new Shape(newSize)); + long currentPositionBytes = 0; + for (TensorFP64 array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + public void init(double value) { for (int i = 0; i < getSize(); i++) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_DOUBLE, getBaseIndex() + i, value); + tensorStorage.set(i, value); } } public void set(int index, double value) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_DOUBLE, getBaseIndex() + index, value); + tensorStorage.set(index, value); } private long getBaseIndex() { @@ -79,7 +103,7 @@ private long getBaseIndex() { * @return */ public double get(int index) { - return tensorStorage.getSegmentWithHeader().getAtIndex(JAVA_DOUBLE, getBaseIndex() + index); + return tensorStorage.get(index); } @Override @@ -135,29 +159,4 @@ public DType getDType() { public DoubleBuffer getDoubleBuffer() { return getSegment().asByteBuffer().asDoubleBuffer(); } - - public static void initialize(TensorFP64 tensor, short value) { - for (@Parallel int i = 0; i < tensor.getSize(); i++) { - tensor.set(i, value); - } - } - - /** - * Concatenates multiple {@link TensorFP64} instances into a single {@link TensorFP64}. - * - * @param arrays - * Variable number of {@link TensorFP64} objects to be concatenated. - * @return A new {@link TensorFP64} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static TensorFP64 concat(TensorFP64... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(TensorFP64::getSize).sum(); - TensorFP64 concatArray = new TensorFP64(new Shape(newSize)); - long currentPositionBytes = 0; - for (TensorFP64 array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorInt16.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorInt16.java index 7d135e5c6c..3206cc90ac 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorInt16.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorInt16.java @@ -17,17 +17,16 @@ */ package uk.ac.manchester.tornado.api.types.tensors; +import java.lang.foreign.MemorySegment; +import java.nio.ShortBuffer; +import java.util.Arrays; + import uk.ac.manchester.tornado.api.annotations.Parallel; import uk.ac.manchester.tornado.api.internal.annotations.SegmentElementSize; import uk.ac.manchester.tornado.api.types.arrays.HalfFloatArray; import uk.ac.manchester.tornado.api.types.arrays.ShortArray; import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; - -import java.lang.foreign.MemorySegment; -import java.nio.ShortBuffer; -import java.util.Arrays; - -import static java.lang.foreign.ValueLayout.JAVA_SHORT; +import uk.ac.manchester.tornado.api.types.tensors.Shape; @SegmentElementSize(size = 2) public final class TensorInt16 extends Tensor { @@ -58,14 +57,39 @@ public TensorInt16(Shape shape) { this.tensorStorage = new ShortArray(numberOfElements); } + public static void initialize(TensorInt16 tensor, short value) { + for (@Parallel int i = 0; i < tensor.getSize(); i++) { + tensor.set(i, value); + } + } + + /** + * Concatenates multiple {@link TensorInt16} instances into a single {@link TensorInt16}. + * + * @param arrays + * Variable number of {@link TensorInt16} objects to be concatenated. + * @return A new {@link TensorInt16} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static TensorInt16 concat(TensorInt16... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(TensorInt16::getSize).sum(); + TensorInt16 concatArray = new TensorInt16(new Shape(newSize)); + long currentPositionBytes = 0; + for (TensorInt16 array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + public void init(short value) { for (int i = 0; i < getSize(); i++) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_SHORT, getBaseIndex() + i, value); + tensorStorage.set(i, value); } } public void set(int index, short value) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_SHORT, getBaseIndex() + index, value); + tensorStorage.set(index, value); } private long getBaseIndex() { @@ -80,7 +104,7 @@ private long getBaseIndex() { * @return */ public short get(int index) { - return tensorStorage.getSegmentWithHeader().getAtIndex(JAVA_SHORT, getBaseIndex() + index); + return tensorStorage.get(index); } @Override @@ -136,29 +160,4 @@ public DType getDType() { public ShortBuffer getShortBuffer() { return getSegment().asByteBuffer().asShortBuffer(); } - - public static void initialize(TensorInt16 tensor, short value) { - for (@Parallel int i = 0; i < tensor.getSize(); i++) { - tensor.set(i, value); - } - } - - /** - * Concatenates multiple {@link TensorInt16} instances into a single {@link TensorInt16}. - * - * @param arrays - * Variable number of {@link TensorInt16} objects to be concatenated. - * @return A new {@link TensorInt16} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static TensorInt16 concat(TensorInt16... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(TensorInt16::getSize).sum(); - TensorInt16 concatArray = new TensorInt16(new Shape(newSize)); - long currentPositionBytes = 0; - for (TensorInt16 array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorInt32.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorInt32.java index 9f67dd0f0b..10dae979af 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorInt32.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorInt32.java @@ -17,17 +17,16 @@ */ package uk.ac.manchester.tornado.api.types.tensors; +import java.lang.foreign.MemorySegment; +import java.nio.IntBuffer; +import java.util.Arrays; + import uk.ac.manchester.tornado.api.annotations.Parallel; import uk.ac.manchester.tornado.api.internal.annotations.SegmentElementSize; import uk.ac.manchester.tornado.api.types.arrays.HalfFloatArray; import uk.ac.manchester.tornado.api.types.arrays.IntArray; import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; - -import java.lang.foreign.MemorySegment; -import java.nio.IntBuffer; -import java.util.Arrays; - -import static java.lang.foreign.ValueLayout.JAVA_INT; +import uk.ac.manchester.tornado.api.types.tensors.Shape; @SegmentElementSize(size = 4) @@ -58,14 +57,39 @@ public TensorInt32(Shape shape) { this.tensorStorage = new IntArray(numberOfElements); } + public static void initialize(TensorInt32 tensor, int value) { + for (@Parallel int i = 0; i < tensor.getSize(); i++) { + tensor.set(i, value); + } + } + + /** + * Concatenates multiple {@link TensorInt32} instances into a single {@link TensorInt32}. + * + * @param arrays + * Variable number of {@link TensorInt32} objects to be concatenated. + * @return A new {@link TensorInt32} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static TensorInt32 concat(TensorInt32... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(TensorInt32::getSize).sum(); + TensorInt32 concatArray = new TensorInt32(new Shape(newSize)); + long currentPositionBytes = 0; + for (TensorInt32 array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + public void init(int value) { for (int i = 0; i < getSize(); i++) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_INT, getBaseIndex() + i, value); + tensorStorage.set(i, value); } } public void set(int index, int value) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_INT, getBaseIndex() + index, value); + tensorStorage.set(index, value); } private long getBaseIndex() { @@ -80,7 +104,7 @@ private long getBaseIndex() { * @return */ public int get(int index) { - return tensorStorage.getSegmentWithHeader().getAtIndex(JAVA_INT, getBaseIndex() + index); + return tensorStorage.get(index); } @Override @@ -136,29 +160,4 @@ public DType getDType() { public IntBuffer getIntBuffer() { return getSegment().asByteBuffer().asIntBuffer(); } - - public static void initialize(TensorInt32 tensor, int value) { - for (@Parallel int i = 0; i < tensor.getSize(); i++) { - tensor.set(i, value); - } - } - - /** - * Concatenates multiple {@link TensorInt32} instances into a single {@link TensorInt32}. - * - * @param arrays - * Variable number of {@link TensorInt32} objects to be concatenated. - * @return A new {@link TensorInt32} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static TensorInt32 concat(TensorInt32... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(TensorInt32::getSize).sum(); - TensorInt32 concatArray = new TensorInt32(new Shape(newSize)); - long currentPositionBytes = 0; - for (TensorInt32 array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } } diff --git a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorInt64.java b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorInt64.java index 63c61adf57..0b615ca127 100644 --- a/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorInt64.java +++ b/tornado-api/src/main/java/uk/ac/manchester/tornado/api/types/tensors/TensorInt64.java @@ -17,17 +17,16 @@ */ package uk.ac.manchester.tornado.api.types.tensors; +import java.lang.foreign.MemorySegment; +import java.nio.LongBuffer; +import java.util.Arrays; + import uk.ac.manchester.tornado.api.annotations.Parallel; import uk.ac.manchester.tornado.api.internal.annotations.SegmentElementSize; import uk.ac.manchester.tornado.api.types.arrays.HalfFloatArray; import uk.ac.manchester.tornado.api.types.arrays.LongArray; import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; - -import java.lang.foreign.MemorySegment; -import java.nio.LongBuffer; -import java.util.Arrays; - -import static java.lang.foreign.ValueLayout.JAVA_LONG; +import uk.ac.manchester.tornado.api.types.tensors.Shape; @SegmentElementSize(size = 8) public final class TensorInt64 extends Tensor { @@ -57,14 +56,39 @@ public TensorInt64(Shape shape) { this.tensorStorage = new LongArray(numberOfElements); } + public static void initialize(TensorInt64 tensor, long value) { + for (@Parallel int i = 0; i < tensor.getSize(); i++) { + tensor.set(i, value); + } + } + + /** + * Concatenates multiple {@link TensorInt64} instances into a single {@link TensorInt64}. + * + * @param arrays + * Variable number of {@link TensorInt64} objects to be concatenated. + * @return A new {@link TensorInt64} instance containing all the elements of the input arrays, + * concatenated in the order they were provided. + */ + public static TensorInt64 concat(TensorInt64... arrays) { + int newSize = Arrays.stream(arrays).mapToInt(TensorInt64::getSize).sum(); + TensorInt64 concatArray = new TensorInt64(new Shape(newSize)); + long currentPositionBytes = 0; + for (TensorInt64 array : arrays) { + MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); + currentPositionBytes += array.getNumBytesOfSegment(); + } + return concatArray; + } + public void init(long value) { for (int i = 0; i < getSize(); i++) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_LONG, getBaseIndex() + i, value); + tensorStorage.set(i, value); } } public void set(int index, long value) { - tensorStorage.getSegmentWithHeader().setAtIndex(JAVA_LONG, getBaseIndex() + index, value); + tensorStorage.set(index, value); } private long getBaseIndex() { @@ -79,7 +103,7 @@ private long getBaseIndex() { * @return */ public long get(int index) { - return tensorStorage.getSegmentWithHeader().getAtIndex(JAVA_LONG, getBaseIndex() + index); + return tensorStorage.get(index); } @Override @@ -135,29 +159,4 @@ public DType getDType() { public LongBuffer getLongBuffer() { return getSegment().asByteBuffer().asLongBuffer(); } - - public static void initialize(TensorInt64 tensor, long value) { - for (@Parallel int i = 0; i < tensor.getSize(); i++) { - tensor.set(i, value); - } - } - - /** - * Concatenates multiple {@link TensorInt64} instances into a single {@link TensorInt64}. - * - * @param arrays - * Variable number of {@link TensorInt64} objects to be concatenated. - * @return A new {@link TensorInt64} instance containing all the elements of the input arrays, - * concatenated in the order they were provided. - */ - public static TensorInt64 concat(TensorInt64... arrays) { - int newSize = Arrays.stream(arrays).mapToInt(TensorInt64::getSize).sum(); - TensorInt64 concatArray = new TensorInt64(new Shape(newSize)); - long currentPositionBytes = 0; - for (TensorInt64 array : arrays) { - MemorySegment.copy(array.getSegment(), 0, concatArray.getSegment(), currentPositionBytes, array.getNumBytesOfSegment()); - currentPositionBytes += array.getNumBytesOfSegment(); - } - return concatArray; - } } diff --git a/tornado-assembly/src/bin/tornado b/tornado-assembly/src/bin/tornado index 7f1c0837c0..81fe595fac 100755 --- a/tornado-assembly/src/bin/tornado +++ b/tornado-assembly/src/bin/tornado @@ -32,8 +32,8 @@ from pathlib import Path __TORNADOVM_DEBUG__ = " -Dtornado.debug=True " __TORNADOVM_FULLDEBUG__ = __TORNADOVM_DEBUG__ + "-Dtornado.fullDebug=True -Ddump.taskgraph=True " __TORNADOVM_THREAD_INFO__ = " -Dtornado.threadInfo=True " -__TORNADOVM_IGV__ = " -Dgraal.Dump=*:5 -Dgraal.PrintGraph=Network -Dgraal.PrintBackendCFG=true " -__TORNADOVM__IGV_LOW_TIER = " -Dgraal.Dump=*:1 -Dgraal.PrintGraph=Network -Dgraal.PrintBackendCFG=true -Dtornado.debug.lowtier=True " +__TORNADOVM_IGV__ = " -Djdk.graal.Dump=*:5 -Djdk.graal.PrintGraph=Network -Djdk.graal.PrintBackendCFG=true " +__TORNADOVM__IGV_LOW_TIER = " -Djdk.graal.Dump=*:1 -Djdk.graal.PrintGraph=Network -Djdk.graal.PrintBackendCFG=true -Dtornado.debug.lowtier=True " __TORNADOVM_PRINT_KERNEL__ = " -Dtornado.print.kernel=True " __TORNADOVM_PRINT_BC__ = " -Dtornado.print.bytecodes=True " __TORNADOVM_DUMP_PROFILER__ = " -Dtornado.profiler=True -Dtornado.log.profiler=True -Dtornado.profiler.dump.dir=" @@ -66,8 +66,7 @@ __OPENCL_MODULE__ = "tornado.drivers.opencl" # ######################################################## # JAVA FLAGS # ######################################################## -__JAVA_GC_JDK11__ = "-XX:+UseParallelOldGC -XX:-UseBiasedLocking " -__JAVA_GC_JDK16__ = "-XX:+UseParallelGC " +__JAVA_GC__ = "-XX:+UseParallelGC " __JAVA_BASE_OPTIONS__ = "-server -XX:-UseCompressedOops -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseCompressedClassPointers --enable-preview " __TRUFFLE_BASE_OPTIONS__ = "--jvm --polyglot --vm.XX:-UseCompressedOops --vm.XX:+UnlockExperimentalVMOptions --vm.XX:+EnableJVMCI --vm.XX:-UseCompressedClassPointers --enable-preview " @@ -160,13 +159,10 @@ class TornadoVMRunnerTool(): sys.exit(0) def checkCompatibilityWithTornadoVM(self): - if (self.java_version == 9 or self.java_version == 10): - print("TornadoVM does not support Java 9 and 10") + if (self.java_version < 23): + print("TornadoVM does not support Java versions before") sys.exit(0) - if (self.java_version == 8): - print("[WARNING] TornadoVM using Java 8 is deprecated.") - def printRelease(self): f = open(self.sdk + "/etc/tornado.release") releaseVersion = f.read() @@ -307,42 +303,37 @@ class TornadoVMRunnerTool(): javaFlags = javaFlags + tornadoFlags + __TORNADOVM_PROVIDERS__ + " " - if (self.java_version == 8): - javaFlags = javaFlags + " -XX:-UseJVMCIClassLoader " - else: - upgradeModulePath = "--upgrade-module-path " + self.sdk + "/share/java/graalJars " + upgradeModulePath = "--upgrade-module-path " + self.sdk + "/share/java/graalJars " - if (self.isGraalVM == False): - javaFlags = javaFlags + upgradeModulePath + if (self.isGraalVM == False): + javaFlags = javaFlags + upgradeModulePath - if (self.java_version >= 16): - javaFlags = javaFlags + __JAVA_GC_JDK16__ - else: - javaFlags = javaFlags + __JAVA_GC_JDK11__ - - common = self.sdk + __COMMON_EXPORTS__ - opencl = self.sdk + __OPENCL_EXPORTS__ - ptx = self.sdk + __PTX_EXPORTS__ - spirv = self.sdk + __SPIRV_EXPORTS__ - - if (self.isTruffleCommand): - common = self.truffleCompatibleExports(common) - opencl = self.truffleCompatibleExports(opencl) - ptx = self.truffleCompatibleExports(ptx) - spirv = self.truffleCompatibleExports(spirv) - - javaFlags = javaFlags + " @" + common + " " - if ("opencl-backend" in self.listOfBackends): - javaFlags = javaFlags + "@" + opencl + " " - tornadoAddModules = tornadoAddModules + "," + __OPENCL_MODULE__ - if ("spirv-backend" in self.listOfBackends): - javaFlags = javaFlags + "@" + opencl + " @" + spirv + " " - tornadoAddModules = tornadoAddModules + "," + __OPENCL_MODULE__ - if ("ptx-backend" in self.listOfBackends): - javaFlags = javaFlags + "@" + ptx + " " - tornadoAddModules = tornadoAddModules + "," + __PTX_MODULE__ - - javaFlags = javaFlags + tornadoAddModules + " " + javaFlags = javaFlags + __JAVA_GC__ + + + common = self.sdk + __COMMON_EXPORTS__ + opencl = self.sdk + __OPENCL_EXPORTS__ + ptx = self.sdk + __PTX_EXPORTS__ + spirv = self.sdk + __SPIRV_EXPORTS__ + + if (self.isTruffleCommand): + common = self.truffleCompatibleExports(common) + opencl = self.truffleCompatibleExports(opencl) + ptx = self.truffleCompatibleExports(ptx) + spirv = self.truffleCompatibleExports(spirv) + + javaFlags = javaFlags + " @" + common + " " + if ("opencl-backend" in self.listOfBackends): + javaFlags = javaFlags + "@" + opencl + " " + tornadoAddModules = tornadoAddModules + "," + __OPENCL_MODULE__ + if ("spirv-backend" in self.listOfBackends): + javaFlags = javaFlags + "@" + opencl + " @" + spirv + " " + tornadoAddModules = tornadoAddModules + "," + __OPENCL_MODULE__ + if ("ptx-backend" in self.listOfBackends): + javaFlags = javaFlags + "@" + ptx + " " + tornadoAddModules = tornadoAddModules + "," + __PTX_MODULE__ + + javaFlags = javaFlags + tornadoAddModules + " " if (args.jvm_options != None): javaFlags = javaFlags + args.jvm_options + " " diff --git a/tornado-assembly/src/etc/exportLists/common-exports b/tornado-assembly/src/etc/exportLists/common-exports index b3a5796995..b65a414e6f 100644 --- a/tornado-assembly/src/etc/exportLists/common-exports +++ b/tornado-assembly/src/etc/exportLists/common-exports @@ -21,78 +21,88 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.cfg=tornado.runtime ---add-exports jdk.internal.vm.ci/jdk.vm.ci.common=jdk.internal.vm.compiler ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.meta=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir=tornado.runtime,tornado.drivers.common ---add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.runtime,tornado.annotation,tornado.drivers.common,jdk.internal.vm.compiler ---add-exports jdk.internal.vm.ci/jdk.vm.ci.code=tornado.runtime,tornado.drivers.common,jdk.internal.vm.compiler ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph.spi=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.gen=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodeinfo=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.runtime,tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.spi=tornado.runtime,tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.api.runtime=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.code=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common=tornado.runtime,tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.target=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.debug=tornado.runtime,tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.hotspot=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.java=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.asm=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases=tornado.runtime,tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.printer=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.runtime=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.cfg=tornado.runtime +--add-exports jdk.internal.vm.ci/jdk.vm.ci.common=jdk.graal.compiler +--add-exports jdk.graal.compiler/jdk.graal.compiler.hotspot.meta=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir=tornado.runtime,tornado.drivers.common +--add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.runtime,tornado.annotation,tornado.drivers.common,jdk.graal.compiler +--add-exports jdk.internal.vm.ci/jdk.vm.ci.code=tornado.runtime,tornado.drivers.common,jdk.graal.compiler +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph.spi=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.gen=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.runtime,tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.runtime,tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.api.runtime=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.code=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.core=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.runtime,tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.target=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.debug=tornado.runtime,tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.java=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.asm=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.graphbuilderconf=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.options=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.constopt=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.target=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.debug=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.options=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases=tornado.runtime,tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.printer=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.runtime=tornado.runtime --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.bytecode=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.spi=tornado.runtime,tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.api.replacements=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.replacements=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.phases=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.type=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining.info=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining.policy=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining.walker=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory=tornado.runtime,tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.virtual=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.constopt=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.bytecode=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.spi=tornado.runtime,tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.api.replacements=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.replacements=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.phases=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.type=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining.info=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining.policy=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining.walker=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.memory=tornado.runtime,tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.virtual=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.constopt=tornado.runtime --add-opens jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.runtime --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.gc=tornado.runtime,tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory.address=tornado.runtime,tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.replacements.nodes=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.word=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.framemap=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.alloc=tornado.runtime ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.memory=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.runtime,tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.virtual=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.drivers.common ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.gc=tornado.runtime,tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.memory.address=tornado.runtime,tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.replacements.nodes=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.word=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.alloc=tornado.runtime +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.memory=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph=tornado.runtime,tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.options=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.virtual=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.drivers.common +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.drivers.common +--add-exports java.base/jdk.internal.foreign=tornado.drivers.opencl diff --git a/tornado-assembly/src/etc/exportLists/opencl-exports b/tornado-assembly/src/etc/exportLists/opencl-exports index 2a6744d1e9..5136854451 100644 --- a/tornado-assembly/src/etc/exportLists/opencl-exports +++ b/tornado-assembly/src/etc/exportLists/opencl-exports @@ -24,68 +24,69 @@ --add-opens java.base/java.lang=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.common=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.meta=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.replacements.classfile=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.alloc=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.cfg=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.framemap=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.hotspot.meta=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.replacements.classfile=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.alloc=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.cfg=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph.spi=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.gen=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodeinfo=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.spi=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.code=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.debug=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.hotspot=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.java=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.asm=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.printer=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph.spi=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.gen=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.code=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.core=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.debug=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.java=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.asm=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.graphbuilderconf=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.options=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.printer=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.bytecode=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.spi=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.api.replacements=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.replacements=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.phases=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.type=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.bytecode=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.spi=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.api.replacements=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.replacements=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.phases=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.type=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.memory=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.drivers.opencl --add-opens jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.opencl --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.asm=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.cfg=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.schedule=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.virtual.phases.ea=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.ssa=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.calc=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.gen=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.match=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory.address=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.type=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.word=tornado.drivers.opencl ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.memory=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.asm=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.cfg=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.schedule=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.virtual.phases.ea=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.ssa=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.calc=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.gen=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.match=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.memory.address=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.type=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.word=tornado.drivers.opencl +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.memory=tornado.drivers.opencl +--add-exports java.base/jdk.internal.foreign=tornado.drivers.opencl diff --git a/tornado-assembly/src/etc/exportLists/ptx-exports b/tornado-assembly/src/etc/exportLists/ptx-exports index 5d787aac8c..27fccce481 100644 --- a/tornado-assembly/src/etc/exportLists/ptx-exports +++ b/tornado-assembly/src/etc/exportLists/ptx-exports @@ -24,68 +24,68 @@ --add-opens java.base/java.lang=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.common=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.meta=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.replacements.classfile=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.alloc=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.cfg=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.framemap=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.hotspot.meta=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.replacements.classfile=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.alloc=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.cfg=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph.spi=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.gen=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodeinfo=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.spi=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.code=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.debug=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.hotspot=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.java=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.asm=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.printer=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph.spi=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.gen=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.code=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.core=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.debug=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.java=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.asm=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.graphbuilderconf=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.options=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.printer=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.bytecode=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.spi=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.api.replacements=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.replacements=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.phases=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.type=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.bytecode=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.spi=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.api.replacements=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.replacements=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.phases=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.type=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.memory=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.drivers.ptx --add-opens jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.ptx --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.asm=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.cfg=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.schedule=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.virtual.phases.ea=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.ssa=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.calc=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.gen=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.match=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory.address=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.type=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.word=tornado.drivers.ptx ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.memory=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.asm=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.cfg=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.schedule=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.virtual.phases.ea=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.ssa=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.calc=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.gen=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.match=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.memory.address=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.type=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.word=tornado.drivers.ptx +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.memory=tornado.drivers.ptx diff --git a/tornado-assembly/src/etc/exportLists/spirv-exports b/tornado-assembly/src/etc/exportLists/spirv-exports index f965d1a3ca..da32aa95f8 100644 --- a/tornado-assembly/src/etc/exportLists/spirv-exports +++ b/tornado-assembly/src/etc/exportLists/spirv-exports @@ -24,68 +24,68 @@ --add-opens java.base/java.lang=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.common=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.hotspot.meta=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.replacements.classfile=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.alloc=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.util=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.cfg=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.framemap=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.hotspot.meta=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.replacements.classfile=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.alloc=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.util=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.cfg=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.framemap=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph.spi=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.gen=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodeinfo=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.spi=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.code=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.debug=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.hotspot=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.java=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.asm=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.phases=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.options=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.tiers=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.util=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.printer=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph.spi=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.gen=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodeinfo=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.calc=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.spi=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.code=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.core=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.debug=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.hotspot=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.java=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.asm=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.phases=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.graphbuilderconf=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.options=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.tiers=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.util=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.printer=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.graph.iterators=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.java=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.bytecode=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.spi=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.api.replacements=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.replacements=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.inlining=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.phases=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.type=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.extended=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.loop=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.loop.phases=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.debug=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.util=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.graph.iterators=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.java=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.bytecode=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.spi=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.api.replacements=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.replacements=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.inlining=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.phases=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.type=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.extended=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.loop=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.loop.phases=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.debug=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.memory=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.util=tornado.drivers.spirv --add-opens jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.spirv --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.asm=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.cfg=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.schedule=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.virtual.phases.ea=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.lir.ssa=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.calc=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.gen=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.match=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.memory.address=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.nodes.type=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.common.util=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.phases.graph=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.word=tornado.drivers.spirv ---add-exports jdk.internal.vm.compiler/org.graalvm.compiler.core.common.memory=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.asm=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.cfg=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.schedule=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.virtual.phases.ea=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.lir.ssa=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.calc=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.gen=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.match=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.memory.address=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.nodes.type=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.common.util=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.phases.graph=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.word=tornado.drivers.spirv +--add-exports jdk.graal.compiler/jdk.graal.compiler.core.common.memory=tornado.drivers.spirv diff --git a/tornado-assembly/src/examples/generated/virtualDevice/virtualDeviceKernelGPU.cl b/tornado-assembly/src/examples/generated/virtualDevice/virtualDeviceKernelGPU.cl index bc167f67c5..9a72c3e06e 100644 --- a/tornado-assembly/src/examples/generated/virtualDevice/virtualDeviceKernelGPU.cl +++ b/tornado-assembly/src/examples/generated/virtualDevice/virtualDeviceKernelGPU.cl @@ -3,11 +3,11 @@ #pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable __kernel void maxReduction(__global long *_kernel_context, __constant uchar *_constant_region, __local uchar *_local_region, __global int *_atomics, __global uchar *input, __global uchar *result) { - float f_12, f_19, f_22, f_21, f_26; - ulong ul_11, ul_0, ul_32, ul_1; + float f_26, f_12, f_21, f_22, f_19; bool b_18, b_25; - long l_31, l_29, l_30, l_9, l_10, l_8; - int i_27, i_28, i_23, i_24, i_20, i_14, i_15, i_16, i_17, i_13, i_6, i_7, i_3, i_4, i_5, i_33; + int i_27, i_28, i_23, i_24, i_5, i_6, i_3, i_4, i_33, i_13, i_14, i_7, i_20, i_17, i_15, i_16; + ulong ul_11, ul_0, ul_32, ul_1; + long l_10, l_9, l_8, l_31, l_30, l_29; // BLOCK 0 ul_0 = (ulong) input; @@ -89,8 +89,8 @@ __kernel void maxReduction(__global long *_kernel_context, __constant uchar *_co #pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable __kernel void rMax(__global long *_kernel_context, __constant uchar *_constant_region, __local uchar *_local_region, __global int *_atomics, __global uchar *array, __private int size) { - float f_2, f_4, f_6, f_8, f_10, f_12, f_14, f_16, f_18, f_20, f_19, f_22, f_21, f_24, f_23, f_26, f_25; - ulong ul_7, ul_9, ul_11, ul_13, ul_15, ul_0, ul_1, ul_17, ul_3, ul_5; + float f_25, f_26, f_21, f_22, f_23, f_24, f_2, f_4, f_10, f_12, f_6, f_8, f_18, f_19, f_20, f_14, f_16; + ulong ul_11, ul_9, ul_15, ul_13, ul_3, ul_0, ul_1, ul_17, ul_7, ul_5; // BLOCK 0 ul_0 = (ulong) array; @@ -122,4 +122,4 @@ __kernel void rMax(__global long *_kernel_context, __constant uchar *_constant_r f_26 = fmax(f_25, f_18); *((__global float *) ul_1) = f_26; return; -} // kernel +} // kernel \ No newline at end of file diff --git a/tornado-drivers/drivers-common/src/main/java/module-info.java b/tornado-drivers/drivers-common/src/main/java/module-info.java index 2df85757e7..81d5c0084a 100644 --- a/tornado-drivers/drivers-common/src/main/java/module-info.java +++ b/tornado-drivers/drivers-common/src/main/java/module-info.java @@ -1,7 +1,8 @@ open module tornado.drivers.common { requires transitive jdk.internal.vm.ci; - requires transitive jdk.internal.vm.compiler; + requires transitive jdk.graal.compiler; requires transitive tornado.runtime; + requires org.graalvm.word; exports uk.ac.manchester.tornado.drivers.providers; exports uk.ac.manchester.tornado.drivers.common; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/code/CodeUtil.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/code/CodeUtil.java index fbbb52a1c2..4027b0175e 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/code/CodeUtil.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/code/CodeUtil.java @@ -26,8 +26,8 @@ import jdk.vm.ci.meta.Local; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.Signature; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.CallingConvention.Type; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/analysis/TornadoFeatureExtraction.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/analysis/TornadoFeatureExtraction.java index e85caf6f82..6108fe37cb 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/analysis/TornadoFeatureExtraction.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/analysis/TornadoFeatureExtraction.java @@ -25,40 +25,40 @@ import java.util.LinkedHashMap; import java.util.Optional; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.calc.AndNode; -import org.graalvm.compiler.nodes.calc.FloatEqualsNode; -import org.graalvm.compiler.nodes.calc.FloatLessThanNode; -import org.graalvm.compiler.nodes.calc.IntegerDivRemNode; -import org.graalvm.compiler.nodes.calc.IntegerEqualsNode; -import org.graalvm.compiler.nodes.calc.IntegerLessThanNode; -import org.graalvm.compiler.nodes.calc.LeftShiftNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.nodes.calc.OrNode; -import org.graalvm.compiler.nodes.calc.RemNode; -import org.graalvm.compiler.nodes.calc.RightShiftNode; -import org.graalvm.compiler.nodes.calc.ShiftNode; -import org.graalvm.compiler.nodes.calc.SignExtendNode; -import org.graalvm.compiler.nodes.calc.SignedDivNode; -import org.graalvm.compiler.nodes.calc.SignedRemNode; -import org.graalvm.compiler.nodes.calc.SubNode; -import org.graalvm.compiler.nodes.calc.UnaryArithmeticNode; -import org.graalvm.compiler.nodes.calc.UnsignedRightShiftNode; -import org.graalvm.compiler.nodes.calc.XorNode; -import org.graalvm.compiler.nodes.extended.IntegerSwitchNode; -import org.graalvm.compiler.nodes.memory.FloatingReadNode; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.WriteNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.AndNode; +import jdk.graal.compiler.nodes.calc.FloatEqualsNode; +import jdk.graal.compiler.nodes.calc.FloatLessThanNode; +import jdk.graal.compiler.nodes.calc.IntegerDivRemNode; +import jdk.graal.compiler.nodes.calc.IntegerEqualsNode; +import jdk.graal.compiler.nodes.calc.IntegerLessThanNode; +import jdk.graal.compiler.nodes.calc.LeftShiftNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.nodes.calc.OrNode; +import jdk.graal.compiler.nodes.calc.RemNode; +import jdk.graal.compiler.nodes.calc.RightShiftNode; +import jdk.graal.compiler.nodes.calc.ShiftNode; +import jdk.graal.compiler.nodes.calc.SignExtendNode; +import jdk.graal.compiler.nodes.calc.SignedDivNode; +import jdk.graal.compiler.nodes.calc.SignedRemNode; +import jdk.graal.compiler.nodes.calc.SubNode; +import jdk.graal.compiler.nodes.calc.UnaryArithmeticNode; +import jdk.graal.compiler.nodes.calc.UnsignedRightShiftNode; +import jdk.graal.compiler.nodes.calc.XorNode; +import jdk.graal.compiler.nodes.extended.IntegerSwitchNode; +import jdk.graal.compiler.nodes.memory.FloatingReadNode; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.WriteNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.phases.Phase; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.api.TornadoDeviceContext; @@ -97,7 +97,7 @@ private LinkedHashMap extractFeatures(StructuredG LinkedHashMap irFeatures = initMap; for (Node node : graph.getNodes().snapshot()) { if (node instanceof MulNode || node instanceof AddNode || node instanceof SubNode // - || node instanceof SignedDivNode || node instanceof org.graalvm.compiler.nodes.calc.AddNode || node instanceof IntegerDivRemNode // + || node instanceof SignedDivNode || node instanceof jdk.graal.compiler.nodes.calc.AddNode || node instanceof IntegerDivRemNode // || node instanceof RemNode || node instanceof SignedRemNode || node instanceof FloatEqualsNode || node instanceof IntegerEqualsNode // ) { updateWithType(irFeatures, node); diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/analysis/TornadoShapeAnalysis.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/analysis/TornadoShapeAnalysis.java index 5bf859199f..1f48e2cd73 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/analysis/TornadoShapeAnalysis.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/analysis/TornadoShapeAnalysis.java @@ -25,16 +25,16 @@ import java.util.List; import java.util.Optional; -import org.graalvm.compiler.graph.NodeBitMap; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.loop.LoopEx; -import org.graalvm.compiler.nodes.loop.LoopFragmentInside; -import org.graalvm.compiler.nodes.loop.LoopsData; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.NodeBitMap; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.loop.LoopEx; +import jdk.graal.compiler.nodes.loop.LoopFragmentInside; +import jdk.graal.compiler.nodes.loop.LoopsData; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.common.TornadoLogger; import uk.ac.manchester.tornado.runtime.domain.DomainTree; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/analysis/TornadoValueTypeReplacement.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/analysis/TornadoValueTypeReplacement.java index 0731766c7c..4922f1007a 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/analysis/TornadoValueTypeReplacement.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/analysis/TornadoValueTypeReplacement.java @@ -26,14 +26,14 @@ import java.util.HashMap; import java.util.Map; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.iterators.NodePredicate; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.java.LoadFieldNode; -import org.graalvm.compiler.nodes.java.NewInstanceNode; -import org.graalvm.compiler.nodes.java.StoreFieldNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.iterators.NodePredicate; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.java.LoadFieldNode; +import jdk.graal.compiler.nodes.java.NewInstanceNode; +import jdk.graal.compiler.nodes.java.StoreFieldNode; +import jdk.graal.compiler.phases.BasePhase; import jdk.vm.ci.meta.ResolvedJavaField; import uk.ac.manchester.tornado.api.internal.annotations.Vector; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/BoundCheckEliminationPhase.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/BoundCheckEliminationPhase.java index d48363973c..d0160ae844 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/BoundCheckEliminationPhase.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/BoundCheckEliminationPhase.java @@ -22,12 +22,12 @@ import java.util.Optional; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.GuardNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.java.AccessIndexedNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.GuardNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.java.AccessIndexedNode; +import jdk.graal.compiler.phases.Phase; import jdk.vm.ci.meta.DeoptimizationReason; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/ExceptionCheckingElimination.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/ExceptionCheckingElimination.java index cd23ebdca1..e81ee388f3 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/ExceptionCheckingElimination.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/ExceptionCheckingElimination.java @@ -22,18 +22,18 @@ import java.util.Optional; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.GuardNode; -import org.graalvm.compiler.nodes.LogicConstantNode; -import org.graalvm.compiler.nodes.LogicNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.IntegerBelowNode; -import org.graalvm.compiler.nodes.calc.IsNullNode; -import org.graalvm.compiler.nodes.extended.GuardedNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.GuardNode; +import jdk.graal.compiler.nodes.LogicConstantNode; +import jdk.graal.compiler.nodes.LogicNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.IntegerBelowNode; +import jdk.graal.compiler.nodes.calc.IsNullNode; +import jdk.graal.compiler.nodes.extended.GuardedNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoMidTierContext; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/ExceptionSuppression.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/ExceptionSuppression.java index d070026f2d..ed5a031d83 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/ExceptionSuppression.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/ExceptionSuppression.java @@ -25,14 +25,12 @@ import java.util.Optional; import java.util.Set; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.GuardNode; -import org.graalvm.compiler.nodes.LogicNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.extended.GuardedNode; -import org.graalvm.compiler.nodes.extended.ValueAnchorNode; -import org.graalvm.compiler.phases.BasePhase; - +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.GuardNode; +import jdk.graal.compiler.nodes.LogicNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.extended.GuardedNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoHighTierContext; public class ExceptionSuppression extends BasePhase { @@ -59,14 +57,6 @@ protected void run(StructuredGraph graph, TornadoHighTierContext context) { } }); - graph.getNodes().filter(ValueAnchorNode.class).forEach(anchor -> { - if (anchor.getAnchoredNode() instanceof GuardNode guard) { - guards.add(guard); - conditions.add(guard.getCondition()); - anchor.removeAnchoredNode(); - } - }); - guards.forEach(guard -> { guard.clearInputs(); guard.safeDelete(); diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/TornadoValueTypeCleanup.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/TornadoValueTypeCleanup.java index fe4246e4b9..7f9cb1eace 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/TornadoValueTypeCleanup.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/guards/TornadoValueTypeCleanup.java @@ -23,14 +23,14 @@ import java.util.Optional; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.iterators.NodePredicate; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.java.NewInstanceNode; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.nodes.virtual.VirtualInstanceNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.iterators.NodePredicate; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.java.NewInstanceNode; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.nodes.virtual.VirtualInstanceNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoHighTierContext; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/LoopCanonicalizer.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/LoopCanonicalizer.java index 5146eed6ba..1f9a970360 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/LoopCanonicalizer.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/LoopCanonicalizer.java @@ -23,12 +23,12 @@ */ package uk.ac.manchester.tornado.drivers.common.compiler.phases.loops; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.LoopEndNode; -import org.graalvm.compiler.nodes.MergeNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.LoopEndNode; +import jdk.graal.compiler.nodes.MergeNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.StructuredGraph; /* * * @author James Clarkson diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoLoopCanonicalization.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoLoopCanonicalization.java index 783862bf47..6a5c7816a5 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoLoopCanonicalization.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoLoopCanonicalization.java @@ -27,12 +27,12 @@ import java.util.List; import java.util.Optional; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.loop.LoopEx; -import org.graalvm.compiler.nodes.loop.LoopsData; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.loop.LoopEx; +import jdk.graal.compiler.nodes.loop.LoopsData; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.runtime.graal.nodes.TornadoLoopsData; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoLoopUnroller.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoLoopUnroller.java index baaca684de..f4f66d6878 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoLoopUnroller.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoLoopUnroller.java @@ -23,25 +23,25 @@ */ package uk.ac.manchester.tornado.drivers.common.compiler.phases.loops; -import static org.graalvm.compiler.core.common.GraalOptions.MaximumDesiredSize; -import static org.graalvm.compiler.debug.DebugContext.INFO_LEVEL; -import static org.graalvm.compiler.nodes.loop.DefaultLoopPolicies.Options.ExactFullUnrollMaxNodes; -import static org.graalvm.compiler.nodes.loop.DefaultLoopPolicies.Options.FullUnrollMaxNodes; +import static jdk.graal.compiler.core.common.GraalOptions.MaximumDesiredSize; +import static jdk.graal.compiler.debug.DebugContext.INFO_LEVEL; +import static jdk.graal.compiler.nodes.loop.DefaultLoopPolicies.Options.ExactFullUnrollMaxNodes; +import static jdk.graal.compiler.nodes.loop.DefaultLoopPolicies.Options.FullUnrollMaxNodes; import static uk.ac.manchester.tornado.runtime.TornadoCoreRuntime.getDebugContext; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.loop.phases.LoopTransformations; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.debug.ControlFlowAnchorNode; -import org.graalvm.compiler.nodes.loop.CountedLoopInfo; -import org.graalvm.compiler.nodes.loop.LoopEx; -import org.graalvm.compiler.nodes.loop.LoopsData; -import org.graalvm.compiler.nodes.spi.CoreProviders; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.BasePhase; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.loop.phases.LoopTransformations; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.debug.ControlFlowAnchorNode; +import jdk.graal.compiler.nodes.loop.CountedLoopInfo; +import jdk.graal.compiler.nodes.loop.LoopEx; +import jdk.graal.compiler.nodes.loop.LoopsData; +import jdk.graal.compiler.nodes.spi.CoreProviders; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.BasePhase; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; import uk.ac.manchester.tornado.runtime.graal.nodes.TornadoLoopsData; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoPartialLoopUnroll.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoPartialLoopUnroll.java index 7e0a1a135e..39e40717fc 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoPartialLoopUnroll.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoPartialLoopUnroll.java @@ -23,15 +23,15 @@ import java.util.Optional; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.loop.LoopEx; -import org.graalvm.compiler.nodes.loop.LoopFragmentInside; -import org.graalvm.compiler.nodes.loop.LoopsData; -import org.graalvm.compiler.phases.BasePhase; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; -import org.graalvm.compiler.phases.tiers.MidTierContext; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.loop.LoopEx; +import jdk.graal.compiler.nodes.loop.LoopFragmentInside; +import jdk.graal.compiler.nodes.loop.LoopsData; +import jdk.graal.compiler.phases.BasePhase; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.phases.tiers.MidTierContext; import uk.ac.manchester.tornado.runtime.common.TornadoOptions; import uk.ac.manchester.tornado.runtime.graal.nodes.TornadoLoopsData; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoPragmaUnroll.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoPragmaUnroll.java index 14cdce0211..bb9fac4ff9 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoPragmaUnroll.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/loops/TornadoPragmaUnroll.java @@ -21,25 +21,25 @@ */ package uk.ac.manchester.tornado.drivers.common.compiler.phases.loops; -import static org.graalvm.compiler.core.common.GraalOptions.MaximumDesiredSize; -import static org.graalvm.compiler.debug.DebugContext.INFO_LEVEL; -import static org.graalvm.compiler.nodes.loop.DefaultLoopPolicies.Options.ExactFullUnrollMaxNodes; -import static org.graalvm.compiler.nodes.loop.DefaultLoopPolicies.Options.FullUnrollMaxNodes; +import static jdk.graal.compiler.core.common.GraalOptions.MaximumDesiredSize; +import static jdk.graal.compiler.debug.DebugContext.INFO_LEVEL; +import static jdk.graal.compiler.nodes.loop.DefaultLoopPolicies.Options.ExactFullUnrollMaxNodes; +import static jdk.graal.compiler.nodes.loop.DefaultLoopPolicies.Options.FullUnrollMaxNodes; import static uk.ac.manchester.tornado.runtime.TornadoCoreRuntime.getDebugContext; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.loop.phases.LoopTransformations; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.debug.ControlFlowAnchorNode; -import org.graalvm.compiler.nodes.loop.CountedLoopInfo; -import org.graalvm.compiler.nodes.loop.LoopEx; -import org.graalvm.compiler.nodes.loop.LoopsData; -import org.graalvm.compiler.nodes.spi.CoreProviders; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.BasePhase; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.loop.phases.LoopTransformations; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.debug.ControlFlowAnchorNode; +import jdk.graal.compiler.nodes.loop.CountedLoopInfo; +import jdk.graal.compiler.nodes.loop.LoopEx; +import jdk.graal.compiler.nodes.loop.LoopsData; +import jdk.graal.compiler.nodes.spi.CoreProviders; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.BasePhase; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; import uk.ac.manchester.tornado.runtime.graal.nodes.TornadoLoopsData; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoFieldAccessFixup.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoFieldAccessFixup.java index 4b9d971b34..2c7dfae40c 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoFieldAccessFixup.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoFieldAccessFixup.java @@ -24,19 +24,19 @@ import java.util.ArrayDeque; import java.util.Optional; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.java.AccessFieldNode; -import org.graalvm.compiler.nodes.java.AccessIndexedNode; -import org.graalvm.compiler.nodes.java.LoadFieldNode; -import org.graalvm.compiler.nodes.java.StoreFieldNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.java.AccessFieldNode; +import jdk.graal.compiler.nodes.java.AccessIndexedNode; +import jdk.graal.compiler.nodes.java.LoadFieldNode; +import jdk.graal.compiler.nodes.java.StoreFieldNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.api.exceptions.TornadoInternalError; import uk.ac.manchester.tornado.runtime.graal.nodes.calc.TornadoAddressArithmeticNode; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoLocalMemoryAllocation.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoLocalMemoryAllocation.java index 35278cad6c..cf6c8c6131 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoLocalMemoryAllocation.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoLocalMemoryAllocation.java @@ -25,12 +25,12 @@ import java.util.Optional; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.graal.nodes.interfaces.MarkLocalArray; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoHighTierContext; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoNewArrayDevirtualizationReplacement.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoNewArrayDevirtualizationReplacement.java index b8245a6f79..be2b79d661 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoNewArrayDevirtualizationReplacement.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoNewArrayDevirtualizationReplacement.java @@ -23,10 +23,10 @@ import java.util.Optional; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.java.NewArrayNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.java.NewArrayNode; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.runtime.graal.nodes.NewArrayNonVirtualizableNode; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoPanamaSegmentsHeaderPhase.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoPanamaSegmentsHeaderPhase.java index 98c7fa071a..9a67656ab7 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoPanamaSegmentsHeaderPhase.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoPanamaSegmentsHeaderPhase.java @@ -23,14 +23,15 @@ import java.util.Optional; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.Phase; +import org.graalvm.word.LocationIdentity; /** * Compiler phase to set the position in the Panama Object header in which the Array Size will be located. @@ -46,7 +47,8 @@ public Optional notApplicableTo(GraphState graphState) { @Override protected void run(StructuredGraph graph) { for (ReadNode readNode : graph.getNodes().filter(ReadNode.class)) { - String methodName = readNode.getLocationIdentity().toString(); + LocationIdentity locationIdentity = (LocationIdentity) readNode.getLocationIdentity(); + String methodName = locationIdentity.toString(); if (methodName.endsWith("numberOfElements")) { AddressNode address = readNode.getAddress(); if (address instanceof OffsetAddressNode offsetAddressNode) { diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoPrivateArrayPiRemoval.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoPrivateArrayPiRemoval.java index 532193c038..414d45ad6c 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoPrivateArrayPiRemoval.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/memalloc/TornadoPrivateArrayPiRemoval.java @@ -21,11 +21,11 @@ import java.util.Optional; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.graal.nodes.NewArrayNonVirtualizableNode; import uk.ac.manchester.tornado.runtime.graal.nodes.PanamaPrivateMemoryNode; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/utils/DumpLowTierGraph.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/utils/DumpLowTierGraph.java index 8092d958ec..9b66d78545 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/utils/DumpLowTierGraph.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/compiler/phases/utils/DumpLowTierGraph.java @@ -25,10 +25,10 @@ import java.util.Optional; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.phases.Phase; public class DumpLowTierGraph extends Phase { @Override diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/utils/BackendDeopt.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/utils/BackendDeopt.java index be3101172b..f24cff856b 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/utils/BackendDeopt.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/utils/BackendDeopt.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.drivers.common.utils; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/utils/CompilerUtil.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/utils/CompilerUtil.java index c609e55a0b..8549ce9367 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/utils/CompilerUtil.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/common/utils/CompilerUtil.java @@ -43,7 +43,7 @@ import java.lang.reflect.Method; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoSuitesProvider; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoMemoryOrder.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoMemoryOrder.java index b0cd8018f8..f9adbabbca 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoMemoryOrder.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoMemoryOrder.java @@ -21,7 +21,7 @@ */ package uk.ac.manchester.tornado.drivers.providers; -import org.graalvm.compiler.core.common.memory.MemoryOrderMode; +import jdk.graal.compiler.core.common.memory.MemoryOrderMode; public class TornadoMemoryOrder { public static MemoryOrderMode GPU_MEMORY_MODE = null; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoMetaAccessExtensionProvider.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoMetaAccessExtensionProvider.java index a48549a66b..6ee25a9eb2 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoMetaAccessExtensionProvider.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoMetaAccessExtensionProvider.java @@ -22,7 +22,7 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider; +import jdk.graal.compiler.core.common.spi.MetaAccessExtensionProvider; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaType; diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoPlatformConfigurationProvider.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoPlatformConfigurationProvider.java index cae93b1acf..c5d5981f98 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoPlatformConfigurationProvider.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoPlatformConfigurationProvider.java @@ -20,8 +20,8 @@ */ package uk.ac.manchester.tornado.drivers.providers; -import org.graalvm.compiler.nodes.gc.BarrierSet; -import org.graalvm.compiler.nodes.spi.PlatformConfigurationProvider; +import jdk.graal.compiler.nodes.gc.BarrierSet; +import jdk.graal.compiler.nodes.spi.PlatformConfigurationProvider; public class TornadoPlatformConfigurationProvider implements PlatformConfigurationProvider { diff --git a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoWordTypes.java b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoWordTypes.java index 331eb15d50..ab789785dc 100644 --- a/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoWordTypes.java +++ b/tornado-drivers/drivers-common/src/main/java/uk/ac/manchester/tornado/drivers/providers/TornadoWordTypes.java @@ -20,7 +20,7 @@ */ package uk.ac.manchester.tornado.drivers.providers; -import org.graalvm.compiler.word.WordTypes; +import jdk.graal.compiler.word.WordTypes; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; diff --git a/tornado-drivers/opencl/src/main/java/module-info.java b/tornado-drivers/opencl/src/main/java/module-info.java index 7db17d4ea6..8cb2b6e50f 100644 --- a/tornado-drivers/opencl/src/main/java/module-info.java +++ b/tornado-drivers/opencl/src/main/java/module-info.java @@ -1,36 +1,7 @@ import uk.ac.manchester.tornado.runtime.TornadoBackendProvider; -module tornado.drivers.opencl { - requires transitive jdk.internal.vm.ci; - requires transitive jdk.internal.vm.compiler; - requires transitive org.graalvm.collections; - requires transitive org.graalvm.word; - requires transitive tornado.api; - requires transitive tornado.runtime; - requires tornado.drivers.common; +module tornado.drivers.opencl{requires java.base;requires transitive jdk.internal.vm.ci;requires transitive jdk.graal.compiler;requires transitive org.graalvm.collections;requires transitive org.graalvm.word;requires transitive tornado.api;requires transitive tornado.runtime;requires tornado.drivers.common; - exports uk.ac.manchester.tornado.drivers.opencl; - exports uk.ac.manchester.tornado.drivers.opencl.builtins; - exports uk.ac.manchester.tornado.drivers.opencl.enums; - exports uk.ac.manchester.tornado.drivers.opencl.exceptions; - exports uk.ac.manchester.tornado.drivers.opencl.graal; - exports uk.ac.manchester.tornado.drivers.opencl.graal.asm; - exports uk.ac.manchester.tornado.drivers.opencl.graal.backend; - exports uk.ac.manchester.tornado.drivers.opencl.graal.compiler; - exports uk.ac.manchester.tornado.drivers.opencl.graal.compiler.plugins; - exports uk.ac.manchester.tornado.drivers.opencl.graal.lir; - exports uk.ac.manchester.tornado.drivers.opencl.graal.meta; - exports uk.ac.manchester.tornado.drivers.opencl.graal.nodes; - exports uk.ac.manchester.tornado.drivers.opencl.graal.nodes.logic; - exports uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector; - exports uk.ac.manchester.tornado.drivers.opencl.graal.phases; - exports uk.ac.manchester.tornado.drivers.opencl.graal.snippets; - exports uk.ac.manchester.tornado.drivers.opencl.mm; - exports uk.ac.manchester.tornado.drivers.opencl.runtime; - exports uk.ac.manchester.tornado.drivers.opencl.tests; - exports uk.ac.manchester.tornado.drivers.opencl.power; - exports uk.ac.manchester.tornado.drivers.opencl.scheduler; +exports uk.ac.manchester.tornado.drivers.opencl;exports uk.ac.manchester.tornado.drivers.opencl.builtins;exports uk.ac.manchester.tornado.drivers.opencl.enums;exports uk.ac.manchester.tornado.drivers.opencl.exceptions;exports uk.ac.manchester.tornado.drivers.opencl.graal;exports uk.ac.manchester.tornado.drivers.opencl.graal.asm;exports uk.ac.manchester.tornado.drivers.opencl.graal.backend;exports uk.ac.manchester.tornado.drivers.opencl.graal.compiler;exports uk.ac.manchester.tornado.drivers.opencl.graal.compiler.plugins;exports uk.ac.manchester.tornado.drivers.opencl.graal.lir;exports uk.ac.manchester.tornado.drivers.opencl.graal.meta;exports uk.ac.manchester.tornado.drivers.opencl.graal.nodes;exports uk.ac.manchester.tornado.drivers.opencl.graal.nodes.logic;exports uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector;exports uk.ac.manchester.tornado.drivers.opencl.graal.phases;exports uk.ac.manchester.tornado.drivers.opencl.graal.snippets;exports uk.ac.manchester.tornado.drivers.opencl.mm;exports uk.ac.manchester.tornado.drivers.opencl.runtime;exports uk.ac.manchester.tornado.drivers.opencl.tests;exports uk.ac.manchester.tornado.drivers.opencl.power;exports uk.ac.manchester.tornado.drivers.opencl.scheduler; - provides TornadoBackendProvider with - uk.ac.manchester.tornado.drivers.opencl.OCLTornadoDriverProvider; -} +provides TornadoBackendProvider with uk.ac.manchester.tornado.drivers.opencl.OCLTornadoDriverProvider;} diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLBackendImpl.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLBackendImpl.java index a85ef6ad98..609217a094 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLBackendImpl.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLBackendImpl.java @@ -34,8 +34,8 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import uk.ac.manchester.tornado.api.common.TornadoDevice; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLCodeCache.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLCodeCache.java index 4cbfd452c9..31207bcae4 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLCodeCache.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLCodeCache.java @@ -545,6 +545,7 @@ private boolean isInputSourceSPIRVBinary(byte[] source) { private void dumpKernelSource(String id, String entryPoint, String log, byte[] source) { final Path outDir = resolveLogDirectory(); final String identifier = id + "-" + entryPoint; + logger.error("Unable to compile task %s: check logs at %s/%s.log", identifier, outDir.toAbsolutePath(), identifier); File file = new File(outDir + "/" + identifier + ".log"); @@ -553,15 +554,16 @@ private void dumpKernelSource(String id, String entryPoint, String log, byte[] s } catch (IOException e) { logger.error("unable to write error log: ", e.getMessage()); } + file = new File(outDir + "/" + identifier + OPENCL_SOURCE_SUFFIX); try (FileOutputStream fos = new FileOutputStream(file)) { fos.write(source); } catch (IOException e) { logger.error("unable to write error log: ", e.getMessage()); } - } + private void installCodeInCodeCache(OCLProgram program, String id, String entryPoint, OCLInstalledCode code) { cache.put(id + "-" + entryPoint, code); // BUG Apple does not seem to like implementing the OpenCL spec diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLTargetDescription.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLTargetDescription.java index 63040d0664..03d2986f8c 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLTargetDescription.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLTargetDescription.java @@ -23,7 +23,7 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.LIRKind; import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.TargetDescription; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLTornadoDriverProvider.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLTornadoDriverProvider.java index 13bff542a0..e3f0a2fc27 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLTornadoDriverProvider.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/OCLTornadoDriverProvider.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.drivers.opencl; -import org.graalvm.compiler.options.OptionValues; +import jdk.graal.compiler.options.OptionValues; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import uk.ac.manchester.tornado.runtime.TornadoAcceleratorBackend; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/builtins/OpenCLIntrinsics.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/builtins/OpenCLIntrinsics.java index 47065b0973..ef0c0895c0 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/builtins/OpenCLIntrinsics.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/builtins/OpenCLIntrinsics.java @@ -25,7 +25,7 @@ */ package uk.ac.manchester.tornado.drivers.opencl.builtins; -import org.graalvm.compiler.api.replacements.Fold; +import jdk.graal.compiler.api.replacements.Fold; public class OpenCLIntrinsics { diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLFrameContext.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLFrameContext.java index 9f83b801c1..20e300708c 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLFrameContext.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLFrameContext.java @@ -23,8 +23,8 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; -import org.graalvm.compiler.lir.asm.FrameContext; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.asm.FrameContext; import uk.ac.manchester.tornado.runtime.common.TornadoLogger; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLFrameMap.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLFrameMap.java index a07a507f5f..475043c7f4 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLFrameMap.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLFrameMap.java @@ -21,9 +21,9 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.NumUtil; -import org.graalvm.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.NumUtil; +import jdk.graal.compiler.lir.framemap.FrameMap; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.RegisterConfig; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLFrameMapBuilder.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLFrameMapBuilder.java index bcc2326ab5..f98fad7a62 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLFrameMapBuilder.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLFrameMapBuilder.java @@ -21,8 +21,8 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal; -import org.graalvm.compiler.lir.framemap.FrameMap; -import org.graalvm.compiler.lir.framemap.FrameMapBuilderImpl; +import jdk.graal.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.lir.framemap.FrameMapBuilderImpl; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.RegisterConfig; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLHotSpotBackendFactory.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLHotSpotBackendFactory.java index a356f9df61..86ace8645b 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLHotSpotBackendFactory.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLHotSpotBackendFactory.java @@ -26,21 +26,23 @@ import static jdk.vm.ci.common.InitTimer.timer; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; -import org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider; -import org.graalvm.compiler.hotspot.meta.HotSpotStampProvider; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.loop.LoopsDataProviderImpl; -import org.graalvm.compiler.nodes.spi.LoopsDataProvider; -import org.graalvm.compiler.nodes.spi.LoweringProvider; -import org.graalvm.compiler.nodes.spi.Replacements; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.printer.GraalDebugHandlersFactory; -import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins; -import org.graalvm.compiler.replacements.classfile.ClassfileBytecodeProvider; -import org.graalvm.compiler.word.WordTypes; +import jdk.graal.compiler.api.replacements.SnippetReflectionProvider; +import jdk.graal.compiler.core.common.spi.MetaAccessExtensionProvider; +import jdk.graal.compiler.hotspot.meta.HotSpotIdentityHashCodeProvider; +import jdk.graal.compiler.hotspot.meta.HotSpotStampProvider; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.loop.LoopsDataProviderImpl; +import jdk.graal.compiler.nodes.spi.IdentityHashCodeProvider; +import jdk.graal.compiler.nodes.spi.LoopsDataProvider; +import jdk.graal.compiler.nodes.spi.LoweringProvider; +import jdk.graal.compiler.nodes.spi.Replacements; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.printer.GraalDebugHandlersFactory; +import jdk.graal.compiler.replacements.StandardGraphBuilderPlugins; +import jdk.graal.compiler.replacements.classfile.ClassfileBytecodeProvider; +import jdk.graal.compiler.word.WordTypes; import jdk.vm.ci.common.InitTimer; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; @@ -106,11 +108,15 @@ public static OCLBackend createJITCompiler(OptionValues options, HotSpotJVMCIRun WordTypes wordTypes = new TornadoWordTypes(metaAccess, wordKind.asJavaKind()); LoopsDataProvider lpd = new LoopsDataProviderImpl(); - Providers p = new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, lowerer.getReplacements(), stampProvider, - platformConfigurationProvider, metaAccessExtensionProvider, snippetReflection, wordTypes, lpd); + HotSpotIdentityHashCodeProvider hotSpotIdentityHashCodeProvider = new HotSpotIdentityHashCodeProvider(); + Providers p = new Providers(metaAccess, // + codeCache, constantReflection, constantFieldProvider, // + foreignCalls, lowerer, lowerer.getReplacements(), stampProvider, // + platformConfigurationProvider, metaAccessExtensionProvider, snippetReflection, // + wordTypes, lpd , hotSpotIdentityHashCodeProvider); ClassfileBytecodeProvider bytecodeProvider = new ClassfileBytecodeProvider(metaAccess, snippetReflection); GraalDebugHandlersFactory graalDebugHandlersFactory = new GraalDebugHandlersFactory(snippetReflection); - TornadoReplacements replacements = new TornadoReplacements(graalDebugHandlersFactory, p, snippetReflection, bytecodeProvider, target); + TornadoReplacements replacements = new TornadoReplacements(graalDebugHandlersFactory, p, bytecodeProvider, target); plugins = createGraphBuilderPlugins(metaAccess, replacements, snippetReflection, lowerer); replacements.setGraphBuilderPlugins(plugins); @@ -118,7 +124,7 @@ public static OCLBackend createJITCompiler(OptionValues options, HotSpotJVMCIRun suites = new OCLSuitesProvider(options, oclDeviceContextImpl, plugins, metaAccess, compilerConfiguration, addressLowering); providers = new OCLProviders(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, platformConfigurationProvider, - metaAccessExtensionProvider, snippetReflection, wordTypes, p.getLoopsDataProvider(), suites); + metaAccessExtensionProvider, snippetReflection, wordTypes, p.getLoopsDataProvider(), suites, hotSpotIdentityHashCodeProvider); lowerer.initialize(options, new DummySnippetFactory(), providers); } @@ -142,7 +148,7 @@ protected static Plugins createGraphBuilderPlugins(HotSpotMetaAccessProvider met false, // false, // loweringProvider); - OCLGraphBuilderPlugins.registerInvocationPlugins(plugins, invocationPlugins); + OCLGraphBuilderPlugins.registerInvocationPlugins(plugins, invocationPlugins, metaAccess); return plugins; } diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLLIRKindTool.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLLIRKindTool.java index 05475b6fd3..08fe8610be 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLLIRKindTool.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLLIRKindTool.java @@ -24,8 +24,8 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.spi.LIRKindTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.spi.LIRKindTool; import uk.ac.manchester.tornado.drivers.opencl.OCLTargetDescription; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLLoweringProvider.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLLoweringProvider.java index 4ef635b9f7..b0b1fabec2 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLLoweringProvider.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLLoweringProvider.java @@ -23,63 +23,67 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal; -import static org.graalvm.compiler.nodes.NamedLocationIdentity.ARRAY_LENGTH_LOCATION; +import static jdk.graal.compiler.nodes.NamedLocationIdentity.ARRAY_LENGTH_LOCATION; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; import static uk.ac.manchester.tornado.drivers.providers.TornadoMemoryOrder.GPU_MEMORY_MODE; import java.util.Iterator; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryExtendKind; -import org.graalvm.compiler.core.common.spi.ForeignCallsProvider; -import org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.core.common.type.StampPair; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeInputList; -import org.graalvm.compiler.nodes.AbstractDeoptimizeNode; -import org.graalvm.compiler.nodes.CompressionNode; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FieldLocationIdentity; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.Invoke; -import org.graalvm.compiler.nodes.InvokeNode; -import org.graalvm.compiler.nodes.LoweredCallTargetNode; -import org.graalvm.compiler.nodes.NamedLocationIdentity; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.UnwindNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryArithmeticNode; -import org.graalvm.compiler.nodes.calc.FloatConvertNode; -import org.graalvm.compiler.nodes.calc.IntegerDivRemNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.nodes.calc.RemNode; -import org.graalvm.compiler.nodes.java.ArrayLengthNode; -import org.graalvm.compiler.nodes.java.InstanceOfNode; -import org.graalvm.compiler.nodes.java.LoadFieldNode; -import org.graalvm.compiler.nodes.java.LoadIndexedNode; -import org.graalvm.compiler.nodes.java.MethodCallTargetNode; -import org.graalvm.compiler.nodes.java.StoreFieldNode; -import org.graalvm.compiler.nodes.java.StoreIndexedNode; -import org.graalvm.compiler.nodes.memory.AbstractWriteNode; -import org.graalvm.compiler.nodes.memory.ExtendableMemoryAccess; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.WriteNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.nodes.spi.LoweringTool; -import org.graalvm.compiler.nodes.spi.PlatformConfigurationProvider; -import org.graalvm.compiler.nodes.type.StampTool; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.replacements.DefaultJavaLoweringProvider; -import org.graalvm.compiler.replacements.SnippetCounter; +import jdk.graal.compiler.core.common.memory.BarrierType; +import jdk.graal.compiler.core.common.memory.MemoryExtendKind; +import jdk.graal.compiler.core.common.spi.ForeignCallsProvider; +import jdk.graal.compiler.core.common.spi.MetaAccessExtensionProvider; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.core.common.type.StampPair; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeInputList; +import jdk.graal.compiler.nodes.AbstractDeoptimizeNode; +import jdk.graal.compiler.nodes.CompressionNode; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FieldLocationIdentity; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.Invoke; +import jdk.graal.compiler.nodes.InvokeNode; +import jdk.graal.compiler.nodes.LoweredCallTargetNode; +import jdk.graal.compiler.nodes.NamedLocationIdentity; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.UnwindNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.BinaryArithmeticNode; +import jdk.graal.compiler.nodes.calc.FloatConvertNode; +import jdk.graal.compiler.nodes.calc.IntegerDivRemNode; +import jdk.graal.compiler.nodes.calc.LeftShiftNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.nodes.calc.RemNode; +import jdk.graal.compiler.nodes.calc.SignExtendNode; +import jdk.graal.compiler.nodes.java.ArrayLengthNode; +import jdk.graal.compiler.nodes.java.InstanceOfNode; +import jdk.graal.compiler.nodes.java.LoadFieldNode; +import jdk.graal.compiler.nodes.java.LoadIndexedNode; +import jdk.graal.compiler.nodes.java.MethodCallTargetNode; +import jdk.graal.compiler.nodes.java.StoreFieldNode; +import jdk.graal.compiler.nodes.java.StoreIndexedNode; +import jdk.graal.compiler.nodes.memory.AbstractWriteNode; +import jdk.graal.compiler.nodes.memory.ExtendableMemoryAccess; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.WriteNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.nodes.spi.LoweringTool; +import jdk.graal.compiler.nodes.spi.PlatformConfigurationProvider; +import jdk.graal.compiler.nodes.type.StampTool; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.replacements.DefaultJavaLoweringProvider; +import jdk.graal.compiler.replacements.SnippetCounter; +import jdk.vm.ci.code.CodeUtil; import org.graalvm.word.LocationIdentity; import jdk.vm.ci.hotspot.HotSpotCallingConventionType; @@ -108,6 +112,7 @@ import uk.ac.manchester.tornado.drivers.opencl.graal.snippets.ReduceCPUSnippets; import uk.ac.manchester.tornado.drivers.opencl.graal.snippets.ReduceGPUSnippets; import uk.ac.manchester.tornado.runtime.TornadoVMConfigAccess; +import uk.ac.manchester.tornado.runtime.common.TornadoOptions; import uk.ac.manchester.tornado.runtime.graal.nodes.GetGroupIdFixedWithNextNode; import uk.ac.manchester.tornado.runtime.graal.nodes.GlobalGroupSizeFixedWithNextNode; import uk.ac.manchester.tornado.runtime.graal.nodes.LocalGroupSizeFixedWithNextNode; @@ -391,7 +396,7 @@ public void lowerStoreIndexedNode(StoreIndexedNode storeIndexed, LoweringTool to JavaKind elementKind = storeIndexed.elementKind(); ValueNode value = storeIndexed.value(); ValueNode array = storeIndexed.array(); - AddressNode address = createArrayAddress(graph, array, elementKind, storeIndexed.index()); + AddressNode address = createArrayAddressTornado(graph, array, elementKind, storeIndexed.index()); AbstractWriteNode memoryWrite = createMemWriteNode(elementKind, value, array, address, graph, storeIndexed); memoryWrite.setStateAfter(storeIndexed.stateAfter()); graph.replaceFixedWithFixed(storeIndexed, memoryWrite); @@ -592,11 +597,27 @@ private AddressNode createArrayAccess(StructuredGraph graph, LoadIndexedNode loa if (isLocalIDNode(loadIndexed) || isPrivateIDNode(loadIndexed)) { address = createArrayLocalAddress(graph, loadIndexed.array(), loadIndexed.index()); } else { - address = createArrayAddress(graph, loadIndexed.array(), elementKind, loadIndexed.index()); + address = createArrayAddressTornado(graph, loadIndexed.array(), elementKind, loadIndexed.index()); } return address; } + public AddressNode createArrayAddressTornado(StructuredGraph graph, ValueNode array, JavaKind elementKind, ValueNode index) { + int arrayBaseOffset = (int) TornadoOptions.PANAMA_OBJECT_HEADER_SIZE; + + ValueNode wordIndex; + if (target.wordSize > 4) { + wordIndex = graph.unique(new SignExtendNode(index, target.wordSize * 8)); + } else { + assert target.wordSize == 4 : "unsupported word size"; + wordIndex = index; + } + int shift = CodeUtil.log2(metaAccess.getArrayIndexScale(elementKind)); + ValueNode scaledIndex = graph.unique(new LeftShiftNode(wordIndex, ConstantNode.forInt(shift, graph))); + ValueNode offset = graph.unique(new AddNode(scaledIndex, ConstantNode.forIntegerKind(target.wordJavaKind, arrayBaseOffset, graph))); + return graph.unique(new OffsetAddressNode(array, offset)); + } + private AbstractWriteNode createMemWriteNode(JavaKind elementKind, ValueNode value, ValueNode array, AddressNode address, StructuredGraph graph, StoreIndexedNode storeIndexed) { AbstractWriteNode memoryWrite; if (isLocalIDNode(storeIndexed) || isPrivateIDNode(storeIndexed)) { diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLProviders.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLProviders.java index 8e67f31d66..426b042d85 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLProviders.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLProviders.java @@ -23,17 +23,18 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal; -import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; -import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; -import org.graalvm.compiler.core.common.spi.ForeignCallsProvider; -import org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider; -import org.graalvm.compiler.nodes.spi.LoopsDataProvider; -import org.graalvm.compiler.nodes.spi.LoweringProvider; -import org.graalvm.compiler.nodes.spi.PlatformConfigurationProvider; -import org.graalvm.compiler.nodes.spi.Replacements; -import org.graalvm.compiler.nodes.spi.StampProvider; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.word.WordTypes; +import jdk.graal.compiler.api.replacements.SnippetReflectionProvider; +import jdk.graal.compiler.core.common.spi.ConstantFieldProvider; +import jdk.graal.compiler.core.common.spi.ForeignCallsProvider; +import jdk.graal.compiler.core.common.spi.MetaAccessExtensionProvider; +import jdk.graal.compiler.hotspot.meta.HotSpotIdentityHashCodeProvider; +import jdk.graal.compiler.nodes.spi.LoopsDataProvider; +import jdk.graal.compiler.nodes.spi.LoweringProvider; +import jdk.graal.compiler.nodes.spi.PlatformConfigurationProvider; +import jdk.graal.compiler.nodes.spi.Replacements; +import jdk.graal.compiler.nodes.spi.StampProvider; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.word.WordTypes; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.meta.ConstantReflectionProvider; @@ -56,9 +57,11 @@ public OCLProviders(MetaAccessProvider metaAccess, // SnippetReflectionProvider snippetReflection, // WordTypes wordTypes, // LoopsDataProvider loopsDataProvider, // - OCLSuitesProvider suitesProvider) { + OCLSuitesProvider suitesProvider, // + HotSpotIdentityHashCodeProvider hotSpotIdentityHashCodeProvider +) { super(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, platformConfigurationProvider, metaAccessExtensionProvider, - snippetReflection, wordTypes, loopsDataProvider); + snippetReflection, wordTypes, loopsDataProvider, hotSpotIdentityHashCodeProvider); this.suites = suitesProvider; } diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLStamp.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLStamp.java index 2425d3bb91..c211b217a6 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLStamp.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLStamp.java @@ -24,10 +24,10 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.spi.LIRKindTool; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.spi.LIRKindTool; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; @@ -123,9 +123,14 @@ public boolean isCompatible(Constant constant) { @Override public boolean isCompatible(Stamp stamp) { - if (stamp instanceof OCLStamp && ((OCLStamp) stamp).oclKind == oclKind) { - return true; - } + if (stamp instanceof OCLStamp) { + return true; + } else if (stamp instanceof ObjectStamp) { + OCLKind stampKind = OCLKind.fromResolvedJavaType(((ObjectStamp) stamp).type()); + if (stampKind == oclKind) { + return true; + } + } unimplemented("stamp iscompat: %s + %s", this, stamp); return false; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLSuitesProvider.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLSuitesProvider.java index 5bbaf238ff..7ae5f7c114 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLSuitesProvider.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/OCLSuitesProvider.java @@ -23,13 +23,13 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal; -import org.graalvm.compiler.java.GraphBuilderPhase; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase.AddressLowering; -import org.graalvm.compiler.phases.tiers.HighTierContext; +import jdk.graal.compiler.java.GraphBuilderPhase; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase.AddressLowering; +import jdk.graal.compiler.phases.tiers.HighTierContext; import jdk.vm.ci.meta.MetaAccessProvider; import uk.ac.manchester.tornado.api.TornadoDeviceContext; @@ -37,6 +37,7 @@ import uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLCompilerConfiguration; import uk.ac.manchester.tornado.runtime.graal.TornadoLIRSuites; import uk.ac.manchester.tornado.runtime.graal.TornadoSuites; +import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoInternalGraphBuilder; import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoSketchTier; import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoSuitesProvider; @@ -62,7 +63,7 @@ private PhaseSuite createGraphBuilderSuite(Plugins plugins) { config.withEagerResolving(true); // config.setUseProfiling(false); - suite.appendPhase(new GraphBuilderPhase(config)); + suite.appendPhase(new TornadoInternalGraphBuilder(config)); return suite; } diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/asm/OCLAssembler.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/asm/OCLAssembler.java index 1f4122f4af..61a5b1d7b3 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/asm/OCLAssembler.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/asm/OCLAssembler.java @@ -32,11 +32,11 @@ import java.util.Arrays; import java.util.List; -import org.graalvm.compiler.asm.AbstractAddress; -import org.graalvm.compiler.asm.Assembler; -import org.graalvm.compiler.asm.Label; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.asm.AbstractAddress; +import jdk.graal.compiler.asm.Assembler; +import jdk.graal.compiler.asm.Label; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.TargetDescription; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/asm/OCLConstantValue.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/asm/OCLConstantValue.java index 5c2e1e844a..a5028f2a78 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/asm/OCLConstantValue.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/asm/OCLConstantValue.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.asm; -import org.graalvm.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.LIRKind; import uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLCompilationResultBuilder; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIROp; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/backend/OCLBackend.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/backend/OCLBackend.java index 689d8dd8b6..59e16adca2 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/backend/OCLBackend.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/backend/OCLBackend.java @@ -37,25 +37,25 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; -import org.graalvm.compiler.code.CompilationResult; -import org.graalvm.compiler.core.common.CompilationIdentifier; -import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; -import org.graalvm.compiler.lir.asm.DataBuilder; -import org.graalvm.compiler.lir.framemap.FrameMap; -import org.graalvm.compiler.lir.framemap.FrameMapBuilder; -import org.graalvm.compiler.lir.framemap.ReferenceMapBuilder; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.tiers.SuitesProvider; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.code.CompilationResult; +import jdk.graal.compiler.core.common.CompilationIdentifier; +import jdk.graal.compiler.core.common.alloc.RegisterAllocationConfig; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.asm.DataBuilder; +import jdk.graal.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.lir.framemap.FrameMapBuilder; +import jdk.graal.compiler.lir.framemap.ReferenceMapBuilder; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.cfg.ControlFlowGraph; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.tiers.SuitesProvider; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.CompilationRequest; @@ -452,7 +452,11 @@ public OCLCodeProvider getCodeCache() { @Override public SuitesProvider getSuites() { - unimplemented("Get suites method in OCLBackend not implemented yet."); + return null; + } + + @Override + public RegisterAllocationConfig newRegisterAllocationConfig(RegisterConfig registerConfig, String[] allocationRestrictedTo, Object stub) { return null; } diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLBarrierSetLIRGenerator.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLBarrierSetLIRGenerator.java deleted file mode 100644 index 722fe89d6f..0000000000 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLBarrierSetLIRGenerator.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2023, APT Group, Department of Computer Science, - * The University of Manchester. All rights reserved. - * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package uk.ac.manchester.tornado.drivers.opencl.graal.compiler; - -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryOrderMode; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.BarrierSetLIRGenerator; - -import jdk.vm.ci.meta.Value; - -public class OCLBarrierSetLIRGenerator extends BarrierSetLIRGenerator { - @Override - public Variable emitBarrieredLoad(LIRKind kind, Value address, LIRFrameState state, MemoryOrderMode memoryOrder, BarrierType barrierType) { - return null; - } -} diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLBlockVisitor.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLBlockVisitor.java index bfded8e495..ff4d4ced8c 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLBlockVisitor.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLBlockVisitor.java @@ -28,23 +28,23 @@ import java.util.Set; import java.util.stream.IntStream; -import org.graalvm.compiler.core.common.cfg.Loop; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeMap; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.BeginNode; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.LoopEndNode; -import org.graalvm.compiler.nodes.LoopExitNode; -import org.graalvm.compiler.nodes.MergeNode; -import org.graalvm.compiler.nodes.ReturnNode; -import org.graalvm.compiler.nodes.StartNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.nodes.extended.IntegerSwitchNode; +import jdk.graal.compiler.core.common.cfg.Loop; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeMap; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.BeginNode; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.LoopEndNode; +import jdk.graal.compiler.nodes.LoopExitNode; +import jdk.graal.compiler.nodes.MergeNode; +import jdk.graal.compiler.nodes.ReturnNode; +import jdk.graal.compiler.nodes.StartNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.cfg.ControlFlowGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.extended.IntegerSwitchNode; import jdk.vm.ci.meta.JavaConstant; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCanonicalizer.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCanonicalizer.java index e7be88b1ff..9ff5150b98 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCanonicalizer.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCanonicalizer.java @@ -23,9 +23,9 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.compiler; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.spi.SimplifierTool; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.spi.SimplifierTool; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaMethod; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilationResult.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilationResult.java index 0d2b69dccc..98d87ed056 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilationResult.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilationResult.java @@ -25,7 +25,7 @@ import java.util.Arrays; import java.util.Set; -import org.graalvm.compiler.code.CompilationResult; +import jdk.graal.compiler.code.CompilationResult; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.drivers.opencl.graal.backend.OCLBackend; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilationResultBuilder.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilationResultBuilder.java index 8afadda373..9e3606ee52 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilationResultBuilder.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilationResultBuilder.java @@ -37,34 +37,34 @@ import org.graalvm.collections.EconomicMap; import org.graalvm.collections.Equivalence; -import org.graalvm.compiler.asm.Assembler; -import org.graalvm.compiler.code.CompilationResult; -import org.graalvm.compiler.core.common.spi.CodeGenProviders; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.lir.InstructionValueProcedure; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.LIRInstruction.OperandFlag; -import org.graalvm.compiler.lir.LIRInstruction.OperandMode; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; -import org.graalvm.compiler.lir.asm.DataBuilder; -import org.graalvm.compiler.lir.asm.FrameContext; -import org.graalvm.compiler.lir.framemap.FrameMap; -import org.graalvm.compiler.nodes.AbstractBeginNode; -import org.graalvm.compiler.nodes.AbstractEndNode; -import org.graalvm.compiler.nodes.AbstractMergeNode; -import org.graalvm.compiler.nodes.ControlSplitNode; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.LoopEndNode; -import org.graalvm.compiler.nodes.LoopExitNode; -import org.graalvm.compiler.nodes.MergeNode; -import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.options.OptionValues; +import jdk.graal.compiler.asm.Assembler; +import jdk.graal.compiler.code.CompilationResult; +import jdk.graal.compiler.nodes.spi.CoreProviders; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.lir.InstructionValueProcedure; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.LIRInstruction.OperandFlag; +import jdk.graal.compiler.lir.LIRInstruction.OperandMode; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.asm.DataBuilder; +import jdk.graal.compiler.lir.asm.FrameContext; +import jdk.graal.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.nodes.AbstractBeginNode; +import jdk.graal.compiler.nodes.AbstractEndNode; +import jdk.graal.compiler.nodes.AbstractMergeNode; +import jdk.graal.compiler.nodes.ControlSplitNode; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.LoopEndNode; +import jdk.graal.compiler.nodes.LoopExitNode; +import jdk.graal.compiler.nodes.MergeNode; +import jdk.graal.compiler.nodes.cfg.ControlFlowGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.options.OptionValues; import jdk.vm.ci.code.Register; import jdk.vm.ci.meta.ResolvedJavaMethod; @@ -93,9 +93,9 @@ public class OCLCompilationResultBuilder extends CompilationResultBuilder { private long[] localGrid; private OCLDeviceContextInterface deviceContext; - public OCLCompilationResultBuilder(CodeGenProviders providers, FrameMap frameMap, Assembler asm, DataBuilder dataBuilder, FrameContext frameContext, OptionValues options, DebugContext debug, + public OCLCompilationResultBuilder(CoreProviders providers, FrameMap frameMap, Assembler asm, DataBuilder dataBuilder, FrameContext frameContext, OptionValues options, DebugContext debug, CompilationResult compilationResult, LIR lir) { - super(providers, frameMap, asm, dataBuilder, frameContext, options, debug, compilationResult, Register.None, EconomicMap.create(Equivalence.DEFAULT), NO_VERIFIERS, lir); + super(providers, frameMap, asm, dataBuilder, frameContext, options, debug, compilationResult, Register.None, NO_VERIFIERS, lir); nonInlinedMethods = new HashSet(); } diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompiler.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompiler.java index 265bb97005..476ff504f0 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompiler.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompiler.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.compiler; -import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; +import static jdk.graal.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.guarantee; import static uk.ac.manchester.tornado.runtime.TornadoCoreRuntime.getDebugContext; import static uk.ac.manchester.tornado.runtime.common.TornadoOptions.DUMP_COMPILED_METHODS; @@ -42,34 +42,34 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; -import org.graalvm.compiler.code.CompilationResult; -import org.graalvm.compiler.core.common.alloc.LinearScanOrder; -import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; -import org.graalvm.compiler.core.common.cfg.CodeEmissionOrder; -import org.graalvm.compiler.debug.DebugCloseable; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.debug.DebugDumpScope; -import org.graalvm.compiler.debug.TimerKey; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory; -import org.graalvm.compiler.lir.framemap.FrameMap; -import org.graalvm.compiler.lir.framemap.FrameMapBuilder; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.lir.phases.AllocationPhase.AllocationContext; -import org.graalvm.compiler.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; -import org.graalvm.compiler.nodes.StructuredGraph.Builder; -import org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.OptimisticOptimizations; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; -import org.graalvm.compiler.phases.tiers.HighTierContext; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.code.CompilationResult; +import jdk.graal.compiler.core.common.alloc.LinearScanOrder; +import jdk.graal.compiler.core.common.alloc.RegisterAllocationConfig; +import jdk.graal.compiler.core.common.cfg.CodeEmissionOrder; +import jdk.graal.compiler.debug.DebugCloseable; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.debug.DebugDumpScope; +import jdk.graal.compiler.debug.TimerKey; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.asm.CompilationResultBuilderFactory; +import jdk.graal.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.lir.framemap.FrameMapBuilder; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.lir.phases.AllocationPhase.AllocationContext; +import jdk.graal.compiler.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.StructuredGraph.AllowAssumptions; +import jdk.graal.compiler.nodes.StructuredGraph.Builder; +import jdk.graal.compiler.nodes.StructuredGraph.ScheduleResult; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.OptimisticOptimizations; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.phases.tiers.HighTierContext; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.code.RegisterConfig; import jdk.vm.ci.meta.Assumptions; @@ -246,7 +246,7 @@ private static LIRGenerationResult emitLIR0(OCLBac } catch (Throwable e) { throw getDebugContext().handle(e); } - RegisterAllocationConfig registerAllocationConfig = backend.newRegisterAllocationConfig(registerConfig, new String[] {}); + RegisterAllocationConfig registerAllocationConfig = backend.newRegisterAllocationConfig(registerConfig, new String[] {}, new Object()); FrameMapBuilder frameMapBuilder = backend.newFrameMapBuilder(registerConfig); LIRGenerationResult lirGenRes = backend.newLIRGenerationResult(graph.compilationId(), lir, frameMapBuilder, registerAllocationConfig); LIRGeneratorTool lirGen = backend.newLIRGenerator(lirGenRes); diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilerConfiguration.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilerConfiguration.java index 937d1e1163..262eee54a0 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilerConfiguration.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLCompilerConfiguration.java @@ -23,14 +23,14 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.compiler; -import org.graalvm.compiler.lir.phases.LIRPhaseSuite; -import org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; -import org.graalvm.compiler.lir.phases.PostAllocationOptimizationStage; -import org.graalvm.compiler.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; -import org.graalvm.compiler.lir.phases.PreAllocationOptimizationStage; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase.AddressLowering; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.lir.phases.LIRPhaseSuite; +import jdk.graal.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; +import jdk.graal.compiler.lir.phases.PostAllocationOptimizationStage; +import jdk.graal.compiler.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; +import jdk.graal.compiler.lir.phases.PreAllocationOptimizationStage; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase.AddressLowering; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; import jdk.vm.ci.meta.MetaAccessProvider; import uk.ac.manchester.tornado.api.TornadoDeviceContext; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLDataBuilder.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLDataBuilder.java index 8a98f04dfc..121f41fe8f 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLDataBuilder.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLDataBuilder.java @@ -25,8 +25,8 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.code.DataSection.Data; -import org.graalvm.compiler.lir.asm.DataBuilder; +import jdk.graal.compiler.code.DataSection.Data; +import jdk.graal.compiler.lir.asm.DataBuilder; import jdk.vm.ci.meta.Constant; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLHighTier.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLHighTier.java index fb5a76b57a..5db9427aa5 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLHighTier.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLHighTier.java @@ -22,24 +22,24 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.compiler; -import static org.graalvm.compiler.core.common.GraalOptions.ConditionalElimination; -import static org.graalvm.compiler.core.common.GraalOptions.OptConvertDeoptsToGuards; -import static org.graalvm.compiler.core.common.GraalOptions.PartialEscapeAnalysis; -import static org.graalvm.compiler.core.phases.HighTier.Options.Inline; -import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; - -import org.graalvm.compiler.loop.phases.ConvertDeoptimizeToGuardPhase; -import org.graalvm.compiler.loop.phases.LoopFullUnrollPhase; -import org.graalvm.compiler.nodes.loop.DefaultLoopPolicies; -import org.graalvm.compiler.nodes.loop.LoopPolicies; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; -import org.graalvm.compiler.phases.common.HighTierLoweringPhase; -import org.graalvm.compiler.phases.common.IterativeConditionalEliminationPhase; -import org.graalvm.compiler.phases.common.inlining.InliningPhase; -import org.graalvm.compiler.phases.schedule.SchedulePhase; -import org.graalvm.compiler.virtual.phases.ea.PartialEscapePhase; +import static jdk.graal.compiler.core.common.GraalOptions.ConditionalElimination; +import static jdk.graal.compiler.core.common.GraalOptions.OptConvertDeoptsToGuards; +import static jdk.graal.compiler.core.common.GraalOptions.PartialEscapeAnalysis; +import static jdk.graal.compiler.core.phases.HighTier.Options.Inline; +import static jdk.graal.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; + +import jdk.graal.compiler.loop.phases.ConvertDeoptimizeToGuardPhase; +import jdk.graal.compiler.loop.phases.LoopFullUnrollPhase; +import jdk.graal.compiler.nodes.loop.DefaultLoopPolicies; +import jdk.graal.compiler.nodes.loop.LoopPolicies; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.phases.common.HighTierLoweringPhase; +import jdk.graal.compiler.phases.common.IterativeConditionalEliminationPhase; +import jdk.graal.compiler.phases.common.inlining.InliningPhase; +import jdk.graal.compiler.phases.schedule.SchedulePhase; +import jdk.graal.compiler.virtual.phases.ea.PartialEscapePhase; import jdk.vm.ci.meta.MetaAccessProvider; import uk.ac.manchester.tornado.api.TornadoDeviceContext; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLIRGenerationPhase.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLIRGenerationPhase.java index 9949212dcf..3d44bcef72 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLIRGenerationPhase.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLIRGenerationPhase.java @@ -23,18 +23,18 @@ import java.util.List; -import org.graalvm.compiler.core.common.cfg.BasicBlock; -import org.graalvm.compiler.core.common.cfg.BlockMap; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGenerator; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.lir.phases.LIRPhase; -import org.graalvm.compiler.lir.ssa.SSAUtil; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.cfg.BasicBlock; +import jdk.graal.compiler.core.common.cfg.BlockMap; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGenerator; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.lir.phases.LIRPhase; +import jdk.graal.compiler.lir.ssa.SSAUtil; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.StructuredGraph.ScheduleResult; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.code.TargetDescription; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLIRGenerationResult.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLIRGenerationResult.java index 5f78941dbc..2d2ec1d554 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLIRGenerationResult.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLIRGenerationResult.java @@ -30,12 +30,12 @@ import java.util.Map; import java.util.Set; -import org.graalvm.compiler.core.common.CompilationIdentifier; -import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.framemap.FrameMapBuilder; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.core.common.CompilationIdentifier; +import jdk.graal.compiler.core.common.alloc.RegisterAllocationConfig; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.framemap.FrameMapBuilder; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; import jdk.vm.ci.code.CallingConvention; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLIRGenerator.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLIRGenerator.java index 784e9ffa28..284c0ca0bc 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLIRGenerator.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLIRGenerator.java @@ -26,22 +26,23 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.CompressEncoding; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.calc.Condition; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryOrderMode; -import org.graalvm.compiler.core.common.spi.CodeGenProviders; -import org.graalvm.compiler.core.common.spi.ForeignCallLinkage; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.LabelRef; -import org.graalvm.compiler.lir.SwitchStrategy; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGenerator; +import jdk.graal.compiler.core.common.CompressEncoding; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.calc.Condition; +import jdk.graal.compiler.core.common.memory.BarrierType; +import jdk.graal.compiler.core.common.memory.MemoryOrderMode; +import jdk.graal.compiler.lir.gen.BarrierSetLIRGeneratorTool; +import jdk.graal.compiler.nodes.spi.CoreProviders; +import jdk.graal.compiler.core.common.spi.ForeignCallLinkage; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.LabelRef; +import jdk.graal.compiler.lir.SwitchStrategy; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGenerator; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; @@ -81,10 +82,9 @@ public class OCLLIRGenerator extends LIRGenerator { private final OCLBuiltinTool oclBuiltinTool; private final OCLGenTool oclGenTool; - public OCLLIRGenerator(CodeGenProviders providers, LIRGenerationResult res) { - super(new OCLLIRKindTool((OCLTargetDescription) providers.getCodeCache().getTarget()), new OCLArithmeticTool(), new OCLBarrierSetLIRGenerator() { - - }, new OCLMoveFactory(), providers, res); + public OCLLIRGenerator(CoreProviders providers, LIRGenerationResult res) { + super(new OCLLIRKindTool((OCLTargetDescription) providers.getCodeCache().getTarget()), new OCLArithmeticTool() { + }, new BarrierSetLIRGeneratorTool() {}, new OCLMoveFactory(), providers, res); this.oclBuiltinTool = new OCLBuiltinTool(); this.oclGenTool = new OCLGenTool(this); } @@ -264,6 +264,16 @@ public void emitIntegerTestBranch(Value value, Value value1, LabelRef lr, LabelR unimplemented(); } + @Override + public void emitOpMaskTestBranch(Value left, boolean negateLeft, Value right, LabelRef trueDestination, LabelRef falseDestination, double trueSuccessorProbability) { + + } + + @Override + public void emitOpMaskOrTestBranch(Value left, Value right, boolean allZeros, LabelRef trueDestination, LabelRef falseDestination, double trueSuccessorProbability) { + + } + @Override public Variable emitIntegerTestMove(Value left, Value right, Value trueValue, Value falseValue) { Logger.traceBuildLIR(Logger.BACKEND.OpenCL, "emitIntegerTestMove: " + left + " " + "&" + right + " ? " + trueValue + " : " + falseValue); @@ -281,6 +291,16 @@ public Variable emitIntegerTestMove(Value left, Value right, Value trueValue, Va return variable; } + @Override + public Variable emitOpMaskTestMove(Value leftVal, boolean negateLeft, Value right, Value trueValue, Value falseValue) { + return null; + } + + @Override + public Variable emitOpMaskOrTestMove(Value leftVal, Value right, boolean allZeros, Value trueValue, Value falseValue) { + return null; + } + @Override public Variable emitReverseBytes(Value operand) { return null; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLowTier.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLowTier.java index 966e89907e..0690fe756c 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLowTier.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLLowTier.java @@ -23,18 +23,16 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.compiler; -import static org.graalvm.compiler.core.common.GraalOptions.ConditionalElimination; - -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase.AddressLowering; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; -import org.graalvm.compiler.phases.common.FixReadsPhase; -import org.graalvm.compiler.phases.common.IterativeConditionalEliminationPhase; -import org.graalvm.compiler.phases.common.LowTierLoweringPhase; -import org.graalvm.compiler.phases.common.UseTrappingNullChecksPhase; -import org.graalvm.compiler.phases.schedule.SchedulePhase; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase.AddressLowering; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.phases.common.FixReadsPhase; +import jdk.graal.compiler.phases.common.IterativeConditionalEliminationPhase; +import jdk.graal.compiler.phases.common.LowTierLoweringPhase; +import jdk.graal.compiler.phases.common.UseTrappingNullChecksPhase; +import jdk.graal.compiler.phases.schedule.SchedulePhase; import uk.ac.manchester.tornado.api.TornadoDeviceContext; import uk.ac.manchester.tornado.drivers.common.compiler.phases.analysis.TornadoFeatureExtraction; @@ -53,6 +51,8 @@ import uk.ac.manchester.tornado.runtime.common.TornadoOptions; import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoLowTier; +import static jdk.graal.compiler.core.common.GraalOptions.ConditionalElimination; + public class OCLLowTier extends TornadoLowTier { TornadoDeviceContext tornadoDeviceContext; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLMidTier.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLMidTier.java index 7a153f8206..e42521c40a 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLMidTier.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLMidTier.java @@ -22,18 +22,18 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.compiler; -import static org.graalvm.compiler.core.common.GraalOptions.ConditionalElimination; -import static org.graalvm.compiler.core.common.GraalOptions.OptFloatingReads; -import static org.graalvm.compiler.core.common.GraalOptions.ReassociateExpressions; - -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.FrameStateAssignmentPhase; -import org.graalvm.compiler.phases.common.GuardLoweringPhase; -import org.graalvm.compiler.phases.common.IterativeConditionalEliminationPhase; -import org.graalvm.compiler.phases.common.MidTierLoweringPhase; -import org.graalvm.compiler.phases.common.ReassociationPhase; -import org.graalvm.compiler.phases.common.RemoveValueProxyPhase; +import static jdk.graal.compiler.core.common.GraalOptions.ConditionalElimination; +import static jdk.graal.compiler.core.common.GraalOptions.OptFloatingReads; +import static jdk.graal.compiler.core.common.GraalOptions.ReassociateExpressions; + +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.FrameStateAssignmentPhase; +import jdk.graal.compiler.phases.common.GuardLoweringPhase; +import jdk.graal.compiler.phases.common.IterativeConditionalEliminationPhase; +import jdk.graal.compiler.phases.common.MidTierLoweringPhase; +import jdk.graal.compiler.phases.common.ReassociationPhase; +import jdk.graal.compiler.phases.common.RemoveValueProxyPhase; import uk.ac.manchester.tornado.drivers.common.compiler.phases.guards.BoundCheckEliminationPhase; import uk.ac.manchester.tornado.drivers.common.compiler.phases.guards.ExceptionCheckingElimination; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLMoveFactory.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLMoveFactory.java index 6998602c38..127f11563c 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLMoveFactory.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLMoveFactory.java @@ -25,8 +25,8 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.gen.MoveFactory; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.gen.MoveFactory; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Constant; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLNodeLIRBuilder.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLNodeLIRBuilder.java index 126e2c795d..78abb8f4da 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLNodeLIRBuilder.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLNodeLIRBuilder.java @@ -31,57 +31,57 @@ import java.util.Collection; import java.util.List; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.cfg.BlockMap; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.gen.NodeLIRBuilder; -import org.graalvm.compiler.core.gen.NodeMatchRules; -import org.graalvm.compiler.core.match.ComplexMatchValue; -import org.graalvm.compiler.debug.TTY; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.LabelRef; -import org.graalvm.compiler.lir.StandardOp.LabelOp; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGenerator.Options; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool.BlockScope; -import org.graalvm.compiler.nodes.AbstractEndNode; -import org.graalvm.compiler.nodes.AbstractMergeNode; -import org.graalvm.compiler.nodes.BreakpointNode; -import org.graalvm.compiler.nodes.DirectCallTargetNode; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.IndirectCallTargetNode; -import org.graalvm.compiler.nodes.Invoke; -import org.graalvm.compiler.nodes.LogicNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.LoopEndNode; -import org.graalvm.compiler.nodes.LoopExitNode; -import org.graalvm.compiler.nodes.LoweredCallTargetNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.SafepointNode; -import org.graalvm.compiler.nodes.ShortCircuitOrNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.FloatEqualsNode; -import org.graalvm.compiler.nodes.calc.FloatLessThanNode; -import org.graalvm.compiler.nodes.calc.IntegerBelowNode; -import org.graalvm.compiler.nodes.calc.IntegerEqualsNode; -import org.graalvm.compiler.nodes.calc.IntegerLessThanNode; -import org.graalvm.compiler.nodes.calc.IntegerTestNode; -import org.graalvm.compiler.nodes.calc.IsNullNode; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.nodes.extended.SwitchNode; -import org.graalvm.compiler.options.OptionValues; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.cfg.BlockMap; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.gen.NodeLIRBuilder; +import jdk.graal.compiler.core.gen.NodeMatchRules; +import jdk.graal.compiler.core.match.ComplexMatchValue; +import jdk.graal.compiler.debug.TTY; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.LabelRef; +import jdk.graal.compiler.lir.StandardOp.LabelOp; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGenerator.Options; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool.BlockScope; +import jdk.graal.compiler.nodes.AbstractEndNode; +import jdk.graal.compiler.nodes.AbstractMergeNode; +import jdk.graal.compiler.nodes.BreakpointNode; +import jdk.graal.compiler.nodes.DirectCallTargetNode; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.IndirectCallTargetNode; +import jdk.graal.compiler.nodes.Invoke; +import jdk.graal.compiler.nodes.LogicNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.LoopEndNode; +import jdk.graal.compiler.nodes.LoopExitNode; +import jdk.graal.compiler.nodes.LoweredCallTargetNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.SafepointNode; +import jdk.graal.compiler.nodes.ShortCircuitOrNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.FloatEqualsNode; +import jdk.graal.compiler.nodes.calc.FloatLessThanNode; +import jdk.graal.compiler.nodes.calc.IntegerBelowNode; +import jdk.graal.compiler.nodes.calc.IntegerEqualsNode; +import jdk.graal.compiler.nodes.calc.IntegerLessThanNode; +import jdk.graal.compiler.nodes.calc.IntegerTestNode; +import jdk.graal.compiler.nodes.calc.IsNullNode; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.extended.SwitchNode; +import jdk.graal.compiler.options.OptionValues; import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.meta.AllocatableValue; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLNodeMatchRules.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLNodeMatchRules.java index 830a87a4e7..29d4fff5c3 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLNodeMatchRules.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLNodeMatchRules.java @@ -21,8 +21,8 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.compiler; -import org.graalvm.compiler.core.gen.NodeMatchRules; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.core.gen.NodeMatchRules; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; public class OCLNodeMatchRules extends NodeMatchRules { diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLReferenceMapBuilder.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLReferenceMapBuilder.java index 91672073cd..3c130c2e18 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLReferenceMapBuilder.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLReferenceMapBuilder.java @@ -23,8 +23,8 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.framemap.ReferenceMapBuilder; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.framemap.ReferenceMapBuilder; import jdk.vm.ci.code.ReferenceMap; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/AtomicPlugins.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/AtomicPlugins.java index 423236b6de..854484cce0 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/AtomicPlugins.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/AtomicPlugins.java @@ -21,11 +21,11 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.compiler.plugins; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLAtomicIntegerPlugin.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLAtomicIntegerPlugin.java index 2980180251..d52c08de65 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLAtomicIntegerPlugin.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLAtomicIntegerPlugin.java @@ -21,10 +21,12 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.compiler.plugins; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin; - +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.NodePlugin; import jdk.vm.ci.hotspot.HotSpotResolvedJavaType; +import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaType; import uk.ac.manchester.tornado.api.internal.annotations.Vector; @@ -45,7 +47,8 @@ private boolean createAtomicIntegerInstance(GraphBuilderContext b, ResolvedJavaT OCLKind kind = resolveOCLKind(type); if (kind != OCLKind.ILLEGAL) { if (kind == OCLKind.INTEGER_ATOMIC_JAVA) { - b.push(JavaKind.Object, b.append(new TornadoAtomicIntegerNode(kind))); + ConstantNode initialValue = new ConstantNode(JavaConstant.forInt(0), StampFactory.forConstant(JavaConstant.forInt(0))); + b.push(JavaKind.Object, b.append(new TornadoAtomicIntegerNode(kind, initialValue))); return true; } } diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLGraphBuilderPlugins.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLGraphBuilderPlugins.java index 7185b8aa36..84f04e6332 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLGraphBuilderPlugins.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLGraphBuilderPlugins.java @@ -44,42 +44,43 @@ import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryOrderMode; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.nodes.extended.BoxNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; -import org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin; -import org.graalvm.compiler.nodes.java.NewArrayNode; -import org.graalvm.compiler.nodes.java.StoreIndexedNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.replacements.InlineDuringParsingPlugin; + import org.graalvm.word.LocationIdentity; +import jdk.graal.compiler.core.common.memory.BarrierType; +import jdk.graal.compiler.core.common.memory.MemoryOrderMode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.nodes.extended.BoxNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; +import jdk.graal.compiler.nodes.graphbuilderconf.NodePlugin; +import jdk.graal.compiler.nodes.java.NewArrayNode; +import jdk.graal.compiler.nodes.java.StoreIndexedNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.replacements.InlineDuringParsingPlugin; +import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.api.KernelContext; import uk.ac.manchester.tornado.api.TornadoVMIntrinsics; import uk.ac.manchester.tornado.api.exceptions.Debug; -import uk.ac.manchester.tornado.api.exceptions.TornadoRuntimeException; +import uk.ac.manchester.tornado.api.types.arrays.TornadoMemorySegment; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLArchitecture; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; @@ -102,7 +103,7 @@ public class OCLGraphBuilderPlugins { - public static void registerInvocationPlugins(final Plugins ps, final InvocationPlugins plugins) { + public static void registerInvocationPlugins(final Plugins ps, final InvocationPlugins plugins, final HotSpotMetaAccessProvider metaAccessProvider) { if (TornadoOptions.INLINE_DURING_BYTECODE_PARSING) { ps.appendInlineInvokePlugin(new InlineDuringParsingPlugin()); } @@ -123,7 +124,7 @@ public static void registerInvocationPlugins(final Plugins ps, final InvocationP OCLHalfFloatPlugins.registerPlugins(ps, plugins); - registerMemoryAccessPlugins(plugins); + registerMemoryAccessPlugins(plugins, metaAccessProvider); } @@ -131,6 +132,7 @@ private static void registerTornadoVMAtomicsPlugins(Registration r) { r.register(new InvocationPlugin("atomic_add", int[].class, Integer.TYPE, Integer.TYPE) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode array, ValueNode index, ValueNode inc) { + receiver.get(true); AtomicAddNodeTemplate atomicIncNode = new AtomicAddNodeTemplate(array, index, inc); b.addPush(JavaKind.Int, b.append(atomicIncNode)); return true; @@ -152,7 +154,9 @@ private static void registerAtomicCall(Registration r, JavaKind returnedJavaKind r.register(new InvocationPlugin("incrementAndGet", Receiver.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { - b.addPush(returnedJavaKind, b.append(new IncAtomicNode(receiver.get()))); + IncAtomicNode atomicNode = new IncAtomicNode(receiver.get(true)); + b.getGraph().addOrUnique(atomicNode); + b.addPush(returnedJavaKind, atomicNode); return true; } }); @@ -160,7 +164,8 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("decrementAndGet", Receiver.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { - b.addPush(returnedJavaKind, b.append(new DecAtomicNode(receiver.get()))); + receiver.get(true); + b.addPush(returnedJavaKind, b.append(new DecAtomicNode(receiver.get(true)))); return true; } }); @@ -168,7 +173,8 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("get", Receiver.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { - b.addPush(returnedJavaKind, b.append(new GetAtomicNode(receiver.get()))); + receiver.get(true); + b.addPush(returnedJavaKind, b.append(new GetAtomicNode(receiver.get(true)))); return true; } }); @@ -188,10 +194,10 @@ public boolean handleInvoke(GraphBuilderContext b, ResolvedJavaMethod method, Va // args[1] = arguments to the invoke node being substituted // ======================================================== ValueNode initialValue = args[1]; - if (initialValue instanceof ConstantNode) { - int value = Integer.parseInt(((ConstantNode) initialValue).getValue().toValueString()); + if (initialValue instanceof ConstantNode constantNode) { + int value = Integer.parseInt(constantNode.getValue().toValueString()); if (value == 0) { - atomic.setInitialValue(initialValue); + atomic.setInitialValue(constantNode); } else { atomic.setInitialValueAtUsages(initialValue); } @@ -211,11 +217,11 @@ public boolean handleInvoke(GraphBuilderContext b, ResolvedJavaMethod method, Va private static TornadoAtomicIntegerNode resolveReceiverAtomic(ValueNode thisObject) { TornadoAtomicIntegerNode atomicNode = null; - if (thisObject instanceof PiNode) { - thisObject = ((PiNode) thisObject).getOriginalNode(); + if (thisObject instanceof PiNode objectAsPiNode) { + thisObject = objectAsPiNode.getOriginalNode(); } - if (thisObject instanceof TornadoAtomicIntegerNode) { - atomicNode = (TornadoAtomicIntegerNode) thisObject; + if (thisObject instanceof TornadoAtomicIntegerNode returnedAtomicNode) { + atomicNode = returnedAtomicNode; } return atomicNode; } @@ -224,6 +230,7 @@ private static void registerLocalBarrier(Registration r) { r.register(new InvocationPlugin("localBarrier", Receiver.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { + receiver.get(true); OCLBarrierNode localBarrierNode = new OCLBarrierNode(OCLBarrierNode.OCLMemFenceFlags.LOCAL); b.add(localBarrierNode); return true; @@ -235,6 +242,7 @@ private static void registerGlobalBarrier(Registration r) { r.register(new InvocationPlugin("globalBarrier", Receiver.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { + receiver.get(true); OCLBarrierNode localBarrierNode = new OCLBarrierNode(OCLBarrierNode.OCLMemFenceFlags.GLOBAL); b.add(localBarrierNode); return true; @@ -246,8 +254,11 @@ private static void registerIntLocalArray(Registration r, JavaKind returnedJavaK r.register(new InvocationPlugin("allocateIntLocalArray", Receiver.class, int.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode size) { + receiver.get(true); ConstantNode constantNode = new ConstantNode(size.asConstant(), StampFactory.forKind(JavaKind.Int)); + b.getGraph().addOrUnique(constantNode); LocalArrayNode localArrayNode = new LocalArrayNode(OCLArchitecture.localSpace, elementType, constantNode); + b.getGraph().addOrUnique(localArrayNode); b.push(returnedJavaKind, localArrayNode); return true; } @@ -258,8 +269,11 @@ private static void registerLongLocalArray(Registration r, JavaKind returnedJava r.register(new InvocationPlugin("allocateLongLocalArray", Receiver.class, int.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode size) { + receiver.get(true); ConstantNode constantNode = new ConstantNode(size.asConstant(), StampFactory.forKind(JavaKind.Int)); + b.getGraph().addOrUnique(constantNode); LocalArrayNode localArrayNode = new LocalArrayNode(OCLArchitecture.localSpace, elementType, constantNode); + b.getGraph().addOrUnique(localArrayNode); b.push(returnedJavaKind, localArrayNode); return true; } @@ -270,8 +284,11 @@ private static void registerFloatLocalArray(Registration r, JavaKind returnedJav r.register(new InvocationPlugin("allocateFloatLocalArray", Receiver.class, int.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode size) { + receiver.get(true); ConstantNode constantNode = new ConstantNode(size.asConstant(), StampFactory.forKind(JavaKind.Int)); + b.getGraph().addOrUnique(constantNode); LocalArrayNode localArrayNode = new LocalArrayNode(OCLArchitecture.localSpace, elementType, constantNode); + b.getGraph().addOrUnique(localArrayNode); b.push(returnedJavaKind, localArrayNode); return true; } @@ -282,8 +299,11 @@ private static void registerDoubleLocalArray(Registration r, JavaKind returnedJa r.register(new InvocationPlugin("allocateDoubleLocalArray", Receiver.class, int.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode size) { + receiver.get(true); ConstantNode constantNode = new ConstantNode(size.asConstant(), StampFactory.forKind(JavaKind.Int)); + b.getGraph().addOrUnique(constantNode); LocalArrayNode localArrayNode = new LocalArrayNode(OCLArchitecture.localSpace, elementType, constantNode); + b.getGraph().addOrUnique(localArrayNode); b.push(returnedJavaKind, localArrayNode); return true; } @@ -314,48 +334,28 @@ private static void registerKernelContextPlugins(InvocationPlugins plugins) { localArraysPlugins(r); } - public static Class getValueLayoutClass(Class k) { - if (k == int.class) { - return ValueLayout.OfInt.class; - } else if (k == double.class) { - return ValueLayout.OfDouble.class; - } else if (k == float.class) { - return ValueLayout.OfFloat.class; - } else if (k == long.class) { - return ValueLayout.OfLong.class; - } else if (k == boolean.class) { - return ValueLayout.OfBoolean.class; - } else if (k == byte.class) { - return ValueLayout.OfByte.class; - } else if (k == char.class) { - return ValueLayout.OfChar.class; - } else if (k == short.class) { - return ValueLayout.OfShort.class; - } else { - throw new TornadoRuntimeException("Class type " + k + " not supported."); - } - } - - private static void registerMemoryAccessPlugins(InvocationPlugins plugins) { - Registration r = new Registration(plugins, MemorySegment.class); + private static void registerMemoryAccessPlugins(InvocationPlugins plugins, HotSpotMetaAccessProvider metaAccessProvider) { + Registration r = new Registration(plugins, TornadoMemorySegment.class); for (JavaKind kind : JavaKind.values()) { if (kind != JavaKind.Object && kind != JavaKind.Void && kind != JavaKind.Illegal) { - r.register(new InvocationPlugin("getAtIndex", Receiver.class, getValueLayoutClass(kind.toJavaClass()), long.class) { + r.register(new InvocationPlugin("get" + kind.name() + "AtIndex", Receiver.class, int.class, int.class) { @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode layout, ValueNode index) { - MulNode mulNode = b.append(new MulNode(index, ConstantNode.forInt(kind.getByteCount()))); - AddressNode addressNode = b.append(new OffsetAddressNode(receiver.get(), mulNode)); + public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode index, ValueNode baseIndex) { + AddNode absoluteIndexNode = b.append(new AddNode(index, baseIndex)); + MulNode mulNode = b.append(new MulNode(absoluteIndexNode, ConstantNode.forInt(kind.getByteCount()))); + AddressNode addressNode = b.append(new OffsetAddressNode(receiver.get(true), mulNode)); JavaReadNode readNode = new JavaReadNode(kind, addressNode, LocationIdentity.any(), BarrierType.NONE, MemoryOrderMode.PLAIN, false); b.addPush(kind, readNode); return true; } }); - r.register(new InvocationPlugin("setAtIndex", Receiver.class, getValueLayoutClass(kind.toJavaClass()), long.class, kind.toJavaClass()) { + r.register(new InvocationPlugin("setAtIndex", Receiver.class, int.class, kind.toJavaClass(), int.class) { @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode layout, ValueNode index, ValueNode value) { - MulNode mulNode = b.append(new MulNode(index, ConstantNode.forInt(kind.getByteCount()))); - AddressNode addressNode = b.append(new OffsetAddressNode(receiver.get(), mulNode)); + public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode index, ValueNode value, ValueNode baseIndex) { + AddNode absoluteIndexNode = b.append(new AddNode(index, baseIndex)); + MulNode mulNode = b.append(new MulNode(absoluteIndexNode, ConstantNode.forInt(kind.getByteCount()))); + AddressNode addressNode = b.append(new OffsetAddressNode(receiver.get(true), mulNode)); JavaWriteNode writeNode = new JavaWriteNode(kind, addressNode, LocationIdentity.any(), value, BarrierType.NONE, false); b.add(writeNode); return true; @@ -431,7 +431,7 @@ public boolean defaultHandler(GraphBuilderContext b, ResolvedJavaMethod targetMe private static void registerOpenCLBuiltinPlugins(InvocationPlugins plugins) { Registration r = new Registration(plugins, java.lang.Math.class); - // We have to overwrite some of standard math plugins + // We have to overwrite some standard math plugins r.setAllowOverwrite(true); registerOpenCLOverridesForType(r, Float.TYPE, JavaKind.Float); registerOpenCLOverridesForType(r, Double.TYPE, JavaKind.Double); diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLHalfFloatPlugins.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLHalfFloatPlugins.java index b9bd8b83b0..4f743255e9 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLHalfFloatPlugins.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLHalfFloatPlugins.java @@ -21,22 +21,21 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.compiler.plugins; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin; - +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.graphbuilderconf.NodePlugin; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.api.types.HalfFloat; import uk.ac.manchester.tornado.runtime.graal.nodes.AddHalfFloatNode; import uk.ac.manchester.tornado.runtime.graal.nodes.DivHalfFloatNode; -import uk.ac.manchester.tornado.runtime.graal.nodes.MultHalfFloatNode; -import uk.ac.manchester.tornado.runtime.graal.nodes.SubHalfFloatNode; import uk.ac.manchester.tornado.runtime.graal.nodes.HalfFloatPlaceholder; +import uk.ac.manchester.tornado.runtime.graal.nodes.MultHalfFloatNode; import uk.ac.manchester.tornado.runtime.graal.nodes.NewHalfFloatInstance; +import uk.ac.manchester.tornado.runtime.graal.nodes.SubHalfFloatNode; public class OCLHalfFloatPlugins { @@ -99,7 +98,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("getHalfFloatValue", InvocationPlugin.Receiver.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { - b.push(JavaKind.Short, b.append(new HalfFloatPlaceholder(receiver.get()))); + b.push(JavaKind.Short, b.append(new HalfFloatPlaceholder(receiver.get(true)))); return true; } }); diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLMathPlugins.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLMathPlugins.java index 86e78e9398..aeede086a3 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLMathPlugins.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLMathPlugins.java @@ -48,11 +48,11 @@ import static uk.ac.manchester.tornado.drivers.opencl.graal.nodes.OCLIntTernaryIntrinsicNode.Operation.CLAMP; import static uk.ac.manchester.tornado.drivers.opencl.graal.nodes.OCLIntUnaryIntrinsicNode.Operation.ABS; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLVectorNodePlugin.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLVectorNodePlugin.java index 3abae9bf9b..291762e291 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLVectorNodePlugin.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLVectorNodePlugin.java @@ -23,8 +23,8 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.compiler.plugins; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.NodePlugin; import jdk.vm.ci.hotspot.HotSpotResolvedJavaType; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLVectorPlugins.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLVectorPlugins.java index 92520af4d7..b67149bf34 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLVectorPlugins.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/plugins/OCLVectorPlugins.java @@ -26,23 +26,22 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.guarantee; import static uk.ac.manchester.tornado.runtime.common.TornadoOptions.TORNADO_ENABLE_BIFS; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.StampPair; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderTool; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; -import org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin; -import org.graalvm.compiler.nodes.java.StoreIndexedNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; - +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.StampPair; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderTool; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; +import jdk.graal.compiler.nodes.graphbuilderconf.NodePlugin; +import jdk.graal.compiler.nodes.java.StoreIndexedNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; @@ -219,7 +218,7 @@ private static VectorValueNode resolveReceiver(ValueNode thisObject) { } private static VectorValueNode resolveReceiver(Receiver receiver) { - ValueNode thisObject = receiver.get(); + ValueNode thisObject = receiver.get(true); return resolveReceiver(thisObject); } @@ -241,9 +240,10 @@ private static void registerVectorCollectionsPlugins(final InvocationPlugins plu final Class declaringClass = vectorKind.getJavaClass(); - final Registration r = new Registration(plugins, declaringClass); + final Registration r = new Registration(plugins, declaringClass).setAllowOverwrite(true); r.register(new InvocationPlugin("loadFromArray", Receiver.class, storageType, int.class) { public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode array, ValueNode index) { + receiver.get(true); final ResolvedJavaType resolvedType = b.getMetaAccess().lookupJavaType(vectorClass); OCLKind kind = OCLKind.fromResolvedJavaType(resolvedType); JavaKind elementKind = kind.getElementKind().asJavaKind(); @@ -256,6 +256,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("storeToArray", Receiver.class, vectorClass, storageType, int.class) { public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value, ValueNode array, ValueNode index) { + receiver.get(true); final ResolvedJavaType resolvedType = b.getMetaAccess().lookupJavaType(vectorClass); OCLKind kind = OCLKind.fromResolvedJavaType(resolvedType); JavaKind elementKind = kind.getElementKind().asJavaKind(); @@ -291,7 +292,7 @@ public boolean handleInvoke(GraphBuilderContext b, ResolvedJavaMethod method, Va r.register(new InvocationPlugin("get", Receiver.class, int.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode laneId) { - final VectorLoadElementNode loadElement = new VectorLoadElementNode(vectorKind.getElementKind(), receiver.get(), laneId); + final VectorLoadElementNode loadElement = new VectorLoadElementNode(vectorKind.getElementKind(), receiver.get(true), laneId); b.push(javaElementKind, b.append(loadElement)); return true; } @@ -300,8 +301,8 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("set", Receiver.class, vectorKind.getJavaClass()) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value) { - if (receiver.get() instanceof ParameterNode) { - final AddressNode address = new OffsetAddressNode(receiver.get(), null); + if (receiver.get(true) instanceof ParameterNode) { + final AddressNode address = new OffsetAddressNode(receiver.get(true), null); final VectorStoreGlobalMemory store = new VectorStoreGlobalMemory(vectorKind, address, value); b.add(b.append(store)); return true; @@ -313,7 +314,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("set", Receiver.class, int.class, elementType) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode laneId, ValueNode value) { - final VectorStoreElementProxyNode store = new VectorStoreElementProxyNode(vectorKind.getElementKind(), receiver.get(), laneId, value); + final VectorStoreElementProxyNode store = new VectorStoreElementProxyNode(vectorKind.getElementKind(), receiver.get(true), laneId, value); b.add(b.append(store)); return true; } @@ -322,7 +323,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("set", Receiver.class, int.class, storageType) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode laneId, ValueNode value) { - final VectorStoreElementProxyNode store = new VectorStoreElementProxyNode(vectorKind.getElementKind(), receiver.get(), laneId, value); + final VectorStoreElementProxyNode store = new VectorStoreElementProxyNode(vectorKind.getElementKind(), receiver.get(true), laneId, value); b.add(b.append(store)); return true; } @@ -374,7 +375,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec final ResolvedJavaType resolvedType = b.getMetaAccess().lookupJavaType(declaringClass); OCLKind kind = OCLKind.fromResolvedJavaType(resolvedType); JavaKind elementKind = kind.getElementKind().asJavaKind(); - ValueNode array = receiver.get(); + ValueNode array = receiver.get(true); GetArrayNode getArrayNode = new GetArrayNode(kind, array, elementKind); b.push(JavaKind.Object, b.append(getArrayNode)); return true; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLAddressLowering.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLAddressLowering.java index 8eb7b6aea6..7dc592a4a6 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLAddressLowering.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLAddressLowering.java @@ -23,13 +23,13 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.FloatingReadNode; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.FloatingReadNode; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase; import uk.ac.manchester.tornado.api.exceptions.TornadoInternalError; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLArchitecture; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLAddressNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLAddressNode.java index cc25029689..f9a00dec36 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLAddressNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLAddressNode.java @@ -21,15 +21,15 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLArchitecture.OCLMemoryBase; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLArithmeticTool.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLArithmeticTool.java index d11463957c..634176b87b 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLArithmeticTool.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLArithmeticTool.java @@ -26,20 +26,20 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic.RSQRT; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.calc.FloatConvert; +import jdk.graal.compiler.core.common.memory.MemoryExtendKind; +import jdk.graal.compiler.core.common.memory.MemoryOrderMode; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGenerator; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.PlatformKind; import jdk.vm.ci.meta.PrimitiveConstant; import jdk.vm.ci.meta.Value; import jdk.vm.ci.meta.ValueKind; -import org.graalvm.compiler.core.common.LIRKind; -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.lir.ConstantValue; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGenerator; import uk.ac.manchester.tornado.drivers.common.code.CodeUtil; import uk.ac.manchester.tornado.drivers.common.logging.Logger; @@ -139,19 +139,6 @@ public Value emitDiv(Value x, Value y, LIRFrameState frameState) { return emitBinaryAssign(OCLBinaryOp.DIV, LIRKind.combine(x, y), x, y); } - @Override - public Value emitFloatConvert(FloatConvert floatConvert, Value input) { - Logger.traceBuildLIR(Logger.BACKEND.OpenCL, "emitFloatConvert: (%s) %s", floatConvert, input); - switch (floatConvert) { - case I2D: - return emitUnaryAssign(OCLUnaryOp.CAST_TO_DOUBLE, LIRKind.value(OCLKind.DOUBLE), input); - default: - unimplemented("float convert %s", floatConvert); - } - return null; - - } - @Override public Value emitMul(Value x, Value y, boolean setFlags) { Logger.traceBuildLIR(Logger.BACKEND.OpenCL, "emitMul: %s * %s", x, y); @@ -207,21 +194,16 @@ public Value emitShr(Value x, Value y) { } private OCLUnaryOp getSignExtendOp(int toBits) { - switch (toBits) { - case 8: - return OCLUnaryOp.CAST_TO_BYTE; - case 16: - return OCLUnaryOp.CAST_TO_SHORT; - case 32: - return OCLUnaryOp.CAST_TO_INT; - case 64: - return OCLUnaryOp.CAST_TO_LONG; - default: - unimplemented(); - } - return null; + return switch (toBits) { + case 8 -> OCLUnaryOp.CAST_TO_BYTE; + case 16 -> OCLUnaryOp.CAST_TO_SHORT; + case 32 -> OCLUnaryOp.CAST_TO_INT; + case 64 -> OCLUnaryOp.CAST_TO_LONG; + default -> throw new UnsupportedOperationException("Unimplemented case for toBits: " + toBits); + }; } + @Override public Value emitNarrow(Value x, int toBits) { Logger.traceBuildLIR(Logger.BACKEND.OpenCL, "emitNarrow: %s, %d", x, toBits); @@ -266,6 +248,11 @@ public Value emitUShr(Value x, Value y) { return emitBinaryAssign(OCLBinaryOp.BITWISE_RIGHT_SHIFT, LIRKind.combine(x, y), x, y); } + @Override + public Value emitFloatConvert(FloatConvert op, Value inputVal, boolean canBeNaN, boolean canOverflow) { + return null; + } + @Override public Value emitXor(Value x, Value y) { Logger.traceBuildLIR(Logger.BACKEND.OpenCL, "emitXor: %s ^ %s", x, y); @@ -298,6 +285,11 @@ public Value emitZeroExtend(Value value, int fromBits, int toBits) { return result; } + @Override + public Value emitZeroExtend(Value inputVal, int fromBits, int toBits, boolean requiresExplicitZeroExtend, boolean requiresLIRKindChange) { + return null; + } + @Override protected boolean isNumericInteger(PlatformKind platformKind) { guarantee(platformKind instanceof OCLKind, "invalid platform kind"); diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLBinary.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLBinary.java index 4eebda33ab..33269933f6 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLBinary.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLBinary.java @@ -23,9 +23,9 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.LIRInstruction.Use; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.LIRInstruction.Use; +import jdk.graal.compiler.lir.Opcode; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLBuiltinTool.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLBuiltinTool.java index 027814a8a0..f538afca6b 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLBuiltinTool.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLBuiltinTool.java @@ -58,8 +58,8 @@ import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic.TAN; import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic.TANH; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLControlFlow.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLControlFlow.java index 4c4ad164a8..e60f2155bd 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLControlFlow.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLControlFlow.java @@ -21,7 +21,7 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.CONST; +import static jdk.graal.compiler.lir.LIRInstruction.OperandFlag.CONST; import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssemblerConstants.BREAK; import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssemblerConstants.CASE; import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssemblerConstants.CLOSE_PARENTHESIS; @@ -33,9 +33,9 @@ import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssemblerConstants.OPEN_PARENTHESIS; import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssemblerConstants.SWITCH; -import org.graalvm.compiler.lir.LIRInstructionClass; -import org.graalvm.compiler.lir.LabelRef; -import org.graalvm.compiler.lir.StandardOp.BlockEndOp; +import jdk.graal.compiler.lir.LIRInstructionClass; +import jdk.graal.compiler.lir.LabelRef; +import jdk.graal.compiler.lir.StandardOp.BlockEndOp; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Constant; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLDirectCall.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLDirectCall.java index bcbcb178ca..43132623a2 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLDirectCall.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLDirectCall.java @@ -23,11 +23,11 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.LIRInstruction.Def; -import org.graalvm.compiler.lir.LIRInstruction.Use; -import org.graalvm.compiler.nodes.DirectCallTargetNode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.LIRInstruction.Def; +import jdk.graal.compiler.lir.LIRInstruction.Use; +import jdk.graal.compiler.nodes.DirectCallTargetNode; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLArchitecture; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLGenTool.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLGenTool.java index 798ec8e426..e98dc5525d 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLGenTool.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLGenTool.java @@ -27,11 +27,11 @@ import java.util.HashMap; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLKind.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLKind.java index b9c2d9a7ca..b948e1c055 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLKind.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLKind.java @@ -331,39 +331,26 @@ public static OCLKind resolveToVectorKind(ResolvedJavaType type) { } public static int lookupTypeIndex(OCLKind kind) { - switch (kind) { - case SHORT: - return 0; - case INT: - return 1; - case FLOAT: - return 2; - case CHAR: - return 3; - case DOUBLE: - return 4; - case HALF: - return 5; - default: - return -1; - } + return switch (kind) { + case SHORT -> 0; + case INT -> 1; + case FLOAT -> 2; + case CHAR -> 3; + case DOUBLE -> 4; + case HALF -> 5; + default -> -1; + }; } public static int lookupLengthIndex(int length) { - switch (length) { - case 2: - return 0; - case 3: - return 1; - case 4: - return 2; - case 8: - return 3; - case 16: - return 4; - default: - return -1; - } + return switch (length) { + case 2 -> 0; + case 3 -> 1; + case 4 -> 2; + case 8 -> 3; + case 16 -> 4; + default -> -1; + }; } @Override diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLLIROp.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLLIROp.java index eb7e742f85..546e21afe8 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLLIROp.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLLIROp.java @@ -21,7 +21,7 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.LIRKind; import jdk.vm.ci.meta.PlatformKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLLIRStmt.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLLIRStmt.java index 665035c52c..7d2673123c 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLLIRStmt.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLLIRStmt.java @@ -21,10 +21,10 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.LIRInstructionClass; -import org.graalvm.compiler.lir.Opcode; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.LIRInstructionClass; +import jdk.graal.compiler.lir.Opcode; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLNullary.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLNullary.java index 18b8a1a33e..2369cd4613 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLNullary.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLNullary.java @@ -23,8 +23,8 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Opcode; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLNullaryIntrinsic; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLPragmaUnroll.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLPragmaUnroll.java index 955b2006ca..bd9e498ea5 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLPragmaUnroll.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLPragmaUnroll.java @@ -1,7 +1,7 @@ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Opcode; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; import uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLCompilationResultBuilder; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLPrintString.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLPrintString.java index 6bf44c0a6e..50799e487b 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLPrintString.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLPrintString.java @@ -25,8 +25,8 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Opcode; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; import uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLCompilationResultBuilder; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLPrintf.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLPrintf.java index dd88d43f32..b2c1de258e 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLPrintf.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLPrintf.java @@ -23,9 +23,9 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Opcode; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLReturnSlot.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLReturnSlot.java index 608dd5eb90..0eaa5dba6b 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLReturnSlot.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLReturnSlot.java @@ -21,8 +21,8 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Opcode; import jdk.vm.ci.meta.AllocatableValue; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLTPrintf.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLTPrintf.java new file mode 100644 index 0000000000..2d2d6de39c --- /dev/null +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLTPrintf.java @@ -0,0 +1,97 @@ +/* + * This file is part of Tornado: A heterogeneous programming framework: + * https://github.com/beehive-lab/tornadovm + * + * Copyright (c) 2013-2020, APT Group, Department of Computer Science, + * The University of Manchester. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +package uk.ac.manchester.tornado.drivers.opencl.graal.lir; + +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Opcode; + +import jdk.vm.ci.meta.Value; +import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; +import uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLCompilationResultBuilder; + +@Opcode("TPRINTF") +public class OCLTPrintf extends OCLLIROp { + + private Value[] inputs; + + public OCLTPrintf(Value[] inputs) { + super(LIRKind.Illegal); + this.inputs = inputs; + } + + @Override + public void emit(OCLCompilationResultBuilder crb, OCLAssembler asm) { + int depth = crb.getResult().getMeta().getDomain().getDepth(); + + asm.emit("if( "); + asm.emit("get_global_id(0) == "); + asm.emitValue(crb, inputs[0]); + + if (depth > 1) { + asm.emit(" && get_global_id(1) == "); + asm.emitValue(crb, inputs[1]); + } + + if (depth > 2) { + asm.emit(" && get_global_id(2) == "); + asm.emitValue(crb, inputs[2]); + } + + asm.emit(" )"); + asm.beginScope(); + + asm.indent(); + asm.emit("printf( \"tornado[%3d,%3d,%3d]> "); + asm.emitValue(crb, inputs[3]); + asm.emit("\", "); + for (int i = 0; i < 3; i++) { + asm.emitValue(crb, inputs[i]); + asm.emit(", "); + } + for (int i = 4; i < inputs.length - 1; i++) { + asm.emitValue(crb, inputs[i]); + asm.emit(", "); + } + asm.emitValue(crb, inputs[inputs.length - 1]); + asm.emit(")"); + asm.delimiter(); + asm.eol(); + asm.endScope(" -- "); + + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(String.format("<%s,%s,%s> tprintf( %s", inputs[0], inputs[1], inputs[2], inputs[3])); + for (int i = 4; i < inputs.length - 1; i++) { + sb.append(inputs[i]); + sb.append(", "); + } + sb.append(inputs[inputs.length - 1]); + sb.append(" )"); + return sb.toString(); + } + +} diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLTernary.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLTernary.java index a8e093b476..90c1063f7e 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLTernary.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLTernary.java @@ -28,9 +28,9 @@ import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssemblerConstants.CLOSE_PARENTHESIS; import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssemblerConstants.OPEN_PARENTHESIS; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.LIRInstruction.Use; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.LIRInstruction.Use; +import jdk.graal.compiler.lir.Opcode; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLThreadConfiguration.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLThreadConfiguration.java index b27ff6766c..7e82a03ccd 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLThreadConfiguration.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLThreadConfiguration.java @@ -23,8 +23,8 @@ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Opcode; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; import uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLCompilationResultBuilder; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLUnary.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLUnary.java index 450eb57cc0..e913966821 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLUnary.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLUnary.java @@ -23,9 +23,9 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.LIRInstruction.Use; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.LIRInstruction.Use; +import jdk.graal.compiler.lir.Opcode; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLVectorAssign.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLVectorAssign.java index 7adcae0900..106e6db7b3 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLVectorAssign.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLVectorAssign.java @@ -23,9 +23,9 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.LIRInstruction.Use; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.LIRInstruction.Use; +import jdk.graal.compiler.lir.Opcode; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLVectorElementSelect.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLVectorElementSelect.java index 36771871b0..9a2152fe50 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLVectorElementSelect.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLVectorElementSelect.java @@ -23,8 +23,8 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Opcode; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLWriteAtomicNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLWriteAtomicNode.java index a697541b53..cec1b648f7 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLWriteAtomicNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/lir/OCLWriteAtomicNode.java @@ -28,22 +28,22 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryOrderMode; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FrameState; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.AbstractWriteNode; -import org.graalvm.compiler.nodes.memory.FixedAccessNode; -import org.graalvm.compiler.nodes.memory.LIRLowerableAccess; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.memory.BarrierType; +import jdk.graal.compiler.core.common.memory.MemoryOrderMode; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FrameState; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.AbstractWriteNode; +import jdk.graal.compiler.nodes.memory.FixedAccessNode; +import jdk.graal.compiler.nodes.memory.LIRLowerableAccess; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import org.graalvm.word.LocationIdentity; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/meta/OCLMemorySpace.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/meta/OCLMemorySpace.java index 0af8745358..ad85d94d3b 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/meta/OCLMemorySpace.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/meta/OCLMemorySpace.java @@ -21,7 +21,7 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.meta; -import org.graalvm.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.LIRKind; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.api.exceptions.TornadoInternalError; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/AtomicAddNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/AtomicAddNode.java index de490f3ecd..fcf2fec314 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/AtomicAddNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/AtomicAddNode.java @@ -23,12 +23,12 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.java.AccessIndexedNode; -import org.graalvm.compiler.nodes.spi.Lowerable; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.java.AccessIndexedNode; +import jdk.graal.compiler.nodes.spi.Lowerable; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/AtomicAddNodeTemplate.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/AtomicAddNodeTemplate.java index d360ada475..3ef66b50e4 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/AtomicAddNodeTemplate.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/AtomicAddNodeTemplate.java @@ -21,15 +21,15 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/AtomicWriteNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/AtomicWriteNode.java index 78c20a6e24..1491a6fe61 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/AtomicWriteNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/AtomicWriteNode.java @@ -25,20 +25,20 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryOrderMode; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FrameState; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.AbstractWriteNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.memory.BarrierType; +import jdk.graal.compiler.core.common.memory.MemoryOrderMode; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FrameState; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.AbstractWriteNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import org.graalvm.word.LocationIdentity; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLBinaryIntrinsic; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/CastNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/CastNode.java index b2aebae5fa..80a1cd15f6 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/CastNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/CastNode.java @@ -21,16 +21,16 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.calc.FloatConvert; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.calc.FloatConvert; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryOp; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/DecAtomicNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/DecAtomicNode.java index e3e3c1e626..fa4e15a9c5 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/DecAtomicNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/DecAtomicNode.java @@ -21,14 +21,14 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/FPGAWorkGroupSizeNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/FPGAWorkGroupSizeNode.java index 93a13e2596..7deb7b7fa5 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/FPGAWorkGroupSizeNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/FPGAWorkGroupSizeNode.java @@ -22,13 +22,13 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; @NodeInfo public class FPGAWorkGroupSizeNode extends FixedWithNextNode implements LIRLowerable { diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/FixedArrayCopyNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/FixedArrayCopyNode.java index f182fc3b90..704e4be64d 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/FixedArrayCopyNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/FixedArrayCopyNode.java @@ -21,30 +21,29 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; - import uk.ac.manchester.tornado.drivers.opencl.graal.OCLArchitecture; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLBinary; -import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIRStmt; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; +import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIRStmt; /** * This node generates a pointer copy between two arrays in private memory. */ @NodeInfo -public class FixedArrayCopyNode extends FloatingNode implements LIRLowerable { +public class FixedArrayCopyNode extends FloatingNode implements LIRLowerable { public static final NodeClass TYPE = NodeClass.create(FixedArrayCopyNode.class); diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/FixedArrayNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/FixedArrayNode.java index a8cbe1f563..4283ef4b66 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/FixedArrayNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/FixedArrayNode.java @@ -21,16 +21,16 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.core.common.type.TypeReference; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.core.common.type.TypeReference; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GetAtomicNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GetAtomicNode.java index c74eecbf5a..d2cd768ad4 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GetAtomicNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GetAtomicNode.java @@ -21,14 +21,14 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GlobalThreadIdNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GlobalThreadIdNode.java index abbc628648..512d5c0fa3 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GlobalThreadIdNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GlobalThreadIdNode.java @@ -21,15 +21,15 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GlobalThreadSizeNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GlobalThreadSizeNode.java index 4f35032c1f..8370a29c59 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GlobalThreadSizeNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GlobalThreadSizeNode.java @@ -21,15 +21,15 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GroupIdNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GroupIdNode.java index a8a2e1c205..e7fea10894 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GroupIdNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/GroupIdNode.java @@ -21,16 +21,16 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/IncAtomicNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/IncAtomicNode.java index 6a145f41cb..42317d3a3d 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/IncAtomicNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/IncAtomicNode.java @@ -21,14 +21,14 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/InstanceLocalMemoryNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/InstanceLocalMemoryNode.java index 97f0f2e73f..eb246418b8 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/InstanceLocalMemoryNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/InstanceLocalMemoryNode.java @@ -25,16 +25,16 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/IntelUnrollPragmaNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/IntelUnrollPragmaNode.java index 3ca4dec8ab..89c42d5cb5 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/IntelUnrollPragmaNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/IntelUnrollPragmaNode.java @@ -24,13 +24,13 @@ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIRStmt; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalArrayNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalArrayNode.java index 48fc0d35ba..b292b31b7f 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalArrayNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalArrayNode.java @@ -23,17 +23,17 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.core.common.type.TypeReference; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.core.common.type.TypeReference; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaType; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalGroupSizeNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalGroupSizeNode.java index f6a2748229..4313fdf862 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalGroupSizeNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalGroupSizeNode.java @@ -23,15 +23,15 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalThreadIDFixedNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalThreadIDFixedNode.java index f5cb8ddc06..cb5ecd73e7 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalThreadIDFixedNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalThreadIDFixedNode.java @@ -25,15 +25,15 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalThreadIdNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalThreadIdNode.java index 4f35140ba2..17c82ca189 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalThreadIdNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalThreadIdNode.java @@ -21,16 +21,16 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalThreadSizeNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalThreadSizeNode.java index 148a7cc7ad..d9a1b3e108 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalThreadSizeNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalThreadSizeNode.java @@ -21,16 +21,16 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalWorkGroupDimensionsNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalWorkGroupDimensionsNode.java index 8a322eeaa8..3445e50a28 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalWorkGroupDimensionsNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/LocalWorkGroupDimensionsNode.java @@ -23,14 +23,14 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/NodeAtomic.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/NodeAtomic.java index 8f4ed3791a..40db8bd27b 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/NodeAtomic.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/NodeAtomic.java @@ -21,10 +21,10 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; @NodeInfo(shortName = "ATOMIC") public abstract class NodeAtomic extends ValueNode { diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLAtomicAddLIR.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLAtomicAddLIR.java index b0ed15429f..8a6053a6be 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLAtomicAddLIR.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLAtomicAddLIR.java @@ -23,17 +23,17 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.Node.Input; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.Node.Input; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; @NodeInfo(shortName = "atomic_add") public class OCLAtomicAddLIR extends FixedNode implements LIRLowerable { diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLBarrierNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLBarrierNode.java index db127732b3..dd1ede0be1 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLBarrierNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLBarrierNode.java @@ -23,13 +23,13 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryIntrinsic; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIRStmt; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFMANode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFMANode.java index 5e8f30d860..5ec6cb3cf3 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFMANode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFMANode.java @@ -23,14 +23,14 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLArithmeticTool; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFPBinaryIntrinsicNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFPBinaryIntrinsicNode.java index 4ce4e13c29..531a1a8887 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFPBinaryIntrinsicNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFPBinaryIntrinsicNode.java @@ -25,19 +25,19 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFPTernaryIntrinsicNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFPTernaryIntrinsicNode.java index f631f27cda..a4407cc24c 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFPTernaryIntrinsicNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFPTernaryIntrinsicNode.java @@ -25,20 +25,20 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.TernaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.TernaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFPUnaryIntrinsicNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFPUnaryIntrinsicNode.java index e54878feaa..0093a95514 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFPUnaryIntrinsicNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLFPUnaryIntrinsicNode.java @@ -25,21 +25,21 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.type.FloatStamp; -import org.graalvm.compiler.core.common.type.PrimitiveStamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.UnaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.FloatStamp; +import jdk.graal.compiler.core.common.type.PrimitiveStamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.UnaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntBinaryIntrinsicNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntBinaryIntrinsicNode.java index 43829e8486..0f0b6d4c9c 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntBinaryIntrinsicNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntBinaryIntrinsicNode.java @@ -25,19 +25,19 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntTernaryIntrinsicNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntTernaryIntrinsicNode.java index 283425f727..30fce9f6a1 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntTernaryIntrinsicNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntTernaryIntrinsicNode.java @@ -25,21 +25,21 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.TernaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.TernaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntUnaryIntrinsicNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntUnaryIntrinsicNode.java index da87acbbdc..479cd3513e 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntUnaryIntrinsicNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntUnaryIntrinsicNode.java @@ -23,18 +23,18 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.UnaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.UnaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntrinsicNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntrinsicNode.java index 8a8d643ada..7d4a94288a 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntrinsicNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLIntrinsicNode.java @@ -27,20 +27,20 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLStampFactory; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLKernelContextAccessNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLKernelContextAccessNode.java index c5407fea7c..134434a6ae 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLKernelContextAccessNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLKernelContextAccessNode.java @@ -23,15 +23,15 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLPragmaUnroll.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLPragmaUnroll.java index 14dc5796b7..a254c566e5 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLPragmaUnroll.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OCLPragmaUnroll.java @@ -23,8 +23,8 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Opcode; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; import uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLCompilationResultBuilder; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OpenCLPrintf.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OpenCLPrintf.java index 1684d9ca82..d12e8ee6dd 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OpenCLPrintf.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/OpenCLPrintf.java @@ -21,12 +21,12 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIRStmt.ExprStmt; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLPrintString; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/PrintfNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/PrintfNode.java index aa15e08983..ef5da10e54 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/PrintfNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/PrintfNode.java @@ -21,14 +21,14 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.graph.NodeInputList; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.graph.NodeInputList; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIRStmt.ExprStmt; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/RSqrtNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/RSqrtNode.java index 2107c4b69a..5f6f670550 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/RSqrtNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/RSqrtNode.java @@ -21,14 +21,14 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLArithmeticTool; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/ReadHalfFloatNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/ReadHalfFloatNode.java index e83d4c3773..6711cf16e6 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/ReadHalfFloatNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/ReadHalfFloatNode.java @@ -21,16 +21,16 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/TPrintfNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/TPrintfNode.java new file mode 100644 index 0000000000..0124cc4eb6 --- /dev/null +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/TPrintfNode.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2018, 2020, APT Group, Department of Computer Science, + * The University of Manchester. All rights reserved. + * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ +package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; + +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.graph.NodeInputList; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; + +import jdk.vm.ci.meta.Value; +import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIRStmt.ExprStmt; +import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLTPrintf; + +@NodeInfo(shortName = "tprintf") +public class TPrintfNode extends FixedWithNextNode implements LIRLowerable { + + public static final NodeClass TYPE = NodeClass.create(TPrintfNode.class); + + @Input + private NodeInputList inputs; + + public TPrintfNode(ValueNode... values) { + super(TYPE, StampFactory.forVoid()); + this.inputs = new NodeInputList<>(this, values.length); + for (int i = 0; i < values.length; i++) { + inputs.set(i, values[i]); + } + } + + @Override + public void generate(NodeLIRBuilderTool gen) { + Value[] args = new Value[inputs.size()]; + for (int i = 0; i < args.length; i++) { + + ValueNode param = inputs.get(i); + if (param.isConstant()) { + args[i] = gen.operand(param); + } else { + args[i] = gen.getLIRGeneratorTool().emitMove(gen.operand(param.asNode())); + } + } + gen.getLIRGeneratorTool().append(new ExprStmt(new OCLTPrintf(args))); + } + +} diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/TornadoAtomicIntegerNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/TornadoAtomicIntegerNode.java index 9be1aff608..efa075c8d7 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/TornadoAtomicIntegerNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/TornadoAtomicIntegerNode.java @@ -10,7 +10,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * @@ -24,17 +24,16 @@ import java.util.ArrayList; import java.util.HashMap; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; - +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.api.exceptions.TornadoRuntimeException; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLStampFactory; @@ -47,35 +46,24 @@ public class TornadoAtomicIntegerNode extends FixedWithNextNode implements LIRLowerable { public static final NodeClass TYPE = NodeClass.create(TornadoAtomicIntegerNode.class); - - private final OCLKind kind; - - private boolean ATOMIC_2_0 = false; - + private static final int DEFAULT_VALUE = -1; // How many atomics integers per graph public static HashMap> globalAtomics = new HashMap<>(); - // Mapping between: // Java Method: -> { ParamIndex -> Position in the Atomic Buffer } public static HashMap> globalAtomicsParameters = new HashMap<>(); - - private static final int DEFAULT_VALUE = -1; - + private final OCLKind kind; @Input - ValueNode initialValue; - + protected ConstantNode initialValue; + private boolean ATOMIC_2_0 = false; private int indexFromGlobalMemory; private boolean atomicsByParameter = false; - public TornadoAtomicIntegerNode(OCLKind kind) { + public TornadoAtomicIntegerNode(OCLKind kind, ConstantNode initialValue) { super(TYPE, OCLStampFactory.getStampFor(kind)); this.kind = kind; - this.initialValue = ConstantNode.forInt(0); - } - - public void setInitialValue(ValueNode valueNode) { - initialValue = valueNode; + this.initialValue = initialValue; } public void setInitialValueAtUsages(ValueNode valueNode) { @@ -86,6 +74,10 @@ public ValueNode getInitialValue() { return this.initialValue; } + public void setInitialValue(ConstantNode valueNode) { + initialValue = valueNode; + } + private void generateExpressionForOpenCL2_0(NodeLIRBuilderTool gen) { LIRGeneratorTool tool = gen.getLIRGeneratorTool(); Variable result = tool.newVariable(tool.getLIRKind(StampFactory.intValue())); @@ -104,8 +96,8 @@ public int getIndexFromGlobalMemory() { } private int getIntFromValueNode() { - if (initialValue instanceof ConstantNode) { - ConstantNode c = (ConstantNode) initialValue; + if (initialValue instanceof ConstantNode initFromValueNode) { + ConstantNode c = initFromValueNode; return Integer.parseInt(c.getValue().toValueString()); } else { throw new TornadoRuntimeException("Value node not implemented for Atomics"); @@ -124,8 +116,8 @@ private void updateGlobalAtomicTable(HashMap positions, int paramIndex, int size * buffer. * * @param paramIndex - * Object parameter index taken from - * {@link org.graalvm.compiler.nodes.ParameterNode}. + * Object parameter index taken from + * {@link org.graalvm.compiler.nodes.ParameterNode}. */ public synchronized void assignIndexFromParameter(int paramIndex) { if (!globalAtomics.containsKey(this.graph().method())) { diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/WriteHalfFloatNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/WriteHalfFloatNode.java index 5669aa1cb1..ed9202b7e3 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/WriteHalfFloatNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/WriteHalfFloatNode.java @@ -21,16 +21,16 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/XclPipelineAttribute.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/XclPipelineAttribute.java index d90d426d24..5a581186be 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/XclPipelineAttribute.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/XclPipelineAttribute.java @@ -21,8 +21,8 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Opcode; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler; import uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLCompilationResultBuilder; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/XilinxPipeliningPragmaNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/XilinxPipeliningPragmaNode.java index 53e14061c3..23eb2908f2 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/XilinxPipeliningPragmaNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/XilinxPipeliningPragmaNode.java @@ -22,13 +22,13 @@ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIRStmt; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/calc/DivNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/calc/DivNode.java index e0e786b9ae..9c72709807 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/calc/DivNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/calc/DivNode.java @@ -26,18 +26,18 @@ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes.calc; -import org.graalvm.compiler.core.common.type.ArithmeticOpTable; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeCycles; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryArithmeticNode; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.ArithmeticOpTable; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeCycles; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryArithmeticNode; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; /* diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalAndNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalAndNode.java index ccf428cd79..6fc2eb35df 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalAndNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalAndNode.java @@ -23,12 +23,12 @@ import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLBinaryOp.LOGICAL_AND; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.LogicNode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.LogicNode; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalEqualsNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalEqualsNode.java index 9ad600e9af..e397583043 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalEqualsNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalEqualsNode.java @@ -23,11 +23,11 @@ import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLBinaryOp.RELATIONAL_EQ; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.LogicNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.LogicNode; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLBinary; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalNotNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalNotNode.java index 445a73a4d3..851a197027 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalNotNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalNotNode.java @@ -23,11 +23,11 @@ import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLUnaryOp.LOGICAL_NOT; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.LogicNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.LogicNode; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIRStmt.AssignStmt; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalOrNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalOrNode.java index 67bd0dbf92..2f808276ea 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalOrNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/logic/LogicalOrNode.java @@ -23,11 +23,11 @@ import static uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLBinaryOp.LOGICAL_OR; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.LogicNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.LogicNode; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLBinary; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/GetArrayNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/GetArrayNode.java index 31c4f5817f..e4a165ea82 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/GetArrayNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/GetArrayNode.java @@ -22,15 +22,15 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLStampFactory; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/LoadIndexedVectorNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/LoadIndexedVectorNode.java index bf8a5a3a96..20ec426c6f 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/LoadIndexedVectorNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/LoadIndexedVectorNode.java @@ -23,10 +23,10 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.java.LoadIndexedNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.java.LoadIndexedNode; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLStampFactory; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/NewVectorNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/NewVectorNode.java index ac775458a8..633079e0ed 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/NewVectorNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/NewVectorNode.java @@ -21,15 +21,15 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLStampFactory; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorAddHalfNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorAddHalfNode.java index 5b61157f32..0a17ddecf4 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorAddHalfNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorAddHalfNode.java @@ -23,15 +23,15 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIRStmt; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorAddNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorAddNode.java index d84db78633..11a6d6e793 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorAddNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorAddNode.java @@ -21,18 +21,18 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorDivNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorDivNode.java index 4ed8f17845..214cec1214 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorDivNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorDivNode.java @@ -21,14 +21,14 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorElementOpNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorElementOpNode.java index df79001a74..eb30f78401 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorElementOpNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorElementOpNode.java @@ -26,20 +26,20 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.guarantee; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorElementSelectNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorElementSelectNode.java index f489408780..fcae56fcf5 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorElementSelectNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorElementSelectNode.java @@ -23,14 +23,14 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.guarantee; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssembler.OCLBinaryOp; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorLoadElementNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorLoadElementNode.java index c1c0f5f736..3e806ba934 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorLoadElementNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorLoadElementNode.java @@ -21,9 +21,9 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; import uk.ac.manchester.tornado.runtime.graal.nodes.interfaces.MarkVectorLoad; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorLoadElementProxyNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorLoadElementProxyNode.java index 2c06290f66..d483735e12 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorLoadElementProxyNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorLoadElementProxyNode.java @@ -23,12 +23,12 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLStampFactory; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorLoadNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorLoadNode.java index fa547649a9..c6e9087602 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorLoadNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorLoadNode.java @@ -23,13 +23,13 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.java.AccessIndexedNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.java.AccessIndexedNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLStamp; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorMulNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorMulNode.java index 00c87886a7..55e9c71cd4 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorMulNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorMulNode.java @@ -21,14 +21,14 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorMultHalfNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorMultHalfNode.java index 6e9b867794..cb63142084 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorMultHalfNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorMultHalfNode.java @@ -23,15 +23,15 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIRStmt; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorSelectionNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorSelectionNode.java index bbdd0cfca3..2ce2115022 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorSelectionNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorSelectionNode.java @@ -21,12 +21,12 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLConstantValue; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorStoreElementProxyNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorStoreElementProxyNode.java index 7dad5fc337..c065b588e1 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorStoreElementProxyNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorStoreElementProxyNode.java @@ -23,15 +23,15 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.Canonicalizable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.Canonicalizable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLStampFactory; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorStoreGlobalMemory.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorStoreGlobalMemory.java index 87f46af16e..0534db9255 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorStoreGlobalMemory.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorStoreGlobalMemory.java @@ -25,13 +25,13 @@ import static uk.ac.manchester.tornado.drivers.providers.TornadoMemoryOrder.GPU_MEMORY_MODE; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLStampFactory; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorSubHalfNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorSubHalfNode.java index 3acf3ecbac..08532c7dd4 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorSubHalfNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorSubHalfNode.java @@ -23,15 +23,15 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLLIRStmt; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorSubNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorSubNode.java index 69334d5c09..7d1a1e83a0 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorSubNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorSubNode.java @@ -21,14 +21,14 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorValueNode.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorValueNode.java index 1013eaab87..143364c896 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorValueNode.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/nodes/vector/VectorValueNode.java @@ -25,24 +25,24 @@ import java.util.List; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.graph.NodeInputList; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.InvokeNode; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.graph.NodeInputList; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.InvokeNode; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/InverseSquareRootPhase.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/InverseSquareRootPhase.java index 9819829262..ce4d45c67a 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/InverseSquareRootPhase.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/InverseSquareRootPhase.java @@ -23,13 +23,13 @@ import java.util.Optional; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatDivNode; -import org.graalvm.compiler.nodes.calc.SqrtNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatDivNode; +import jdk.graal.compiler.nodes.calc.SqrtNode; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.RSqrtNode; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFMAPhase.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFMAPhase.java index 6d81e3cd44..f3a1275f0d 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFMAPhase.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFMAPhase.java @@ -23,12 +23,12 @@ import java.util.Optional; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.phases.Phase; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.OCLFMANode; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFP16SupportPhase.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFP16SupportPhase.java index 8fb8807515..d9c0ea9b08 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFP16SupportPhase.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFP16SupportPhase.java @@ -23,11 +23,10 @@ import java.util.Optional; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.phases.Phase; - +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.api.TornadoDeviceContext; import uk.ac.manchester.tornado.api.exceptions.TornadoDeviceFP16NotSupported; import uk.ac.manchester.tornado.drivers.opencl.OCLDevice; @@ -53,11 +52,11 @@ public Optional notApplicableTo(GraphState graphState) { protected void run(StructuredGraph graph) { boolean fp16Support = false; String extensions = null; - if (deviceContext.getDevice() instanceof OCLDevice) { - OCLDevice oclDevice = (OCLDevice) deviceContext.getDevice(); + if (deviceContext.getDevice() instanceof OCLDevice oclDeviceFromContext) { + OCLDevice oclDevice = oclDeviceFromContext; extensions = oclDevice.getDeviceExtensions(); - } else if (deviceContext.getDevice() instanceof VirtualOCLDevice) { - VirtualOCLDevice oclDevice = (VirtualOCLDevice) deviceContext.getDevice(); + } else if (deviceContext.getDevice() instanceof VirtualOCLDevice virtualOCLDeviceFromContext) { + VirtualOCLDevice oclDevice = virtualOCLDeviceFromContext; extensions = oclDevice.getDeviceExtensions(); } if (extensions != null && extensions.contains("cl_khr_fp16")) { diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFP64SupportPhase.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFP64SupportPhase.java index 87bacc7b0f..98e159e18c 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFP64SupportPhase.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFP64SupportPhase.java @@ -21,14 +21,14 @@ import java.util.Optional; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.calc.SqrtNode; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.WriteNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.calc.SqrtNode; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.WriteNode; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.api.TornadoDeviceContext; import uk.ac.manchester.tornado.api.exceptions.TornadoDeviceFP64NotSupported; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFPGAPragmaPhase.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFPGAPragmaPhase.java index ccfdcd3114..61d4cc8bc5 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFPGAPragmaPhase.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFPGAPragmaPhase.java @@ -23,25 +23,25 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.phases; -import static org.graalvm.compiler.core.common.GraalOptions.MaximumDesiredSize; -import static org.graalvm.compiler.nodes.loop.DefaultLoopPolicies.Options.ExactFullUnrollMaxNodes; -import static org.graalvm.compiler.nodes.loop.DefaultLoopPolicies.Options.FullUnrollMaxNodes; +import static jdk.graal.compiler.core.common.GraalOptions.MaximumDesiredSize; +import static jdk.graal.compiler.nodes.loop.DefaultLoopPolicies.Options.ExactFullUnrollMaxNodes; +import static jdk.graal.compiler.nodes.loop.DefaultLoopPolicies.Options.FullUnrollMaxNodes; import java.util.List; import java.util.Optional; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.debug.ControlFlowAnchorNode; -import org.graalvm.compiler.nodes.loop.CountedLoopInfo; -import org.graalvm.compiler.nodes.loop.LoopEx; -import org.graalvm.compiler.nodes.loop.LoopsData; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.debug.ControlFlowAnchorNode; +import jdk.graal.compiler.nodes.loop.CountedLoopInfo; +import jdk.graal.compiler.nodes.loop.LoopEx; +import jdk.graal.compiler.nodes.loop.LoopsData; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.api.TornadoDeviceContext; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.IntelUnrollPragmaNode; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFPGAThreadScheduler.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFPGAThreadScheduler.java index a73610dde4..7dc35aaa44 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFPGAThreadScheduler.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/OCLFPGAThreadScheduler.java @@ -24,12 +24,12 @@ import java.util.Optional; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.api.WorkerGrid; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.FPGAWorkGroupSizeNode; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoAtomicsParametersPhase.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoAtomicsParametersPhase.java index 9f9fe95bd2..a923669274 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoAtomicsParametersPhase.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoAtomicsParametersPhase.java @@ -10,7 +10,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * @@ -23,15 +23,14 @@ import java.util.Optional; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.StartNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.phases.Phase; - +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.StartNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.IncAtomicNode; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.NodeAtomic; @@ -59,12 +58,14 @@ protected void run(StructuredGraph graph) { if (!filter.isEmpty()) { for (NodeAtomic atomic : filter) { - if (atomic.getAtomicNode() instanceof ParameterNode) { + if (atomic.getAtomicNode() instanceof ParameterNode parameterNodeAsAtomic) { - ParameterNode atomicArgument = (ParameterNode) atomic.getAtomicNode(); + ParameterNode atomicArgument = parameterNodeAsAtomic; int indexNode = atomicArgument.index(); - TornadoAtomicIntegerNode newNode = new TornadoAtomicIntegerNode(OCLKind.INTEGER_ATOMIC_JAVA); + final ConstantNode initialValue = graph.addOrUnique(ConstantNode.forInt(0)); + graph.addOrUnique(initialValue); + TornadoAtomicIntegerNode newNode = new TornadoAtomicIntegerNode(OCLKind.INTEGER_ATOMIC_JAVA, initialValue); graph.addOrUnique(newNode); newNode.assignIndexFromParameter(indexNode); @@ -78,7 +79,7 @@ protected void run(StructuredGraph graph) { newNode.setNext(first); // Replace usages for this new node - ParameterNode parameter = (ParameterNode) atomic.getAtomicNode(); + ParameterNode parameter = parameterNodeAsAtomic; newNode.replaceAtMatchingUsages(atomic, node -> !node.equals(atomic)); parameter.replaceAtMatchingUsages(newNode, node -> node.equals(atomic)); diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoAtomicsScheduling.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoAtomicsScheduling.java index b47dbaeedc..910d096092 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoAtomicsScheduling.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoAtomicsScheduling.java @@ -25,16 +25,16 @@ import java.util.Optional; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StartNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.memory.WriteNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StartNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.memory.WriteNode; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.DecAtomicNode; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.IncAtomicNode; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoBatchGlobalIndexOffset.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoBatchGlobalIndexOffset.java index 3cd52bd9c7..8bba1f9295 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoBatchGlobalIndexOffset.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoBatchGlobalIndexOffset.java @@ -24,20 +24,20 @@ import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.RawConstant; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FrameState; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.java.LoadIndexedNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FrameState; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.java.LoadIndexedNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.common.BatchCompilationConfig; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoHighTierContext; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoFixedArrayCopyPhase.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoFixedArrayCopyPhase.java index 0871d0e51f..dead8af3d7 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoFixedArrayCopyPhase.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoFixedArrayCopyPhase.java @@ -21,27 +21,42 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.phases; -import jdk.vm.ci.meta.ResolvedJavaType; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.Phase; +import java.util.Optional; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.Phase; +import jdk.vm.ci.meta.ResolvedJavaType; import uk.ac.manchester.tornado.api.exceptions.TornadoCompilationException; import uk.ac.manchester.tornado.drivers.opencl.graal.OCLArchitecture; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.FixedArrayCopyNode; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.FixedArrayNode; -import java.util.Optional; - /** * This phase examines if a copy takes place between two arrays in private memory based on * an if condition and, if so, inserts a {@link FixedArrayCopyNode} to generate an update in the references. */ public class TornadoFixedArrayCopyPhase extends Phase { + private static boolean isFixedArrayCopied(ValuePhiNode phiNode) { + return phiNode.usages().filter(OffsetAddressNode.class).isNotEmpty() && phiNode.values().filter(FixedArrayNode.class).isNotEmpty(); + } + + private static ValuePhiNode getPrivateArrayIndex(Node node) { + // identify the index + for (Node input : node.inputs()) { + if (input instanceof ValuePhiNode phiNode) { + return phiNode; + } else { + return getPrivateArrayIndex(input); + } + } + return null; + } + @Override public Optional notApplicableTo(GraphState graphState) { return ALWAYS_APPLICABLE; @@ -67,20 +82,4 @@ protected void run(StructuredGraph graph) { } } - private static boolean isFixedArrayCopied(ValuePhiNode phiNode) { - return phiNode.usages().filter(OffsetAddressNode.class).isNotEmpty() && phiNode.values().filter(FixedArrayNode.class).isNotEmpty(); - } - - private static ValuePhiNode getPrivateArrayIndex(Node node) { - // identify the index - for (Node input : node.inputs()) { - if (input instanceof ValuePhiNode phiNode) { - return phiNode; - } else { - return getPrivateArrayIndex(input); - } - } - return null; - } - } diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoFloatingReadReplacement.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoFloatingReadReplacement.java index 6130096696..0209122f01 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoFloatingReadReplacement.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoFloatingReadReplacement.java @@ -21,8 +21,8 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.phases; -import static org.graalvm.compiler.graph.Graph.NodeEvent.NODE_ADDED; -import static org.graalvm.compiler.graph.Graph.NodeEvent.ZERO_USAGES; +import static jdk.graal.compiler.graph.Graph.NodeEvent.NODE_ADDED; +import static jdk.graal.compiler.graph.Graph.NodeEvent.ZERO_USAGES; import static org.graalvm.word.LocationIdentity.any; import static org.graalvm.word.LocationIdentity.init; @@ -34,52 +34,52 @@ import org.graalvm.collections.EconomicSet; import org.graalvm.collections.Equivalence; import org.graalvm.collections.UnmodifiableMapCursor; -import org.graalvm.compiler.core.common.cfg.Loop; -import org.graalvm.compiler.debug.DebugCloseable; -import org.graalvm.compiler.debug.GraalError; -import org.graalvm.compiler.graph.Graph; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.AbstractBeginNode; -import org.graalvm.compiler.nodes.AbstractMergeNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.LoopEndNode; -import org.graalvm.compiler.nodes.LoopExitNode; -import org.graalvm.compiler.nodes.MemoryMapControlSinkNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.ProxyNode; -import org.graalvm.compiler.nodes.StartNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValueNodeInterface; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.nodes.cfg.HIRLoop; -import org.graalvm.compiler.nodes.memory.AddressableMemoryAccess; -import org.graalvm.compiler.nodes.memory.FloatableAccessNode; -import org.graalvm.compiler.nodes.memory.FloatingAccessNode; -import org.graalvm.compiler.nodes.memory.FloatingReadNode; -import org.graalvm.compiler.nodes.memory.MemoryAccess; -import org.graalvm.compiler.nodes.memory.MemoryAnchorNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.memory.MemoryMap; -import org.graalvm.compiler.nodes.memory.MemoryMapNode; -import org.graalvm.compiler.nodes.memory.MemoryPhiNode; -import org.graalvm.compiler.nodes.memory.MultiMemoryKill; -import org.graalvm.compiler.nodes.memory.SingleMemoryKill; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.nodes.spi.CoreProviders; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.FloatingReadPhase; -import org.graalvm.compiler.phases.common.PostRunCanonicalizationPhase; -import org.graalvm.compiler.phases.common.util.EconomicSetNodeEventListener; -import org.graalvm.compiler.phases.graph.ReentrantNodeIterator; import org.graalvm.word.LocationIdentity; +import jdk.graal.compiler.core.common.cfg.Loop; +import jdk.graal.compiler.debug.DebugCloseable; +import jdk.graal.compiler.debug.GraalError; +import jdk.graal.compiler.graph.Graph; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.AbstractBeginNode; +import jdk.graal.compiler.nodes.AbstractMergeNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.LoopEndNode; +import jdk.graal.compiler.nodes.LoopExitNode; +import jdk.graal.compiler.nodes.MemoryMapControlSinkNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.ProxyNode; +import jdk.graal.compiler.nodes.StartNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValueNodeInterface; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.cfg.ControlFlowGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.cfg.HIRLoop; +import jdk.graal.compiler.nodes.memory.AddressableMemoryAccess; +import jdk.graal.compiler.nodes.memory.FloatableAccessNode; +import jdk.graal.compiler.nodes.memory.FloatingAccessNode; +import jdk.graal.compiler.nodes.memory.FloatingReadNode; +import jdk.graal.compiler.nodes.memory.MemoryAccess; +import jdk.graal.compiler.nodes.memory.MemoryAnchorNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.memory.MemoryMap; +import jdk.graal.compiler.nodes.memory.MemoryMapNode; +import jdk.graal.compiler.nodes.memory.MemoryPhiNode; +import jdk.graal.compiler.nodes.memory.MultiMemoryKill; +import jdk.graal.compiler.nodes.memory.SingleMemoryKill; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.nodes.spi.CoreProviders; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.FloatingReadPhase; +import jdk.graal.compiler.phases.common.PostRunCanonicalizationPhase; +import jdk.graal.compiler.phases.common.util.EconomicSetNodeEventListener; +import jdk.graal.compiler.phases.graph.ReentrantNodeIterator; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.FixedArrayNode; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.OCLBarrierNode; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector.VectorLoadElementNode; @@ -246,7 +246,8 @@ protected void run(StructuredGraph graph, CoreProviders context) { EconomicMap> modifiedInLoops = null; if (graph.hasLoops()) { modifiedInLoops = EconomicMap.create(Equivalence.IDENTITY); - ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, true, false, false); + ControlFlowGraph cfg = ControlFlowGraph.newBuilder(graph).connectBlocks(true).computeLoops(true).computeFrequency(true).build(); + for (Loop l : cfg.getLoops()) { HIRLoop loop = (HIRLoop) l; processLoop(loop, modifiedInLoops); @@ -352,7 +353,7 @@ private static void processAnchor(MemoryAnchorNode anchor, TornadoFloatingReadRe private static void processAccess(MemoryAccess access, TornadoFloatingReadReplacement.MemoryMapImpl state) { LocationIdentity locationIdentity = access.getLocationIdentity(); - if (!locationIdentity.equals(LocationIdentity.any()) && locationIdentity.isMutable()) { + if (!locationIdentity.equals(any()) && locationIdentity.isMutable()) { MemoryKill lastLocationAccess = state.getLastLocationAccess(locationIdentity); access.setLastLocationAccess(lastLocationAccess); } @@ -409,7 +410,7 @@ protected TornadoFloatingReadReplacement.MemoryMapImpl processNode(FixedNode nod if (node instanceof LoopExitNode) { final LoopExitNode loopExitNode = (LoopExitNode) node; final EconomicSet modifiedInLoop = modifiedInLoops.get(loopExitNode.loopBegin()); - final boolean anyModified = modifiedInLoop.contains(LocationIdentity.any()); + final boolean anyModified = modifiedInLoop.contains(any()); state.getMap().replaceAll((locationIdentity, memoryNode) -> (anyModified || modifiedInLoop.contains(locationIdentity)) ? ProxyNode.forMemory(memoryNode, loopExitNode, locationIdentity) : memoryNode); @@ -509,7 +510,7 @@ protected TornadoFloatingReadReplacement.MemoryMapImpl afterSplit(AbstractBeginN protected EconomicMap processLoop(LoopBeginNode loop, TornadoFloatingReadReplacement.MemoryMapImpl initialState) { EconomicSet modifiedLocations = modifiedInLoops.get(loop); EconomicMap phis = EconomicMap.create(Equivalence.DEFAULT); - if (modifiedLocations.contains(LocationIdentity.any())) { + if (modifiedLocations.contains(any())) { // create phis for all locations if ANY is modified in the loop modifiedLocations = EconomicSet.create(Equivalence.DEFAULT, modifiedLocations); modifiedLocations.addAll(initialState.getMap().getKeys()); diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoHalfFloatReplacement.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoHalfFloatReplacement.java index 6365c557d2..959d72c51e 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoHalfFloatReplacement.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoHalfFloatReplacement.java @@ -21,30 +21,26 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.phases; -import java.util.ArrayList; -import java.util.Optional; - +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.FloatDivNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.nodes.calc.SubNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.extended.ValueAnchorNode; +import jdk.graal.compiler.nodes.java.NewInstanceNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.phases.BasePhase; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.RawConstant; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.calc.FloatDivNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.nodes.calc.SubNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.extended.ValueAnchorNode; -import org.graalvm.compiler.nodes.java.NewInstanceNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.phases.BasePhase; - import uk.ac.manchester.tornado.api.internal.annotations.HalfType; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLKind; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.ReadHalfFloatNode; @@ -64,135 +60,10 @@ import uk.ac.manchester.tornado.runtime.graal.nodes.VectorHalfRead; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoHighTierContext; -public class TornadoHalfFloatReplacement extends BasePhase { - - @Override - public Optional notApplicableTo(GraphState graphState) { - return ALWAYS_APPLICABLE; - } - - protected void run(StructuredGraph graph, TornadoHighTierContext context) { - - for (ValueAnchorNode valueAnchorNode : graph.getNodes().filter(ValueAnchorNode.class)) { - ArrayList deletePi = new ArrayList(); - for (Node valueAnchorNodeUsage : valueAnchorNode.usages()) { - if (valueAnchorNodeUsage instanceof PiNode) { - PiNode piNode = (PiNode) valueAnchorNodeUsage; - piNode.replaceAtUsages(piNode.object()); - deletePi.add(piNode); - } - } - for (PiNode p : deletePi) { - p.safeDelete(); - } - deleteFixed(valueAnchorNode); - } - - // replace reads with halfFloat reads - for (JavaReadNode javaRead : graph.getNodes().filter(JavaReadNode.class)) { - if (javaRead.successors().first() instanceof NewInstanceNode) { - NewInstanceNode newInstanceNode = (NewInstanceNode) javaRead.successors().first(); - if (newInstanceNode.instanceClass().getAnnotation(HalfType.class) != null) { - if (newInstanceNode.successors().first() instanceof NewHalfFloatInstance) { - NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) newInstanceNode.successors().first(); - deleteFixed(newHalfFloatInstance); - } - AddressNode readingAddress = javaRead.getAddress(); - ReadHalfFloatNode readHalfFloatNode = new ReadHalfFloatNode(readingAddress); - graph.addWithoutUnique(readHalfFloatNode); - replaceFixed(javaRead, readHalfFloatNode); - newInstanceNode.replaceAtUsages(readHalfFloatNode); - deleteFixed(newInstanceNode); - } - } - } - - for (NewInstanceNode newInstanceNode : graph.getNodes().filter(NewInstanceNode.class)) { - if (newInstanceNode.instanceClass().getAnnotation(HalfType.class) != null) { - if (newInstanceNode.successors().first() instanceof NewHalfFloatInstance) { - NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) newInstanceNode.successors().first(); - ValueNode valueInput = newHalfFloatInstance.getValue(); - newInstanceNode.replaceAtUsages(valueInput); - deleteFixed(newInstanceNode); - deleteFixed(newHalfFloatInstance); - } - } - } - - // replace writes with halfFloat writes - for (JavaWriteNode javaWrite : graph.getNodes().filter(JavaWriteNode.class)) { - if (isWriteHalfFloat(javaWrite)) { - // This casting is safe to do as it is already checked by the isWriteHalfFloat function - HalfFloatPlaceholder placeholder = (HalfFloatPlaceholder) javaWrite.value(); - ValueNode writingValue; - if (javaWrite.predecessor() instanceof NewHalfFloatInstance) { - // if a new HalfFloat instance is written - NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) javaWrite.predecessor(); - writingValue = newHalfFloatInstance.getValue(); - if (newHalfFloatInstance.predecessor() instanceof NewInstanceNode) { - NewInstanceNode newInstanceNode = (NewInstanceNode) newHalfFloatInstance.predecessor(); - if (newInstanceNode.instanceClass().toString().contains("HalfFloat")) { - deleteFixed(newInstanceNode); - deleteFixed(newHalfFloatInstance); - } - } - } else { - // if the result of an operation or a stored value is written - writingValue = placeholder.getInput(); - } - placeholder.replaceAtUsages(writingValue); - placeholder.safeDelete(); - AddressNode writingAddress = javaWrite.getAddress(); - WriteHalfFloatNode writeHalfFloatNode = new WriteHalfFloatNode(writingAddress, writingValue); - graph.addWithoutUnique(writeHalfFloatNode); - replaceFixed(javaWrite, writeHalfFloatNode); - deleteFixed(javaWrite); - } - } - - // replace the half float operator nodes with the corresponding regular operators - replaceAddHalfFloatNodes(graph); - replaceSubHalfFloatNodes(graph); - replaceMultHalfFloatNodes(graph); - replaceDivHalfFloatNodes(graph); - - // add after the loadindexedvector nodes the marker node to fix the offset of its read - - for (LoadIndexedVectorNode loadIndexedVectorNode : graph.getNodes().filter(LoadIndexedVectorNode.class)) { - if (loadIndexedVectorNode.getOCLKind().isHalf()) { - VectorHalfRead vectorHalfRead; - if (loadIndexedVectorNode.index() instanceof ConstantNode) { - ConstantNode offset = (ConstantNode) loadIndexedVectorNode.index(); - int offsetValue = Integer.valueOf(offset.getValue().toValueString()); - vectorHalfRead = graph.addWithoutUnique(new VectorHalfRead(offsetValue)); - } else { - vectorHalfRead = graph.addWithoutUnique(new VectorHalfRead()); - } - graph.addAfterFixed(loadIndexedVectorNode, vectorHalfRead); - } - } - - for (VectorValueNode vectorValueNode : graph.getNodes().filter(VectorValueNode.class)) { - if (vectorValueNode.getOCLKind().isHalf()) { - for (Node vectorElement : vectorValueNode.inputs()) { - if (vectorElement instanceof VectorLoadElementNode) { - VectorLoadElementNode vectorLoad = (VectorLoadElementNode) vectorElement; - VectorLoadElementNode vectorLoadShort = new VectorLoadElementNode(OCLKind.HALF, vectorLoad.getVector(), vectorLoad.getLaneId()); - graph.addWithoutUnique(vectorLoadShort); - vectorLoad.replaceAtUsages(vectorLoadShort); - vectorLoad.safeDelete(); - } else if (vectorElement instanceof ConstantNode constantNode && constantNode.getValue().toValueString().contains("null")) { - Constant zeroValue = new RawConstant(0); - ConstantNode zero = new ConstantNode(zeroValue, StampFactory.forKind(JavaKind.Short)); - graph.addWithoutUnique(zero); - constantNode.replaceAtUsages(zero); - constantNode.safeDelete(); - } - } - } - } +import java.util.ArrayList; +import java.util.Optional; - } +public class TornadoHalfFloatReplacement extends BasePhase { private static ValueNode replaceAdd(AddHalfFloatNode addHalfFloatNode, StructuredGraph graph) { ValueNode addNode; @@ -243,8 +114,18 @@ public static ValueNode replaceSub(SubHalfFloatNode subHalfFloatNode, Structured graph.addWithoutUnique(subNode); } - subHalfFloatNode.replaceAtUsages(subNode); + PiNode piNode = null; + if (subHalfFloatNode.usages().filter(PiNode.class).isNotEmpty()) { + piNode = subHalfFloatNode.usages().filter(PiNode.class).first(); + } + if (piNode != null) { + piNode.replaceAtUsages(subNode); + piNode.safeDelete(); + } else { + subHalfFloatNode.replaceAtUsages(subNode); + } subHalfFloatNode.safeDelete(); + return subNode; } @@ -267,7 +148,32 @@ private static ValueNode replaceMult(MultHalfFloatNode multHalfFloatNode, Struct graph.addWithoutUnique(multNode); } - multHalfFloatNode.replaceAtUsages(multNode); + if (multHalfFloatNode.usages().filter(PiNode.class).isNotEmpty()) { + PiNode piNode = multHalfFloatNode.usages().filter(PiNode.class).first(); + if (piNode.inputs().filter(ValueAnchorNode.class).isNotEmpty()) { + ValueAnchorNode anchorNode = piNode.inputs().filter(ValueAnchorNode.class).first(); + deleteFixed(anchorNode); + piNode.replaceAtUsages(multNode); + piNode.safeDelete(); + } else { + piNode.replaceAtUsages(multNode); + piNode.safeDelete(); + } + } else { + multHalfFloatNode.replaceAtUsages(multNode); + } + + PiNode piNode = null; + if (multHalfFloatNode.usages().filter(PiNode.class).isNotEmpty()) { + piNode = multHalfFloatNode.usages().filter(PiNode.class).first(); + } + if (piNode != null) { + piNode.replaceAtUsages(multNode); + piNode.safeDelete(); + } else { + multHalfFloatNode.replaceAtUsages(multNode); + } + multHalfFloatNode.safeDelete(); return multNode; } @@ -285,7 +191,17 @@ private static ValueNode replaceDiv(DivHalfFloatNode divHalfFloatNode, Structure FloatDivNode divNode = new FloatDivNode(divX, divY); graph.addWithoutUnique(divNode); - divHalfFloatNode.replaceAtUsages(divNode); + PiNode piNode = null; + if (divHalfFloatNode.usages().filter(PiNode.class).isNotEmpty()) { + piNode = divHalfFloatNode.usages().filter(PiNode.class).first(); + } + if (piNode != null) { + piNode.replaceAtUsages(divNode); + piNode.safeDelete(); + } else { + divHalfFloatNode.replaceAtUsages(divNode); + } + divHalfFloatNode.safeDelete(); return divNode; } @@ -361,4 +277,138 @@ private static void deleteFixed(Node node) { } } + @Override + public Optional notApplicableTo(GraphState graphState) { + return ALWAYS_APPLICABLE; + } + + protected void run(StructuredGraph graph, TornadoHighTierContext context) { + + for (ValueAnchorNode valueAnchorNode : graph.getNodes().filter(ValueAnchorNode.class)) { + ArrayList deletePi = new ArrayList(); + for (Node valueAnchorNodeUsage : valueAnchorNode.usages()) { + if (valueAnchorNodeUsage instanceof PiNode) { + PiNode piNode = (PiNode) valueAnchorNodeUsage; + piNode.replaceAtUsages(piNode.object()); + deletePi.add(piNode); + } + } + for (PiNode p : deletePi) { + p.safeDelete(); + } + deleteFixed(valueAnchorNode); + } + + // replace reads with halfFloat reads + for (JavaReadNode javaRead : graph.getNodes().filter(JavaReadNode.class)) { + if (javaRead.successors().first() instanceof NewInstanceNode) { + NewInstanceNode newInstanceNode = (NewInstanceNode) javaRead.successors().first(); + if (newInstanceNode.instanceClass().getAnnotation(HalfType.class) != null) { + if (newInstanceNode.successors().first() instanceof NewHalfFloatInstance) { + NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) newInstanceNode.successors().first(); + deleteFixed(newHalfFloatInstance); + } + AddressNode readingAddress = javaRead.getAddress(); + ReadHalfFloatNode readHalfFloatNode = new ReadHalfFloatNode(readingAddress); + graph.addWithoutUnique(readHalfFloatNode); + replaceFixed(javaRead, readHalfFloatNode); + newInstanceNode.replaceAtUsages(readHalfFloatNode); + deleteFixed(newInstanceNode); + } + } + } + + for (NewInstanceNode newInstanceNode : graph.getNodes().filter(NewInstanceNode.class)) { + if (newInstanceNode.instanceClass().getAnnotation(HalfType.class) != null) { + if (newInstanceNode.successors().first() instanceof NewHalfFloatInstance) { + NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) newInstanceNode.successors().first(); + ValueNode valueInput = newHalfFloatInstance.getValue(); + newInstanceNode.replaceAtUsages(valueInput); + deleteFixed(newInstanceNode); + deleteFixed(newHalfFloatInstance); + } + } + } + + // replace writes with halfFloat writes + for (JavaWriteNode javaWrite : graph.getNodes().filter(JavaWriteNode.class)) { + if (isWriteHalfFloat(javaWrite)) { + // This casting is safe to do as it is already checked by the isWriteHalfFloat function + HalfFloatPlaceholder placeholder = (HalfFloatPlaceholder) javaWrite.value(); + ValueNode writingValue; + if (javaWrite.predecessor() instanceof NewHalfFloatInstance) { + // if a new HalfFloat instance is written + NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) javaWrite.predecessor(); + writingValue = newHalfFloatInstance.getValue(); + if (newHalfFloatInstance.predecessor() instanceof NewInstanceNode) { + NewInstanceNode newInstanceNode = (NewInstanceNode) newHalfFloatInstance.predecessor(); + if (newInstanceNode.instanceClass().toString().contains("HalfFloat")) { + deleteFixed(newInstanceNode); + deleteFixed(newHalfFloatInstance); + } + } + } else { + // if the result of an operation or a stored value is written + writingValue = placeholder.getInput(); + } + placeholder.replaceAtUsages(writingValue); + placeholder.safeDelete(); + AddressNode writingAddress = javaWrite.getAddress(); + WriteHalfFloatNode writeHalfFloatNode = new WriteHalfFloatNode(writingAddress, writingValue); + graph.addWithoutUnique(writeHalfFloatNode); + replaceFixed(javaWrite, writeHalfFloatNode); + deleteFixed(javaWrite); + } + } + + // replace the half float operator nodes with the corresponding regular operators + replaceAddHalfFloatNodes(graph); + replaceSubHalfFloatNodes(graph); + replaceMultHalfFloatNodes(graph); + replaceDivHalfFloatNodes(graph); + + // add after the loadindexedvector nodes the marker node to fix the offset of its read + + for (LoadIndexedVectorNode loadIndexedVectorNode : graph.getNodes().filter(LoadIndexedVectorNode.class)) { + if (loadIndexedVectorNode.getOCLKind().isHalf()) { + VectorHalfRead vectorHalfRead; + if (loadIndexedVectorNode.index() instanceof ConstantNode) { + ConstantNode offset = (ConstantNode) loadIndexedVectorNode.index(); + int offsetValue = Integer.valueOf(offset.getValue().toValueString()); + vectorHalfRead = graph.addWithoutUnique(new VectorHalfRead(offsetValue)); + } else { + vectorHalfRead = graph.addWithoutUnique(new VectorHalfRead()); + } + graph.addAfterFixed(loadIndexedVectorNode, vectorHalfRead); + } + } + + for (VectorValueNode vectorValueNode : graph.getNodes().filter(VectorValueNode.class)) { + if (vectorValueNode.getOCLKind().isHalf()) { + for (Node vectorElement : vectorValueNode.inputs()) { + if (vectorElement instanceof VectorLoadElementNode) { + VectorLoadElementNode vectorLoad = (VectorLoadElementNode) vectorElement; + VectorLoadElementNode vectorLoadShort = new VectorLoadElementNode(OCLKind.HALF, vectorLoad.getVector(), vectorLoad.getLaneId()); + graph.addWithoutUnique(vectorLoadShort); + vectorLoad.replaceAtUsages(vectorLoadShort); + vectorLoad.safeDelete(); + } else if (vectorElement instanceof ConstantNode constantNode && constantNode.getValue().toValueString().contains("null")) { + Constant zeroValue = new RawConstant(0); + ConstantNode zero = new ConstantNode(zeroValue, StampFactory.forKind(JavaKind.Short)); + graph.addWithoutUnique(zero); + constantNode.replaceAtUsages(zero); + constantNode.safeDelete(); + } + } + } + } + + for (HalfFloatPlaceholder placeholder : graph.getNodes().filter(HalfFloatPlaceholder.class)) { + ValueNode input = placeholder.getInput(); + placeholder.replaceAtUsages(input); + placeholder.safeDelete(); + } + + } + } diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoHalfFloatVectorOffset.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoHalfFloatVectorOffset.java index d20f9db80b..ad5ec955d1 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoHalfFloatVectorOffset.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoHalfFloatVectorOffset.java @@ -24,16 +24,16 @@ import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.RawConstant; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.LeftShiftNode; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.WriteNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.LeftShiftNode; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.WriteNode; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; import uk.ac.manchester.tornado.drivers.opencl.graal.lir.OCLAddressNode; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.vector.VectorValueNode; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoIfCanonicalization.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoIfCanonicalization.java index 7a0d4c294d..0bb6492ba5 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoIfCanonicalization.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoIfCanonicalization.java @@ -26,20 +26,20 @@ import java.util.Map; import java.util.Set; -import org.graalvm.compiler.nodes.AbstractBeginNode; -import org.graalvm.compiler.nodes.AbstractEndNode; -import org.graalvm.compiler.nodes.AbstractMergeNode; -import org.graalvm.compiler.nodes.BeginNode; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.LogicNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.LoopEndNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.phases.BasePhase; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.nodes.AbstractBeginNode; +import jdk.graal.compiler.nodes.AbstractEndNode; +import jdk.graal.compiler.nodes.AbstractMergeNode; +import jdk.graal.compiler.nodes.BeginNode; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.LogicNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.LoopEndNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.phases.BasePhase; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; import uk.ac.manchester.tornado.api.exceptions.TornadoInternalError; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.logic.LogicalNotNode; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoOpenCLIntrinsicsReplacements.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoOpenCLIntrinsicsReplacements.java index e08f2866f2..8ff569644d 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoOpenCLIntrinsicsReplacements.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoOpenCLIntrinsicsReplacements.java @@ -30,16 +30,16 @@ import java.util.Optional; -import org.graalvm.compiler.graph.NodeInputList; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.CallTargetNode; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.InvokeNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.NodeInputList; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.CallTargetNode; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.InvokeNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.phases.BasePhase; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoParallelScheduler.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoParallelScheduler.java index 7f0efd2f04..cf06471f2f 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoParallelScheduler.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoParallelScheduler.java @@ -27,15 +27,15 @@ import java.util.Optional; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.nodes.calc.SubNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.nodes.calc.SubNode; +import jdk.graal.compiler.phases.BasePhase; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.opencl.graal.nodes.GlobalThreadIdNode; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoTaskSpecialisation.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoTaskSpecialisation.java index 63bc1aa63a..7afe53f616 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoTaskSpecialisation.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/phases/TornadoTaskSpecialisation.java @@ -32,29 +32,29 @@ import java.util.Optional; import java.util.concurrent.atomic.AtomicBoolean; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.graph.Graph.Mark; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedGuardNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.LogicConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.calc.IntegerLessThanNode; -import org.graalvm.compiler.nodes.calc.IsNullNode; -import org.graalvm.compiler.nodes.extended.UnboxNode; -import org.graalvm.compiler.nodes.java.ArrayLengthNode; -import org.graalvm.compiler.nodes.java.LoadFieldNode; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.phases.BasePhase; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.graph.Graph.Mark; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedGuardNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.LogicConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.calc.IntegerLessThanNode; +import jdk.graal.compiler.nodes.calc.IsNullNode; +import jdk.graal.compiler.nodes.extended.UnboxNode; +import jdk.graal.compiler.nodes.java.ArrayLengthNode; +import jdk.graal.compiler.nodes.java.LoadFieldNode; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.phases.BasePhase; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaField; @@ -380,6 +380,7 @@ protected void run(StructuredGraph graph, TornadoHighTierContext context) { deadCodeElimination.run(graph); + getDebugContext().dump(DebugContext.INFO_LEVEL, graph, "After TaskSpecialisation iteration = " + iterations); hasWork = (lastNodeCount != graph.getNodeCount() || graph.getNewNodes(mark).isNotEmpty() || hasPanamaArraySizeNode(graph)) && (iterations < MAX_ITERATIONS); diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/snippets/ReduceCPUSnippets.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/snippets/ReduceCPUSnippets.java index 1b8710b3c8..3718f75468 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/snippets/ReduceCPUSnippets.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/snippets/ReduceCPUSnippets.java @@ -23,17 +23,17 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.snippets; -import org.graalvm.compiler.api.replacements.Snippet; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LoweringTool; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.replacements.SnippetTemplate; -import org.graalvm.compiler.replacements.SnippetTemplate.AbstractTemplates; -import org.graalvm.compiler.replacements.SnippetTemplate.Arguments; -import org.graalvm.compiler.replacements.SnippetTemplate.SnippetInfo; -import org.graalvm.compiler.replacements.Snippets; +import jdk.graal.compiler.api.replacements.Snippet; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LoweringTool; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.replacements.SnippetTemplate; +import jdk.graal.compiler.replacements.SnippetTemplate.AbstractTemplates; +import jdk.graal.compiler.replacements.SnippetTemplate.Arguments; +import jdk.graal.compiler.replacements.SnippetTemplate.SnippetInfo; +import jdk.graal.compiler.replacements.Snippets; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.api.math.TornadoMath; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/snippets/ReduceGPUSnippets.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/snippets/ReduceGPUSnippets.java index 9d22e90349..33f3c6dc04 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/snippets/ReduceGPUSnippets.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/snippets/ReduceGPUSnippets.java @@ -25,18 +25,18 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.snippets; -import org.graalvm.compiler.api.replacements.Snippet; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.java.NewArrayNode; -import org.graalvm.compiler.nodes.spi.LoweringTool; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.replacements.SnippetTemplate; -import org.graalvm.compiler.replacements.SnippetTemplate.AbstractTemplates; -import org.graalvm.compiler.replacements.SnippetTemplate.Arguments; -import org.graalvm.compiler.replacements.SnippetTemplate.SnippetInfo; -import org.graalvm.compiler.replacements.Snippets; +import jdk.graal.compiler.api.replacements.Snippet; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.java.NewArrayNode; +import jdk.graal.compiler.nodes.spi.LoweringTool; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.replacements.SnippetTemplate; +import jdk.graal.compiler.replacements.SnippetTemplate.AbstractTemplates; +import jdk.graal.compiler.replacements.SnippetTemplate.Arguments; +import jdk.graal.compiler.replacements.SnippetTemplate.SnippetInfo; +import jdk.graal.compiler.replacements.Snippets; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.api.math.TornadoMath; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/snippets/TornadoSnippetTypeInference.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/snippets/TornadoSnippetTypeInference.java index f90b7d09b7..5d56512bef 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/snippets/TornadoSnippetTypeInference.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/snippets/TornadoSnippetTypeInference.java @@ -21,8 +21,8 @@ */ package uk.ac.manchester.tornado.drivers.opencl.graal.snippets; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.replacements.SnippetTemplate.SnippetInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.replacements.SnippetTemplate.SnippetInfo; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/mm/OCLArrayWrapper.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/mm/OCLArrayWrapper.java index 3e9997223d..adc8a4cfe8 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/mm/OCLArrayWrapper.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/mm/OCLArrayWrapper.java @@ -65,7 +65,7 @@ protected OCLArrayWrapper(final OCLDeviceContext device, final JavaKind kind, lo this.bufferOffset = 0; arrayLengthOffset = getVMConfig().arrayOopDescLengthOffset(); - arrayHeaderSize = getVMConfig().getArrayBaseOffset(kind); + arrayHeaderSize = (int) TornadoOptions.PANAMA_OBJECT_HEADER_SIZE; logger = new TornadoLogger(this.getClass()); } diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/tests/TestOpenCLJITCompiler.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/tests/TestOpenCLJITCompiler.java index 4879ef249c..eaf14d07d3 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/tests/TestOpenCLJITCompiler.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/tests/TestOpenCLJITCompiler.java @@ -29,7 +29,7 @@ import java.util.Arrays; import java.util.HashMap; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.api.annotations.Parallel; diff --git a/tornado-drivers/ptx/src/main/java/module-info.java b/tornado-drivers/ptx/src/main/java/module-info.java index 0ae1ee54f1..6a90f2e19a 100644 --- a/tornado-drivers/ptx/src/main/java/module-info.java +++ b/tornado-drivers/ptx/src/main/java/module-info.java @@ -1,8 +1,9 @@ import uk.ac.manchester.tornado.runtime.TornadoBackendProvider; module tornado.drivers.ptx { + requires java.base; requires transitive jdk.internal.vm.ci; - requires transitive jdk.internal.vm.compiler; + requires transitive jdk.graal.compiler; requires transitive org.graalvm.collections; requires transitive org.graalvm.word; requires transitive tornado.api; @@ -25,6 +26,5 @@ exports uk.ac.manchester.tornado.drivers.ptx.runtime; exports uk.ac.manchester.tornado.drivers.ptx.power; - provides TornadoBackendProvider with - uk.ac.manchester.tornado.drivers.ptx.PTXTornadoDriverProvider; + provides TornadoBackendProvider with uk.ac.manchester.tornado.drivers.ptx.PTXTornadoDriverProvider; } diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/PTXBackendImpl.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/PTXBackendImpl.java index 27521964e7..1a24a34ee0 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/PTXBackendImpl.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/PTXBackendImpl.java @@ -27,8 +27,8 @@ import java.util.ArrayList; import java.util.List; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import uk.ac.manchester.tornado.api.common.TornadoDevice; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/PTXTornadoDriverProvider.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/PTXTornadoDriverProvider.java index fafb1ceabd..d612228118 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/PTXTornadoDriverProvider.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/PTXTornadoDriverProvider.java @@ -24,7 +24,7 @@ package uk.ac.manchester.tornado.drivers.ptx; -import org.graalvm.compiler.options.OptionValues; +import jdk.graal.compiler.options.OptionValues; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import uk.ac.manchester.tornado.runtime.TornadoAcceleratorBackend; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/builtins/PTXIntrinsics.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/builtins/PTXIntrinsics.java index e528adacc1..6fdfce273e 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/builtins/PTXIntrinsics.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/builtins/PTXIntrinsics.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.drivers.ptx.builtins; -import org.graalvm.compiler.api.replacements.Fold; +import jdk.graal.compiler.api.replacements.Fold; public class PTXIntrinsics { diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXArchitecture.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXArchitecture.java index 8af297bfac..60ea2d4057 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXArchitecture.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXArchitecture.java @@ -27,8 +27,8 @@ import java.nio.ByteOrder; import java.util.Set; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.Register.RegisterCategory; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXCodeUtil.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXCodeUtil.java index ff07b8ea20..2bc51e4749 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXCodeUtil.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXCodeUtil.java @@ -28,8 +28,8 @@ import java.nio.ByteBuffer; import java.util.Arrays; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.CodeCacheProvider; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXFrameContext.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXFrameContext.java index 17455312d8..0189226dc5 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXFrameContext.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXFrameContext.java @@ -23,8 +23,8 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; -import org.graalvm.compiler.lir.asm.FrameContext; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.asm.FrameContext; import uk.ac.manchester.tornado.runtime.common.TornadoLogger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXFrameMap.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXFrameMap.java index 4b18f8cdfd..06818b1888 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXFrameMap.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXFrameMap.java @@ -21,8 +21,8 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal; -import org.graalvm.compiler.core.common.NumUtil; -import org.graalvm.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.core.common.NumUtil; +import jdk.graal.compiler.lir.framemap.FrameMap; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.RegisterConfig; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXFrameMapBuilder.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXFrameMapBuilder.java index e4f294dad3..0455fc4936 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXFrameMapBuilder.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXFrameMapBuilder.java @@ -23,8 +23,8 @@ import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.RegisterConfig; -import org.graalvm.compiler.lir.framemap.FrameMap; -import org.graalvm.compiler.lir.framemap.FrameMapBuilderImpl; +import jdk.graal.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.lir.framemap.FrameMapBuilderImpl; public class PTXFrameMapBuilder extends FrameMapBuilderImpl { public PTXFrameMapBuilder(FrameMap frameMap, CodeCacheProvider codeCache, RegisterConfig registerConfig) { diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXHotSpotBackendFactory.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXHotSpotBackendFactory.java index 4302f3bb2f..b45c2b2839 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXHotSpotBackendFactory.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXHotSpotBackendFactory.java @@ -25,21 +25,22 @@ import static jdk.vm.ci.common.InitTimer.timer; -import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; -import org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider; -import org.graalvm.compiler.hotspot.meta.HotSpotStampProvider; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.loop.LoopsDataProviderImpl; -import org.graalvm.compiler.nodes.spi.LoopsDataProvider; -import org.graalvm.compiler.nodes.spi.LoweringProvider; -import org.graalvm.compiler.nodes.spi.Replacements; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.printer.GraalDebugHandlersFactory; -import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins; -import org.graalvm.compiler.replacements.classfile.ClassfileBytecodeProvider; -import org.graalvm.compiler.word.WordTypes; +import jdk.graal.compiler.api.replacements.SnippetReflectionProvider; +import jdk.graal.compiler.core.common.spi.MetaAccessExtensionProvider; +import jdk.graal.compiler.hotspot.meta.HotSpotIdentityHashCodeProvider; +import jdk.graal.compiler.hotspot.meta.HotSpotStampProvider; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.loop.LoopsDataProviderImpl; +import jdk.graal.compiler.nodes.spi.LoopsDataProvider; +import jdk.graal.compiler.nodes.spi.LoweringProvider; +import jdk.graal.compiler.nodes.spi.Replacements; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.printer.GraalDebugHandlersFactory; +import jdk.graal.compiler.replacements.StandardGraphBuilderPlugins; +import jdk.graal.compiler.replacements.classfile.ClassfileBytecodeProvider; +import jdk.graal.compiler.word.WordTypes; import jdk.vm.ci.common.InitTimer; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; @@ -94,14 +95,19 @@ public static PTXBackend createJITCompiler(OptionValues options, HotSpotJVMCIRun MetaAccessExtensionProvider metaAccessExtensionProvider = new TornadoMetaAccessExtensionProvider(); lowerer = new PTXLoweringProvider(metaAccess, foreignCalls, platformConfigurationProvider, metaAccessExtensionProvider, constantReflection, target, vmConfig); WordTypes wordTypes = new TornadoWordTypes(metaAccess, JavaKind.Long); - LoopsDataProvider lpd = new LoopsDataProviderImpl(); - Providers p = new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, lowerer.getReplacements(), stampProvider, - platformConfigurationProvider, metaAccessExtensionProvider, snippetReflection, wordTypes, lpd); + + HotSpotIdentityHashCodeProvider hotSpotIdentityHashCodeProvider = new HotSpotIdentityHashCodeProvider(); + + Providers p = new Providers(metaAccess, // + codeCache, constantReflection, constantFieldProvider, // + foreignCalls, lowerer, lowerer.getReplacements(), stampProvider, // + platformConfigurationProvider, metaAccessExtensionProvider, snippetReflection, // + wordTypes, lpd , hotSpotIdentityHashCodeProvider); ClassfileBytecodeProvider bytecodeProvider = new ClassfileBytecodeProvider(metaAccess, snippetReflection); GraalDebugHandlersFactory graalDebugHandlersFactory = new GraalDebugHandlersFactory(snippetReflection); - TornadoReplacements replacements = new TornadoReplacements(graalDebugHandlersFactory, p, snippetReflection, bytecodeProvider, target); + TornadoReplacements replacements = new TornadoReplacements(graalDebugHandlersFactory, p, bytecodeProvider, target); plugins = createGraphBuilderPlugins(metaAccess, replacements, snippetReflection, lowerer); replacements.setGraphBuilderPlugins(plugins); @@ -109,7 +115,7 @@ public static PTXBackend createJITCompiler(OptionValues options, HotSpotJVMCIRun suites = new PTXSuitesProvider(options, deviceContext, plugins, metaAccess, compilerConfiguration, addressLowering); providers = new PTXProviders(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, platformConfigurationProvider, - metaAccessExtensionProvider, snippetReflection, wordTypes, p.getLoopsDataProvider(), suites); + metaAccessExtensionProvider, snippetReflection, wordTypes, p.getLoopsDataProvider(), suites, hotSpotIdentityHashCodeProvider); lowerer.initialize(options, new DummySnippetFactory(), providers); diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXLIRKindTool.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXLIRKindTool.java index 8c744705e4..00f03238c4 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXLIRKindTool.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXLIRKindTool.java @@ -24,8 +24,8 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.spi.LIRKindTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.spi.LIRKindTool; import uk.ac.manchester.tornado.drivers.ptx.PTXTargetDescription; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXLoweringProvider.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXLoweringProvider.java index 43d99fd364..469f50b374 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXLoweringProvider.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXLoweringProvider.java @@ -21,62 +21,66 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal; -import static org.graalvm.compiler.nodes.NamedLocationIdentity.ARRAY_LENGTH_LOCATION; +import static jdk.graal.compiler.nodes.NamedLocationIdentity.ARRAY_LENGTH_LOCATION; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; import static uk.ac.manchester.tornado.drivers.providers.TornadoMemoryOrder.GPU_MEMORY_MODE; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryExtendKind; -import org.graalvm.compiler.core.common.spi.ForeignCallsProvider; -import org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.core.common.type.StampPair; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeInputList; -import org.graalvm.compiler.nodes.AbstractDeoptimizeNode; -import org.graalvm.compiler.nodes.CompressionNode; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FieldLocationIdentity; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.Invoke; -import org.graalvm.compiler.nodes.InvokeNode; -import org.graalvm.compiler.nodes.LoweredCallTargetNode; -import org.graalvm.compiler.nodes.NamedLocationIdentity; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.UnwindNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryArithmeticNode; -import org.graalvm.compiler.nodes.calc.FloatConvertNode; -import org.graalvm.compiler.nodes.calc.IntegerDivRemNode; -import org.graalvm.compiler.nodes.calc.RemNode; -import org.graalvm.compiler.nodes.java.ArrayLengthNode; -import org.graalvm.compiler.nodes.java.InstanceOfNode; -import org.graalvm.compiler.nodes.java.LoadFieldNode; -import org.graalvm.compiler.nodes.java.LoadIndexedNode; -import org.graalvm.compiler.nodes.java.MethodCallTargetNode; -import org.graalvm.compiler.nodes.java.StoreFieldNode; -import org.graalvm.compiler.nodes.java.StoreIndexedNode; -import org.graalvm.compiler.nodes.memory.AbstractWriteNode; -import org.graalvm.compiler.nodes.memory.ExtendableMemoryAccess; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.WriteNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.nodes.spi.LoweringTool; -import org.graalvm.compiler.nodes.spi.PlatformConfigurationProvider; -import org.graalvm.compiler.nodes.type.StampTool; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.replacements.DefaultJavaLoweringProvider; -import org.graalvm.compiler.replacements.SnippetCounter; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.LeftShiftNode; +import jdk.graal.compiler.nodes.calc.SignExtendNode; +import jdk.vm.ci.code.CodeUtil; import org.graalvm.word.LocationIdentity; +import jdk.graal.compiler.core.common.memory.BarrierType; +import jdk.graal.compiler.core.common.memory.MemoryExtendKind; +import jdk.graal.compiler.core.common.spi.ForeignCallsProvider; +import jdk.graal.compiler.core.common.spi.MetaAccessExtensionProvider; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.core.common.type.StampPair; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeInputList; +import jdk.graal.compiler.nodes.AbstractDeoptimizeNode; +import jdk.graal.compiler.nodes.CompressionNode; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FieldLocationIdentity; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.Invoke; +import jdk.graal.compiler.nodes.InvokeNode; +import jdk.graal.compiler.nodes.LoweredCallTargetNode; +import jdk.graal.compiler.nodes.NamedLocationIdentity; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.UnwindNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryArithmeticNode; +import jdk.graal.compiler.nodes.calc.FloatConvertNode; +import jdk.graal.compiler.nodes.calc.IntegerDivRemNode; +import jdk.graal.compiler.nodes.calc.RemNode; +import jdk.graal.compiler.nodes.java.ArrayLengthNode; +import jdk.graal.compiler.nodes.java.InstanceOfNode; +import jdk.graal.compiler.nodes.java.LoadFieldNode; +import jdk.graal.compiler.nodes.java.LoadIndexedNode; +import jdk.graal.compiler.nodes.java.MethodCallTargetNode; +import jdk.graal.compiler.nodes.java.StoreFieldNode; +import jdk.graal.compiler.nodes.java.StoreIndexedNode; +import jdk.graal.compiler.nodes.memory.AbstractWriteNode; +import jdk.graal.compiler.nodes.memory.ExtendableMemoryAccess; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.WriteNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.nodes.spi.LoweringTool; +import jdk.graal.compiler.nodes.spi.PlatformConfigurationProvider; +import jdk.graal.compiler.nodes.type.StampTool; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.replacements.DefaultJavaLoweringProvider; +import jdk.graal.compiler.replacements.SnippetCounter; import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.hotspot.HotSpotCallingConventionType; import jdk.vm.ci.meta.ConstantReflectionProvider; @@ -101,6 +105,7 @@ import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.vector.LoadIndexedVectorNode; import uk.ac.manchester.tornado.drivers.ptx.graal.snippets.PTXGPUReduceSnippets; import uk.ac.manchester.tornado.runtime.TornadoVMConfigAccess; +import uk.ac.manchester.tornado.runtime.common.TornadoOptions; import uk.ac.manchester.tornado.runtime.graal.nodes.GetGroupIdFixedWithNextNode; import uk.ac.manchester.tornado.runtime.graal.nodes.GlobalGroupSizeFixedWithNextNode; import uk.ac.manchester.tornado.runtime.graal.nodes.LocalGroupSizeFixedWithNextNode; @@ -468,7 +473,7 @@ public void lowerStoreIndexedNode(StoreIndexedNode storeIndexed, LoweringTool to JavaKind elementKind = storeIndexed.elementKind(); ValueNode value = storeIndexed.value(); ValueNode array = storeIndexed.array(); - AddressNode address = createArrayAddress(graph, array, elementKind, storeIndexed.index()); + AddressNode address = createArrayAddressTornado(graph, array, elementKind, storeIndexed.index()); ValueNode writeValue = value; Stamp valueStamp = value.stamp(NodeView.DEFAULT); if (!(valueStamp instanceof PTXStamp) || !((PTXStamp) valueStamp).getPTXKind().isVector()) { @@ -519,11 +524,25 @@ private AddressNode createArrayAccess(StructuredGraph graph, LoadIndexedNode loa if (isLocalIDNode(loadIndexed) || isPrivateIDNode(loadIndexed)) { address = createArrayLocalAddress(graph, loadIndexed.array(), loadIndexed.index()); } else { - address = createArrayAddress(graph, loadIndexed.array(), elementKind, loadIndexed.index()); + address = createArrayAddressTornado(graph, loadIndexed.array(), elementKind, loadIndexed.index()); } return address; } + public AddressNode createArrayAddressTornado(StructuredGraph graph, ValueNode array, JavaKind elementKind, ValueNode index) { + int arrayBaseOffset = (int) TornadoOptions.PANAMA_OBJECT_HEADER_SIZE; + ValueNode wordIndex; + if (target.wordSize > 4) { + wordIndex = graph.unique(new SignExtendNode(index, target.wordSize * 8)); + } else { + assert target.wordSize == 4 : "unsupported word size"; + wordIndex = index; + } + int shift = CodeUtil.log2(metaAccess.getArrayIndexScale(elementKind)); + ValueNode scaledIndex = graph.unique(new LeftShiftNode(wordIndex, ConstantNode.forInt(shift, graph))); + ValueNode offset = graph.unique(new AddNode(scaledIndex, ConstantNode.forIntegerKind(target.wordJavaKind, arrayBaseOffset, graph))); + return graph.unique(new OffsetAddressNode(array, offset)); + } private AddressNode createArrayLocalAddress(StructuredGraph graph, ValueNode array, ValueNode index) { return graph.unique(new OffsetAddressNode(array, index)); } diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXProviders.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXProviders.java index aa0c60a5f1..72195a9cfd 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXProviders.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXProviders.java @@ -21,17 +21,18 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal; -import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; -import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; -import org.graalvm.compiler.core.common.spi.ForeignCallsProvider; -import org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider; -import org.graalvm.compiler.nodes.spi.LoopsDataProvider; -import org.graalvm.compiler.nodes.spi.LoweringProvider; -import org.graalvm.compiler.nodes.spi.PlatformConfigurationProvider; -import org.graalvm.compiler.nodes.spi.Replacements; -import org.graalvm.compiler.nodes.spi.StampProvider; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.word.WordTypes; +import jdk.graal.compiler.api.replacements.SnippetReflectionProvider; +import jdk.graal.compiler.core.common.spi.ConstantFieldProvider; +import jdk.graal.compiler.core.common.spi.ForeignCallsProvider; +import jdk.graal.compiler.core.common.spi.MetaAccessExtensionProvider; +import jdk.graal.compiler.hotspot.meta.HotSpotIdentityHashCodeProvider; +import jdk.graal.compiler.nodes.spi.LoopsDataProvider; +import jdk.graal.compiler.nodes.spi.LoweringProvider; +import jdk.graal.compiler.nodes.spi.PlatformConfigurationProvider; +import jdk.graal.compiler.nodes.spi.Replacements; +import jdk.graal.compiler.nodes.spi.StampProvider; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.word.WordTypes; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.meta.ConstantReflectionProvider; @@ -54,9 +55,12 @@ public PTXProviders(MetaAccessProvider metaAccess, // SnippetReflectionProvider snippetReflection, // WordTypes wordTypes, // LoopsDataProvider loopsDataProvider, // - PTXSuitesProvider suitesProvider) { + PTXSuitesProvider suitesProvider, // + HotSpotIdentityHashCodeProvider hotSpotIdentityHashCodeProvider + + ) { super(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, platformConfigurationProvider, metaAccessExtensionProvider, - snippetReflection, wordTypes, loopsDataProvider); + snippetReflection, wordTypes, loopsDataProvider, hotSpotIdentityHashCodeProvider); this.suites = suitesProvider; } diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXStamp.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXStamp.java index 49eac1ae3d..4fdb8110ff 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXStamp.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXStamp.java @@ -21,14 +21,10 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal; -import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; - -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.spi.LIRKindTool; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.Stamp; - +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.spi.LIRKindTool; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MemoryAccessProvider; @@ -36,6 +32,9 @@ import jdk.vm.ci.meta.ResolvedJavaType; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; +import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; +import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; + public class PTXStamp extends ObjectStamp { private static final ResolvedJavaType STAMP_TYPE = null; @@ -71,33 +70,18 @@ public PTXKind getPTXKind() { return kind; } - @Override public JavaKind getStackKind() { if (kind.isPrimitive()) { - switch (kind) { - case PRED: - return JavaKind.Boolean; - case S8: - case U8: - return JavaKind.Byte; - case S16: - case U16: - case F16: - case B16: - return JavaKind.Short; - case S32: - case U32: - return JavaKind.Int; - case S64: - case U64: - return JavaKind.Long; - case F32: - return JavaKind.Float; - case F64: - return JavaKind.Double; - default: - return JavaKind.Illegal; - } + return switch (kind) { + case PRED -> JavaKind.Boolean; + case S8, U8 -> JavaKind.Byte; + case S16, U16, F16, B16 -> JavaKind.Short; + case S32, U32 -> JavaKind.Int; + case S64, U64 -> JavaKind.Long; + case F32 -> JavaKind.Float; + case F64 -> JavaKind.Double; + default -> JavaKind.Illegal; + }; } else if (kind.isVector()) { return JavaKind.Object; } @@ -124,8 +108,13 @@ public boolean isCompatible(Constant constant) { @Override public boolean isCompatible(Stamp stamp) { - if (stamp instanceof PTXStamp && ((PTXStamp) stamp).kind == kind) { + if (stamp instanceof PTXStamp) { return true; + } else if (stamp instanceof ObjectStamp) { + PTXKind stampKind = PTXKind.fromResolvedJavaType(((ObjectStamp) stamp).type()); + if (stampKind == kind) { + return true; + } } unimplemented("stamp is compat: %s + %s", this, stamp); diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXSuitesProvider.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXSuitesProvider.java index 6822081fc5..2a59b57f66 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXSuitesProvider.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/PTXSuitesProvider.java @@ -23,18 +23,19 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal; -import org.graalvm.compiler.java.GraphBuilderPhase; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase; -import org.graalvm.compiler.phases.tiers.HighTierContext; +import jdk.graal.compiler.java.GraphBuilderPhase; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase; +import jdk.graal.compiler.phases.tiers.HighTierContext; import jdk.vm.ci.meta.MetaAccessProvider; import uk.ac.manchester.tornado.drivers.ptx.PTXDeviceContext; import uk.ac.manchester.tornado.drivers.ptx.graal.compiler.PTXCompilerConfiguration; import uk.ac.manchester.tornado.runtime.graal.TornadoLIRSuites; import uk.ac.manchester.tornado.runtime.graal.TornadoSuites; +import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoInternalGraphBuilder; import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoSketchTier; import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoSuitesProvider; @@ -57,7 +58,7 @@ private PhaseSuite createGraphBuilderSuite(GraphBuilderConfigur config.withEagerResolving(true); // config.setUseProfiling(false); - suite.appendPhase(new GraphBuilderPhase(config)); + suite.appendPhase(new TornadoInternalGraphBuilder(config)); return suite; } diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/asm/PTXAssembler.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/asm/PTXAssembler.java index ddd4f3d3ea..8c6a7a246f 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/asm/PTXAssembler.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/asm/PTXAssembler.java @@ -49,13 +49,13 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import org.graalvm.compiler.asm.AbstractAddress; -import org.graalvm.compiler.asm.Assembler; -import org.graalvm.compiler.asm.Label; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.LabelRef; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.asm.AbstractAddress; +import jdk.graal.compiler.asm.Assembler; +import jdk.graal.compiler.asm.Label; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LabelRef; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodes.cfg.HIRBlock; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.TargetDescription; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/backend/PTXBackend.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/backend/PTXBackend.java index b876ff30be..dcaae2de60 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/backend/PTXBackend.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/backend/PTXBackend.java @@ -32,22 +32,22 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.IntStream; -import org.graalvm.compiler.code.CompilationResult; -import org.graalvm.compiler.core.common.CompilationIdentifier; -import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; -import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory; -import org.graalvm.compiler.lir.asm.DataBuilder; -import org.graalvm.compiler.lir.framemap.FrameMap; -import org.graalvm.compiler.lir.framemap.FrameMapBuilder; -import org.graalvm.compiler.lir.framemap.ReferenceMapBuilder; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.tiers.SuitesProvider; +import jdk.graal.compiler.code.CompilationResult; +import jdk.graal.compiler.core.common.CompilationIdentifier; +import jdk.graal.compiler.core.common.alloc.RegisterAllocationConfig; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.asm.CompilationResultBuilderFactory; +import jdk.graal.compiler.lir.asm.DataBuilder; +import jdk.graal.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.lir.framemap.FrameMapBuilder; +import jdk.graal.compiler.lir.framemap.ReferenceMapBuilder; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.tiers.SuitesProvider; import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.CompilationRequest; @@ -143,6 +143,11 @@ public PTXTargetDescription getTarget() { return target; } + @Override + public RegisterAllocationConfig newRegisterAllocationConfig(RegisterConfig registerConfig, String[] allocationRestrictedTo, Object stub) { + return null; + } + @Override public boolean isInitialised() { return isInitialised; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXBarrierSetLIRGenerator.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXBarrierSetLIRGenerator.java deleted file mode 100644 index 03a7aaf8d1..0000000000 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXBarrierSetLIRGenerator.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2023, APT Group, Department of Computer Science, - * School of Engineering, The University of Manchester. All rights reserved. - * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -package uk.ac.manchester.tornado.drivers.ptx.graal.compiler; - -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryOrderMode; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.BarrierSetLIRGenerator; - -import jdk.vm.ci.meta.Value; - -public class PTXBarrierSetLIRGenerator extends BarrierSetLIRGenerator { - @Override - public Variable emitBarrieredLoad(LIRKind kind, Value address, LIRFrameState state, MemoryOrderMode memoryOrder, BarrierType barrierType) { - return null; - } -} diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXBlockVisitor.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXBlockVisitor.java index fb86d13a72..1e64c9c7a1 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXBlockVisitor.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXBlockVisitor.java @@ -22,8 +22,8 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.compiler; -import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.cfg.ControlFlowGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompilationResult.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompilationResult.java index 32a0f31c34..6cc590aa07 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompilationResult.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompilationResult.java @@ -28,7 +28,7 @@ import java.util.HashSet; import java.util.Set; -import org.graalvm.compiler.code.CompilationResult; +import jdk.graal.compiler.code.CompilationResult; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.drivers.ptx.graal.backend.PTXBackend; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompilationResultBuilder.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompilationResultBuilder.java index ff73a783ab..68337a8e60 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompilationResultBuilder.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompilationResultBuilder.java @@ -33,29 +33,29 @@ import org.graalvm.collections.EconomicMap; import org.graalvm.collections.Equivalence; -import org.graalvm.compiler.asm.Assembler; -import org.graalvm.compiler.code.CompilationResult; -import org.graalvm.compiler.core.common.spi.CodeGenProviders; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; -import org.graalvm.compiler.lir.asm.DataBuilder; -import org.graalvm.compiler.lir.asm.FrameContext; -import org.graalvm.compiler.lir.framemap.FrameMap; -import org.graalvm.compiler.nodes.AbstractBeginNode; -import org.graalvm.compiler.nodes.AbstractEndNode; -import org.graalvm.compiler.nodes.ControlSplitNode; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.LoopEndNode; -import org.graalvm.compiler.nodes.LoopExitNode; -import org.graalvm.compiler.nodes.MergeNode; -import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.options.OptionValues; +import jdk.graal.compiler.asm.Assembler; +import jdk.graal.compiler.code.CompilationResult; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.asm.DataBuilder; +import jdk.graal.compiler.lir.asm.FrameContext; +import jdk.graal.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.nodes.AbstractBeginNode; +import jdk.graal.compiler.nodes.AbstractEndNode; +import jdk.graal.compiler.nodes.ControlSplitNode; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.LoopEndNode; +import jdk.graal.compiler.nodes.LoopExitNode; +import jdk.graal.compiler.nodes.MergeNode; +import jdk.graal.compiler.nodes.cfg.ControlFlowGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.spi.CoreProviders; +import jdk.graal.compiler.options.OptionValues; import jdk.vm.ci.code.Register; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.api.exceptions.TornadoInternalError; @@ -76,10 +76,9 @@ public class PTXCompilationResultBuilder extends CompilationResultBuilder { private PTXLIRGenerationResult lirGenRes; private TaskDataContext meta; - public PTXCompilationResultBuilder(CodeGenProviders providers, FrameMap frameMap, Assembler asm, DataBuilder dataBuilder, FrameContext frameContext, OptionValues options, DebugContext debug, + public PTXCompilationResultBuilder(CoreProviders providers, FrameMap frameMap, Assembler asm, DataBuilder dataBuilder, FrameContext frameContext, OptionValues options, DebugContext debug, CompilationResult compilationResult, LIR lir) { - super(providers, frameMap, asm, dataBuilder, frameContext, options, debug, compilationResult, Register.None, EconomicMap.create(Equivalence.DEFAULT), NO_VERIFIERS, lir); - + super(providers, frameMap, asm, dataBuilder, frameContext, options, debug, compilationResult, Register.None, NO_VERIFIERS, lir); nonInlinedMethods = new HashSet<>(); this.asm = (PTXAssembler) asm; } diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompiler.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompiler.java index 7ab5c958c9..60e86e34b3 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompiler.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompiler.java @@ -38,30 +38,30 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; -import org.graalvm.compiler.core.common.alloc.LinearScanOrder; -import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; -import org.graalvm.compiler.core.common.cfg.CodeEmissionOrder; -import org.graalvm.compiler.debug.DebugCloseable; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.debug.DebugDumpScope; -import org.graalvm.compiler.debug.TimerKey; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory; -import org.graalvm.compiler.lir.framemap.FrameMap; -import org.graalvm.compiler.lir.framemap.FrameMapBuilder; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.lir.phases.AllocationPhase; -import org.graalvm.compiler.lir.phases.PreAllocationOptimizationPhase; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.OptimisticOptimizations; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; -import org.graalvm.compiler.phases.tiers.HighTierContext; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.core.common.alloc.LinearScanOrder; +import jdk.graal.compiler.core.common.alloc.RegisterAllocationConfig; +import jdk.graal.compiler.core.common.cfg.CodeEmissionOrder; +import jdk.graal.compiler.debug.DebugCloseable; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.debug.DebugDumpScope; +import jdk.graal.compiler.debug.TimerKey; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.asm.CompilationResultBuilderFactory; +import jdk.graal.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.lir.framemap.FrameMapBuilder; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.lir.phases.AllocationPhase; +import jdk.graal.compiler.lir.phases.PreAllocationOptimizationPhase; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.OptimisticOptimizations; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.phases.tiers.HighTierContext; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.meta.Assumptions; @@ -174,7 +174,7 @@ private static LIRGenerationResult emitLIR(PTXCompilationRequest r) { } catch (Throwable e) { throw TornadoCoreRuntime.getDebugContext().handle(e); } - RegisterAllocationConfig registerAllocationConfig = r.backend.newRegisterAllocationConfig(null, new String[] {}); + RegisterAllocationConfig registerAllocationConfig = r.backend.newRegisterAllocationConfig(null, new String[] {}, new Object()); FrameMapBuilder frameMapBuilder = r.backend.newFrameMapBuilder(null); LIRGenerationResult lirGenRes = r.backend.newLIRGenerationResult(r.graph.compilationId(), lir, frameMapBuilder, registerAllocationConfig); LIRGeneratorTool lirGen = r.backend.newLIRGenerator(lirGenRes); diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompilerConfiguration.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompilerConfiguration.java index 955d8df9e2..60253eef8a 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompilerConfiguration.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXCompilerConfiguration.java @@ -24,14 +24,14 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.compiler; -import org.graalvm.compiler.lir.phases.LIRPhaseSuite; -import org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase; -import org.graalvm.compiler.lir.phases.PostAllocationOptimizationStage; -import org.graalvm.compiler.lir.phases.PreAllocationOptimizationPhase; -import org.graalvm.compiler.lir.phases.PreAllocationOptimizationStage; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.lir.phases.LIRPhaseSuite; +import jdk.graal.compiler.lir.phases.PostAllocationOptimizationPhase; +import jdk.graal.compiler.lir.phases.PostAllocationOptimizationStage; +import jdk.graal.compiler.lir.phases.PreAllocationOptimizationPhase; +import jdk.graal.compiler.lir.phases.PreAllocationOptimizationStage; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; import jdk.vm.ci.meta.MetaAccessProvider; import uk.ac.manchester.tornado.api.TornadoDeviceContext; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXDataBuilder.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXDataBuilder.java index f25bed977f..d4213cd82d 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXDataBuilder.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXDataBuilder.java @@ -24,8 +24,8 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.code.DataSection; -import org.graalvm.compiler.lir.asm.DataBuilder; +import jdk.graal.compiler.code.DataSection; +import jdk.graal.compiler.lir.asm.DataBuilder; import jdk.vm.ci.meta.Constant; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXHighTier.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXHighTier.java index eb1a5f865e..7b2721f374 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXHighTier.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXHighTier.java @@ -24,26 +24,25 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.compiler; -import static org.graalvm.compiler.core.common.GraalOptions.ConditionalElimination; -import static org.graalvm.compiler.core.common.GraalOptions.OptConvertDeoptsToGuards; -import static org.graalvm.compiler.core.common.GraalOptions.PartialEscapeAnalysis; -import static org.graalvm.compiler.core.phases.HighTier.Options.Inline; -import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; - -import org.graalvm.compiler.loop.phases.ConvertDeoptimizeToGuardPhase; -import org.graalvm.compiler.loop.phases.LoopFullUnrollPhase; -import org.graalvm.compiler.nodes.loop.DefaultLoopPolicies; -import org.graalvm.compiler.nodes.loop.LoopPolicies; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; -import org.graalvm.compiler.phases.common.HighTierLoweringPhase; -import org.graalvm.compiler.phases.common.IterativeConditionalEliminationPhase; -import org.graalvm.compiler.phases.common.RemoveValueProxyPhase; -import org.graalvm.compiler.phases.common.inlining.InliningPhase; -import org.graalvm.compiler.phases.schedule.SchedulePhase; -import org.graalvm.compiler.virtual.phases.ea.PartialEscapePhase; - +import static jdk.graal.compiler.core.common.GraalOptions.ConditionalElimination; +import static jdk.graal.compiler.core.common.GraalOptions.OptConvertDeoptsToGuards; +import static jdk.graal.compiler.core.common.GraalOptions.PartialEscapeAnalysis; +import static jdk.graal.compiler.core.phases.HighTier.Options.Inline; +import static jdk.graal.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; + +import jdk.graal.compiler.loop.phases.ConvertDeoptimizeToGuardPhase; +import jdk.graal.compiler.loop.phases.LoopFullUnrollPhase; +import jdk.graal.compiler.nodes.loop.DefaultLoopPolicies; +import jdk.graal.compiler.nodes.loop.LoopPolicies; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.phases.common.HighTierLoweringPhase; +import jdk.graal.compiler.phases.common.IterativeConditionalEliminationPhase; +import jdk.graal.compiler.phases.common.RemoveValueProxyPhase; +import jdk.graal.compiler.phases.common.inlining.InliningPhase; +import jdk.graal.compiler.phases.schedule.SchedulePhase; +import jdk.graal.compiler.virtual.phases.ea.PartialEscapePhase; import jdk.vm.ci.meta.MetaAccessProvider; import uk.ac.manchester.tornado.drivers.common.compiler.phases.analysis.TornadoShapeAnalysis; import uk.ac.manchester.tornado.drivers.common.compiler.phases.guards.ExceptionSuppression; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLIRGenerationPhase.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLIRGenerationPhase.java index 915f8439b0..702f319e89 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLIRGenerationPhase.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLIRGenerationPhase.java @@ -24,17 +24,17 @@ import java.util.List; -import org.graalvm.compiler.core.common.cfg.BasicBlock; -import org.graalvm.compiler.core.common.cfg.BlockMap; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGenerator; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.lir.phases.LIRPhase; -import org.graalvm.compiler.lir.ssa.SSAUtil; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.cfg.BasicBlock; +import jdk.graal.compiler.core.common.cfg.BlockMap; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGenerator; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.lir.phases.LIRPhase; +import jdk.graal.compiler.lir.ssa.SSAUtil; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.code.TargetDescription; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLIRGenerationResult.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLIRGenerationResult.java index 3667da295d..0152d79025 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLIRGenerationResult.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLIRGenerationResult.java @@ -31,12 +31,12 @@ import java.util.Map; import java.util.Set; -import org.graalvm.compiler.core.common.CompilationIdentifier; -import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.framemap.FrameMapBuilder; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.core.common.CompilationIdentifier; +import jdk.graal.compiler.core.common.alloc.RegisterAllocationConfig; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.framemap.FrameMapBuilder; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; import jdk.vm.ci.code.CallingConvention; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLIRGenerator.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLIRGenerator.java index df2edb0263..65fb58c778 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLIRGenerator.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLIRGenerator.java @@ -10,7 +10,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * @@ -29,23 +29,23 @@ import java.util.HashMap; import java.util.Map; -import org.graalvm.compiler.core.common.CompressEncoding; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.calc.Condition; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryOrderMode; -import org.graalvm.compiler.core.common.spi.ForeignCallLinkage; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.LabelRef; -import org.graalvm.compiler.lir.SwitchStrategy; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGenerator; -import org.graalvm.compiler.phases.util.Providers; - +import jdk.graal.compiler.core.common.CompressEncoding; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.calc.Condition; +import jdk.graal.compiler.core.common.memory.BarrierType; +import jdk.graal.compiler.core.common.memory.MemoryOrderMode; +import jdk.graal.compiler.core.common.spi.ForeignCallLinkage; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.LabelRef; +import jdk.graal.compiler.lir.SwitchStrategy; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.BarrierSetLIRGeneratorTool; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGenerator; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.meta.AllocatableValue; @@ -84,7 +84,7 @@ public class PTXLIRGenerator extends LIRGenerator { private final Map parameterAllocations; public PTXLIRGenerator(Providers providers, LIRGenerationResult lirGenRes) { - super(new PTXLIRKindTool((PTXTargetDescription) providers.getCodeCache().getTarget()), new PTXArithmeticTool(), new PTXBarrierSetLIRGenerator(), new PTXMoveFactory(), providers, lirGenRes); + super(new PTXLIRKindTool((PTXTargetDescription) providers.getCodeCache().getTarget()), new PTXArithmeticTool(), new BarrierSetLIRGeneratorTool() {}, new PTXMoveFactory(), providers, lirGenRes); ptxGenTool = new PTXGenTool(this); parameterAllocations = new HashMap<>(); ptxBuiltinTool = new PTXBuiltinTool(); @@ -98,14 +98,11 @@ public static PTXBinaryOp getConditionalOp(Condition condition) { case AT: case GT: return PTXBinaryOp.SETP_GT; - case EQ: return PTXBinaryOp.SETP_EQ; - case BE: case LE: return PTXBinaryOp.SETP_LE; - case BT: case LT: return PTXBinaryOp.SETP_LT; @@ -114,7 +111,6 @@ public static PTXBinaryOp getConditionalOp(Condition condition) { default: shouldNotReachHere(); break; - } return null; } @@ -298,6 +294,16 @@ public void emitIntegerTestBranch(Value left, Value right, LabelRef trueDestinat unimplemented(); } + @Override + public void emitOpMaskTestBranch(Value left, boolean negateLeft, Value right, LabelRef trueDestination, LabelRef falseDestination, double trueSuccessorProbability) { + + } + + @Override + public void emitOpMaskOrTestBranch(Value left, Value right, boolean allZeros, LabelRef trueDestination, LabelRef falseDestination, double trueSuccessorProbability) { + + } + @Override public Variable emitConditionalMove(PlatformKind cmpKind, Value left, Value right, Condition cond, boolean unorderedIsTrue, Value trueValue, Value falseValue) { Logger.traceBuildLIR(Logger.BACKEND.PTX, "emitConditionalMove"); @@ -317,13 +323,13 @@ public Variable emitConditionalMove(PlatformKind cmpKind, Value left, Value righ * based on a bitwise and operation between two values. * * @param leftVal - * the left value of a condition + * the left value of a condition * @param right - * the right value of a condition + * the right value of a condition * @param trueValue - * the true value to move in the result + * the true value to move in the result * @param falseValue - * the false value to move in the result + * the false value to move in the result * @return Variable: reference to the variable that contains the result */ @Override @@ -346,6 +352,16 @@ public Variable emitIntegerTestMove(Value leftVal, Value right, Value trueValue, return result; } + @Override + public Variable emitOpMaskTestMove(Value leftVal, boolean negateLeft, Value right, Value trueValue, Value falseValue) { + return null; + } + + @Override + public Variable emitOpMaskOrTestMove(Value leftVal, Value right, boolean allZeros, Value trueValue, Value falseValue) { + return null; + } + @Override public Variable emitReverseBytes(Value operand) { return null; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLowTier.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLowTier.java index 4bd5858f28..7622f079a1 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLowTier.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXLowTier.java @@ -24,18 +24,17 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.compiler; -import static org.graalvm.compiler.core.common.GraalOptions.ConditionalElimination; -import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Required; - -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; -import org.graalvm.compiler.phases.common.FixReadsPhase; -import org.graalvm.compiler.phases.common.IterativeConditionalEliminationPhase; -import org.graalvm.compiler.phases.common.LowTierLoweringPhase; -import org.graalvm.compiler.phases.schedule.SchedulePhase; - +import static jdk.graal.compiler.core.common.GraalOptions.ConditionalElimination; +import static jdk.graal.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Required; + +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.phases.common.FixReadsPhase; +import jdk.graal.compiler.phases.common.IterativeConditionalEliminationPhase; +import jdk.graal.compiler.phases.common.LowTierLoweringPhase; +import jdk.graal.compiler.phases.schedule.SchedulePhase; import uk.ac.manchester.tornado.api.TornadoDeviceContext; import uk.ac.manchester.tornado.drivers.common.compiler.phases.analysis.TornadoFeatureExtraction; import uk.ac.manchester.tornado.drivers.common.compiler.phases.loops.TornadoLoopCanonicalization; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXMidTier.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXMidTier.java index cf91db8dd6..a26a0e51db 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXMidTier.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXMidTier.java @@ -24,18 +24,17 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.compiler; -import static org.graalvm.compiler.core.common.GraalOptions.ConditionalElimination; -import static org.graalvm.compiler.core.common.GraalOptions.OptFloatingReads; -import static org.graalvm.compiler.core.common.GraalOptions.ReassociateExpressions; - -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.FrameStateAssignmentPhase; -import org.graalvm.compiler.phases.common.GuardLoweringPhase; -import org.graalvm.compiler.phases.common.IterativeConditionalEliminationPhase; -import org.graalvm.compiler.phases.common.MidTierLoweringPhase; -import org.graalvm.compiler.phases.common.ReassociationPhase; - +import static jdk.graal.compiler.core.common.GraalOptions.ConditionalElimination; +import static jdk.graal.compiler.core.common.GraalOptions.OptFloatingReads; +import static jdk.graal.compiler.core.common.GraalOptions.ReassociateExpressions; + +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.FrameStateAssignmentPhase; +import jdk.graal.compiler.phases.common.GuardLoweringPhase; +import jdk.graal.compiler.phases.common.IterativeConditionalEliminationPhase; +import jdk.graal.compiler.phases.common.MidTierLoweringPhase; +import jdk.graal.compiler.phases.common.ReassociationPhase; import uk.ac.manchester.tornado.drivers.common.compiler.phases.guards.BoundCheckEliminationPhase; import uk.ac.manchester.tornado.drivers.common.compiler.phases.guards.ExceptionCheckingElimination; import uk.ac.manchester.tornado.drivers.common.compiler.phases.memalloc.TornadoPanamaSegmentsHeaderPhase; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXMoveFactory.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXMoveFactory.java index a8fe6be187..755a274438 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXMoveFactory.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXMoveFactory.java @@ -24,8 +24,8 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.gen.MoveFactory; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.gen.MoveFactory; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Constant; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXNodeLIRBuilder.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXNodeLIRBuilder.java index 4d63728c18..fb281fd199 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXNodeLIRBuilder.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXNodeLIRBuilder.java @@ -36,56 +36,56 @@ import java.util.List; import java.util.Map; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.cfg.BlockMap; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.gen.NodeLIRBuilder; -import org.graalvm.compiler.core.match.ComplexMatchValue; -import org.graalvm.compiler.debug.TTY; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.LabelRef; -import org.graalvm.compiler.lir.StandardOp; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGenerator; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodes.AbstractEndNode; -import org.graalvm.compiler.nodes.AbstractMergeNode; -import org.graalvm.compiler.nodes.BeginNode; -import org.graalvm.compiler.nodes.BreakpointNode; -import org.graalvm.compiler.nodes.DirectCallTargetNode; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.IndirectCallTargetNode; -import org.graalvm.compiler.nodes.Invoke; -import org.graalvm.compiler.nodes.LogicNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.LoopEndNode; -import org.graalvm.compiler.nodes.LoopExitNode; -import org.graalvm.compiler.nodes.LoweredCallTargetNode; -import org.graalvm.compiler.nodes.MergeNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.SafepointNode; -import org.graalvm.compiler.nodes.ShortCircuitOrNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.FloatEqualsNode; -import org.graalvm.compiler.nodes.calc.FloatLessThanNode; -import org.graalvm.compiler.nodes.calc.IntegerBelowNode; -import org.graalvm.compiler.nodes.calc.IntegerEqualsNode; -import org.graalvm.compiler.nodes.calc.IntegerLessThanNode; -import org.graalvm.compiler.nodes.calc.IntegerTestNode; -import org.graalvm.compiler.nodes.calc.IsNullNode; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.nodes.extended.IntegerSwitchNode; -import org.graalvm.compiler.options.OptionValues; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.cfg.BlockMap; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.gen.NodeLIRBuilder; +import jdk.graal.compiler.core.match.ComplexMatchValue; +import jdk.graal.compiler.debug.TTY; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.LabelRef; +import jdk.graal.compiler.lir.StandardOp; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGenerator; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodes.AbstractEndNode; +import jdk.graal.compiler.nodes.AbstractMergeNode; +import jdk.graal.compiler.nodes.BeginNode; +import jdk.graal.compiler.nodes.BreakpointNode; +import jdk.graal.compiler.nodes.DirectCallTargetNode; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.IndirectCallTargetNode; +import jdk.graal.compiler.nodes.Invoke; +import jdk.graal.compiler.nodes.LogicNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.LoopEndNode; +import jdk.graal.compiler.nodes.LoopExitNode; +import jdk.graal.compiler.nodes.LoweredCallTargetNode; +import jdk.graal.compiler.nodes.MergeNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.SafepointNode; +import jdk.graal.compiler.nodes.ShortCircuitOrNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.FloatEqualsNode; +import jdk.graal.compiler.nodes.calc.FloatLessThanNode; +import jdk.graal.compiler.nodes.calc.IntegerBelowNode; +import jdk.graal.compiler.nodes.calc.IntegerEqualsNode; +import jdk.graal.compiler.nodes.calc.IntegerLessThanNode; +import jdk.graal.compiler.nodes.calc.IntegerTestNode; +import jdk.graal.compiler.nodes.calc.IsNullNode; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.extended.IntegerSwitchNode; +import jdk.graal.compiler.options.OptionValues; import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.meta.AllocatableValue; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXNodeMatchRules.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXNodeMatchRules.java index 41547cde5f..80a4f797a8 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXNodeMatchRules.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/PTXNodeMatchRules.java @@ -22,8 +22,8 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.compiler; -import org.graalvm.compiler.core.gen.NodeMatchRules; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.core.gen.NodeMatchRules; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; public class PTXNodeMatchRules extends NodeMatchRules { public PTXNodeMatchRules(LIRGeneratorTool lirGen) { diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXGraphBuilderPlugins.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXGraphBuilderPlugins.java index b2c9b4b385..eee513ae75 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXGraphBuilderPlugins.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXGraphBuilderPlugins.java @@ -23,55 +23,37 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.compiler.plugins; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPBinaryIntrinsicNode.Operation.FMAX; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPBinaryIntrinsicNode.Operation.FMIN; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPBinaryIntrinsicNode.Operation.POW; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.ATAN; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.COS; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.EXP; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.FABS; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.LOG; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.SIGN; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.SIN; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.TAN; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.TANH; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXIntBinaryIntrinsicNode.Operation.MAX; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXIntBinaryIntrinsicNode.Operation.MIN; -import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXIntUnaryIntrinsicNode.Operation.POPCOUNT; - -import java.lang.foreign.MemorySegment; -import java.lang.foreign.ValueLayout; - -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryOrderMode; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.nodes.extended.BoxNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; -import org.graalvm.compiler.nodes.java.NewArrayNode; -import org.graalvm.compiler.nodes.java.StoreIndexedNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.replacements.InlineDuringParsingPlugin; -import org.graalvm.word.LocationIdentity; - +import jdk.graal.compiler.core.common.memory.BarrierType; +import jdk.graal.compiler.core.common.memory.MemoryOrderMode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.nodes.calc.SignExtendNode; +import jdk.graal.compiler.nodes.extended.BoxNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; +import jdk.graal.compiler.nodes.java.NewArrayNode; +import jdk.graal.compiler.nodes.java.StoreIndexedNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.replacements.InlineDuringParsingPlugin; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; +import org.graalvm.word.LocationIdentity; import uk.ac.manchester.tornado.api.KernelContext; import uk.ac.manchester.tornado.api.exceptions.Debug; -import uk.ac.manchester.tornado.api.exceptions.TornadoRuntimeException; +import uk.ac.manchester.tornado.api.types.arrays.TornadoMemorySegment; import uk.ac.manchester.tornado.drivers.ptx.graal.PTXArchitecture; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.LocalArrayNode; @@ -83,6 +65,22 @@ import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PrintfNode; import uk.ac.manchester.tornado.runtime.common.TornadoOptions; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPBinaryIntrinsicNode.Operation.FMAX; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPBinaryIntrinsicNode.Operation.FMIN; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPBinaryIntrinsicNode.Operation.POW; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.ATAN; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.COS; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.EXP; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.FABS; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.LOG; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.SIGN; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.SIN; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.TAN; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode.Operation.TANH; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXIntBinaryIntrinsicNode.Operation.MAX; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXIntBinaryIntrinsicNode.Operation.MIN; +import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXIntUnaryIntrinsicNode.Operation.POPCOUNT; + public class PTXGraphBuilderPlugins { public static void registerInvocationPlugins(final Plugins ps, final InvocationPlugins plugins) { @@ -190,6 +188,7 @@ private static void registerLocalBarrier(Registration r) { r.register(new InvocationPlugin("localBarrier", InvocationPlugin.Receiver.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { + receiver.get(true); PTXBarrierNode localBarrierNode = new PTXBarrierNode(0, -1); b.add(localBarrierNode); return true; @@ -201,6 +200,7 @@ private static void registerGlobalBarrier(Registration r) { r.register(new InvocationPlugin("globalBarrier", InvocationPlugin.Receiver.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { + receiver.get(true); PTXBarrierNode localBarrierNode = new PTXBarrierNode(1, -1); b.add(localBarrierNode); return true; @@ -212,8 +212,11 @@ private static void registerIntLocalArray(Registration r, JavaKind returnedJavaK r.register(new InvocationPlugin("allocateIntLocalArray", InvocationPlugin.Receiver.class, int.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode size) { + receiver.get(true); ConstantNode constantNode = new ConstantNode(size.asConstant(), StampFactory.forKind(JavaKind.Int)); + b.getGraph().addOrUnique(constantNode); LocalArrayNode localArrayNode = new LocalArrayNode(PTXArchitecture.sharedSpace, elementType, constantNode); + b.getGraph().addOrUnique(localArrayNode); b.push(returnedJavaKind, localArrayNode); return true; } @@ -224,8 +227,11 @@ private static void registerLongLocalArray(Registration r, JavaKind returnedJava r.register(new InvocationPlugin("allocateLongLocalArray", InvocationPlugin.Receiver.class, int.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode size) { + receiver.get(true); ConstantNode constantNode = new ConstantNode(size.asConstant(), StampFactory.forKind(JavaKind.Int)); + b.getGraph().addOrUnique(constantNode); LocalArrayNode localArrayNode = new LocalArrayNode(PTXArchitecture.sharedSpace, elementType, constantNode); + b.getGraph().addOrUnique(localArrayNode); b.push(returnedJavaKind, localArrayNode); return true; } @@ -236,8 +242,11 @@ private static void registerFloatLocalArray(Registration r, JavaKind returnedJav r.register(new InvocationPlugin("allocateFloatLocalArray", InvocationPlugin.Receiver.class, int.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode size) { + receiver.get(true); ConstantNode constantNode = new ConstantNode(size.asConstant(), StampFactory.forKind(JavaKind.Int)); + b.getGraph().addOrUnique(constantNode); LocalArrayNode localArrayNode = new LocalArrayNode(PTXArchitecture.sharedSpace, elementType, constantNode); + b.getGraph().addOrUnique(localArrayNode); b.push(returnedJavaKind, localArrayNode); return true; } @@ -248,8 +257,11 @@ private static void registerDoubleLocalArray(Registration r, JavaKind returnedJa r.register(new InvocationPlugin("allocateDoubleLocalArray", InvocationPlugin.Receiver.class, int.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode size) { + receiver.get(true); ConstantNode constantNode = new ConstantNode(size.asConstant(), StampFactory.forKind(JavaKind.Int)); + b.getGraph().addOrUnique(constantNode); LocalArrayNode localArrayNode = new LocalArrayNode(PTXArchitecture.sharedSpace, elementType, constantNode); + b.getGraph().addOrUnique(localArrayNode); b.push(returnedJavaKind, localArrayNode); return true; } @@ -399,48 +411,32 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec } - public static Class getValueLayoutClass(Class k) { - if (k == int.class) { - return ValueLayout.OfInt.class; - } else if (k == double.class) { - return ValueLayout.OfDouble.class; - } else if (k == float.class) { - return ValueLayout.OfFloat.class; - } else if (k == long.class) { - return ValueLayout.OfLong.class; - } else if (k == boolean.class) { - return ValueLayout.OfBoolean.class; - } else if (k == byte.class) { - return ValueLayout.OfByte.class; - } else if (k == char.class) { - return ValueLayout.OfChar.class; - } else if (k == short.class) { - return ValueLayout.OfShort.class; - } else { - throw new TornadoRuntimeException("Class type " + k + " not supported."); - } - } - private static void registerMemoryAccessPlugins(InvocationPlugins plugins) { - Registration r = new Registration(plugins, MemorySegment.class); + Registration r = new Registration(plugins, TornadoMemorySegment.class); for (JavaKind kind : JavaKind.values()) { if (kind != JavaKind.Object && kind != JavaKind.Void && kind != JavaKind.Illegal) { - r.register(new InvocationPlugin("getAtIndex", InvocationPlugin.Receiver.class, getValueLayoutClass(kind.toJavaClass()), long.class) { + r.register(new InvocationPlugin("get" + kind.name() + "AtIndex", InvocationPlugin.Receiver.class, int.class, int.class) { @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode layout, ValueNode index) { - MulNode mulNode = b.append(new MulNode(index, ConstantNode.forInt(kind.getByteCount()))); - AddressNode addressNode = b.append(new OffsetAddressNode(receiver.get(), mulNode)); + public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode index, ValueNode baseIndex) { + AddNode absoluteIndexNode = b.append(new AddNode(index, baseIndex)); + SignExtendNode signExtend = new SignExtendNode(absoluteIndexNode.asNode(), 64); + b.getGraph().addOrUnique(signExtend); + MulNode mulNode = b.append(new MulNode(signExtend, ConstantNode.forInt(kind.getByteCount()))); + AddressNode addressNode = b.append(new OffsetAddressNode(receiver.get(true), mulNode)); JavaReadNode readNode = new JavaReadNode(kind, addressNode, LocationIdentity.any(), BarrierType.NONE, MemoryOrderMode.PLAIN, false); b.addPush(kind, readNode); return true; } }); - r.register(new InvocationPlugin("setAtIndex", InvocationPlugin.Receiver.class, getValueLayoutClass(kind.toJavaClass()), long.class, kind.toJavaClass()) { + r.register(new InvocationPlugin("setAtIndex", InvocationPlugin.Receiver.class, int.class, kind.toJavaClass(), int.class) { @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode layout, ValueNode index, ValueNode value) { - MulNode mulNode = b.append(new MulNode(index, ConstantNode.forInt(kind.getByteCount()))); - AddressNode addressNode = b.append(new OffsetAddressNode(receiver.get(), mulNode)); + public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode index, ValueNode value, ValueNode baseIndex) { + AddNode absoluteIndexNode = b.append(new AddNode(index, baseIndex)); + SignExtendNode signExtend = new SignExtendNode(absoluteIndexNode.asNode(), 64); + b.getGraph().addOrUnique(signExtend); + MulNode mulNode = b.append(new MulNode(signExtend, ConstantNode.forInt(kind.getByteCount()))); + AddressNode addressNode = b.append(new OffsetAddressNode(receiver.get(true), mulNode)); JavaWriteNode writeNode = new JavaWriteNode(kind, addressNode, LocationIdentity.any(), value, BarrierType.NONE, false); b.add(writeNode); return true; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXHalfFloatPlugin.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXHalfFloatPlugin.java index 19c1be979a..31ccd50259 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXHalfFloatPlugin.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXHalfFloatPlugin.java @@ -23,13 +23,12 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.compiler.plugins; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin; - +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.graphbuilderconf.NodePlugin; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.api.types.HalfFloat; @@ -101,7 +100,10 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("getHalfFloatValue", InvocationPlugin.Receiver.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { - b.push(JavaKind.Short, b.append(new HalfFloatPlaceholder(receiver.get()))); + receiver.get(true); + // PiNode piNode = new PiNode(receiver.get(), StampFactory.forKind(JavaKind.Short)); + // b.getGraph().addOrUnique(piNode); + b.push(JavaKind.Short, b.append(new HalfFloatPlaceholder(receiver.get(true)))); return true; } }); diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXMathPlugins.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXMathPlugins.java index 606c2c3cb4..7b21607a78 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXMathPlugins.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXMathPlugins.java @@ -23,6 +23,19 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.compiler.plugins; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; +import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.meta.ResolvedJavaMethod; +import uk.ac.manchester.tornado.api.math.TornadoMath; +import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPBinaryIntrinsicNode; +import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode; +import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXIntBinaryIntrinsicNode; +import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXIntUnaryIntrinsicNode; + import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPBinaryIntrinsicNode.Operation.FMAX; import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPBinaryIntrinsicNode.Operation.FMIN; import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPBinaryIntrinsicNode.Operation.POW; @@ -44,20 +57,6 @@ import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXIntBinaryIntrinsicNode.Operation.MIN; import static uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXIntUnaryIntrinsicNode.Operation.ABS; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; - -import jdk.vm.ci.meta.JavaKind; -import jdk.vm.ci.meta.ResolvedJavaMethod; -import uk.ac.manchester.tornado.api.math.TornadoMath; -import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPBinaryIntrinsicNode; -import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFPUnaryIntrinsicNode; -import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXIntBinaryIntrinsicNode; -import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXIntUnaryIntrinsicNode; - public class PTXMathPlugins { public static void registerTornadoMathPlugins(final InvocationPlugins plugins) { diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXVectorNodePlugin.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXVectorNodePlugin.java index 314becbea9..770f241e46 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXVectorNodePlugin.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXVectorNodePlugin.java @@ -21,8 +21,8 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.compiler.plugins; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.NodePlugin; import jdk.vm.ci.hotspot.HotSpotResolvedJavaType; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXVectorPlugins.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXVectorPlugins.java index 51127451b0..c0e9ce1eaa 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXVectorPlugins.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/compiler/plugins/PTXVectorPlugins.java @@ -23,25 +23,22 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.compiler.plugins; -import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.guarantee; - -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.StampPair; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderTool; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; -import org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin; -import org.graalvm.compiler.nodes.java.StoreIndexedNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; - +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.StampPair; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderTool; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; +import jdk.graal.compiler.nodes.graphbuilderconf.NodePlugin; +import jdk.graal.compiler.nodes.java.StoreIndexedNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; @@ -91,6 +88,8 @@ import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.vector.VectorValueNode; import uk.ac.manchester.tornado.runtime.graal.nodes.PanamaPrivateMemoryNode; +import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.guarantee; + public final class PTXVectorPlugins { public static void registerPlugins(final Plugins ps, final InvocationPlugins plugins) { @@ -206,7 +205,7 @@ private static VectorValueNode resolveReceiver(GraphBuilderContext b, PTXKind ve } private static VectorValueNode resolveReceiver(GraphBuilderContext b, PTXKind vectorKind, Receiver receiver) { - ValueNode thisObject = receiver.get(); + ValueNode thisObject = receiver.get(true); return resolveReceiver(b, vectorKind, thisObject); } @@ -228,9 +227,10 @@ private static void registerVectorCollectionsPlugins(final InvocationPlugins plu final Class declaringClass = vectorKind.getJavaClass(); - final Registration r = new Registration(plugins, declaringClass); + final Registration r = new Registration(plugins, declaringClass).setAllowOverwrite(true); r.register(new InvocationPlugin("loadFromArray", Receiver.class, storageType, int.class) { public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode array, ValueNode index) { + receiver.get(true); final ResolvedJavaType resolvedType = b.getMetaAccess().lookupJavaType(vectorClass); PTXKind kind = PTXKind.fromResolvedJavaType(resolvedType); JavaKind elementKind = kind.getElementKind().asJavaKind(); @@ -243,6 +243,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("storeToArray", Receiver.class, vectorClass, storageType, int.class) { public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value, ValueNode array, ValueNode index) { + receiver.get(true); final ResolvedJavaType resolvedType = b.getMetaAccess().lookupJavaType(vectorClass); PTXKind kind = PTXKind.fromResolvedJavaType(resolvedType); JavaKind elementKind = kind.getElementKind().asJavaKind(); @@ -264,8 +265,8 @@ private static void registerVectorPlugins(final Plugins ps, final InvocationPlug ps.appendNodePlugin(new NodePlugin() { @Override public boolean handleInvoke(GraphBuilderContext b, ResolvedJavaMethod method, ValueNode[] args) { - if (method.getName().equals("") && (method.toString().contains("FloatArray.(int)") || method.toString().contains("DoubleArray.(int)") || method.toString().contains( - "IntArray.(int)") || method.toString().contains("HalfFloatArray.(int)"))) { + if (method.getName().equals("") && (method.toString().contains("FloatArray.(int)") || method.toString().contains("DoubleArray.(int)") || method.toString() + .contains("IntArray.(int)") || method.toString().contains("HalfFloatArray.(int)"))) { Class javaType = resolveJavaClass(method.toString()); b.append(new PanamaPrivateMemoryNode(b.getMetaAccess().lookupJavaType(javaType), args[1])); return true; @@ -276,7 +277,8 @@ public boolean handleInvoke(GraphBuilderContext b, ResolvedJavaMethod method, Va r.register(new InvocationPlugin("get", Receiver.class, int.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode laneId) { - final VectorLoadElementNode loadElement = new VectorLoadElementNode(vectorKind.getElementKind(), receiver.get(), laneId); + receiver.get(true); + final VectorLoadElementNode loadElement = new VectorLoadElementNode(vectorKind.getElementKind(), receiver.get(true), laneId); b.push(javaElementKind, b.append(loadElement)); return true; } @@ -285,8 +287,9 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("set", Receiver.class, vectorKind.getJavaClass()) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value) { - if (receiver.get() instanceof ParameterNode) { - final AddressNode address = new OffsetAddressNode(receiver.get(), null); + receiver.get(true); + if (receiver.get(true) instanceof ParameterNode) { + final AddressNode address = new OffsetAddressNode(receiver.get(true), null); final VectorStoreGlobalMemory store = new VectorStoreGlobalMemory(vectorKind, address, value); b.add(b.append(store)); return true; @@ -298,7 +301,8 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("set", Receiver.class, int.class, elementType) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode laneId, ValueNode value) { - final VectorStoreElementProxyNode store = new VectorStoreElementProxyNode(vectorKind.getElementKind(), receiver.get(), laneId, value); + receiver.get(true); + final VectorStoreElementProxyNode store = new VectorStoreElementProxyNode(vectorKind.getElementKind(), receiver.get(true), laneId, value); b.add(b.append(store)); return true; } @@ -307,7 +311,8 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("set", Receiver.class, int.class, storageType) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode laneId, ValueNode value) { - final VectorStoreElementProxyNode store = new VectorStoreElementProxyNode(vectorKind.getElementKind(), receiver.get(), laneId, value); + receiver.get(true); + final VectorStoreElementProxyNode store = new VectorStoreElementProxyNode(vectorKind.getElementKind(), receiver.get(true), laneId, value); b.add(b.append(store)); return true; } @@ -359,7 +364,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec final ResolvedJavaType resolvedType = b.getMetaAccess().lookupJavaType(declaringClass); PTXKind kind = PTXKind.fromResolvedJavaType(resolvedType); JavaKind elementKind = kind.getElementKind().asJavaKind(); - ValueNode array = receiver.get(); + ValueNode array = receiver.get(true); GetArrayNode getArrayNode = new GetArrayNode(kind, array, elementKind); b.push(JavaKind.Object, b.append(getArrayNode)); return true; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXAddressLowering.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXAddressLowering.java index 6b571f4041..68d89b6560 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXAddressLowering.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXAddressLowering.java @@ -24,13 +24,13 @@ import static uk.ac.manchester.tornado.drivers.ptx.graal.PTXArchitecture.PTXMemoryBase; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.FloatingReadNode; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.FloatingReadNode; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase; import uk.ac.manchester.tornado.api.exceptions.TornadoInternalError; import uk.ac.manchester.tornado.drivers.ptx.graal.PTXArchitecture; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXAddressNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXAddressNode.java index 50f13788e9..c55c95ad21 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXAddressNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXAddressNode.java @@ -24,17 +24,17 @@ import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.ptx.graal.PTXArchitecture.PTXMemoryBase; import uk.ac.manchester.tornado.drivers.ptx.graal.PTXStamp; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXArithmeticTool.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXArithmeticTool.java index 3d95b64038..739f7642b4 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXArithmeticTool.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXArithmeticTool.java @@ -27,15 +27,15 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler.PTXUnaryIntrinsic.RSQRT; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.calc.FloatConvert; +import jdk.graal.compiler.core.common.memory.MemoryExtendKind; +import jdk.graal.compiler.core.common.memory.MemoryOrderMode; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGenerator; import jdk.vm.ci.meta.JavaConstant; -import org.graalvm.compiler.core.common.LIRKind; -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.lir.ConstantValue; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGenerator; import jdk.vm.ci.meta.PlatformKind; import jdk.vm.ci.meta.Value; @@ -167,8 +167,7 @@ public Value emitUShr(Value a, Value b) { } @Override - public Value emitFloatConvert(FloatConvert op, Value inputVal) { - unimplemented(); + public Value emitFloatConvert(FloatConvert op, Value inputVal, boolean canBeNaN, boolean canOverflow) { return null; } @@ -242,6 +241,11 @@ public Value emitZeroExtend(Value inputVal, int fromBits, int toBits) { return result; } + @Override + public Value emitZeroExtend(Value inputVal, int fromBits, int toBits, boolean requiresExplicitZeroExtend, boolean requiresLIRKindChange) { + return null; + } + public PTXLIRGenerator getGen() { return (PTXLIRGenerator) getLIRGen(); } diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXBinary.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXBinary.java index 8c58cdfde6..5b8d777245 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXBinary.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXBinary.java @@ -12,7 +12,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * @@ -24,14 +24,13 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.lir; -import static org.graalvm.compiler.lir.LIRInstruction.Use; import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler.PTXBinaryIntrinsic; import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssemblerConstants.TAB; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; -import org.graalvm.compiler.lir.Variable; - +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.Opcode; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler.PTXBinaryOp; @@ -47,9 +46,9 @@ protected static class BinaryConsumer extends PTXLIROp { @Opcode protected final PTXBinaryOp opcode; - @Use + @LIRInstruction.Use protected Value x; - @Use + @LIRInstruction.Use protected Value y; protected BinaryConsumer(PTXBinaryOp opcode, LIRKind lirKind, Value x, Value y) { diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXBuiltinTool.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXBuiltinTool.java index 5a87ac906c..525b94149b 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXBuiltinTool.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXBuiltinTool.java @@ -38,9 +38,9 @@ import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler.PTXUnaryIntrinsic.SQRT; import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler.PTXUnaryIntrinsic.TANH; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.api.exceptions.TornadoInternalError; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXControlFlow.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXControlFlow.java index a8877f6e76..1f0d12ab8e 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXControlFlow.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXControlFlow.java @@ -29,8 +29,8 @@ import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssemblerConstants.TAB; import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssemblerConstants.UNI; -import org.graalvm.compiler.lir.LIRInstructionClass; -import org.graalvm.compiler.lir.LabelRef; +import jdk.graal.compiler.lir.LIRInstructionClass; +import jdk.graal.compiler.lir.LabelRef; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.api.exceptions.TornadoInternalError; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXDirectCall.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXDirectCall.java index 21cbf04a11..2c77287439 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXDirectCall.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXDirectCall.java @@ -31,10 +31,10 @@ import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssemblerConstants.SPACE; import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssemblerConstants.TAB; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodes.DirectCallTargetNode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodes.DirectCallTargetNode; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.api.exceptions.TornadoInternalError; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXGenTool.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXGenTool.java index e828e4f44e..026e4c1a43 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXGenTool.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXGenTool.java @@ -29,11 +29,11 @@ import java.util.HashMap; import jdk.vm.ci.meta.Local; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaConstant; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXLIROp.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXLIROp.java index acdbcb7d3f..7654fb7fbe 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXLIROp.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXLIROp.java @@ -25,8 +25,8 @@ import jdk.vm.ci.meta.PlatformKind; import jdk.vm.ci.meta.Value; import jdk.vm.ci.meta.ValueKind; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Variable; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler; import uk.ac.manchester.tornado.drivers.ptx.graal.compiler.PTXCompilationResultBuilder; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXLIRStmt.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXLIRStmt.java index 4c6293b84b..cc814925d9 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXLIRStmt.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXLIRStmt.java @@ -50,12 +50,12 @@ import java.nio.charset.StandardCharsets; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.LIRInstructionClass; -import org.graalvm.compiler.lir.Opcode; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.LIRInstructionClass; +import jdk.graal.compiler.lir.Opcode; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.ptx.graal.PTXArchitecture; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXNullary.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXNullary.java index 1c39905e56..ee7f08e430 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXNullary.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXNullary.java @@ -33,9 +33,9 @@ import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssemblerConstants.SPACE; import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssemblerConstants.TAB; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Opcode; +import jdk.graal.compiler.lir.Variable; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler.PTXNullaryOp; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXPrintf.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXPrintf.java index b7c344e079..d2fc4ec6c7 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXPrintf.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXPrintf.java @@ -20,11 +20,11 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Opcode; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.lir.Variable; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssemblerConstants; import uk.ac.manchester.tornado.drivers.ptx.graal.compiler.PTXCompilationResultBuilder; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXTernary.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXTernary.java index 54dc633847..de651c9f7d 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXTernary.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXTernary.java @@ -12,7 +12,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * @@ -24,12 +24,10 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.lir; -import static org.graalvm.compiler.lir.LIRInstruction.Use; - -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; -import org.graalvm.compiler.lir.Variable; - +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.Opcode; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler.PTXTernaryOp; @@ -44,11 +42,11 @@ protected static class TernaryConsumer extends PTXLIROp { @Opcode protected final PTXTernaryOp opcode; - @Use + @LIRInstruction.Use protected Value x; - @Use + @LIRInstruction.Use protected Value y; - @Use + @LIRInstruction.Use protected Value z; protected TernaryConsumer(PTXTernaryOp opcode, LIRKind lirKind, Value x, Value y, Value z) { diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXUnary.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXUnary.java index 08f77e0d69..2fa5bca27b 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXUnary.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXUnary.java @@ -12,7 +12,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * @@ -24,7 +24,6 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.lir; -import static org.graalvm.compiler.lir.LIRInstruction.Use; import static uk.ac.manchester.tornado.drivers.ptx.graal.PTXArchitecture.paramSpace; import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler.PTXUnaryOp; import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssemblerConstants.COMMA; @@ -33,11 +32,11 @@ import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssemblerConstants.SQUARE_BRACKETS_OPEN; import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssemblerConstants.TAB; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Opcode; -import org.graalvm.compiler.lir.Variable; - +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.Opcode; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.ptx.graal.PTXArchitecture.PTXMemoryBase; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler; @@ -50,7 +49,7 @@ public class PTXUnary { * Abstract operation which consumes one input */ protected static class UnaryConsumer extends PTXLIROp { - @Use + @LIRInstruction.Use protected Value value; @Opcode diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXVectorAssign.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXVectorAssign.java index 734d696551..16db63677c 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXVectorAssign.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXVectorAssign.java @@ -53,9 +53,9 @@ import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssemblerConstants.TAB; import static uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXLIRStmt.AssignStmt.shouldEmitMove; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.LIRInstruction.Use; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.LIRInstruction.Use; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXVectorElementSelect.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXVectorElementSelect.java index f2cb7e55e7..56f6760b31 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXVectorElementSelect.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXVectorElementSelect.java @@ -24,9 +24,9 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.lir; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Opcode; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Opcode; +import jdk.graal.compiler.lir.Variable; @Opcode("VSEL") public class PTXVectorElementSelect extends Value { diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXVectorSplit.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXVectorSplit.java index 77a056bb39..cb3952e2db 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXVectorSplit.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/lir/PTXVectorSplit.java @@ -32,7 +32,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.lir.Variable; import uk.ac.manchester.tornado.api.exceptions.TornadoInternalError; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/CastNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/CastNode.java index e06c20ee61..ffb5f039a7 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/CastNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/CastNode.java @@ -22,17 +22,17 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.calc.FloatConvert; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.calc.FloatConvert; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.PrimitiveConstant; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/FixedArrayCopyNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/FixedArrayCopyNode.java index 54780d0e1e..8e7c91e030 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/FixedArrayCopyNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/FixedArrayCopyNode.java @@ -10,7 +10,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * @@ -21,27 +21,26 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.core.common.type.TypeReference; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.RawConstant; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.core.common.type.TypeReference; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; - import uk.ac.manchester.tornado.drivers.ptx.graal.PTXArchitecture; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXBinary; -import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXUnary; -import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXLIRStmt; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; +import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXLIRStmt; +import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXUnary; /** * This node generates a pointer copy between two arrays in private memory. diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/FixedArrayNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/FixedArrayNode.java index 28c9bf519c..8698ee2273 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/FixedArrayNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/FixedArrayNode.java @@ -24,16 +24,16 @@ import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler.PTXBinaryTemplate; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.core.common.type.TypeReference; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.core.common.type.TypeReference; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GetArrayNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GetArrayNode.java index 59214a63e0..4936a2580e 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GetArrayNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GetArrayNode.java @@ -22,15 +22,15 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.ptx.graal.PTXStampFactory; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GlobalThreadIdNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GlobalThreadIdNode.java index 3b5685bf69..f077a3d26b 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GlobalThreadIdNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GlobalThreadIdNode.java @@ -24,17 +24,17 @@ import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler.PTXTernaryOp; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GlobalThreadSizeNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GlobalThreadSizeNode.java index 035f74c2d4..53aac7dfc3 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GlobalThreadSizeNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GlobalThreadSizeNode.java @@ -25,17 +25,17 @@ import static uk.ac.manchester.tornado.drivers.ptx.graal.PTXArchitecture.PTXBuiltInRegisterArray; import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler.PTXBinaryOp.MUL_WIDE; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GroupIdNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GroupIdNode.java index c78f0d5d75..fe57b05c1f 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GroupIdNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/GroupIdNode.java @@ -21,18 +21,18 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalArrayNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalArrayNode.java index b1d3fdebde..c8bd39c222 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalArrayNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalArrayNode.java @@ -25,17 +25,17 @@ import static uk.ac.manchester.tornado.drivers.ptx.graal.PTXArchitecture.PTXMemoryBase; import static uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler.PTXBinaryTemplate; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.core.common.type.TypeReference; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.core.common.type.TypeReference; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaType; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalGroupSizeNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalGroupSizeNode.java index 3ba017257e..8d5d7ef250 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalGroupSizeNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalGroupSizeNode.java @@ -22,17 +22,17 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalThreadIDFixedNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalThreadIDFixedNode.java index b6a3b79b25..bbdb49cb16 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalThreadIDFixedNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalThreadIDFixedNode.java @@ -21,17 +21,17 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalThreadIdNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalThreadIdNode.java index 6a24d36880..2b12f51466 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalThreadIdNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalThreadIdNode.java @@ -21,18 +21,18 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalThreadSizeNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalThreadSizeNode.java index 122f24caf5..7d8640b631 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalThreadSizeNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/LocalThreadSizeNode.java @@ -21,17 +21,17 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXBarrierNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXBarrierNode.java index b0801f1fc0..f3c5de0164 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXBarrierNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXBarrierNode.java @@ -21,13 +21,13 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.common.logging.Logger; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXFMANode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXFMANode.java index dd8fe95ddb..bbd5ecfcaa 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXFMANode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXFMANode.java @@ -21,14 +21,14 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXArithmeticTool; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXFPBinaryIntrinsicNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXFPBinaryIntrinsicNode.java index e674df4a87..f8849af986 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXFPBinaryIntrinsicNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXFPBinaryIntrinsicNode.java @@ -23,22 +23,22 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXFPUnaryIntrinsicNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXFPUnaryIntrinsicNode.java index 031fc323a1..9715776548 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXFPUnaryIntrinsicNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXFPUnaryIntrinsicNode.java @@ -23,23 +23,23 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.FloatStamp; -import org.graalvm.compiler.core.common.type.PrimitiveStamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.UnaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.FloatStamp; +import jdk.graal.compiler.core.common.type.PrimitiveStamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.UnaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXHalfFloatDivisionNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXHalfFloatDivisionNode.java index 953ae41073..61e242625c 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXHalfFloatDivisionNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXHalfFloatDivisionNode.java @@ -23,16 +23,16 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXLIRStmt; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXIntBinaryIntrinsicNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXIntBinaryIntrinsicNode.java index 5cdef507e1..9074c88141 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXIntBinaryIntrinsicNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXIntBinaryIntrinsicNode.java @@ -23,19 +23,19 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXIntUnaryIntrinsicNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXIntUnaryIntrinsicNode.java index 2647c14591..966a23dca8 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXIntUnaryIntrinsicNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXIntUnaryIntrinsicNode.java @@ -23,19 +23,19 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.UnaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.UnaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXKernelContextAccessNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXKernelContextAccessNode.java index 7e62eba0a6..4b332e8d04 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXKernelContextAccessNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PTXKernelContextAccessNode.java @@ -23,16 +23,16 @@ import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.ptx.graal.PTXArchitecture; import uk.ac.manchester.tornado.drivers.ptx.graal.asm.PTXAssembler; import uk.ac.manchester.tornado.drivers.ptx.graal.compiler.PTXLIRGenerator; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PrintfNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PrintfNode.java index 7763755b44..79d2cf1221 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PrintfNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PrintfNode.java @@ -21,18 +21,18 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.IterableNodeType; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.IterableNodeType; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PrintfStringNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PrintfStringNode.java index deb3a31882..c58d6726cb 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PrintfStringNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/PrintfStringNode.java @@ -22,15 +22,15 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/RSqrtNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/RSqrtNode.java index 5d94efe37a..546f3bf4e0 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/RSqrtNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/RSqrtNode.java @@ -21,14 +21,14 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXArithmeticTool; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/ReadHalfFloatNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/ReadHalfFloatNode.java index a4cb9f560c..65d262b909 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/ReadHalfFloatNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/ReadHalfFloatNode.java @@ -21,16 +21,16 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/WriteHalfFloatNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/WriteHalfFloatNode.java index 52a313146a..b2d5bed0d3 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/WriteHalfFloatNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/WriteHalfFloatNode.java @@ -21,18 +21,18 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/calc/DivNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/calc/DivNode.java index a2c36a594d..52026f8f3f 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/calc/DivNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/calc/DivNode.java @@ -27,16 +27,16 @@ the DivNode as a child of FloatingNode does not exist any longer. */ -import org.graalvm.compiler.core.common.type.ArithmeticOpTable; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryArithmeticNode; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.ArithmeticOpTable; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryArithmeticNode; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/LoadIndexedVectorNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/LoadIndexedVectorNode.java index 8997e38c79..d6c7f66f54 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/LoadIndexedVectorNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/LoadIndexedVectorNode.java @@ -22,10 +22,10 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes.vector; import jdk.vm.ci.meta.JavaKind; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.java.LoadIndexedNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.java.LoadIndexedNode; import uk.ac.manchester.tornado.drivers.ptx.graal.PTXStampFactory; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorAddHalfNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorAddHalfNode.java index 16488a82ef..c40f9b9050 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorAddHalfNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorAddHalfNode.java @@ -23,15 +23,15 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXLIRStmt; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorAddNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorAddNode.java index 2df376ec76..7d5496d4ab 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorAddNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorAddNode.java @@ -21,18 +21,18 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorDivNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorDivNode.java index 38373af32b..9e4774613e 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorDivNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorDivNode.java @@ -21,17 +21,17 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorElementOpNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorElementOpNode.java index 6cc324528b..d586c70ba4 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorElementOpNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorElementOpNode.java @@ -24,20 +24,20 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.guarantee; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorLoadElementNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorLoadElementNode.java index 14b254571c..261ced72e5 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorLoadElementNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorLoadElementNode.java @@ -23,9 +23,9 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes.vector; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; import uk.ac.manchester.tornado.runtime.graal.nodes.interfaces.MarkVectorLoad; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorMulNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorMulNode.java index 21f11a4ca4..d3caadf99c 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorMulNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorMulNode.java @@ -21,17 +21,17 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorMultHalfNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorMultHalfNode.java index bb2e0e6daa..597188bcab 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorMultHalfNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorMultHalfNode.java @@ -23,17 +23,17 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXLIRStmt; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorStoreElementProxyNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorStoreElementProxyNode.java index 50a0a6d149..cce838ee43 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorStoreElementProxyNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorStoreElementProxyNode.java @@ -21,15 +21,15 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes.vector; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.Canonicalizable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.Canonicalizable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; import uk.ac.manchester.tornado.drivers.ptx.graal.PTXStampFactory; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorStoreGlobalMemory.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorStoreGlobalMemory.java index c56cd346ec..5f0ee25934 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorStoreGlobalMemory.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorStoreGlobalMemory.java @@ -21,13 +21,13 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.providers.TornadoMemoryOrder; import uk.ac.manchester.tornado.drivers.ptx.graal.PTXStampFactory; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorSubHalfNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorSubHalfNode.java index f70f926e8f..2032883370 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorSubHalfNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorSubHalfNode.java @@ -23,15 +23,15 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXLIRStmt; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorSubNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorSubNode.java index a889531040..1eba30a184 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorSubNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorSubNode.java @@ -21,17 +21,17 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorValueNode.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorValueNode.java index 5e559f8ce7..ce72fa975e 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorValueNode.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/nodes/vector/VectorValueNode.java @@ -24,24 +24,24 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.graph.NodeInputList; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.InvokeNode; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.graph.NodeInputList; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.InvokeNode; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaConstant; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/InverseSquareRootPhase.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/InverseSquareRootPhase.java index 0ff868f902..19946b2e8b 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/InverseSquareRootPhase.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/InverseSquareRootPhase.java @@ -23,13 +23,13 @@ import java.util.Optional; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatDivNode; -import org.graalvm.compiler.nodes.calc.SqrtNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatDivNode; +import jdk.graal.compiler.nodes.calc.SqrtNode; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.RSqrtNode; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/PTXFMAPhase.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/PTXFMAPhase.java index 78fdd888dd..2b6e27a36c 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/PTXFMAPhase.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/PTXFMAPhase.java @@ -23,13 +23,13 @@ import java.util.Optional; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXFMANode; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.ReadHalfFloatNode; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoBatchGlobalIndexOffset.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoBatchGlobalIndexOffset.java index 358017de38..9367725387 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoBatchGlobalIndexOffset.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoBatchGlobalIndexOffset.java @@ -24,20 +24,20 @@ import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.RawConstant; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FrameState; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.java.LoadIndexedNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FrameState; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.java.LoadIndexedNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.common.BatchCompilationConfig; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoHighTierContext; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoFixedArrayCopyPhase.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoFixedArrayCopyPhase.java index fa47e0e736..63ccf523c0 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoFixedArrayCopyPhase.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoFixedArrayCopyPhase.java @@ -21,24 +21,23 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.phases; -import jdk.vm.ci.meta.ResolvedJavaType; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.Phase; +import java.util.ArrayList; +import java.util.Optional; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.Phase; +import jdk.vm.ci.meta.ResolvedJavaType; import uk.ac.manchester.tornado.api.exceptions.TornadoCompilationException; import uk.ac.manchester.tornado.drivers.ptx.graal.PTXArchitecture; +import uk.ac.manchester.tornado.drivers.ptx.graal.PTXStampFactory; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.FixedArrayCopyNode; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.FixedArrayNode; -import uk.ac.manchester.tornado.drivers.ptx.graal.PTXStampFactory; - -import java.util.ArrayList; -import java.util.Optional; /** * This phase examines if a copy takes place between two arrays in private memory based on @@ -46,6 +45,38 @@ */ public class TornadoFixedArrayCopyPhase extends Phase { + private static boolean isFixedArrayCopied(ValuePhiNode phiNode) { + return phiNode.usages().filter(OffsetAddressNode.class).isNotEmpty() && phiNode.values().filter(FixedArrayNode.class).isNotEmpty(); + } + + private static void deleteFixed(Node n) { + Node pred = n.predecessor(); + Node suc = n.successors().first(); + + n.replaceFirstSuccessor(suc, null); + n.replaceAtPredecessor(suc); + pred.replaceFirstSuccessor(n, suc); + + for (Node us : n.usages()) { + n.removeUsage(us); + } + n.clearInputs(); + + n.safeDelete(); + } + + private static ValuePhiNode getPrivateArrayIndex(Node node) { + // identify the index + for (Node input : node.inputs()) { + if (input instanceof ValuePhiNode phiNode) { + return phiNode; + } else { + return getPrivateArrayIndex(input); + } + } + return null; + } + @Override public Optional notApplicableTo(GraphState graphState) { return ALWAYS_APPLICABLE; @@ -84,36 +115,4 @@ protected void run(StructuredGraph graph) { } } - private static boolean isFixedArrayCopied(ValuePhiNode phiNode) { - return phiNode.usages().filter(OffsetAddressNode.class).isNotEmpty() && phiNode.values().filter(FixedArrayNode.class).isNotEmpty(); - } - - private static void deleteFixed(Node n) { - Node pred = n.predecessor(); - Node suc = n.successors().first(); - - n.replaceFirstSuccessor(suc, null); - n.replaceAtPredecessor(suc); - pred.replaceFirstSuccessor(n, suc); - - for (Node us : n.usages()) { - n.removeUsage(us); - } - n.clearInputs(); - - n.safeDelete(); - } - - private static ValuePhiNode getPrivateArrayIndex(Node node) { - // identify the index - for (Node input : node.inputs()) { - if (input instanceof ValuePhiNode phiNode) { - return phiNode; - } else { - return getPrivateArrayIndex(input); - } - } - return null; - } - } diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoFloatingReadReplacement.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoFloatingReadReplacement.java index 8463f89fde..319f1b3fa7 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoFloatingReadReplacement.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoFloatingReadReplacement.java @@ -10,7 +10,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * @@ -21,8 +21,6 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.phases; -import static org.graalvm.compiler.graph.Graph.NodeEvent.NODE_ADDED; -import static org.graalvm.compiler.graph.Graph.NodeEvent.ZERO_USAGES; import static org.graalvm.word.LocationIdentity.any; import static org.graalvm.word.LocationIdentity.init; @@ -34,52 +32,52 @@ import org.graalvm.collections.EconomicSet; import org.graalvm.collections.Equivalence; import org.graalvm.collections.UnmodifiableMapCursor; -import org.graalvm.compiler.core.common.cfg.Loop; -import org.graalvm.compiler.debug.DebugCloseable; -import org.graalvm.compiler.debug.GraalError; -import org.graalvm.compiler.graph.Graph; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.AbstractBeginNode; -import org.graalvm.compiler.nodes.AbstractMergeNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.LoopEndNode; -import org.graalvm.compiler.nodes.LoopExitNode; -import org.graalvm.compiler.nodes.MemoryMapControlSinkNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.ProxyNode; -import org.graalvm.compiler.nodes.StartNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValueNodeInterface; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.nodes.cfg.HIRLoop; -import org.graalvm.compiler.nodes.memory.AddressableMemoryAccess; -import org.graalvm.compiler.nodes.memory.FloatableAccessNode; -import org.graalvm.compiler.nodes.memory.FloatingAccessNode; -import org.graalvm.compiler.nodes.memory.FloatingReadNode; -import org.graalvm.compiler.nodes.memory.MemoryAccess; -import org.graalvm.compiler.nodes.memory.MemoryAnchorNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.memory.MemoryMap; -import org.graalvm.compiler.nodes.memory.MemoryMapNode; -import org.graalvm.compiler.nodes.memory.MemoryPhiNode; -import org.graalvm.compiler.nodes.memory.MultiMemoryKill; -import org.graalvm.compiler.nodes.memory.SingleMemoryKill; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.nodes.spi.CoreProviders; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.FloatingReadPhase; -import org.graalvm.compiler.phases.common.PostRunCanonicalizationPhase; -import org.graalvm.compiler.phases.common.util.EconomicSetNodeEventListener; -import org.graalvm.compiler.phases.graph.ReentrantNodeIterator; import org.graalvm.word.LocationIdentity; +import jdk.graal.compiler.core.common.cfg.Loop; +import jdk.graal.compiler.debug.DebugCloseable; +import jdk.graal.compiler.debug.GraalError; +import jdk.graal.compiler.graph.Graph; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.AbstractBeginNode; +import jdk.graal.compiler.nodes.AbstractMergeNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.LoopEndNode; +import jdk.graal.compiler.nodes.LoopExitNode; +import jdk.graal.compiler.nodes.MemoryMapControlSinkNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.ProxyNode; +import jdk.graal.compiler.nodes.StartNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValueNodeInterface; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.cfg.ControlFlowGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.cfg.HIRLoop; +import jdk.graal.compiler.nodes.memory.AddressableMemoryAccess; +import jdk.graal.compiler.nodes.memory.FloatableAccessNode; +import jdk.graal.compiler.nodes.memory.FloatingAccessNode; +import jdk.graal.compiler.nodes.memory.FloatingReadNode; +import jdk.graal.compiler.nodes.memory.MemoryAccess; +import jdk.graal.compiler.nodes.memory.MemoryAnchorNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.memory.MemoryMap; +import jdk.graal.compiler.nodes.memory.MemoryMapNode; +import jdk.graal.compiler.nodes.memory.MemoryPhiNode; +import jdk.graal.compiler.nodes.memory.MultiMemoryKill; +import jdk.graal.compiler.nodes.memory.SingleMemoryKill; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.nodes.spi.CoreProviders; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.FloatingReadPhase; +import jdk.graal.compiler.phases.common.PostRunCanonicalizationPhase; +import jdk.graal.compiler.phases.common.util.EconomicSetNodeEventListener; +import jdk.graal.compiler.phases.graph.ReentrantNodeIterator; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.FixedArrayNode; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXBarrierNode; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.vector.VectorLoadElementNode; @@ -107,7 +105,7 @@ public TornadoFloatingReadReplacement(CanonicalizerPhase canonicalizer) { /** * @param createMemoryMapNodes - * a {@link MemoryMapNode} will be created for each return if this + * a {@link MemoryMapNode} will be created for each return if this * @param canonicalizer */ public TornadoFloatingReadReplacement(boolean createMemoryMapNodes, CanonicalizerPhase canonicalizer) { @@ -247,17 +245,17 @@ protected void run(StructuredGraph graph, CoreProviders context) { EconomicMap> modifiedInLoops = null; if (graph.hasLoops()) { modifiedInLoops = EconomicMap.create(Equivalence.IDENTITY); - ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, true, false, false); + ControlFlowGraph cfg = ControlFlowGraph.newBuilder(graph).connectBlocks(true).computeLoops(true).computeFrequency(true).build(); for (Loop l : cfg.getLoops()) { HIRLoop loop = (HIRLoop) l; processLoop(loop, modifiedInLoops); } } - EconomicSetNodeEventListener listener = new EconomicSetNodeEventListener(EnumSet.of(NODE_ADDED, ZERO_USAGES)); + EconomicSetNodeEventListener listener = new EconomicSetNodeEventListener(EnumSet.of(Graph.NodeEvent.NODE_ADDED, Graph.NodeEvent.ZERO_USAGES)); try (Graph.NodeEventScope nes = graph.trackNodeEvents(listener)) { - ReentrantNodeIterator.apply(new FloatingReadPhase.FloatingReadClosure(modifiedInLoops, true, createMemoryMapNodes, initMemory), graph.start(), - new FloatingReadPhase.MemoryMapImpl(graph.start())); + ReentrantNodeIterator.apply(new FloatingReadPhase.FloatingReadClosure(modifiedInLoops, true, createMemoryMapNodes, initMemory), graph.start(), new FloatingReadPhase.MemoryMapImpl(graph + .start())); } for (Node n : removeExternallyUsedNodes(listener.getNodes())) { @@ -362,9 +360,9 @@ private static void processAccess(MemoryAccess access, TornadoFloatingReadReplac /** * @param accessNode - * is a {@link FixedNode} that will be replaced by a - * {@link FloatingNode}. This method checks if the node that is going - * to be replaced has an {@link PTXBarrierNode} as next. + * is a {@link FixedNode} that will be replaced by a + * {@link FloatingNode}. This method checks if the node that is going + * to be replaced has an {@link PTXBarrierNode} as next. */ private static boolean isNextNodeBarrierNode(FloatableAccessNode accessNode) { return (accessNode.next() instanceof PTXBarrierNode); @@ -372,9 +370,9 @@ private static boolean isNextNodeBarrierNode(FloatableAccessNode accessNode) { /** * @param nextNode - * is a {@link FixedNode} that will be replaced by a - * {@link FloatingNode}. This method removes the redundant - * {@link PTXBarrierNode}. + * is a {@link FixedNode} that will be replaced by a + * {@link FloatingNode}. This method removes the redundant + * {@link PTXBarrierNode}. */ private static void replaceRedundantBarrierNode(Node nextNode) { nextNode.replaceAtUsages(nextNode.successors().first()); @@ -416,8 +414,9 @@ protected TornadoFloatingReadReplacement.MemoryMapImpl processNode(FixedNode nod final LoopExitNode loopExitNode = (LoopExitNode) node; final EconomicSet modifiedInLoop = modifiedInLoops.get(loopExitNode.loopBegin()); final boolean anyModified = modifiedInLoop.contains(LocationIdentity.any()); - state.getMap().replaceAll( - (locationIdentity, memoryNode) -> (anyModified || modifiedInLoop.contains(locationIdentity)) ? ProxyNode.forMemory(memoryNode, loopExitNode, locationIdentity) : memoryNode); + state.getMap().replaceAll((locationIdentity, memoryNode) -> (anyModified || modifiedInLoop.contains(locationIdentity)) + ? ProxyNode.forMemory(memoryNode, loopExitNode, locationIdentity) + : memoryNode); } if (node instanceof MemoryAnchorNode) { diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoHalfFloatReplacement.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoHalfFloatReplacement.java index 3674639ba5..47acd25f69 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoHalfFloatReplacement.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoHalfFloatReplacement.java @@ -21,29 +21,25 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.phases; -import java.util.ArrayList; -import java.util.Optional; - +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.nodes.calc.SubNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.extended.ValueAnchorNode; +import jdk.graal.compiler.nodes.java.NewInstanceNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.phases.BasePhase; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.RawConstant; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.nodes.calc.SubNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.extended.ValueAnchorNode; -import org.graalvm.compiler.nodes.java.NewInstanceNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.phases.BasePhase; - import uk.ac.manchester.tornado.api.internal.annotations.HalfType; import uk.ac.manchester.tornado.drivers.ptx.graal.lir.PTXKind; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.PTXHalfFloatDivisionNode; @@ -64,135 +60,10 @@ import uk.ac.manchester.tornado.runtime.graal.nodes.VectorHalfRead; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoHighTierContext; -public class TornadoHalfFloatReplacement extends BasePhase { - - @Override - public Optional notApplicableTo(GraphState graphState) { - return ALWAYS_APPLICABLE; - } - - protected void run(StructuredGraph graph, TornadoHighTierContext context) { - - for (ValueAnchorNode valueAnchorNode : graph.getNodes().filter(ValueAnchorNode.class)) { - ArrayList deletePi = new ArrayList(); - for (Node valueAnchorNodeUsage : valueAnchorNode.usages()) { - if (valueAnchorNodeUsage instanceof PiNode) { - PiNode piNode = (PiNode) valueAnchorNodeUsage; - piNode.replaceAtUsages(piNode.object()); - deletePi.add(piNode); - } - } - for (PiNode p : deletePi) { - p.safeDelete(); - } - deleteFixed(valueAnchorNode); - } - - // replace reads with halfFloat reads - for (JavaReadNode javaRead : graph.getNodes().filter(JavaReadNode.class)) { - if (javaRead.successors().first() instanceof NewInstanceNode) { - NewInstanceNode newInstanceNode = (NewInstanceNode) javaRead.successors().first(); - if (newInstanceNode.instanceClass().getAnnotation(HalfType.class) != null) { - if (newInstanceNode.successors().first() instanceof NewHalfFloatInstance) { - NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) newInstanceNode.successors().first(); - deleteFixed(newHalfFloatInstance); - } - AddressNode readingAddress = javaRead.getAddress(); - ReadHalfFloatNode readHalfFloatNode = new ReadHalfFloatNode(readingAddress); - graph.addWithoutUnique(readHalfFloatNode); - replaceFixed(javaRead, readHalfFloatNode); - newInstanceNode.replaceAtUsages(readHalfFloatNode); - deleteFixed(newInstanceNode); - } - } - } - - for (NewInstanceNode newInstanceNode : graph.getNodes().filter(NewInstanceNode.class)) { - if (newInstanceNode.instanceClass().getAnnotation(HalfType.class) != null) { - if (newInstanceNode.successors().first() instanceof NewHalfFloatInstance) { - NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) newInstanceNode.successors().first(); - ValueNode valueInput = newHalfFloatInstance.getValue(); - newInstanceNode.replaceAtUsages(valueInput); - deleteFixed(newInstanceNode); - deleteFixed(newHalfFloatInstance); - } - } - } - - // replace writes with halfFloat writes - for (JavaWriteNode javaWrite : graph.getNodes().filter(JavaWriteNode.class)) { - if (isWriteHalfFloat(javaWrite)) { - // This casting is safe to do as it is already checked by the isWriteHalfFloat function - HalfFloatPlaceholder placeholder = (HalfFloatPlaceholder) javaWrite.value(); - ValueNode writingValue; - if (javaWrite.predecessor() instanceof NewHalfFloatInstance) { - // if a new HalfFloat instance is written - NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) javaWrite.predecessor(); - writingValue = newHalfFloatInstance.getValue(); - if (newHalfFloatInstance.predecessor() instanceof NewInstanceNode) { - NewInstanceNode newInstanceNode = (NewInstanceNode) newHalfFloatInstance.predecessor(); - if (newInstanceNode.instanceClass().toString().contains("HalfFloat")) { - deleteFixed(newInstanceNode); - deleteFixed(newHalfFloatInstance); - } - } - } else { - // if the result of an operation or a stored value is written - writingValue = placeholder.getInput(); - } - placeholder.replaceAtUsages(writingValue); - placeholder.safeDelete(); - AddressNode writingAddress = javaWrite.getAddress(); - WriteHalfFloatNode writeHalfFloatNode = new WriteHalfFloatNode(writingAddress, writingValue); - graph.addWithoutUnique(writeHalfFloatNode); - replaceFixed(javaWrite, writeHalfFloatNode); - deleteFixed(javaWrite); - } - } - - // replace the half float operator nodes with the corresponding regular operators - replaceAddHalfFloatNodes(graph); - replaceSubHalfFloatNodes(graph); - replaceMultHalfFloatNodes(graph); - replaceDivHalfFloatNodes(graph); - - // add after the loadindexedvector nodes the marker node to fix the offset of its read - - for (LoadIndexedVectorNode loadIndexedVectorNode : graph.getNodes().filter(LoadIndexedVectorNode.class)) { - if (loadIndexedVectorNode.getPtxKind().isHalf()) { - VectorHalfRead vectorHalfRead; - if (loadIndexedVectorNode.index() instanceof ConstantNode) { - ConstantNode offset = (ConstantNode) loadIndexedVectorNode.index(); - int offsetValue = Integer.valueOf(offset.getValue().toValueString()); - vectorHalfRead = graph.addWithoutUnique(new VectorHalfRead(offsetValue)); - } else { - vectorHalfRead = graph.addWithoutUnique(new VectorHalfRead()); - } - graph.addAfterFixed(loadIndexedVectorNode, vectorHalfRead); - } - } - - for (VectorValueNode vectorValueNode : graph.getNodes().filter(VectorValueNode.class)) { - if (vectorValueNode.getPTXKind().isHalf()) { - for (Node vectorElement : vectorValueNode.inputs()) { - if (vectorElement instanceof VectorLoadElementNode) { - VectorLoadElementNode vectorLoad = (VectorLoadElementNode) vectorElement; - VectorLoadElementNode vectorLoadShort = new VectorLoadElementNode(PTXKind.S16, vectorLoad.getVector(), vectorLoad.getLaneId()); - graph.addWithoutUnique(vectorLoadShort); - vectorLoad.replaceAtUsages(vectorLoadShort); - vectorLoad.safeDelete(); - } else if (vectorElement instanceof ConstantNode constantNode && constantNode.getValue().toValueString().contains("null")) { - Constant zeroValue = new RawConstant(0); - ConstantNode zero = new ConstantNode(zeroValue, StampFactory.forKind(JavaKind.Short)); - graph.addWithoutUnique(zero); - constantNode.replaceAtUsages(zero); - constantNode.safeDelete(); - } - } - } - } +import java.util.ArrayList; +import java.util.Optional; - } +public class TornadoHalfFloatReplacement extends BasePhase { private static ValueNode replaceAdd(AddHalfFloatNode addHalfFloatNode, StructuredGraph graph) { ValueNode addNode; @@ -242,8 +113,19 @@ private static ValueNode replaceSub(SubHalfFloatNode subHalfFloatNode, Structure subNode = new SubNode(subX, subY); graph.addWithoutUnique(subNode); } - subHalfFloatNode.replaceAtUsages(subNode); + + PiNode piNode = null; + if (subHalfFloatNode.usages().filter(PiNode.class).isNotEmpty()) { + piNode = subHalfFloatNode.usages().filter(PiNode.class).first(); + } + if (piNode != null) { + piNode.replaceAtUsages(subNode); + piNode.safeDelete(); + } else { + subHalfFloatNode.replaceAtUsages(subNode); + } subHalfFloatNode.safeDelete(); + return subNode; } @@ -265,7 +147,18 @@ private static ValueNode replaceMult(MultHalfFloatNode multHalfFloatNode, Struct multNode = new MulNode(multX, multY); graph.addWithoutUnique(multNode); } - multHalfFloatNode.replaceAtUsages(multNode); + + PiNode piNode = null; + if (multHalfFloatNode.usages().filter(PiNode.class).isNotEmpty()) { + piNode = multHalfFloatNode.usages().filter(PiNode.class).first(); + } + if (piNode != null) { + piNode.replaceAtUsages(multNode); + piNode.safeDelete(); + } else { + multHalfFloatNode.replaceAtUsages(multNode); + } + multHalfFloatNode.safeDelete(); return multNode; } @@ -283,7 +176,17 @@ private static ValueNode replaceDiv(DivHalfFloatNode divHalfFloatNode, Structure PTXHalfFloatDivisionNode divNode = new PTXHalfFloatDivisionNode(divX, divY); graph.addWithoutUnique(divNode); - divHalfFloatNode.replaceAtUsages(divNode); + PiNode piNode = null; + if (divHalfFloatNode.usages().filter(PiNode.class).isNotEmpty()) { + piNode = divHalfFloatNode.usages().filter(PiNode.class).first(); + } + if (piNode != null) { + piNode.replaceAtUsages(divNode); + piNode.safeDelete(); + } else { + divHalfFloatNode.replaceAtUsages(divNode); + } + divHalfFloatNode.safeDelete(); return divNode; } @@ -358,4 +261,147 @@ private static void deleteFixed(Node node) { node.safeDelete(); } } + + @Override + public Optional notApplicableTo(GraphState graphState) { + return ALWAYS_APPLICABLE; + } + + protected void run(StructuredGraph graph, TornadoHighTierContext context) { + + for (ValueAnchorNode valueAnchorNode : graph.getNodes().filter(ValueAnchorNode.class)) { + ArrayList deletePi = new ArrayList(); + for (Node valueAnchorNodeUsage : valueAnchorNode.usages()) { + if (valueAnchorNodeUsage instanceof PiNode) { + PiNode piNode = (PiNode) valueAnchorNodeUsage; + piNode.replaceAtUsages(piNode.object()); + deletePi.add(piNode); + } + } + for (PiNode p : deletePi) { + p.safeDelete(); + } + deleteFixed(valueAnchorNode); + } + + // cleaup the reminder Pi nodes introduced since Graal 24.0.1 + for (PiNode piNode : graph.getNodes().filter(PiNode.class)) { + for (Node piNodeUsages : piNode.usages()) { + if (piNodeUsages instanceof VectorValueNode) { + piNode.replaceAtUsages(piNode.object()); + piNode.safeDelete(); + } + } + } + + // replace reads with halfFloat reads + for (JavaReadNode javaRead : graph.getNodes().filter(JavaReadNode.class)) { + if (javaRead.successors().first() instanceof NewInstanceNode) { + NewInstanceNode newInstanceNode = (NewInstanceNode) javaRead.successors().first(); + if (newInstanceNode.instanceClass().getAnnotation(HalfType.class) != null) { + if (newInstanceNode.successors().first() instanceof NewHalfFloatInstance) { + NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) newInstanceNode.successors().first(); + deleteFixed(newHalfFloatInstance); + } + AddressNode readingAddress = javaRead.getAddress(); + ReadHalfFloatNode readHalfFloatNode = new ReadHalfFloatNode(readingAddress); + graph.addWithoutUnique(readHalfFloatNode); + replaceFixed(javaRead, readHalfFloatNode); + newInstanceNode.replaceAtUsages(readHalfFloatNode); + deleteFixed(newInstanceNode); + } + } + } + + for (NewInstanceNode newInstanceNode : graph.getNodes().filter(NewInstanceNode.class)) { + if (newInstanceNode.instanceClass().getAnnotation(HalfType.class) != null) { + if (newInstanceNode.successors().first() instanceof NewHalfFloatInstance) { + NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) newInstanceNode.successors().first(); + ValueNode valueInput = newHalfFloatInstance.getValue(); + newInstanceNode.replaceAtUsages(valueInput); + deleteFixed(newInstanceNode); + deleteFixed(newHalfFloatInstance); + } + } + } + + // replace writes with halfFloat writes + for (JavaWriteNode javaWrite : graph.getNodes().filter(JavaWriteNode.class)) { + if (isWriteHalfFloat(javaWrite)) { + // This casting is safe to do as it is already checked by the isWriteHalfFloat function + HalfFloatPlaceholder placeholder = (HalfFloatPlaceholder) javaWrite.value(); + ValueNode writingValue; + if (javaWrite.predecessor() instanceof NewHalfFloatInstance) { + // if a new HalfFloat instance is written + NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) javaWrite.predecessor(); + writingValue = newHalfFloatInstance.getValue(); + if (newHalfFloatInstance.predecessor() instanceof NewInstanceNode) { + NewInstanceNode newInstanceNode = (NewInstanceNode) newHalfFloatInstance.predecessor(); + if (newInstanceNode.instanceClass().toString().contains("HalfFloat")) { + deleteFixed(newInstanceNode); + deleteFixed(newHalfFloatInstance); + } + } + } else { + // if the result of an operation or a stored value is written + writingValue = placeholder.getInput(); + } + placeholder.replaceAtUsages(writingValue); + placeholder.safeDelete(); + AddressNode writingAddress = javaWrite.getAddress(); + WriteHalfFloatNode writeHalfFloatNode = new WriteHalfFloatNode(writingAddress, writingValue); + graph.addWithoutUnique(writeHalfFloatNode); + replaceFixed(javaWrite, writeHalfFloatNode); + deleteFixed(javaWrite); + } + } + + // replace the half float operator nodes with the corresponding regular operators + replaceAddHalfFloatNodes(graph); + replaceSubHalfFloatNodes(graph); + replaceMultHalfFloatNodes(graph); + replaceDivHalfFloatNodes(graph); + + // add after the loadindexedvector nodes the marker node to fix the offset of its read + + for (LoadIndexedVectorNode loadIndexedVectorNode : graph.getNodes().filter(LoadIndexedVectorNode.class)) { + if (loadIndexedVectorNode.getPtxKind().isHalf()) { + VectorHalfRead vectorHalfRead; + if (loadIndexedVectorNode.index() instanceof ConstantNode) { + ConstantNode offset = (ConstantNode) loadIndexedVectorNode.index(); + int offsetValue = Integer.valueOf(offset.getValue().toValueString()); + vectorHalfRead = graph.addWithoutUnique(new VectorHalfRead(offsetValue)); + } else { + vectorHalfRead = graph.addWithoutUnique(new VectorHalfRead()); + } + graph.addAfterFixed(loadIndexedVectorNode, vectorHalfRead); + } + } + + for (VectorValueNode vectorValueNode : graph.getNodes().filter(VectorValueNode.class)) { + if (vectorValueNode.getPTXKind().isHalf()) { + for (Node vectorElement : vectorValueNode.inputs()) { + if (vectorElement instanceof VectorLoadElementNode) { + VectorLoadElementNode vectorLoad = (VectorLoadElementNode) vectorElement; + VectorLoadElementNode vectorLoadShort = new VectorLoadElementNode(PTXKind.S16, vectorLoad.getVector(), vectorLoad.getLaneId()); + graph.addWithoutUnique(vectorLoadShort); + vectorLoad.replaceAtUsages(vectorLoadShort); + vectorLoad.safeDelete(); + } else if (vectorElement instanceof ConstantNode constantNode && constantNode.getValue().toValueString().contains("null")) { + Constant zeroValue = new RawConstant(0); + ConstantNode zero = new ConstantNode(zeroValue, StampFactory.forKind(JavaKind.Short)); + graph.addWithoutUnique(zero); + constantNode.replaceAtUsages(zero); + constantNode.safeDelete(); + } + } + } + } + + for (HalfFloatPlaceholder placeholder : graph.getNodes().filter(HalfFloatPlaceholder.class)) { + ValueNode input = placeholder.getInput(); + placeholder.replaceAtUsages(input); + placeholder.safeDelete(); + } + } } diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoHalfFloatVectorOffset.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoHalfFloatVectorOffset.java index adc945fe64..12bbaae327 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoHalfFloatVectorOffset.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoHalfFloatVectorOffset.java @@ -24,17 +24,17 @@ import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.RawConstant; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.LeftShiftNode; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.WriteNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.LeftShiftNode; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.WriteNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.vector.VectorValueNode; import uk.ac.manchester.tornado.runtime.graal.nodes.VectorHalfRead; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoPTXIntrinsicsReplacements.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoPTXIntrinsicsReplacements.java index b856bd8c45..ec18544269 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoPTXIntrinsicsReplacements.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoPTXIntrinsicsReplacements.java @@ -26,16 +26,16 @@ import java.util.Optional; -import org.graalvm.compiler.graph.NodeInputList; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.CallTargetNode; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.InvokeNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.NodeInputList; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.CallTargetNode; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.InvokeNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.phases.BasePhase; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoParallelScheduler.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoParallelScheduler.java index ad52a5c730..83c0fb2e90 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoParallelScheduler.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoParallelScheduler.java @@ -25,13 +25,13 @@ import java.util.Optional; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.GlobalThreadIdNode; import uk.ac.manchester.tornado.drivers.ptx.graal.nodes.GlobalThreadSizeNode; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoTaskSpecialisation.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoTaskSpecialisation.java index 6b7459b816..928171d829 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoTaskSpecialisation.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/phases/TornadoTaskSpecialisation.java @@ -31,29 +31,29 @@ import java.util.Optional; import java.util.concurrent.atomic.AtomicBoolean; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.graph.Graph; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedGuardNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.LogicConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.calc.IntegerLessThanNode; -import org.graalvm.compiler.nodes.calc.IsNullNode; -import org.graalvm.compiler.nodes.extended.UnboxNode; -import org.graalvm.compiler.nodes.java.ArrayLengthNode; -import org.graalvm.compiler.nodes.java.LoadFieldNode; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.phases.BasePhase; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.graph.Graph; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedGuardNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.LogicConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.calc.IntegerLessThanNode; +import jdk.graal.compiler.nodes.calc.IsNullNode; +import jdk.graal.compiler.nodes.extended.UnboxNode; +import jdk.graal.compiler.nodes.java.ArrayLengthNode; +import jdk.graal.compiler.nodes.java.LoadFieldNode; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.phases.BasePhase; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaField; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/snippets/PTXGPUReduceSnippets.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/snippets/PTXGPUReduceSnippets.java index 9a9ebfd4a9..afdd6f35cc 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/snippets/PTXGPUReduceSnippets.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/snippets/PTXGPUReduceSnippets.java @@ -21,18 +21,18 @@ */ package uk.ac.manchester.tornado.drivers.ptx.graal.snippets; -import org.graalvm.compiler.api.replacements.Snippet; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.java.NewArrayNode; -import org.graalvm.compiler.nodes.spi.LoweringTool; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.replacements.SnippetTemplate; -import org.graalvm.compiler.replacements.SnippetTemplate.AbstractTemplates; -import org.graalvm.compiler.replacements.SnippetTemplate.Arguments; -import org.graalvm.compiler.replacements.SnippetTemplate.SnippetInfo; -import org.graalvm.compiler.replacements.Snippets; +import jdk.graal.compiler.api.replacements.Snippet; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.java.NewArrayNode; +import jdk.graal.compiler.nodes.spi.LoweringTool; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.replacements.SnippetTemplate; +import jdk.graal.compiler.replacements.SnippetTemplate.AbstractTemplates; +import jdk.graal.compiler.replacements.SnippetTemplate.Arguments; +import jdk.graal.compiler.replacements.SnippetTemplate.SnippetInfo; +import jdk.graal.compiler.replacements.Snippets; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.api.math.TornadoMath; diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/snippets/TornadoSnippetTypeInference.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/snippets/TornadoSnippetTypeInference.java index ae37023cef..eacd40b800 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/snippets/TornadoSnippetTypeInference.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/graal/snippets/TornadoSnippetTypeInference.java @@ -24,8 +24,8 @@ package uk.ac.manchester.tornado.drivers.ptx.graal.snippets; import jdk.vm.ci.meta.JavaKind; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.replacements.SnippetTemplate.SnippetInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.replacements.SnippetTemplate.SnippetInfo; public interface TornadoSnippetTypeInference { diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/mm/PTXArrayWrapper.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/mm/PTXArrayWrapper.java index 42024a2be8..bf3e73b109 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/mm/PTXArrayWrapper.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/mm/PTXArrayWrapper.java @@ -58,7 +58,7 @@ public PTXArrayWrapper(PTXDeviceContext deviceContext, JavaKind kind) { this.buffer = INIT_VALUE; this.bufferSize = INIT_VALUE; - arrayHeaderSize = getVMConfig().getArrayBaseOffset(kind); + arrayHeaderSize = (int) TornadoOptions.PANAMA_OBJECT_HEADER_SIZE; arrayLengthOffset = getVMConfig().arrayOopDescLengthOffset(); logger = new TornadoLogger(this.getClass()); } diff --git a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/tests/TestPTXJITCompiler.java b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/tests/TestPTXJITCompiler.java index 69a08214e1..02f7d2e05f 100644 --- a/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/tests/TestPTXJITCompiler.java +++ b/tornado-drivers/ptx/src/main/java/uk/ac/manchester/tornado/drivers/ptx/tests/TestPTXJITCompiler.java @@ -27,7 +27,7 @@ import java.util.Arrays; import java.util.HashMap; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.api.annotations.Parallel; diff --git a/tornado-drivers/spirv/src/main/java/module-info.java b/tornado-drivers/spirv/src/main/java/module-info.java index 6ad624dc83..7b6649a716 100644 --- a/tornado-drivers/spirv/src/main/java/module-info.java +++ b/tornado-drivers/spirv/src/main/java/module-info.java @@ -1,8 +1,11 @@ import uk.ac.manchester.tornado.runtime.TornadoBackendProvider; module tornado.drivers.spirv { + requires java.base; requires transitive jdk.internal.vm.ci; - requires transitive jdk.internal.vm.compiler; + requires transitive jdk.graal.compiler; + requires transitive org.graalvm.collections; + requires transitive org.graalvm.word; requires transitive tornado.api; requires transitive tornado.runtime; requires tornado.drivers.common; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVBackend.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVBackend.java index 8797ba5d04..53d6e23c77 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVBackend.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVBackend.java @@ -39,26 +39,26 @@ import java.util.Stack; import java.util.concurrent.atomic.AtomicInteger; -import org.graalvm.compiler.code.CompilationResult; -import org.graalvm.compiler.core.common.CompilationIdentifier; -import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; -import org.graalvm.compiler.lir.asm.DataBuilder; -import org.graalvm.compiler.lir.framemap.FrameMap; -import org.graalvm.compiler.lir.framemap.FrameMapBuilder; -import org.graalvm.compiler.lir.framemap.ReferenceMapBuilder; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.tiers.SuitesProvider; +import jdk.graal.compiler.code.CompilationResult; +import jdk.graal.compiler.core.common.CompilationIdentifier; +import jdk.graal.compiler.core.common.alloc.RegisterAllocationConfig; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.asm.DataBuilder; +import jdk.graal.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.lir.framemap.FrameMapBuilder; +import jdk.graal.compiler.lir.framemap.ReferenceMapBuilder; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.cfg.ControlFlowGraph; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.tiers.SuitesProvider; import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.CompilationRequest; @@ -211,6 +211,11 @@ public SuitesProvider getSuites() { return null; } + @Override + public RegisterAllocationConfig newRegisterAllocationConfig(RegisterConfig registerConfig, String[] allocationRestrictedTo, Object stub) { + return null; + } + @Override protected CompiledCode createCompiledCode(ResolvedJavaMethod method, CompilationRequest compilationRequest, CompilationResult compilationResult, boolean isDefault, OptionValues options) { unimplemented("Create compiled code method in SPIRVBackend not implemented yet."); diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVBackendImpl.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVBackendImpl.java index 9da5cc1ba9..4e66d85b20 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVBackendImpl.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVBackendImpl.java @@ -27,8 +27,8 @@ import java.util.HashMap; import java.util.List; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import uk.ac.manchester.tornado.api.common.TornadoDevice; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVThreadBuiltIn.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVThreadBuiltIn.java index f45db696fd..1a4887ce65 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVThreadBuiltIn.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVThreadBuiltIn.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.drivers.spirv; -import org.graalvm.compiler.graph.Node; +import jdk.graal.compiler.graph.Node; import uk.ac.manchester.beehivespirvtoolkit.lib.instructions.operands.SPIRVBuiltIn; import uk.ac.manchester.tornado.drivers.spirv.graal.nodes.GlobalThreadIdNode; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVTornadoDriverProvider.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVTornadoDriverProvider.java index d698029d4b..ea70855404 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVTornadoDriverProvider.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/SPIRVTornadoDriverProvider.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.drivers.spirv; -import org.graalvm.compiler.options.OptionValues; +import jdk.graal.compiler.options.OptionValues; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import uk.ac.manchester.tornado.runtime.TornadoAcceleratorBackend; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVFrameContext.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVFrameContext.java index cade0eadb1..fe76c72579 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVFrameContext.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVFrameContext.java @@ -24,8 +24,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; -import org.graalvm.compiler.lir.asm.FrameContext; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.asm.FrameContext; /** * Mapping for a native frame. diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVFrameMap.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVFrameMap.java index adc87542a9..92e2b5cde9 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVFrameMap.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVFrameMap.java @@ -24,9 +24,9 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.NumUtil; -import org.graalvm.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.NumUtil; +import jdk.graal.compiler.lir.framemap.FrameMap; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.RegisterConfig; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVFrameMapBuilder.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVFrameMapBuilder.java index a6916a1362..6b5210ed40 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVFrameMapBuilder.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVFrameMapBuilder.java @@ -24,8 +24,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal; -import org.graalvm.compiler.lir.framemap.FrameMap; -import org.graalvm.compiler.lir.framemap.FrameMapBuilderImpl; +import jdk.graal.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.lir.framemap.FrameMapBuilderImpl; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.RegisterConfig; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVHotSpotBackendFactory.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVHotSpotBackendFactory.java index 9c8be3b479..9eea48abf6 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVHotSpotBackendFactory.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVHotSpotBackendFactory.java @@ -24,21 +24,22 @@ package uk.ac.manchester.tornado.drivers.spirv.graal; import static jdk.vm.ci.common.InitTimer.timer; -import static org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; - -import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; -import org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider; -import org.graalvm.compiler.hotspot.meta.HotSpotStampProvider; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.loop.LoopsDataProviderImpl; -import org.graalvm.compiler.nodes.spi.LoopsDataProvider; -import org.graalvm.compiler.nodes.spi.LoweringProvider; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.printer.GraalDebugHandlersFactory; -import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins; -import org.graalvm.compiler.replacements.classfile.ClassfileBytecodeProvider; -import org.graalvm.compiler.word.WordTypes; + +import jdk.graal.compiler.api.replacements.SnippetReflectionProvider; +import jdk.graal.compiler.core.common.spi.MetaAccessExtensionProvider; +import jdk.graal.compiler.hotspot.meta.HotSpotIdentityHashCodeProvider; +import jdk.graal.compiler.hotspot.meta.HotSpotStampProvider; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.loop.LoopsDataProviderImpl; +import jdk.graal.compiler.nodes.spi.LoopsDataProvider; +import jdk.graal.compiler.nodes.spi.LoweringProvider; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.printer.GraalDebugHandlersFactory; +import jdk.graal.compiler.replacements.StandardGraphBuilderPlugins; +import jdk.graal.compiler.replacements.classfile.ClassfileBytecodeProvider; +import jdk.graal.compiler.word.WordTypes; import jdk.vm.ci.common.InitTimer; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; @@ -85,40 +86,45 @@ public static SPIRVBackend createJITCompiler(OptionValues options, HotSpotJVMCIR HotSpotConstantReflectionProvider constantReflection = (HotSpotConstantReflectionProvider) jvmci.getConstantReflection(); // We specify an architecture of 64 bits - SPIRVArchitecture architecture = new SPIRVArchitecture(SPIRVKind.OP_TYPE_INT_64, device.getByteOrder(), spirvRuntime); + uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVArchitecture architecture = new uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVArchitecture(SPIRVKind.OP_TYPE_INT_64, device.getByteOrder(), spirvRuntime); SPIRVTargetDescription targetDescription = new SPIRVTargetDescription(architecture, false, SPIRV_STACK_ALIGNMENT, SPIRV_IMPLICIT_NULL_CHECK_LIMIT, SPIRV_INLINE_OBJECT, device .isDeviceDoubleFPSupported(), device.getDeviceExtensions()); SPIRVDeviceContext deviceContext = context.getDeviceContext(device.getDeviceIndex()); - SPIRVCodeProvider codeProvider = new SPIRVCodeProvider(targetDescription); + uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVCodeProvider codeProvider = new uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVCodeProvider(targetDescription); - SPIRVProviders providers; - SPIRVSuitesProvider suites; - SPIRVLoweringProvider lowerer; - Plugins plugins; + uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVProviders providers; + uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVSuitesProvider suites; + uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVLoweringProvider lowerer; + GraphBuilderConfiguration.Plugins plugins; try (InitTimer t = timer("create providers")) { TornadoPlatformConfigurationProvider platformConfigurationProvider = new TornadoPlatformConfigurationProvider(); MetaAccessExtensionProvider metaAccessExtensionProvider = new TornadoMetaAccessExtensionProvider(); - lowerer = new SPIRVLoweringProvider(metaAccess, foreignCalls, platformConfigurationProvider, metaAccessExtensionProvider, constantReflection, vmConfig, targetDescription, false); + lowerer = new uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVLoweringProvider(metaAccess, foreignCalls, platformConfigurationProvider, metaAccessExtensionProvider, constantReflection, vmConfig, targetDescription, false); WordTypes wordTypes = new TornadoWordTypes(metaAccess, SPIRVKind.OP_TYPE_FLOAT_32.asJavaKind()); LoopsDataProvider lpd = new LoopsDataProviderImpl(); - Providers p = new Providers(metaAccess, codeProvider, constantReflection, constantFieldProvider, foreignCalls, lowerer, lowerer.getReplacements(), stampProvider, - platformConfigurationProvider, metaAccessExtensionProvider, snippetReflection, wordTypes, lpd); + HotSpotIdentityHashCodeProvider hotSpotIdentityHashCodeProvider = new HotSpotIdentityHashCodeProvider(); + + Providers p = new Providers(metaAccess, // + codeProvider, constantReflection, constantFieldProvider, // + foreignCalls, lowerer, lowerer.getReplacements(), stampProvider, // + platformConfigurationProvider, metaAccessExtensionProvider, snippetReflection, // + wordTypes, lpd , hotSpotIdentityHashCodeProvider); ClassfileBytecodeProvider bytecodeProvider = new ClassfileBytecodeProvider(metaAccess, snippetReflection); GraalDebugHandlersFactory graalDebugHandlersFactory = new GraalDebugHandlersFactory(snippetReflection); - TornadoReplacements replacements = new TornadoReplacements(graalDebugHandlersFactory, p, snippetReflection, bytecodeProvider, targetDescription); + TornadoReplacements replacements = new TornadoReplacements(graalDebugHandlersFactory, p, bytecodeProvider, targetDescription); plugins = createGraphPlugins(metaAccess, replacements, snippetReflection, lowerer); replacements.setGraphBuilderPlugins(plugins); - suites = new SPIRVSuitesProvider(options, deviceContext, plugins, metaAccess, compilerConfiguration, addressLowering); + suites = new uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVSuitesProvider(options, deviceContext, plugins, metaAccess, compilerConfiguration, addressLowering); - providers = new SPIRVProviders(metaAccess, codeProvider, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, platformConfigurationProvider, - metaAccessExtensionProvider, snippetReflection, wordTypes, p.getLoopsDataProvider(), suites); + providers = new uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVProviders(metaAccess, codeProvider, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, platformConfigurationProvider, + metaAccessExtensionProvider, snippetReflection, wordTypes, p.getLoopsDataProvider(), suites, hotSpotIdentityHashCodeProvider); lowerer.initialize(options, new DummySnippetFactory(), providers); } @@ -137,10 +143,10 @@ public static SPIRVBackend createJITCompiler(OptionValues options, HotSpotJVMCIR * {@link TornadoReplacements} * @return Plugins for SPIRV */ - private static Plugins createGraphPlugins(HotSpotMetaAccessProvider metaAccess, TornadoReplacements replacements, SnippetReflectionProvider snippetReflectionProvider, + private static GraphBuilderConfiguration.Plugins createGraphPlugins(HotSpotMetaAccessProvider metaAccess, TornadoReplacements replacements, SnippetReflectionProvider snippetReflectionProvider, LoweringProvider loweringProvider) { InvocationPlugins invocationPlugins = new InvocationPlugins(); - Plugins plugins = new Plugins(invocationPlugins); + GraphBuilderConfiguration.Plugins plugins = new GraphBuilderConfiguration.Plugins(invocationPlugins); SPIRVGraphBuilderPlugins.registerParametersPlugins(plugins); SPIRVGraphBuilderPlugins.registerNewInstancePlugins(plugins); diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVLIRKindTool.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVLIRKindTool.java index cb6df125ad..e03b3dc0bf 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVLIRKindTool.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVLIRKindTool.java @@ -24,8 +24,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.spi.LIRKindTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.spi.LIRKindTool; import uk.ac.manchester.tornado.drivers.spirv.SPIRVTargetDescription; import uk.ac.manchester.tornado.drivers.spirv.graal.lir.SPIRVKind; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVLoweringProvider.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVLoweringProvider.java index d5ac16d409..d78cacfb4d 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVLoweringProvider.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVLoweringProvider.java @@ -24,62 +24,66 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal; -import static org.graalvm.compiler.nodes.NamedLocationIdentity.ARRAY_LENGTH_LOCATION; +import static jdk.graal.compiler.nodes.NamedLocationIdentity.ARRAY_LENGTH_LOCATION; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; import static uk.ac.manchester.tornado.drivers.providers.TornadoMemoryOrder.GPU_MEMORY_MODE; import java.util.Iterator; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryExtendKind; -import org.graalvm.compiler.core.common.spi.ForeignCallsProvider; -import org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.core.common.type.StampPair; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeInputList; -import org.graalvm.compiler.nodes.AbstractDeoptimizeNode; -import org.graalvm.compiler.nodes.CompressionNode; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FieldLocationIdentity; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.Invoke; -import org.graalvm.compiler.nodes.InvokeNode; -import org.graalvm.compiler.nodes.LoweredCallTargetNode; -import org.graalvm.compiler.nodes.NamedLocationIdentity; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.UnwindNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryArithmeticNode; -import org.graalvm.compiler.nodes.calc.FloatConvertNode; -import org.graalvm.compiler.nodes.calc.IntegerDivRemNode; -import org.graalvm.compiler.nodes.calc.RemNode; -import org.graalvm.compiler.nodes.java.ArrayLengthNode; -import org.graalvm.compiler.nodes.java.InstanceOfNode; -import org.graalvm.compiler.nodes.java.LoadFieldNode; -import org.graalvm.compiler.nodes.java.LoadIndexedNode; -import org.graalvm.compiler.nodes.java.MethodCallTargetNode; -import org.graalvm.compiler.nodes.java.StoreFieldNode; -import org.graalvm.compiler.nodes.java.StoreIndexedNode; -import org.graalvm.compiler.nodes.memory.AbstractWriteNode; -import org.graalvm.compiler.nodes.memory.ExtendableMemoryAccess; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.WriteNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.nodes.spi.LoweringTool; -import org.graalvm.compiler.nodes.spi.PlatformConfigurationProvider; -import org.graalvm.compiler.nodes.type.StampTool; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.replacements.DefaultJavaLoweringProvider; -import org.graalvm.compiler.replacements.SnippetCounter; +import jdk.graal.compiler.core.common.memory.BarrierType; +import jdk.graal.compiler.core.common.memory.MemoryExtendKind; +import jdk.graal.compiler.core.common.spi.ForeignCallsProvider; +import jdk.graal.compiler.core.common.spi.MetaAccessExtensionProvider; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.core.common.type.StampPair; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeInputList; +import jdk.graal.compiler.nodes.AbstractDeoptimizeNode; +import jdk.graal.compiler.nodes.CompressionNode; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FieldLocationIdentity; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.Invoke; +import jdk.graal.compiler.nodes.InvokeNode; +import jdk.graal.compiler.nodes.LoweredCallTargetNode; +import jdk.graal.compiler.nodes.NamedLocationIdentity; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.UnwindNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.BinaryArithmeticNode; +import jdk.graal.compiler.nodes.calc.FloatConvertNode; +import jdk.graal.compiler.nodes.calc.IntegerDivRemNode; +import jdk.graal.compiler.nodes.calc.LeftShiftNode; +import jdk.graal.compiler.nodes.calc.RemNode; +import jdk.graal.compiler.nodes.calc.SignExtendNode; +import jdk.graal.compiler.nodes.java.ArrayLengthNode; +import jdk.graal.compiler.nodes.java.InstanceOfNode; +import jdk.graal.compiler.nodes.java.LoadFieldNode; +import jdk.graal.compiler.nodes.java.LoadIndexedNode; +import jdk.graal.compiler.nodes.java.MethodCallTargetNode; +import jdk.graal.compiler.nodes.java.StoreFieldNode; +import jdk.graal.compiler.nodes.java.StoreIndexedNode; +import jdk.graal.compiler.nodes.memory.AbstractWriteNode; +import jdk.graal.compiler.nodes.memory.ExtendableMemoryAccess; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.WriteNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.nodes.spi.LoweringTool; +import jdk.graal.compiler.nodes.spi.PlatformConfigurationProvider; +import jdk.graal.compiler.nodes.type.StampTool; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.replacements.DefaultJavaLoweringProvider; +import jdk.graal.compiler.replacements.SnippetCounter; +import jdk.vm.ci.code.CodeUtil; import org.graalvm.word.LocationIdentity; import jdk.vm.ci.hotspot.HotSpotCallingConventionType; @@ -107,6 +111,7 @@ import uk.ac.manchester.tornado.drivers.spirv.graal.nodes.LocalThreadSizeNode; import uk.ac.manchester.tornado.drivers.spirv.graal.snippets.ReduceGPUSnippets; import uk.ac.manchester.tornado.runtime.TornadoVMConfigAccess; +import uk.ac.manchester.tornado.runtime.common.TornadoOptions; import uk.ac.manchester.tornado.runtime.graal.nodes.GetGroupIdFixedWithNextNode; import uk.ac.manchester.tornado.runtime.graal.nodes.GlobalGroupSizeFixedWithNextNode; import uk.ac.manchester.tornado.runtime.graal.nodes.LocalGroupSizeFixedWithNextNode; @@ -273,14 +278,14 @@ private void lowerReduceSnippets(Node node, LoweringTool tool) { private void lowerLocalNewArray(StructuredGraph graph, int length, NewArrayNonVirtualizableNode newArray) { LocalArrayNode localArrayNode; ConstantNode newLengthNode = ConstantNode.forInt(length, graph); - localArrayNode = graph.addWithoutUnique(new LocalArrayNode(SPIRVArchitecture.localSpace, newArray.elementType(), newLengthNode)); + localArrayNode = graph.addWithoutUnique(new LocalArrayNode(uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVArchitecture.localSpace, newArray.elementType(), newLengthNode)); newArray.replaceAtUsages(localArrayNode); } private void lowerPrivateNewArray(StructuredGraph graph, int size, NewArrayNonVirtualizableNode newArray) { FixedArrayNode fixedArrayNode; final ConstantNode newLengthNode = ConstantNode.forInt(size, graph); - fixedArrayNode = graph.addWithoutUnique(new FixedArrayNode(SPIRVArchitecture.privateSpace, newArray.elementType(), newLengthNode)); + fixedArrayNode = graph.addWithoutUnique(new FixedArrayNode(uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVArchitecture.privateSpace, newArray.elementType(), newLengthNode)); newArray.replaceAtUsages(fixedArrayNode); } @@ -359,7 +364,7 @@ private void lowerInvoke(Invoke invoke, LoweringTool tool, StructuredGraph graph ResolvedJavaType type = os.javaType(tool.getMetaAccess()); SPIRVKind kind = SPIRVKind.fromResolvedJavaTypeToVectorKind(type); if (kind != SPIRVKind.ILLEGAL) { - returnStampPair = StampPair.createSingle(SPIRVStampFactory.getStampFor(kind)); + returnStampPair = StampPair.createSingle(uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVStampFactory.getStampFor(kind)); } } @@ -481,7 +486,7 @@ private AddressNode createArrayAccess(StructuredGraph graph, LoadIndexedNode loa if (isLocalIDNode(loadIndexed) || isPrivateIDNode(loadIndexed)) { address = createArrayLocalAddress(graph, loadIndexed.array(), loadIndexed.index()); } else { - address = createArrayAddress(graph, loadIndexed.array(), elementKind, loadIndexed.index()); + address = createArrayAddressTornado(graph, loadIndexed.array(), elementKind, loadIndexed.index()); } return address; } @@ -493,7 +498,7 @@ public void lowerLoadIndexedNode(LoadIndexedNode loadIndexed, LoweringTool tool) AddressNode address; Stamp loadStamp = loadIndexed.stamp(NodeView.DEFAULT); - if (!(loadIndexed.stamp(NodeView.DEFAULT) instanceof SPIRVStamp)) { + if (!(loadIndexed.stamp(NodeView.DEFAULT) instanceof uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVStamp)) { loadStamp = loadStamp(loadIndexed.stamp(NodeView.DEFAULT), elementKind, false); } address = createArrayAccess(graph, loadIndexed, elementKind); @@ -532,7 +537,7 @@ private AbstractWriteNode createMemWriteNode(JavaKind elementKind, ValueNode val } ValueNode storeConvertValue = value; Stamp valueStamp = value.stamp(NodeView.DEFAULT); - if (!(valueStamp instanceof SPIRVStamp) || !((SPIRVStamp) valueStamp).getSPIRVKind().isVector()) { + if (!(valueStamp instanceof uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVStamp) || !((uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVStamp) valueStamp).getSPIRVKind().isVector()) { storeConvertValue = implicitStoreConvert(graph, elementKind, value); } memoryWrite = graph.add(new WriteNode(address, NamedLocationIdentity.getArrayLocation(elementKind), storeConvertValue, BarrierType.NONE, TornadoMemoryOrder.GPU_MEMORY_MODE)); @@ -546,12 +551,27 @@ public void lowerStoreIndexedNode(StoreIndexedNode storeIndexed, LoweringTool to ValueNode valueToStore = storeIndexed.value(); ValueNode array = storeIndexed.array(); ValueNode index = storeIndexed.index(); - AddressNode address = createArrayAddress(graph, array, elementKind, index); + AddressNode address = createArrayAddressTornado(graph, array, elementKind, index); AbstractWriteNode memoryWrite = createMemWriteNode(elementKind, valueToStore, array, address, graph, storeIndexed); memoryWrite.setStateAfter(storeIndexed.stateAfter()); graph.replaceFixedWithFixed(storeIndexed, memoryWrite); } + public AddressNode createArrayAddressTornado(StructuredGraph graph, ValueNode array, JavaKind elementKind, ValueNode index) { + int arrayBaseOffset = (int) TornadoOptions.PANAMA_OBJECT_HEADER_SIZE; + ValueNode wordIndex; + if (target.wordSize > 4) { + wordIndex = graph.unique(new SignExtendNode(index, target.wordSize * 8)); + } else { + assert target.wordSize == 4 : "unsupported word size"; + wordIndex = index; + } + int shift = CodeUtil.log2(metaAccess.getArrayIndexScale(elementKind)); + ValueNode scaledIndex = graph.unique(new LeftShiftNode(wordIndex, ConstantNode.forInt(shift, graph))); + ValueNode offset = graph.unique(new AddNode(scaledIndex, ConstantNode.forIntegerKind(target.wordJavaKind, arrayBaseOffset, graph))); + return graph.unique(new OffsetAddressNode(array, offset)); + } + @Override protected void lowerLoadFieldNode(LoadFieldNode loadField, LoweringTool tool) { assert loadField.getStackKind() != JavaKind.Illegal; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVProviders.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVProviders.java index 3de1c3fc7c..db4ea24081 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVProviders.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVProviders.java @@ -24,17 +24,18 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal; -import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; -import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; -import org.graalvm.compiler.core.common.spi.ForeignCallsProvider; -import org.graalvm.compiler.core.common.spi.MetaAccessExtensionProvider; -import org.graalvm.compiler.nodes.spi.LoopsDataProvider; -import org.graalvm.compiler.nodes.spi.LoweringProvider; -import org.graalvm.compiler.nodes.spi.PlatformConfigurationProvider; -import org.graalvm.compiler.nodes.spi.Replacements; -import org.graalvm.compiler.nodes.spi.StampProvider; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.word.WordTypes; +import jdk.graal.compiler.api.replacements.SnippetReflectionProvider; +import jdk.graal.compiler.core.common.spi.ConstantFieldProvider; +import jdk.graal.compiler.core.common.spi.ForeignCallsProvider; +import jdk.graal.compiler.core.common.spi.MetaAccessExtensionProvider; +import jdk.graal.compiler.hotspot.meta.HotSpotIdentityHashCodeProvider; +import jdk.graal.compiler.nodes.spi.LoopsDataProvider; +import jdk.graal.compiler.nodes.spi.LoweringProvider; +import jdk.graal.compiler.nodes.spi.PlatformConfigurationProvider; +import jdk.graal.compiler.nodes.spi.Replacements; +import jdk.graal.compiler.nodes.spi.StampProvider; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.word.WordTypes; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.meta.ConstantReflectionProvider; @@ -57,9 +58,10 @@ public SPIRVProviders(MetaAccessProvider metaAccess, // SnippetReflectionProvider snippetReflection, // WordTypes wordTypes, // LoopsDataProvider loopsDataProvider, // - SPIRVSuitesProvider suitesProvider) { + SPIRVSuitesProvider suitesProvider, + HotSpotIdentityHashCodeProvider hotSpotIdentityHashCodeProvider) { super(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, stampProvider, platformConfigurationProvider, metaAccessExtensionProvider, - snippetReflection, wordTypes, loopsDataProvider); + snippetReflection, wordTypes, loopsDataProvider, hotSpotIdentityHashCodeProvider); this.suites = suitesProvider; } diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVStamp.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVStamp.java index 62afe97ded..0de25ce19c 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVStamp.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVStamp.java @@ -27,10 +27,10 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.spi.LIRKindTool; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.spi.LIRKindTool; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; @@ -132,8 +132,13 @@ public boolean isCompatible(Constant constant) { @Override public boolean isCompatible(Stamp stamp) { - if (stamp instanceof SPIRVStamp && ((SPIRVStamp) stamp).spirvKind == spirvKind) { + if (stamp instanceof SPIRVStamp) { return true; + } else if (stamp instanceof ObjectStamp) { + SPIRVKind stampKind = SPIRVKind.fromJavaKind(((ObjectStamp) stamp).type()); + if (stampKind == spirvKind) { + return true; + } } unimplemented("stamp is compat: %s + %s", this, stamp); return false; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVSuitesProvider.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVSuitesProvider.java index 7cfb9bbd2c..e84b6b5d52 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVSuitesProvider.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/SPIRVSuitesProvider.java @@ -23,12 +23,12 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal; -import org.graalvm.compiler.java.GraphBuilderPhase; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase; -import org.graalvm.compiler.phases.tiers.HighTierContext; +import jdk.graal.compiler.java.GraphBuilderPhase; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase; +import jdk.graal.compiler.phases.tiers.HighTierContext; import jdk.vm.ci.meta.MetaAccessProvider; import uk.ac.manchester.tornado.drivers.spirv.SPIRVDeviceContext; @@ -36,6 +36,7 @@ import uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilerConfiguration; import uk.ac.manchester.tornado.runtime.graal.TornadoLIRSuites; import uk.ac.manchester.tornado.runtime.graal.TornadoSuites; +import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoInternalGraphBuilder; import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoSketchTier; import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoSuitesProvider; @@ -63,7 +64,7 @@ private PhaseSuite createGraphBuilderSuite(GraphBuilderConfigur PhaseSuite suite = new PhaseSuite<>(); GraphBuilderConfiguration config = GraphBuilderConfiguration.getSnippetDefault(plugins); config.withEagerResolving(true); - suite.appendPhase(new GraphBuilderPhase(config)); + suite.appendPhase(new TornadoInternalGraphBuilder(config)); return suite; } diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/asm/SPIRVAssembler.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/asm/SPIRVAssembler.java index 8398193dde..40e6a664ec 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/asm/SPIRVAssembler.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/asm/SPIRVAssembler.java @@ -33,12 +33,12 @@ import java.util.Map; import java.util.Stack; -import org.graalvm.compiler.asm.AbstractAddress; -import org.graalvm.compiler.asm.Assembler; -import org.graalvm.compiler.asm.Label; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.asm.AbstractAddress; +import jdk.graal.compiler.asm.Assembler; +import jdk.graal.compiler.asm.Label; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.TargetDescription; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVBarrierSetLIRGenerator.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVBarrierSetLIRGenerator.java deleted file mode 100644 index a8bf47eb11..0000000000 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVBarrierSetLIRGenerator.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This file is part of Tornado: A heterogeneous programming framework: - * https://github.com/beehive-lab/tornadovm - * - * Copyright (c) 2021-2022, APT Group, Department of Computer Science, - * School of Engineering, The University of Manchester. All rights reserved. - * Copyright (c) 2009-2021, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ -package uk.ac.manchester.tornado.drivers.spirv.graal.compiler; - -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryOrderMode; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.BarrierSetLIRGenerator; - -import jdk.vm.ci.meta.Value; - -public class SPIRVBarrierSetLIRGenerator extends BarrierSetLIRGenerator { - @Override - public Variable emitBarrieredLoad(LIRKind kind, Value address, LIRFrameState state, MemoryOrderMode memoryOrder, BarrierType barrierType) { - return null; - } -} diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVBlockVisitor.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVBlockVisitor.java index dc4b71a633..bb48ae4cb8 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVBlockVisitor.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVBlockVisitor.java @@ -24,8 +24,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler; -import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.cfg.ControlFlowGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; import uk.ac.manchester.tornado.drivers.common.logging.Logger; import uk.ac.manchester.tornado.drivers.spirv.graal.asm.SPIRVAssembler; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCanonicalizer.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCanonicalizer.java index 43756d2cb1..0cb559aadb 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCanonicalizer.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCanonicalizer.java @@ -24,9 +24,9 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.spi.SimplifierTool; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.spi.SimplifierTool; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaMethod; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompilationResult.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompilationResult.java index fa2317bea5..554feb7728 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompilationResult.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompilationResult.java @@ -28,7 +28,7 @@ import java.util.Arrays; import java.util.Set; -import org.graalvm.compiler.code.CompilationResult; +import jdk.graal.compiler.code.CompilationResult; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.drivers.spirv.graal.asm.SPIRVAssembler; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompilationResultBuilder.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompilationResultBuilder.java index d303769038..9ffbf9913c 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompilationResultBuilder.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompilationResultBuilder.java @@ -33,31 +33,32 @@ import org.graalvm.collections.EconomicMap; import org.graalvm.collections.Equivalence; -import org.graalvm.compiler.asm.Assembler; -import org.graalvm.compiler.code.CompilationResult; -import org.graalvm.compiler.core.common.spi.CodeGenProviders; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; -import org.graalvm.compiler.lir.asm.DataBuilder; -import org.graalvm.compiler.lir.asm.FrameContext; -import org.graalvm.compiler.lir.framemap.FrameMap; -import org.graalvm.compiler.nodes.AbstractBeginNode; -import org.graalvm.compiler.nodes.AbstractEndNode; -import org.graalvm.compiler.nodes.ControlSplitNode; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.LoopEndNode; -import org.graalvm.compiler.nodes.LoopExitNode; -import org.graalvm.compiler.nodes.MergeNode; -import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.options.OptionValues; +import jdk.graal.compiler.asm.Assembler; +import jdk.graal.compiler.code.CompilationResult; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.asm.DataBuilder; +import jdk.graal.compiler.lir.asm.FrameContext; +import jdk.graal.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.nodes.AbstractBeginNode; +import jdk.graal.compiler.nodes.AbstractEndNode; +import jdk.graal.compiler.nodes.ControlSplitNode; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.LoopEndNode; +import jdk.graal.compiler.nodes.LoopExitNode; +import jdk.graal.compiler.nodes.MergeNode; +import jdk.graal.compiler.nodes.cfg.ControlFlowGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.spi.CoreProviders; +import jdk.graal.compiler.options.OptionValues; import jdk.vm.ci.code.Register; import jdk.vm.ci.meta.ResolvedJavaMethod; + import uk.ac.manchester.tornado.api.exceptions.TornadoInternalError; import uk.ac.manchester.tornado.drivers.common.logging.Logger; import uk.ac.manchester.tornado.drivers.opencl.graal.compiler.OCLBlockVisitor; @@ -75,10 +76,9 @@ public class SPIRVCompilationResultBuilder extends CompilationResultBuilder { private boolean isParallel; private SPIRVDeviceContext deviceContext; - public SPIRVCompilationResultBuilder(CodeGenProviders providers, FrameMap frameMap, Assembler asm, DataBuilder dataBuilder, FrameContext frameContext, OptionValues options, DebugContext debug, + public SPIRVCompilationResultBuilder(CoreProviders providers, FrameMap frameMap, Assembler asm, DataBuilder dataBuilder, FrameContext frameContext, OptionValues options, DebugContext debug, CompilationResult compilationResult, LIR lir) { - super(providers, frameMap, asm, dataBuilder, frameContext, options, debug, compilationResult, Register.None, EconomicMap.create(Equivalence.DEFAULT), NO_VERIFIERS, lir); - + super(providers, frameMap, asm, dataBuilder, frameContext, options, debug, compilationResult, Register.None, NO_VERIFIERS, lir); nonInlinedMethods = new HashSet<>(); } @@ -148,7 +148,7 @@ public void emit(LIR lir) { final ControlFlowGraph cfg = (ControlFlowGraph) lir.getControlFlowGraph(); Logger.traceCodeGen(Logger.BACKEND.SPIRV, "Traversing CFG: ", cfg.graph.name); cfg.computePostdominators(); - traverseControlFlowGraph(cfg, new SPIRVBlockVisitor(this)); + traverseControlFlowGraph(cfg, new uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVBlockVisitor(this)); Logger.traceCodeGen(Logger.BACKEND.SPIRV, "Finished traversing CFG"); this.lir = null; @@ -156,14 +156,14 @@ public void emit(LIR lir) { } - private void traverseControlFlowGraph(ControlFlowGraph cfg, SPIRVBlockVisitor visitor) { + private void traverseControlFlowGraph(ControlFlowGraph cfg, uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVBlockVisitor visitor) { traverseControlFlowGraph(cfg.getStartBlock(), visitor, new HashSet<>(), new HashMap<>()); if (rescheduledBasicBlocks != null) { rescheduledBasicBlocks.clear(); } } - private void rescheduleBasicBlock(HIRBlock basicBlock, SPIRVBlockVisitor visitor, HashSet visited, HashMap pending) { + private void rescheduleBasicBlock(HIRBlock basicBlock, uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVBlockVisitor visitor, HashSet visited, HashMap pending) { HIRBlock block = pending.get(basicBlock); visitor.enter(block); visitor.exit(block); @@ -217,7 +217,7 @@ private boolean isTrueBranchWithEndNodeOrNotControlSplit(HIRBlock blockTrueBranc * @param pending * {@link HashMap} */ - private void rescheduleTrueBranchConditionsIfNeeded(HIRBlock basicBlock, SPIRVBlockVisitor visitor, HashSet visited, HashMap pending) { + private void rescheduleTrueBranchConditionsIfNeeded(HIRBlock basicBlock, uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVBlockVisitor visitor, HashSet visited, HashMap pending) { if (!basicBlock.isLoopHeader() && basicBlock.getDominator() != null && basicBlock.getDominator().getEndNode() instanceof IfNode) { IfNode ifNode = (IfNode) basicBlock.getDominator().getEndNode(); HIRBlock blockTrueBranch = getBlockTrueBranch(basicBlock); @@ -236,7 +236,7 @@ && isTrueBranchWithEndNodeOrNotControlSplit(blockTrueBranch))) { } } - private void traverseControlFlowGraph(HIRBlock basicBlock, SPIRVBlockVisitor visitor, HashSet visited, HashMap pending) { + private void traverseControlFlowGraph(HIRBlock basicBlock, uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVBlockVisitor visitor, HashSet visited, HashMap pending) { if (pending.containsKey(basicBlock) && !visited.contains(pending.get(basicBlock))) { rescheduleBasicBlock(basicBlock, visitor, visited, pending); @@ -356,6 +356,7 @@ public void addNonInlinedMethod(ResolvedJavaMethod targetMethod) { nonInlinedMethods.add(targetMethod); } + public TaskDataContext getTaskMetaData() { return ((SPIRVCompilationResult) compilationResult).getMeta(); } diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompiler.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompiler.java index 488890bc28..421790916b 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompiler.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompiler.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler; -import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; +import static jdk.graal.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.guarantee; import static uk.ac.manchester.tornado.runtime.TornadoCoreRuntime.getDebugContext; import static uk.ac.manchester.tornado.runtime.common.TornadoOptions.DUMP_COMPILED_METHODS; @@ -44,30 +44,30 @@ import java.util.List; import java.util.Set; -import org.graalvm.compiler.code.CompilationResult; -import org.graalvm.compiler.core.common.alloc.LinearScanOrder; -import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; -import org.graalvm.compiler.core.common.cfg.BasicBlock; -import org.graalvm.compiler.debug.DebugCloseable; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.debug.DebugDumpScope; -import org.graalvm.compiler.debug.TimerKey; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory; -import org.graalvm.compiler.lir.framemap.FrameMap; -import org.graalvm.compiler.lir.framemap.FrameMapBuilder; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.lir.phases.AllocationPhase; -import org.graalvm.compiler.lir.phases.PreAllocationOptimizationPhase; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.OptimisticOptimizations; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; -import org.graalvm.compiler.phases.tiers.HighTierContext; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.code.CompilationResult; +import jdk.graal.compiler.core.common.alloc.LinearScanOrder; +import jdk.graal.compiler.core.common.alloc.RegisterAllocationConfig; +import jdk.graal.compiler.core.common.cfg.BasicBlock; +import jdk.graal.compiler.debug.DebugCloseable; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.debug.DebugDumpScope; +import jdk.graal.compiler.debug.TimerKey; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.asm.CompilationResultBuilderFactory; +import jdk.graal.compiler.lir.framemap.FrameMap; +import jdk.graal.compiler.lir.framemap.FrameMapBuilder; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.lir.phases.AllocationPhase; +import jdk.graal.compiler.lir.phases.PreAllocationOptimizationPhase; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.OptimisticOptimizations; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.phases.tiers.HighTierContext; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.code.RegisterConfig; import jdk.vm.ci.code.TargetDescription; @@ -110,9 +110,9 @@ public class SPIRVCompiler { private static final TimerKey EmitLIR = DebugContext.timer("SPIRVEmitLIR"); private static final TimerKey EmitCode = DebugContext.timer("SPIRVEmitCode"); - private static final SPIRVIRGenerationPhase LIR_GENERATION_PHASE = new SPIRVIRGenerationPhase(); + private static final uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVIRGenerationPhase LIR_GENERATION_PHASE = new uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVIRGenerationPhase(); - private synchronized static SPIRVCompilationResult compile(SPIRVCompilationRequest r) { + private synchronized static uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResult compile(SPIRVCompilationRequest r) { assert !r.graph.isFrozen(); try (DebugContext.Scope s0 = getDebugContext().scope("GraalCompiler", r.graph, r.providers.getCodeCache()); DebugCloseable a = CompilerTimer.start(getDebugContext())) { emitFrontEnd(r.providers, r.backend, r.installedCodeOwner, r.args, r.meta, r.graph, r.graphBuilderSuite, r.optimisticOpts, r.profilingInfo, r.suites, r.isKernel, r.buildGraph, @@ -143,7 +143,7 @@ private static void emitFrontEnd(Providers providers, SPIRVBackend backend, Reso /* * Register metadata with all tornado phases */ - ((SPIRVCanonicalizer) suites.getHighTier().getCustomCanonicalizer()).setContext(providers.getMetaAccess(), installedCodeOwner, args, meta); + ((uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCanonicalizer) suites.getHighTier().getCustomCanonicalizer()).setContext(providers.getMetaAccess(), installedCodeOwner, args, meta); final TornadoHighTierContext highTierContext = new TornadoHighTierContext(providers, graphBuilderSuite, optimisticOpts, installedCodeOwner, args, meta, isKernel, batchCompilationConfig); if (buildGraph) { @@ -172,7 +172,7 @@ private static void emitFrontEnd(Providers providers, SPIRVBackend backend, Reso } } - private static void emitBackEnd(StructuredGraph graph, Object stub, ResolvedJavaMethod installedCodeOwner, SPIRVBackend backend, SPIRVCompilationResult compilationResult, + private static void emitBackEnd(StructuredGraph graph, Object stub, ResolvedJavaMethod installedCodeOwner, SPIRVBackend backend, uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResult compilationResult, RegisterConfig registerConfig, TornadoLIRSuites lirSuites, boolean isKernel, boolean isParallel, TornadoProfiler profiler) { try (DebugContext.Scope s = getDebugContext().scope("SPIRVBackend", graph.getLastSchedule()); DebugCloseable a = BackEnd.start(getDebugContext())) { LIRGenerationResult lirGen = null; @@ -190,7 +190,7 @@ private static void emitBackEnd(StructuredGraph graph, Object stub, ResolvedJava } private static LIRGenerationResult emitLIR(SPIRVBackend backend, StructuredGraph graph, Object stub, RegisterConfig registerConfig, TornadoLIRSuites lirSuites, - SPIRVCompilationResult compilationResult, boolean isKernel) { + uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResult compilationResult, boolean isKernel) { try { return emitLIR0(backend, graph, stub, registerConfig, lirSuites, compilationResult, isKernel); } catch (Throwable e) { @@ -216,15 +216,15 @@ private static LIRGenerationResult emitLIR0(SPIRVB } catch (Throwable e) { throw getDebugContext().handle(e); } - RegisterAllocationConfig registerAllocationConfig = backend.newRegisterAllocationConfig(registerConfig, new String[] {}); + RegisterAllocationConfig registerAllocationConfig = backend.newRegisterAllocationConfig(registerConfig, new String[] {}, new Object()); FrameMapBuilder frameMapBuilder = backend.newFrameMapBuilder(registerConfig); - SPIRVLIRGenerationResult lirGenRes = (SPIRVLIRGenerationResult) backend.newLIRGenerationResult(graph.compilationId(), lir, frameMapBuilder, registerAllocationConfig); + uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVLIRGenerationResult lirGenRes = (uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVLIRGenerationResult) backend.newLIRGenerationResult(graph.compilationId(), lir, frameMapBuilder, registerAllocationConfig); lirGenRes.setMethodIndex(backend.getMethodIndex()); LIRGeneratorTool lirGen = backend.newLIRGenerator(lirGenRes); NodeLIRBuilderTool nodeLirGen = backend.newNodeLIRBuilder(graph, lirGen); // LIR generation - SPIRVIRGenerationPhase.LIRGenerationContext context = new SPIRVIRGenerationPhase.LIRGenerationContext(lirGen, nodeLirGen, graph, schedule, isKernel); + uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVIRGenerationPhase.LIRGenerationContext context = new uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVIRGenerationPhase.LIRGenerationContext(lirGen, nodeLirGen, graph, schedule, isKernel); LIR_GENERATION_PHASE.apply(backend.getTarget(), lirGenRes, context); try (DebugContext.Scope s = getDebugContext().scope("LIRStages", nodeLirGen, lir)) { @@ -250,10 +250,10 @@ private static LIRGenerationResult emitLowLevel(TargetDescription target, LIRGen } private static void emitCode(SPIRVBackend backend, Assumptions assumptions, ResolvedJavaMethod rootMethod, List methods, int bytecodeSize, LIRGenerationResult lirGen, - SPIRVCompilationResult compilationResult, ResolvedJavaMethod installedCodeOwner, boolean isKernel, boolean isParallel, TornadoProfiler profiler) { + uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResult compilationResult, ResolvedJavaMethod installedCodeOwner, boolean isKernel, boolean isParallel, TornadoProfiler profiler) { try (DebugCloseable a = EmitCode.start(getDebugContext())) { FrameMap frameMap = lirGen.getFrameMap(); - final SPIRVCompilationResultBuilder crb = backend.newCompilationResultBuilder(frameMap, compilationResult, isKernel, isParallel, lirGen.getLIR()); + final uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResultBuilder crb = backend.newCompilationResultBuilder(frameMap, compilationResult, isKernel, isParallel, lirGen.getLIR()); backend.emitCode(crb, lirGen.getLIR(), installedCodeOwner, profiler); if (assumptions != null && !assumptions.isEmpty()) { @@ -311,7 +311,7 @@ public static String buildKernelName(String methodName) { return sb.toString(); } - public static SPIRVCompilationResult compileSketchForDevice(Sketch sketch, CompilableTask task, SPIRVProviders providers, SPIRVBackend backend, TornadoProfiler profiler) { + public static uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResult compileSketchForDevice(Sketch sketch, CompilableTask task, SPIRVProviders providers, SPIRVBackend backend, TornadoProfiler profiler) { final StructuredGraph kernelGraph = (StructuredGraph) sketch.getGraph().copy(getDebugContext()); ResolvedJavaMethod resolvedJavaMethod = kernelGraph.method(); @@ -327,7 +327,7 @@ public static SPIRVCompilationResult compileSketchForDevice(Sketch sketch, Compi OptimisticOptimizations optimisticOptimizations = OptimisticOptimizations.ALL; ProfilingInfo profilingInfo = resolvedJavaMethod.getProfilingInfo(); - SPIRVCompilationResult kernelCompilationResult = new SPIRVCompilationResult(task.getId(), buildKernelName(resolvedJavaMethod.getName()), taskMeta); + uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResult kernelCompilationResult = new uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResult(task.getId(), buildKernelName(resolvedJavaMethod.getName()), taskMeta); CompilationResultBuilderFactory factory = CompilationResultBuilderFactory.Default; Set methods = new HashSet<>(); @@ -369,7 +369,7 @@ public static SPIRVCompilationResult compileSketchForDevice(Sketch sketch, Compi Sketch currentSketch = TornadoSketcher.lookup(currentMethod, task.meta().getBackendIndex(), taskMeta.getDeviceIndex()); final StructuredGraph graph = (StructuredGraph) currentSketch.getGraph().copy(getDebugContext()); - final SPIRVCompilationResult compilationResult = new SPIRVCompilationResult(task.getId(), currentMethod.getName(), taskMeta); + final uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResult compilationResult = new uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResult(task.getId(), currentMethod.getName(), taskMeta); // Share assembler across compilation results compilationResult.setAssembler(kernelCompilationRequest.compilationResult.getAssembler()); @@ -468,7 +468,7 @@ public static class SPIRVCompilationRequest { public final ProfilingInfo profilingInfo; public final TornadoSuites suites; public final TornadoLIRSuites lirSuites; - public final SPIRVCompilationResult compilationResult; + public final uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResult compilationResult; public final CompilationResultBuilderFactory factory; public final boolean isKernel; public final boolean buildGraph; @@ -477,7 +477,7 @@ public static class SPIRVCompilationRequest { public SPIRVCompilationRequest(StructuredGraph graph, ResolvedJavaMethod installedCodeOwner, Object[] args, TaskDataContext meta, Providers providers, SPIRVBackend backend, PhaseSuite graphBuilderSuite, OptimisticOptimizations optimisticOpts, ProfilingInfo profilingInfo, TornadoSuites suites, TornadoLIRSuites lirSuites, - SPIRVCompilationResult compilationResult, CompilationResultBuilderFactory factory, boolean isKernel, boolean buildGraph, BatchCompilationConfig batchCompilationConfig, + uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResult compilationResult, CompilationResultBuilderFactory factory, boolean isKernel, boolean buildGraph, BatchCompilationConfig batchCompilationConfig, TornadoProfiler profiler) { this.graph = graph; this.installedCodeOwner = installedCodeOwner; @@ -498,7 +498,7 @@ public SPIRVCompilationRequest(StructuredGraph graph, ResolvedJavaMethod install this.profiler = profiler; } - public SPIRVCompilationResult execute() { + public uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVCompilationResult execute() { return SPIRVCompiler.compile(this); } } diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompilerConfiguration.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompilerConfiguration.java index 165fb09ab1..df2f56ae64 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompilerConfiguration.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVCompilerConfiguration.java @@ -23,14 +23,14 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler; -import org.graalvm.compiler.lir.phases.LIRPhaseSuite; -import org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase; -import org.graalvm.compiler.lir.phases.PostAllocationOptimizationStage; -import org.graalvm.compiler.lir.phases.PreAllocationOptimizationPhase; -import org.graalvm.compiler.lir.phases.PreAllocationOptimizationStage; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.lir.phases.LIRPhaseSuite; +import jdk.graal.compiler.lir.phases.PostAllocationOptimizationPhase; +import jdk.graal.compiler.lir.phases.PostAllocationOptimizationStage; +import jdk.graal.compiler.lir.phases.PreAllocationOptimizationPhase; +import jdk.graal.compiler.lir.phases.PreAllocationOptimizationStage; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; import jdk.vm.ci.meta.MetaAccessProvider; import uk.ac.manchester.tornado.api.TornadoDeviceContext; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVDataBuilder.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVDataBuilder.java index 9e7a4ab430..bb6024d773 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVDataBuilder.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVDataBuilder.java @@ -24,8 +24,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler; -import org.graalvm.compiler.code.DataSection; -import org.graalvm.compiler.lir.asm.DataBuilder; +import jdk.graal.compiler.code.DataSection; +import jdk.graal.compiler.lir.asm.DataBuilder; import jdk.vm.ci.meta.Constant; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVHighTier.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVHighTier.java index af3edda13d..665510aa6a 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVHighTier.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVHighTier.java @@ -23,26 +23,25 @@ * */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler; - -import static org.graalvm.compiler.core.common.GraalOptions.ConditionalElimination; -import static org.graalvm.compiler.core.common.GraalOptions.OptConvertDeoptsToGuards; -import static org.graalvm.compiler.core.common.GraalOptions.PartialEscapeAnalysis; -import static org.graalvm.compiler.core.phases.HighTier.Options.Inline; -import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; - -import org.graalvm.compiler.loop.phases.ConvertDeoptimizeToGuardPhase; -import org.graalvm.compiler.loop.phases.LoopFullUnrollPhase; -import org.graalvm.compiler.nodes.loop.DefaultLoopPolicies; -import org.graalvm.compiler.nodes.loop.LoopPolicies; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; -import org.graalvm.compiler.phases.common.HighTierLoweringPhase; -import org.graalvm.compiler.phases.common.IterativeConditionalEliminationPhase; -import org.graalvm.compiler.phases.common.inlining.InliningPhase; -import org.graalvm.compiler.phases.schedule.SchedulePhase; -import org.graalvm.compiler.virtual.phases.ea.PartialEscapePhase; - +import static jdk.graal.compiler.core.common.GraalOptions.ConditionalElimination; +import static jdk.graal.compiler.core.common.GraalOptions.OptConvertDeoptsToGuards; +import static jdk.graal.compiler.core.common.GraalOptions.PartialEscapeAnalysis; +import static jdk.graal.compiler.core.phases.HighTier.Options.Inline; +import static jdk.graal.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; + +import jdk.graal.compiler.loop.phases.ConvertDeoptimizeToGuardPhase; +import jdk.graal.compiler.loop.phases.LoopFullUnrollPhase; +import jdk.graal.compiler.nodes.loop.DefaultLoopPolicies; +import jdk.graal.compiler.nodes.loop.LoopPolicies; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.phases.common.HighTierLoweringPhase; +import jdk.graal.compiler.phases.common.IterativeConditionalEliminationPhase; +import jdk.graal.compiler.phases.common.RemoveValueProxyPhase; +import jdk.graal.compiler.phases.common.inlining.InliningPhase; +import jdk.graal.compiler.phases.schedule.SchedulePhase; +import jdk.graal.compiler.virtual.phases.ea.PartialEscapePhase; import jdk.vm.ci.meta.MetaAccessProvider; import uk.ac.manchester.tornado.api.TornadoDeviceContext; import uk.ac.manchester.tornado.drivers.common.compiler.phases.analysis.TornadoShapeAnalysis; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVIRGenerationPhase.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVIRGenerationPhase.java index 7afd656454..63d709dae6 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVIRGenerationPhase.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVIRGenerationPhase.java @@ -26,16 +26,16 @@ import java.util.List; -import org.graalvm.compiler.core.common.cfg.BlockMap; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGenerator; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.lir.phases.LIRPhase; -import org.graalvm.compiler.lir.ssa.SSAUtil; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.cfg.BlockMap; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGenerator; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.lir.phases.LIRPhase; +import jdk.graal.compiler.lir.ssa.SSAUtil; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.code.TargetDescription; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVLIRGenerationResult.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVLIRGenerationResult.java index 4c1fa06e99..2c2191ae01 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVLIRGenerationResult.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVLIRGenerationResult.java @@ -31,12 +31,12 @@ import java.util.Map; import java.util.Set; -import org.graalvm.compiler.core.common.CompilationIdentifier; -import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.framemap.FrameMapBuilder; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.core.common.CompilationIdentifier; +import jdk.graal.compiler.core.common.alloc.RegisterAllocationConfig; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.framemap.FrameMapBuilder; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; import jdk.vm.ci.code.CallingConvention; import uk.ac.manchester.tornado.drivers.spirv.graal.lir.SPIRVKind; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVLIRGenerator.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVLIRGenerator.java index 084f742116..30bbe90cc4 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVLIRGenerator.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVLIRGenerator.java @@ -27,22 +27,23 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.CompressEncoding; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.calc.Condition; -import org.graalvm.compiler.core.common.cfg.BasicBlock; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryOrderMode; -import org.graalvm.compiler.core.common.spi.CodeGenProviders; -import org.graalvm.compiler.core.common.spi.ForeignCallLinkage; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.LabelRef; -import org.graalvm.compiler.lir.SwitchStrategy; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGenerator; +import jdk.graal.compiler.core.common.CompressEncoding; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.calc.Condition; +import jdk.graal.compiler.core.common.cfg.BasicBlock; +import jdk.graal.compiler.core.common.memory.BarrierType; +import jdk.graal.compiler.core.common.memory.MemoryOrderMode; +import jdk.graal.compiler.lir.gen.BarrierSetLIRGeneratorTool; +import jdk.graal.compiler.nodes.spi.CoreProviders; +import jdk.graal.compiler.core.common.spi.ForeignCallLinkage; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.LabelRef; +import jdk.graal.compiler.lir.SwitchStrategy; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGenerator; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; @@ -77,9 +78,8 @@ public class SPIRVLIRGenerator extends LIRGenerator { private SPIRVGenTool spirvGenTool; private SPIRVBuiltinTool spirvBuiltinTool; - public SPIRVLIRGenerator(CodeGenProviders providers, LIRGenerationResult lirGenRes, final int methodIndex) { - super(new SPIRVLIRKindTool((SPIRVTargetDescription) providers.getCodeCache().getTarget()), new SPIRVArithmeticTool(), new SPIRVBarrierSetLIRGenerator(), new SPIRVMoveFactory(), providers, - lirGenRes); + public SPIRVLIRGenerator(CoreProviders providers, LIRGenerationResult lirGenRes, final int methodIndex) { + super(new SPIRVLIRKindTool((SPIRVTargetDescription) providers.getCodeCache().getTarget()), new SPIRVArithmeticTool(), new BarrierSetLIRGeneratorTool() {}, new uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVMoveFactory(), providers, lirGenRes); spirvGenTool = new SPIRVGenTool(this); spirvBuiltinTool = new SPIRVBuiltinTool(); this.methodIndex = methodIndex; @@ -215,6 +215,16 @@ public void emitIntegerTestBranch(Value left, Value right, LabelRef trueDestinat throw new RuntimeException("Not implemented yet"); } + @Override + public void emitOpMaskTestBranch(Value left, boolean negateLeft, Value right, LabelRef trueDestination, LabelRef falseDestination, double trueSuccessorProbability) { + + } + + @Override + public void emitOpMaskOrTestBranch(Value left, Value right, boolean allZeros, LabelRef trueDestination, LabelRef falseDestination, double trueSuccessorProbability) { + + } + @Override public Variable emitConditionalMove(PlatformKind cmpKind, Value leftVal, Value right, Condition cond, boolean unorderedIsTrue, Value trueValue, Value falseValue) { Logger.traceBuildLIR(Logger.BACKEND.SPIRV, "emit TernaryBranch: " + leftVal + " " + cond + right + " ? " + trueValue + " : " + falseValue); @@ -255,6 +265,16 @@ public Variable emitIntegerTestMove(Value leftVal, Value right, Value trueValue, return result; } + @Override + public Variable emitOpMaskTestMove(Value leftVal, boolean negateLeft, Value right, Value trueValue, Value falseValue) { + return null; + } + + @Override + public Variable emitOpMaskOrTestMove(Value leftVal, Value right, boolean allZeros, Value trueValue, Value falseValue) { + return null; + } + @Override public Variable emitReverseBytes(Value operand) { return null; @@ -355,7 +375,7 @@ public Variable newVariable(ValueKind valueKind) { // Format of the variable "_" // variable.setName("spirv_" + spirvKind.getTypePrefix() + "_" + variable.index // + "F" + methodIndex); - SPIRVLIRGenerationResult res = (SPIRVLIRGenerationResult) getResult(); + uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVLIRGenerationResult res = (uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVLIRGenerationResult) getResult(); res.insertVariable(variable); return variable; } diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVLowTier.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVLowTier.java index 77a761c5f1..b2113ced2b 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVLowTier.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVLowTier.java @@ -24,18 +24,19 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler; -import static org.graalvm.compiler.core.common.GraalOptions.ConditionalElimination; -import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Required; - -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; -import org.graalvm.compiler.phases.common.FixReadsPhase; -import org.graalvm.compiler.phases.common.IterativeConditionalEliminationPhase; -import org.graalvm.compiler.phases.common.LowTierLoweringPhase; -import org.graalvm.compiler.phases.common.UseTrappingNullChecksPhase; -import org.graalvm.compiler.phases.schedule.SchedulePhase; +import static jdk.graal.compiler.core.common.GraalOptions.ConditionalElimination; +import static jdk.graal.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Required; + +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.phases.common.FixReadsPhase; +import jdk.graal.compiler.phases.common.RemoveValueProxyPhase; +import jdk.graal.compiler.phases.common.UseTrappingNullChecksPhase; +import jdk.graal.compiler.phases.common.IterativeConditionalEliminationPhase; +import jdk.graal.compiler.phases.common.LowTierLoweringPhase; +import jdk.graal.compiler.phases.schedule.SchedulePhase; import uk.ac.manchester.tornado.api.TornadoDeviceContext; import uk.ac.manchester.tornado.drivers.common.compiler.phases.analysis.TornadoFeatureExtraction; @@ -87,6 +88,7 @@ public SPIRVLowTier(OptionValues options, TornadoDeviceContext deviceContext, Ad appendPhase(new InverseSquareRootPhase()); } + // TODO Atomics Phase for SPIRV (this is the last thing to support) appendPhase(new SchedulePhase(SchedulePhase.SchedulingStrategy.LATEST_OUT_OF_LOOPS)); diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVMidTier.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVMidTier.java index b1e81f4836..506101c3e7 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVMidTier.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVMidTier.java @@ -24,19 +24,19 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler; -import static org.graalvm.compiler.core.common.GraalOptions.ConditionalElimination; -import static org.graalvm.compiler.core.common.GraalOptions.OptFloatingReads; -import static org.graalvm.compiler.core.common.GraalOptions.ReassociateExpressions; - -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.FrameStateAssignmentPhase; -import org.graalvm.compiler.phases.common.GuardLoweringPhase; -import org.graalvm.compiler.phases.common.IterativeConditionalEliminationPhase; -import org.graalvm.compiler.phases.common.MidTierLoweringPhase; -import org.graalvm.compiler.phases.common.ReassociationPhase; -import org.graalvm.compiler.phases.common.RemoveValueProxyPhase; - +import static jdk.graal.compiler.core.common.GraalOptions.ConditionalElimination; +import static jdk.graal.compiler.core.common.GraalOptions.OptFloatingReads; +import static jdk.graal.compiler.core.common.GraalOptions.ReassociateExpressions; + +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.FrameStateAssignmentPhase; +import jdk.graal.compiler.phases.common.GuardLoweringPhase; +import jdk.graal.compiler.phases.common.IterativeConditionalEliminationPhase; +import jdk.graal.compiler.phases.common.MidTierLoweringPhase; +import jdk.graal.compiler.phases.common.ReassociationPhase; + +import jdk.graal.compiler.phases.common.RemoveValueProxyPhase; import uk.ac.manchester.tornado.drivers.common.compiler.phases.loops.TornadoPartialLoopUnroll; import uk.ac.manchester.tornado.drivers.common.compiler.phases.guards.BoundCheckEliminationPhase; import uk.ac.manchester.tornado.drivers.common.compiler.phases.guards.ExceptionCheckingElimination; @@ -75,14 +75,14 @@ public SPIRVMidTier(OptionValues options) { appendPhase(new TornadoFloatingReadReplacement(canonicalizer)); } + appendPhase(new RemoveValueProxyPhase(canonicalizer)); + appendPhase(canonicalizer); if (ConditionalElimination.getValue(options)) { appendPhase(new IterativeConditionalEliminationPhase(canonicalizer, true)); } - appendPhase(new RemoveValueProxyPhase(canonicalizer)); - appendPhase(new GuardLoweringPhase()); appendPhase(canonicalizer); diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVMoveFactory.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVMoveFactory.java index 3ca890cb91..02f6b9de58 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVMoveFactory.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVMoveFactory.java @@ -24,8 +24,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.gen.MoveFactory; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.gen.MoveFactory; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Constant; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVNodeLIRBuilder.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVNodeLIRBuilder.java index 79672923f4..e617a5c778 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVNodeLIRBuilder.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVNodeLIRBuilder.java @@ -35,59 +35,59 @@ import java.util.List; import java.util.Map; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.cfg.BlockMap; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.VoidStamp; -import org.graalvm.compiler.core.gen.NodeLIRBuilder; -import org.graalvm.compiler.core.gen.NodeMatchRules; -import org.graalvm.compiler.core.match.ComplexMatchValue; -import org.graalvm.compiler.debug.TTY; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.LabelRef; -import org.graalvm.compiler.lir.StandardOp.LabelOp; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGenerator; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool.BlockScope; -import org.graalvm.compiler.nodes.AbstractEndNode; -import org.graalvm.compiler.nodes.AbstractMergeNode; -import org.graalvm.compiler.nodes.BeginNode; -import org.graalvm.compiler.nodes.BreakpointNode; -import org.graalvm.compiler.nodes.DirectCallTargetNode; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.IndirectCallTargetNode; -import org.graalvm.compiler.nodes.Invoke; -import org.graalvm.compiler.nodes.LogicNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.LoopEndNode; -import org.graalvm.compiler.nodes.LoopExitNode; -import org.graalvm.compiler.nodes.LoweredCallTargetNode; -import org.graalvm.compiler.nodes.MergeNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.SafepointNode; -import org.graalvm.compiler.nodes.ShortCircuitOrNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.FloatEqualsNode; -import org.graalvm.compiler.nodes.calc.FloatLessThanNode; -import org.graalvm.compiler.nodes.calc.IntegerBelowNode; -import org.graalvm.compiler.nodes.calc.IntegerEqualsNode; -import org.graalvm.compiler.nodes.calc.IntegerLessThanNode; -import org.graalvm.compiler.nodes.calc.IntegerTestNode; -import org.graalvm.compiler.nodes.calc.IsNullNode; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.nodes.extended.IntegerSwitchNode; -import org.graalvm.compiler.nodes.extended.SwitchNode; -import org.graalvm.compiler.options.OptionValues; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.cfg.BlockMap; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.VoidStamp; +import jdk.graal.compiler.core.gen.NodeLIRBuilder; +import jdk.graal.compiler.core.gen.NodeMatchRules; +import jdk.graal.compiler.core.match.ComplexMatchValue; +import jdk.graal.compiler.debug.TTY; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.LabelRef; +import jdk.graal.compiler.lir.StandardOp.LabelOp; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGenerator; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool.BlockScope; +import jdk.graal.compiler.nodes.AbstractEndNode; +import jdk.graal.compiler.nodes.AbstractMergeNode; +import jdk.graal.compiler.nodes.BeginNode; +import jdk.graal.compiler.nodes.BreakpointNode; +import jdk.graal.compiler.nodes.DirectCallTargetNode; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.IndirectCallTargetNode; +import jdk.graal.compiler.nodes.Invoke; +import jdk.graal.compiler.nodes.LogicNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.LoopEndNode; +import jdk.graal.compiler.nodes.LoopExitNode; +import jdk.graal.compiler.nodes.LoweredCallTargetNode; +import jdk.graal.compiler.nodes.MergeNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.SafepointNode; +import jdk.graal.compiler.nodes.ShortCircuitOrNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.FloatEqualsNode; +import jdk.graal.compiler.nodes.calc.FloatLessThanNode; +import jdk.graal.compiler.nodes.calc.IntegerBelowNode; +import jdk.graal.compiler.nodes.calc.IntegerEqualsNode; +import jdk.graal.compiler.nodes.calc.IntegerLessThanNode; +import jdk.graal.compiler.nodes.calc.IntegerTestNode; +import jdk.graal.compiler.nodes.calc.IsNullNode; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.extended.IntegerSwitchNode; +import jdk.graal.compiler.nodes.extended.SwitchNode; +import jdk.graal.compiler.options.OptionValues; import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.meta.AllocatableValue; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVNodeMatchRules.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVNodeMatchRules.java index 9bc2aec057..e04db49394 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVNodeMatchRules.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVNodeMatchRules.java @@ -24,8 +24,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler; -import org.graalvm.compiler.core.gen.NodeMatchRules; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.core.gen.NodeMatchRules; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; public class SPIRVNodeMatchRules extends NodeMatchRules { diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVReferenceMapBuilder.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVReferenceMapBuilder.java index a6ea254e73..efd770e174 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVReferenceMapBuilder.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/SPIRVReferenceMapBuilder.java @@ -24,8 +24,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.framemap.ReferenceMapBuilder; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.framemap.ReferenceMapBuilder; import jdk.vm.ci.code.ReferenceMap; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/lir/SPIRVArithmeticTool.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/lir/SPIRVArithmeticTool.java index 6d269ca1fa..9aaa14e211 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/lir/SPIRVArithmeticTool.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/lir/SPIRVArithmeticTool.java @@ -27,14 +27,14 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.guarantee; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.LIRKind; -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.lir.ConstantValue; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGenerator; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.calc.FloatConvert; +import jdk.graal.compiler.core.common.memory.MemoryExtendKind; +import jdk.graal.compiler.core.common.memory.MemoryOrderMode; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGenerator; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaConstant; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVGraphBuilderPlugins.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVGraphBuilderPlugins.java index 45e5cb33eb..73d699e609 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVGraphBuilderPlugins.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVGraphBuilderPlugins.java @@ -46,28 +46,31 @@ import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; -import org.graalvm.compiler.core.common.memory.BarrierType; -import org.graalvm.compiler.core.common.memory.MemoryOrderMode; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.replacements.InlineDuringParsingPlugin; +import jdk.graal.compiler.core.common.memory.BarrierType; +import jdk.graal.compiler.core.common.memory.MemoryOrderMode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.nodes.calc.SignExtendNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.replacements.InlineDuringParsingPlugin; import org.graalvm.word.LocationIdentity; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.api.KernelContext; import uk.ac.manchester.tornado.api.exceptions.TornadoRuntimeException; +import uk.ac.manchester.tornado.api.types.arrays.TornadoMemorySegment; import uk.ac.manchester.tornado.drivers.common.logging.Logger; import uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVArchitecture; import uk.ac.manchester.tornado.drivers.spirv.graal.lir.SPIRVKind; @@ -84,11 +87,11 @@ public class SPIRVGraphBuilderPlugins { public static void registerParametersPlugins(Plugins plugins) { - SPIRVVectorPlugins.registerParameterPlugins(plugins); + uk.ac.manchester.tornado.drivers.spirv.graal.compiler.plugins.SPIRVVectorPlugins.registerParameterPlugins(plugins); } public static void registerNewInstancePlugins(Plugins plugins) { - plugins.appendNodePlugin(new SPIRVVectorNodePlugin()); + plugins.appendNodePlugin(new uk.ac.manchester.tornado.drivers.spirv.graal.compiler.plugins.SPIRVVectorNodePlugin()); // FIXME: Atomics for SPIRV Backend not implemented. } @@ -105,10 +108,10 @@ public static void registerInvocationPlugins(Plugins plugins, final InvocationPl // Register plugins for the new API registerKernelContextPlugins(invocationPlugins); - SPIRVMathPlugins.registerTornadoMathPlugins(invocationPlugins); - SPIRVVectorPlugins.registerPlugins(plugins, invocationPlugins); + uk.ac.manchester.tornado.drivers.spirv.graal.compiler.plugins.SPIRVMathPlugins.registerTornadoMathPlugins(invocationPlugins); + uk.ac.manchester.tornado.drivers.spirv.graal.compiler.plugins.SPIRVVectorPlugins.registerPlugins(plugins, invocationPlugins); - SPIRVHalfFloatPlugins.registerPlugins(plugins, invocationPlugins); + uk.ac.manchester.tornado.drivers.spirv.graal.compiler.plugins.SPIRVHalfFloatPlugins.registerPlugins(plugins, invocationPlugins); // Register plugins for Off-Heap Arrays with Panama registerMemoryAccessPlugins(invocationPlugins); } @@ -154,6 +157,7 @@ private static void registerLocalBarrier(Registration r) { r.register(new InvocationPlugin("localBarrier", InvocationPlugin.Receiver.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { + receiver.get(true); SPIRVBarrierNode localBarrierNode = new SPIRVBarrierNode(SPIRVBarrierNode.SPIRVMemFenceFlags.LOCAL); b.append(localBarrierNode); return true; @@ -165,6 +169,7 @@ private static void registerGlobalBarrier(Registration r) { r.register(new InvocationPlugin("globalBarrier", InvocationPlugin.Receiver.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { + receiver.get(true); SPIRVBarrierNode barrierNode = new SPIRVBarrierNode(SPIRVBarrierNode.SPIRVMemFenceFlags.GLOBAL); b.append(barrierNode); return true; @@ -185,8 +190,11 @@ private static void registerLocalArray(Registration r, final String method, Java r.register(new InvocationPlugin(method, InvocationPlugin.Receiver.class, int.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode size) { + receiver.get(true); ConstantNode constantNode = new ConstantNode(size.asConstant(), StampFactory.forKind(JavaKind.Int)); + b.getGraph().addOrUnique(constantNode); LocalArrayNode localArrayNode = new LocalArrayNode(SPIRVArchitecture.localSpace, elementType, constantNode); + b.getGraph().addOrUnique(localArrayNode); b.push(returnedJavaKind, localArrayNode); return true; } @@ -367,48 +375,33 @@ private static void registerTornadoVMIntrinsicsPlugins(Plugins plugins) { } } - public static Class getValueLayoutClass(Class k) { - if (k == int.class) { - return ValueLayout.OfInt.class; - } else if (k == double.class) { - return ValueLayout.OfDouble.class; - } else if (k == float.class) { - return ValueLayout.OfFloat.class; - } else if (k == long.class) { - return ValueLayout.OfLong.class; - } else if (k == boolean.class) { - return ValueLayout.OfBoolean.class; - } else if (k == byte.class) { - return ValueLayout.OfByte.class; - } else if (k == char.class) { - return ValueLayout.OfChar.class; - } else if (k == short.class) { - return ValueLayout.OfShort.class; - } else { - throw new TornadoRuntimeException("Class type " + k + " not supported."); - } - } private static void registerMemoryAccessPlugins(InvocationPlugins plugins) { - Registration r = new Registration(plugins, MemorySegment.class); + Registration r = new Registration(plugins, TornadoMemorySegment.class); for (JavaKind kind : JavaKind.values()) { if (kind != JavaKind.Object && kind != JavaKind.Void && kind != JavaKind.Illegal) { - r.register(new InvocationPlugin("getAtIndex", InvocationPlugin.Receiver.class, getValueLayoutClass(kind.toJavaClass()), long.class) { + r.register(new InvocationPlugin("get" + kind.name() + "AtIndex", InvocationPlugin.Receiver.class, int.class, int.class) { @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode layout, ValueNode index) { - MulNode mulNode = b.append(new MulNode(index, ConstantNode.forInt(kind.getByteCount()))); - AddressNode addressNode = b.append(new OffsetAddressNode(receiver.get(), mulNode)); + public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode index, ValueNode baseIndex) { + AddNode absoluteIndexNode = b.append(new AddNode(index, baseIndex)); + SignExtendNode signExtend = new SignExtendNode(absoluteIndexNode.asNode(), 64); + b.getGraph().addOrUnique(signExtend); + MulNode mulNode = b.append(new MulNode(signExtend, ConstantNode.forInt(kind.getByteCount()))); + AddressNode addressNode = b.append(new OffsetAddressNode(receiver.get(true), mulNode)); JavaReadNode readNode = new JavaReadNode(kind, addressNode, LocationIdentity.any(), BarrierType.NONE, MemoryOrderMode.PLAIN, false); b.addPush(kind, readNode); return true; } }); - r.register(new InvocationPlugin("setAtIndex", InvocationPlugin.Receiver.class, getValueLayoutClass(kind.toJavaClass()), long.class, kind.toJavaClass()) { + r.register(new InvocationPlugin("setAtIndex", InvocationPlugin.Receiver.class, int.class, kind.toJavaClass(), int.class) { @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode layout, ValueNode index, ValueNode value) { - MulNode mulNode = b.append(new MulNode(index, ConstantNode.forInt(kind.getByteCount()))); - AddressNode addressNode = b.append(new OffsetAddressNode(receiver.get(), mulNode)); + public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode index, ValueNode value, ValueNode baseIndex) { + AddNode absoluteIndexNode = b.append(new AddNode(index, baseIndex)); + SignExtendNode signExtend = new SignExtendNode(absoluteIndexNode.asNode(), 64); + b.getGraph().addOrUnique(signExtend); + MulNode mulNode = b.append(new MulNode(signExtend, ConstantNode.forInt(kind.getByteCount()))); + AddressNode addressNode = b.append(new OffsetAddressNode(receiver.get(true), mulNode)); JavaWriteNode writeNode = new JavaWriteNode(kind, addressNode, LocationIdentity.any(), value, BarrierType.NONE, false); b.add(writeNode); return true; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVHalfFloatPlugins.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVHalfFloatPlugins.java index 96c59e9d7a..f858ff0463 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVHalfFloatPlugins.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVHalfFloatPlugins.java @@ -24,12 +24,12 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler.plugins; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.graphbuilderconf.NodePlugin; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVMathPlugins.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVMathPlugins.java index 513be74554..4a4ed0786c 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVMathPlugins.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVMathPlugins.java @@ -23,10 +23,10 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler.plugins; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVVectorNodePlugin.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVVectorNodePlugin.java index e28da06269..a067843b9e 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVVectorNodePlugin.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVVectorNodePlugin.java @@ -23,8 +23,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.compiler.plugins; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.NodePlugin; import jdk.vm.ci.hotspot.HotSpotResolvedJavaType; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVVectorPlugins.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVVectorPlugins.java index d1c975f80e..b6173768b9 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVVectorPlugins.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/compiler/plugins/SPIRVVectorPlugins.java @@ -25,22 +25,22 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.guarantee; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.StampPair; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderTool; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; -import org.graalvm.compiler.nodes.graphbuilderconf.NodePlugin; -import org.graalvm.compiler.nodes.java.StoreIndexedNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.StampPair; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderTool; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; +import jdk.graal.compiler.nodes.graphbuilderconf.NodePlugin; +import jdk.graal.compiler.nodes.java.StoreIndexedNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; @@ -221,9 +221,10 @@ private static void registerVectorCollectionsPlugins(final InvocationPlugins plu final Class declaringClass = vectorKind.getJavaClass(); - final Registration r = new Registration(plugins, declaringClass); + final Registration r = new Registration(plugins, declaringClass).setAllowOverwrite(true); r.register(new InvocationPlugin("loadFromArray", Receiver.class, storageType, int.class) { public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode array, ValueNode index) { + receiver.get(true); final ResolvedJavaType resolvedType = b.getMetaAccess().lookupJavaType(vectorClass); SPIRVKind kind = SPIRVKind.fromResolvedJavaTypeToVectorKind(resolvedType); JavaKind elementKind = kind.getElementKind().asJavaKind(); @@ -236,6 +237,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("storeToArray", Receiver.class, vectorClass, storageType, int.class) { public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value, ValueNode array, ValueNode index) { + receiver.get(true); final ResolvedJavaType resolvedType = b.getMetaAccess().lookupJavaType(vectorClass); SPIRVKind kind = SPIRVKind.fromResolvedJavaTypeToVectorKind(resolvedType); JavaKind elementKind = kind.getElementKind().asJavaKind(); @@ -271,7 +273,8 @@ public boolean handleInvoke(GraphBuilderContext b, ResolvedJavaMethod method, Va r.register(new InvocationPlugin("get", Receiver.class, int.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode laneId) { - final VectorLoadElementNode loadElement = new VectorLoadElementNode(spirvVectorKind.getElementKind(), receiver.get(), laneId); + receiver.get(true); + final VectorLoadElementNode loadElement = new VectorLoadElementNode(spirvVectorKind.getElementKind(), receiver.get(true), laneId); b.push(javaElementKind, b.append(loadElement)); return true; } @@ -280,7 +283,8 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("set", Receiver.class, int.class, storageType) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode laneId, ValueNode value) { - final VectorStoreElementProxyNode store = new VectorStoreElementProxyNode(spirvVectorKind.getElementKind(), receiver.get(), laneId, value); + receiver.get(true); + final VectorStoreElementProxyNode store = new VectorStoreElementProxyNode(spirvVectorKind.getElementKind(), receiver.get(true), laneId, value); b.add(b.append(store)); return true; } @@ -289,8 +293,9 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("set", Receiver.class, spirvVectorKind.getJavaClass()) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value) { - if (receiver.get() instanceof ParameterNode) { - final AddressNode address = new OffsetAddressNode(receiver.get(), null); + receiver.get(true); + if (receiver.get(true) instanceof ParameterNode) { + final AddressNode address = new OffsetAddressNode(receiver.get(true), null); final VectorStoreGlobalMemory store = new VectorStoreGlobalMemory(spirvVectorKind, address, value); b.add(b.append(store)); return true; @@ -302,7 +307,8 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("set", Receiver.class, int.class, elementType) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode laneId, ValueNode value) { - final VectorStoreElementProxyNode store = new VectorStoreElementProxyNode(spirvVectorKind.getElementKind(), receiver.get(), laneId, value); + receiver.get(true); + final VectorStoreElementProxyNode store = new VectorStoreElementProxyNode(spirvVectorKind.getElementKind(), receiver.get(true), laneId, value); b.add(b.append(store)); return true; } @@ -351,10 +357,11 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec r.register(new InvocationPlugin("getArray", Receiver.class) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver) { + receiver.get(true); final ResolvedJavaType resolvedType = b.getMetaAccess().lookupJavaType(declaringClass); SPIRVKind kind = SPIRVKind.fromResolvedJavaTypeToVectorKind(resolvedType); JavaKind elementKind = kind.getElementKind().asJavaKind(); - ValueNode array = receiver.get(); + ValueNode array = receiver.get(true); GetArrayNode getArrayNode = new GetArrayNode(kind, array, elementKind); b.push(JavaKind.Object, b.append(getArrayNode)); return true; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVAddressLowering.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVAddressLowering.java index bfec49d241..d2104bb995 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVAddressLowering.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVAddressLowering.java @@ -24,13 +24,13 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.lir; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.FloatingReadNode; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.FloatingReadNode; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase; import uk.ac.manchester.tornado.api.exceptions.TornadoInternalError; import uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVArchitecture; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVAddressNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVAddressNode.java index 7648969662..bd3ae71281 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVAddressNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVAddressNode.java @@ -24,15 +24,15 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.lir; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVArchitecture; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVBinary.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVBinary.java index 59d9fc5364..fecaf67593 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVBinary.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVBinary.java @@ -23,13 +23,13 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.calc.Condition; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.LIRInstruction.Use; -import org.graalvm.compiler.lir.Opcode; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.calc.Condition; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.LIRInstruction.Use; +import jdk.graal.compiler.lir.Opcode; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVBuiltinTool.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVBuiltinTool.java index 1b2ff9402b..eab028c68c 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVBuiltinTool.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVBuiltinTool.java @@ -25,8 +25,8 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVControlFlow.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVControlFlow.java index 25707a8c21..f42be61fe2 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVControlFlow.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVControlFlow.java @@ -23,12 +23,12 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.lir; -import org.graalvm.compiler.core.common.cfg.BasicBlock; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.LIRInstructionClass; -import org.graalvm.compiler.lir.LabelRef; -import org.graalvm.compiler.lir.Opcode; -import org.graalvm.compiler.lir.SwitchStrategy; +import jdk.graal.compiler.core.common.cfg.BasicBlock; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.LIRInstructionClass; +import jdk.graal.compiler.lir.LabelRef; +import jdk.graal.compiler.lir.Opcode; +import jdk.graal.compiler.lir.SwitchStrategy; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Constant; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVDirectCall.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVDirectCall.java index 328f134eff..d4e5226626 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVDirectCall.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVDirectCall.java @@ -23,11 +23,11 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.LIRFrameState; -import org.graalvm.compiler.lir.LIRInstruction.Def; -import org.graalvm.compiler.lir.LIRInstruction.Use; -import org.graalvm.compiler.nodes.DirectCallTargetNode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.LIRFrameState; +import jdk.graal.compiler.lir.LIRInstruction.Def; +import jdk.graal.compiler.lir.LIRInstruction.Use; +import jdk.graal.compiler.nodes.DirectCallTargetNode; import jdk.vm.ci.meta.Value; import uk.ac.manchester.beehivespirvtoolkit.lib.instructions.SPIRVOpFunctionCall; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVGenTool.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVGenTool.java index 2f68d14057..213a814601 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVGenTool.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVGenTool.java @@ -27,10 +27,10 @@ import java.util.HashMap; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVLIROp.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVLIROp.java index 6c6bc6b117..0c2e6a585a 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVLIROp.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVLIROp.java @@ -24,8 +24,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.ConstantValue; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.ConstantValue; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.PlatformKind; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVLIRStmt.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVLIRStmt.java index 4c71fc8609..134aa90341 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVLIRStmt.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVLIRStmt.java @@ -27,12 +27,12 @@ import java.util.List; import java.util.Map; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.LIRInstructionClass; -import org.graalvm.compiler.lir.Opcode; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.LIRInstructionClass; +import jdk.graal.compiler.lir.Opcode; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVNullary.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVNullary.java index cdafeb0d20..454259874b 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVNullary.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVNullary.java @@ -23,8 +23,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.cfg.BasicBlock; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.cfg.BasicBlock; import uk.ac.manchester.beehivespirvtoolkit.lib.SPIRVInstScope; import uk.ac.manchester.beehivespirvtoolkit.lib.instructions.SPIRVOpBranch; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVTernary.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVTernary.java index 46372b638d..68394926ee 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVTernary.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVTernary.java @@ -23,9 +23,9 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.LIRInstruction; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.LIRInstruction; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVUnary.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVUnary.java index ab339dd32d..10f1f29566 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVUnary.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVUnary.java @@ -23,13 +23,13 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.cfg.BasicBlock; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.LIRInstruction.Def; -import org.graalvm.compiler.lir.LIRInstruction.Use; -import org.graalvm.compiler.lir.Opcode; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.cfg.BasicBlock; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.LIRInstruction.Def; +import jdk.graal.compiler.lir.LIRInstruction.Use; +import jdk.graal.compiler.lir.Opcode; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Local; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVVectorAssign.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVVectorAssign.java index c47e98e8c1..8e44f1e939 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVVectorAssign.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVVectorAssign.java @@ -23,8 +23,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.ConstantValue; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.ConstantValue; import jdk.vm.ci.meta.Value; import uk.ac.manchester.beehivespirvtoolkit.lib.instructions.SPIRVOpCompositeInsert; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVVectorElementSelect.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVVectorElementSelect.java index 4d1ebcae4a..656d10e4e1 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVVectorElementSelect.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/lir/SPIRVVectorElementSelect.java @@ -23,10 +23,10 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.lir; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Opcode; -import org.graalvm.compiler.lir.Variable; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Opcode; +import jdk.graal.compiler.lir.Variable; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/meta/SPIRVMemorySpace.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/meta/SPIRVMemorySpace.java index 91e971dcfd..d8f0bca3a7 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/meta/SPIRVMemorySpace.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/meta/SPIRVMemorySpace.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.meta; -import org.graalvm.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.LIRKind; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.opencl.graal.asm.OCLAssemblerConstants; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/CastNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/CastNode.java index 0c19a6b3fa..b377934bb4 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/CastNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/CastNode.java @@ -24,16 +24,16 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.calc.FloatConvert; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.calc.FloatConvert; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.spirv.graal.compiler.SPIRVLIRGenerator; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/FixedArrayNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/FixedArrayNode.java index 1d40ae89e3..1df4f7bf09 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/FixedArrayNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/FixedArrayNode.java @@ -24,17 +24,17 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.core.common.type.TypeReference; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.core.common.type.TypeReference; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.ResolvedJavaType; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/GlobalThreadIdNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/GlobalThreadIdNode.java index c9d4294664..28de0f9cbc 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/GlobalThreadIdNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/GlobalThreadIdNode.java @@ -24,16 +24,16 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/GlobalThreadSizeNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/GlobalThreadSizeNode.java index 257797f154..9fddf1cd1a 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/GlobalThreadSizeNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/GlobalThreadSizeNode.java @@ -24,16 +24,16 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/GroupIdNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/GroupIdNode.java index 8b142070e6..995426d00d 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/GroupIdNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/GroupIdNode.java @@ -24,17 +24,17 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalArrayNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalArrayNode.java index 789f54279a..9a1156e453 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalArrayNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalArrayNode.java @@ -24,17 +24,17 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.core.common.type.TypeReference; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.core.common.type.TypeReference; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalGroupSizeNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalGroupSizeNode.java index bd341dd855..e3812a9ab8 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalGroupSizeNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalGroupSizeNode.java @@ -24,16 +24,16 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalThreadIdFixedNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalThreadIdFixedNode.java index 150c7f5808..4b0e4c1c52 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalThreadIdFixedNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalThreadIdFixedNode.java @@ -24,16 +24,16 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalThreadIdNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalThreadIdNode.java index 6d35294802..b405371f9c 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalThreadIdNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalThreadIdNode.java @@ -24,16 +24,16 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalThreadSizeNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalThreadSizeNode.java index 29e9363a74..ee4dd20439 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalThreadSizeNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalThreadSizeNode.java @@ -24,16 +24,16 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalWorkGroupDimensionsNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalWorkGroupDimensionsNode.java index 207c1a933e..d95700d0aa 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalWorkGroupDimensionsNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/LocalWorkGroupDimensionsNode.java @@ -24,12 +24,12 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/PragmaUnrollNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/PragmaUnrollNode.java index a9ac2fa96a..546b3b378a 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/PragmaUnrollNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/PragmaUnrollNode.java @@ -24,13 +24,13 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; @NodeInfo public class PragmaUnrollNode extends FixedWithNextNode implements LIRLowerable { diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/RSqrtNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/RSqrtNode.java index 59180a4409..2e1806d05b 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/RSqrtNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/RSqrtNode.java @@ -24,14 +24,14 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.spirv.graal.compiler.lir.SPIRVArithmeticTool; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/ReadHalfFloatNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/ReadHalfFloatNode.java index 95139ee480..7b4b9551e0 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/ReadHalfFloatNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/ReadHalfFloatNode.java @@ -24,16 +24,16 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVBarrierNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVBarrierNode.java index 45cd8babfb..b1806719d7 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVBarrierNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVBarrierNode.java @@ -24,13 +24,13 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.common.logging.Logger; import uk.ac.manchester.tornado.drivers.spirv.graal.lir.SPIRVLIRStmt; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVFMANode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVFMANode.java index 328a19d24c..3570a2a271 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVFMANode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVFMANode.java @@ -24,14 +24,14 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.spirv.graal.compiler.lir.SPIRVArithmeticTool; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVFPBinaryIntrinsicNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVFPBinaryIntrinsicNode.java index 22d1a78cc4..acd278221c 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVFPBinaryIntrinsicNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVFPBinaryIntrinsicNode.java @@ -24,19 +24,19 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVFPUnaryIntrinsicNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVFPUnaryIntrinsicNode.java index f43011cb56..9604fd4e36 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVFPUnaryIntrinsicNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVFPUnaryIntrinsicNode.java @@ -24,21 +24,21 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.type.FloatStamp; -import org.graalvm.compiler.core.common.type.PrimitiveStamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.UnaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.FloatStamp; +import jdk.graal.compiler.core.common.type.PrimitiveStamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.UnaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVIntBinaryIntrinsicNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVIntBinaryIntrinsicNode.java index 6b0a0eae6f..209b2eb661 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVIntBinaryIntrinsicNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVIntBinaryIntrinsicNode.java @@ -24,19 +24,19 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVIntTernaryIntrinsicNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVIntTernaryIntrinsicNode.java index e17e1bbbf4..df93ac2cd1 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVIntTernaryIntrinsicNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVIntTernaryIntrinsicNode.java @@ -24,21 +24,21 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.TernaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.TernaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVIntUnaryIntrinsicNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVIntUnaryIntrinsicNode.java index 26232493c7..3021e51a96 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVIntUnaryIntrinsicNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVIntUnaryIntrinsicNode.java @@ -24,18 +24,18 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.UnaryNode; -import org.graalvm.compiler.nodes.spi.ArithmeticLIRLowerable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.UnaryNode; +import jdk.graal.compiler.nodes.spi.ArithmeticLIRLowerable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVKernelContextAccessNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVKernelContextAccessNode.java index 9c356e3ffd..b26036615c 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVKernelContextAccessNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SPIRVKernelContextAccessNode.java @@ -24,16 +24,16 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SlotsBaseAddressNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SlotsBaseAddressNode.java index 4d9447bc74..1dfb4ebba0 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SlotsBaseAddressNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/SlotsBaseAddressNode.java @@ -24,12 +24,12 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/ThreadConfigurationNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/ThreadConfigurationNode.java index 0330fcf798..0250d35b7e 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/ThreadConfigurationNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/ThreadConfigurationNode.java @@ -24,13 +24,13 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; @NodeInfo public class ThreadConfigurationNode extends FixedWithNextNode implements LIRLowerable { diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/WriteHalfFloatNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/WriteHalfFloatNode.java index 487f694f40..336dca162d 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/WriteHalfFloatNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/WriteHalfFloatNode.java @@ -24,16 +24,16 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/GetArrayNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/GetArrayNode.java index a00a108676..00a342bd3c 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/GetArrayNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/GetArrayNode.java @@ -24,14 +24,14 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes.vector; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVStampFactory; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/LoadIndexedVectorNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/LoadIndexedVectorNode.java index 7ec64b7963..26cbc45647 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/LoadIndexedVectorNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/LoadIndexedVectorNode.java @@ -24,10 +24,10 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes.vector; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.java.LoadIndexedNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.java.LoadIndexedNode; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVStampFactory; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/SPIRVVectorValueNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/SPIRVVectorValueNode.java index 7471a40c62..316655672c 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/SPIRVVectorValueNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/SPIRVVectorValueNode.java @@ -24,24 +24,24 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.graph.NodeInputList; -import org.graalvm.compiler.lir.ConstantValue; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.InvokeNode; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.graph.NodeInputList; +import jdk.graal.compiler.lir.ConstantValue; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.InvokeNode; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Value; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorAddHalfNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorAddHalfNode.java index f8ada45365..118b28d79e 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorAddHalfNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorAddHalfNode.java @@ -26,15 +26,15 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.common.logging.Logger; import uk.ac.manchester.tornado.drivers.spirv.graal.asm.SPIRVAssembler; import uk.ac.manchester.tornado.drivers.spirv.graal.lir.SPIRVBinary; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorAddNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorAddNode.java index afbf4d90cc..251b4456c9 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorAddNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorAddNode.java @@ -24,18 +24,18 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorDivNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorDivNode.java index 89d95143c5..69494564e0 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorDivNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorDivNode.java @@ -24,17 +24,17 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorElementOpNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorElementOpNode.java index 75bd80baa0..a9b144d319 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorElementOpNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorElementOpNode.java @@ -27,20 +27,20 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.guarantee; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorLoadElementNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorLoadElementNode.java index ca81590c5c..f0ed352e80 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorLoadElementNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorLoadElementNode.java @@ -24,9 +24,9 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes.vector; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; import uk.ac.manchester.tornado.drivers.spirv.graal.lir.SPIRVKind; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorMultHalfNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorMultHalfNode.java index d6f65effbe..982841b034 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorMultHalfNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorMultHalfNode.java @@ -26,16 +26,16 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.common.logging.Logger; import uk.ac.manchester.tornado.drivers.spirv.graal.asm.SPIRVAssembler; import uk.ac.manchester.tornado.drivers.spirv.graal.lir.SPIRVBinary; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorMultNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorMultNode.java index 0eccdb5e21..cb59e6633a 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorMultNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorMultNode.java @@ -24,17 +24,17 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorStoreElementProxyNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorStoreElementProxyNode.java index ed37f75cf3..f45ff3f74b 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorStoreElementProxyNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorStoreElementProxyNode.java @@ -24,15 +24,15 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes.vector; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.Canonicalizable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.Canonicalizable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; import uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVStampFactory; import uk.ac.manchester.tornado.drivers.spirv.graal.lir.SPIRVKind; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorStoreGlobalMemory.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorStoreGlobalMemory.java index e0b39a9053..43f6086390 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorStoreGlobalMemory.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorStoreGlobalMemory.java @@ -21,13 +21,13 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.providers.TornadoMemoryOrder; import uk.ac.manchester.tornado.drivers.spirv.graal.SPIRVStampFactory; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorSubHalfNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorSubHalfNode.java index dfda9c4d68..d279577950 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorSubHalfNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorSubHalfNode.java @@ -26,14 +26,14 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import uk.ac.manchester.tornado.drivers.spirv.graal.asm.SPIRVAssembler; import uk.ac.manchester.tornado.drivers.spirv.graal.lir.SPIRVBinary; import uk.ac.manchester.tornado.drivers.spirv.graal.lir.SPIRVLIROp; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorSubNode.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorSubNode.java index 6ddc289242..ab18e1c3d1 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorSubNode.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/nodes/vector/VectorSubNode.java @@ -24,17 +24,17 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.nodes.vector; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.Variable; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.Variable; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.drivers.common.logging.Logger; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/InverseSquareRootPhase.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/InverseSquareRootPhase.java index d9c0c17823..a8c8cdc1e4 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/InverseSquareRootPhase.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/InverseSquareRootPhase.java @@ -26,12 +26,12 @@ import java.util.Optional; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatDivNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatDivNode; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.drivers.spirv.graal.nodes.RSqrtNode; import uk.ac.manchester.tornado.drivers.spirv.graal.nodes.SPIRVFPUnaryIntrinsicNode; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/SPIRVFMAPhase.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/SPIRVFMAPhase.java index 2808cbfddc..ababe792ad 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/SPIRVFMAPhase.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/SPIRVFMAPhase.java @@ -26,12 +26,12 @@ import java.util.Optional; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.phases.Phase; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.drivers.spirv.graal.nodes.SPIRVFMANode; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/SPIRVFP64SupportPhase.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/SPIRVFP64SupportPhase.java index 8b3310cdb3..691cbdda00 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/SPIRVFP64SupportPhase.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/SPIRVFP64SupportPhase.java @@ -21,14 +21,14 @@ import java.util.Optional; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.calc.SqrtNode; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.WriteNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.calc.SqrtNode; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.WriteNode; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.api.TornadoDeviceContext; import uk.ac.manchester.tornado.api.exceptions.TornadoDeviceFP64NotSupported; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoBatchGlobalIndexOffset.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoBatchGlobalIndexOffset.java index 4a71e62c0b..130cba3d92 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoBatchGlobalIndexOffset.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoBatchGlobalIndexOffset.java @@ -27,20 +27,20 @@ import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.RawConstant; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FrameState; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.java.LoadIndexedNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FrameState; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.java.LoadIndexedNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.common.BatchCompilationConfig; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoHighTierContext; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoFixedArrayCopyPhase.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoFixedArrayCopyPhase.java index a2bef8360c..dcb37d4a0d 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoFixedArrayCopyPhase.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoFixedArrayCopyPhase.java @@ -24,18 +24,19 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.phases; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.BasePhase; - +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.api.exceptions.TornadoCompilationException; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoLowTierContext; import uk.ac.manchester.tornado.drivers.spirv.graal.nodes.FixedArrayNode; import java.util.Optional; +import static jdk.graal.compiler.phases.BasePhase.ALWAYS_APPLICABLE; + public class TornadoFixedArrayCopyPhase extends BasePhase { @Override diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoFloatingReadReplacement.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoFloatingReadReplacement.java index 382e798d8c..1c8fa3faac 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoFloatingReadReplacement.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoFloatingReadReplacement.java @@ -21,8 +21,8 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.phases; -import static org.graalvm.compiler.graph.Graph.NodeEvent.NODE_ADDED; -import static org.graalvm.compiler.graph.Graph.NodeEvent.ZERO_USAGES; +import static jdk.graal.compiler.graph.Graph.NodeEvent.NODE_ADDED; +import static jdk.graal.compiler.graph.Graph.NodeEvent.ZERO_USAGES; import static org.graalvm.word.LocationIdentity.any; import static org.graalvm.word.LocationIdentity.init; @@ -35,50 +35,50 @@ import org.graalvm.collections.EconomicSet; import org.graalvm.collections.Equivalence; import org.graalvm.collections.UnmodifiableMapCursor; -import org.graalvm.compiler.core.common.cfg.Loop; -import org.graalvm.compiler.debug.DebugCloseable; -import org.graalvm.compiler.debug.GraalError; -import org.graalvm.compiler.graph.Graph; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.AbstractBeginNode; -import org.graalvm.compiler.nodes.AbstractMergeNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.LoopEndNode; -import org.graalvm.compiler.nodes.LoopExitNode; -import org.graalvm.compiler.nodes.MemoryMapControlSinkNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.ProxyNode; -import org.graalvm.compiler.nodes.StartNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValueNodeInterface; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.cfg.ControlFlowGraph; -import org.graalvm.compiler.nodes.cfg.HIRBlock; -import org.graalvm.compiler.nodes.cfg.HIRLoop; -import org.graalvm.compiler.nodes.memory.AddressableMemoryAccess; -import org.graalvm.compiler.nodes.memory.FloatableAccessNode; -import org.graalvm.compiler.nodes.memory.FloatingAccessNode; -import org.graalvm.compiler.nodes.memory.FloatingReadNode; -import org.graalvm.compiler.nodes.memory.MemoryAccess; -import org.graalvm.compiler.nodes.memory.MemoryAnchorNode; -import org.graalvm.compiler.nodes.memory.MemoryKill; -import org.graalvm.compiler.nodes.memory.MemoryMap; -import org.graalvm.compiler.nodes.memory.MemoryMapNode; -import org.graalvm.compiler.nodes.memory.MemoryPhiNode; -import org.graalvm.compiler.nodes.memory.MultiMemoryKill; -import org.graalvm.compiler.nodes.memory.SingleMemoryKill; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.nodes.spi.CoreProviders; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.FloatingReadPhase; -import org.graalvm.compiler.phases.common.PostRunCanonicalizationPhase; -import org.graalvm.compiler.phases.common.util.EconomicSetNodeEventListener; -import org.graalvm.compiler.phases.graph.ReentrantNodeIterator; +import jdk.graal.compiler.core.common.cfg.Loop; +import jdk.graal.compiler.debug.DebugCloseable; +import jdk.graal.compiler.debug.GraalError; +import jdk.graal.compiler.graph.Graph; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.AbstractBeginNode; +import jdk.graal.compiler.nodes.AbstractMergeNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.LoopEndNode; +import jdk.graal.compiler.nodes.LoopExitNode; +import jdk.graal.compiler.nodes.MemoryMapControlSinkNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.ProxyNode; +import jdk.graal.compiler.nodes.StartNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValueNodeInterface; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.cfg.ControlFlowGraph; +import jdk.graal.compiler.nodes.cfg.HIRBlock; +import jdk.graal.compiler.nodes.cfg.HIRLoop; +import jdk.graal.compiler.nodes.memory.AddressableMemoryAccess; +import jdk.graal.compiler.nodes.memory.FloatableAccessNode; +import jdk.graal.compiler.nodes.memory.FloatingAccessNode; +import jdk.graal.compiler.nodes.memory.FloatingReadNode; +import jdk.graal.compiler.nodes.memory.MemoryAccess; +import jdk.graal.compiler.nodes.memory.MemoryAnchorNode; +import jdk.graal.compiler.nodes.memory.MemoryKill; +import jdk.graal.compiler.nodes.memory.MemoryMap; +import jdk.graal.compiler.nodes.memory.MemoryMapNode; +import jdk.graal.compiler.nodes.memory.MemoryPhiNode; +import jdk.graal.compiler.nodes.memory.MultiMemoryKill; +import jdk.graal.compiler.nodes.memory.SingleMemoryKill; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.nodes.spi.CoreProviders; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.FloatingReadPhase; +import jdk.graal.compiler.phases.common.PostRunCanonicalizationPhase; +import jdk.graal.compiler.phases.common.util.EconomicSetNodeEventListener; +import jdk.graal.compiler.phases.graph.ReentrantNodeIterator; import org.graalvm.word.LocationIdentity; import uk.ac.manchester.tornado.drivers.spirv.graal.nodes.FixedArrayNode; @@ -252,7 +252,7 @@ protected void run(StructuredGraph graph, CoreProviders context) { EconomicMap> modifiedInLoops = null; if (graph.hasLoops()) { modifiedInLoops = EconomicMap.create(Equivalence.IDENTITY); - ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, true, false, false); + ControlFlowGraph cfg = ControlFlowGraph.newBuilder(graph).connectBlocks(true).computeLoops(true).computeFrequency(true).build(); for (Loop l : cfg.getLoops()) { HIRLoop loop = (HIRLoop) l; processLoop(loop, modifiedInLoops); @@ -359,7 +359,7 @@ private static void processAnchor(MemoryAnchorNode anchor, TornadoFloatingReadRe private static void processAccess(MemoryAccess access, TornadoFloatingReadReplacement.MemoryMapImpl state) { LocationIdentity locationIdentity = access.getLocationIdentity(); - if (!locationIdentity.equals(LocationIdentity.any()) && locationIdentity.isMutable()) { + if (!locationIdentity.equals(any()) && locationIdentity.isMutable()) { MemoryKill lastLocationAccess = state.getLastLocationAccess(locationIdentity); access.setLastLocationAccess(lastLocationAccess); } @@ -420,7 +420,7 @@ protected TornadoFloatingReadReplacement.MemoryMapImpl processNode(FixedNode nod if (node instanceof LoopExitNode) { final LoopExitNode loopExitNode = (LoopExitNode) node; final EconomicSet modifiedInLoop = modifiedInLoops.get(loopExitNode.loopBegin()); - final boolean anyModified = modifiedInLoop.contains(LocationIdentity.any()); + final boolean anyModified = modifiedInLoop.contains(any()); state.getMap().replaceAll( (locationIdentity, memoryNode) -> (anyModified || modifiedInLoop.contains(locationIdentity)) ? ProxyNode.forMemory(memoryNode, loopExitNode, locationIdentity) : memoryNode); } @@ -519,7 +519,7 @@ protected TornadoFloatingReadReplacement.MemoryMapImpl afterSplit(AbstractBeginN protected EconomicMap processLoop(LoopBeginNode loop, TornadoFloatingReadReplacement.MemoryMapImpl initialState) { EconomicSet modifiedLocations = modifiedInLoops.get(loop); EconomicMap phis = EconomicMap.create(Equivalence.DEFAULT); - if (modifiedLocations.contains(LocationIdentity.any())) { + if (modifiedLocations.contains(any())) { // create phis for all locations if ANY is modified in the loop modifiedLocations = EconomicSet.create(Equivalence.DEFAULT, modifiedLocations); modifiedLocations.addAll(initialState.getMap().getKeys()); diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoHalfFloatReplacement.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoHalfFloatReplacement.java index 98f657b68d..24463b934d 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoHalfFloatReplacement.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoHalfFloatReplacement.java @@ -24,30 +24,26 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.phases; -import java.util.ArrayList; -import java.util.Optional; - +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.FloatDivNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.nodes.calc.SubNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.extended.ValueAnchorNode; +import jdk.graal.compiler.nodes.java.NewInstanceNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.phases.BasePhase; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.RawConstant; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.calc.FloatDivNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.nodes.calc.SubNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.extended.ValueAnchorNode; -import org.graalvm.compiler.nodes.java.NewInstanceNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.phases.BasePhase; - import uk.ac.manchester.tornado.api.internal.annotations.HalfType; import uk.ac.manchester.tornado.drivers.spirv.graal.lir.SPIRVKind; import uk.ac.manchester.tornado.drivers.spirv.graal.nodes.ReadHalfFloatNode; @@ -67,135 +63,10 @@ import uk.ac.manchester.tornado.runtime.graal.nodes.VectorHalfRead; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoHighTierContext; -public class TornadoHalfFloatReplacement extends BasePhase { - - @Override - public Optional notApplicableTo(GraphState graphState) { - return ALWAYS_APPLICABLE; - } - - protected void run(StructuredGraph graph, TornadoHighTierContext context) { - - for (ValueAnchorNode valueAnchorNode : graph.getNodes().filter(ValueAnchorNode.class)) { - ArrayList deletePi = new ArrayList(); - for (Node valueAnchorNodeUsage : valueAnchorNode.usages()) { - if (valueAnchorNodeUsage instanceof PiNode) { - PiNode piNode = (PiNode) valueAnchorNodeUsage; - piNode.replaceAtUsages(piNode.object()); - deletePi.add(piNode); - } - } - for (PiNode p : deletePi) { - p.safeDelete(); - } - deleteFixed(valueAnchorNode); - } - - // replace reads with halfFloat reads - for (JavaReadNode javaRead : graph.getNodes().filter(JavaReadNode.class)) { - if (javaRead.successors().first() instanceof NewInstanceNode) { - NewInstanceNode newInstanceNode = (NewInstanceNode) javaRead.successors().first(); - if (newInstanceNode.instanceClass().getAnnotation(HalfType.class) != null) { - if (newInstanceNode.successors().first() instanceof NewHalfFloatInstance) { - NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) newInstanceNode.successors().first(); - deleteFixed(newHalfFloatInstance); - } - AddressNode readingAddress = javaRead.getAddress(); - ReadHalfFloatNode readHalfFloatNode = new ReadHalfFloatNode(readingAddress); - graph.addWithoutUnique(readHalfFloatNode); - replaceFixed(javaRead, readHalfFloatNode); - newInstanceNode.replaceAtUsages(readHalfFloatNode); - deleteFixed(newInstanceNode); - } - } - } - - for (NewInstanceNode newInstanceNode : graph.getNodes().filter(NewInstanceNode.class)) { - if (newInstanceNode.instanceClass().getAnnotation(HalfType.class) != null) { - if (newInstanceNode.successors().first() instanceof NewHalfFloatInstance) { - NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) newInstanceNode.successors().first(); - ValueNode valueInput = newHalfFloatInstance.getValue(); - newInstanceNode.replaceAtUsages(valueInput); - deleteFixed(newInstanceNode); - deleteFixed(newHalfFloatInstance); - } - } - } - - // replace writes with halfFloat writes - for (JavaWriteNode javaWrite : graph.getNodes().filter(JavaWriteNode.class)) { - if (isWriteHalfFloat(javaWrite)) { - // This casting is safe to do as it is already checked by the isWriteHalfFloat function - HalfFloatPlaceholder placeholder = (HalfFloatPlaceholder) javaWrite.value(); - ValueNode writingValue; - if (javaWrite.predecessor() instanceof NewHalfFloatInstance) { - // if a new HalfFloat instance is written - NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) javaWrite.predecessor(); - writingValue = newHalfFloatInstance.getValue(); - if (newHalfFloatInstance.predecessor() instanceof NewInstanceNode) { - NewInstanceNode newInstanceNode = (NewInstanceNode) newHalfFloatInstance.predecessor(); - if (newInstanceNode.instanceClass().toString().contains("HalfFloat")) { - deleteFixed(newInstanceNode); - deleteFixed(newHalfFloatInstance); - } - } - } else { - // if the result of an operation or a stored value is written - writingValue = placeholder.getInput(); - } - placeholder.replaceAtUsages(writingValue); - placeholder.safeDelete(); - AddressNode writingAddress = javaWrite.getAddress(); - WriteHalfFloatNode writeHalfFloatNode = new WriteHalfFloatNode(writingAddress, writingValue); - graph.addWithoutUnique(writeHalfFloatNode); - replaceFixed(javaWrite, writeHalfFloatNode); - deleteFixed(javaWrite); - } - } - - // replace the half float operator nodes with the corresponding regular operators - replaceAddHalfFloatNodes(graph); - replaceSubHalfFloatNodes(graph); - replaceMultHalfFloatNodes(graph); - replaceDivHalfFloatNodes(graph); - - // add after the loadindexedvector nodes the marker node to fix the offset of its read - - for (LoadIndexedVectorNode loadIndexedVectorNode : graph.getNodes().filter(LoadIndexedVectorNode.class)) { - if (loadIndexedVectorNode.getSPIRVKind().isHalf()) { - VectorHalfRead vectorHalfRead; - if (loadIndexedVectorNode.index() instanceof ConstantNode) { - ConstantNode offset = (ConstantNode) loadIndexedVectorNode.index(); - int offsetValue = Integer.valueOf(offset.getValue().toValueString()); - vectorHalfRead = graph.addWithoutUnique(new VectorHalfRead(offsetValue)); - } else { - vectorHalfRead = graph.addWithoutUnique(new VectorHalfRead()); - } - graph.addAfterFixed(loadIndexedVectorNode, vectorHalfRead); - } - } - - for (SPIRVVectorValueNode vectorValueNode : graph.getNodes().filter(SPIRVVectorValueNode.class)) { - if (vectorValueNode.getSPIRVKind().isHalf()) { - for (Node vectorElement : vectorValueNode.inputs()) { - if (vectorElement instanceof VectorLoadElementNode) { - VectorLoadElementNode vectorLoad = (VectorLoadElementNode) vectorElement; - VectorLoadElementNode vectorLoadShort = new VectorLoadElementNode(SPIRVKind.OP_TYPE_FLOAT_16, vectorLoad.getVector(), vectorLoad.getLaneId()); - graph.addWithoutUnique(vectorLoadShort); - vectorLoad.replaceAtUsages(vectorLoadShort); - vectorLoad.safeDelete(); - } else if (vectorElement instanceof ConstantNode constantNode && constantNode.getValue().toValueString().contains("null")) { - Constant zeroValue = new RawConstant(0); - ConstantNode zero = new ConstantNode(zeroValue, StampFactory.forKind(JavaKind.Short)); - graph.addWithoutUnique(zero); - constantNode.replaceAtUsages(zero); - constantNode.safeDelete(); - } - } - } - } +import java.util.ArrayList; +import java.util.Optional; - } +public class TornadoHalfFloatReplacement extends BasePhase { private static ValueNode replaceAdd(AddHalfFloatNode addHalfFloatNode, StructuredGraph graph) { boolean isVectorOperation = isVectorOp(addHalfFloatNode.getX(), addHalfFloatNode.getY()); @@ -247,8 +118,18 @@ private static ValueNode replaceSub(SubHalfFloatNode subHalfFloatNode, Structure subNode = new SubNode(subX, subY); graph.addWithoutUnique(subNode); } - subHalfFloatNode.replaceAtUsages(subNode); + PiNode piNode = null; + if (subHalfFloatNode.usages().filter(PiNode.class).isNotEmpty()) { + piNode = subHalfFloatNode.usages().filter(PiNode.class).first(); + } + if (piNode != null) { + piNode.replaceAtUsages(subNode); + piNode.safeDelete(); + } else { + subHalfFloatNode.replaceAtUsages(subNode); + } subHalfFloatNode.safeDelete(); + return subNode; } @@ -279,7 +160,17 @@ private static ValueNode replaceMult(MultHalfFloatNode multHalfFloatNode, Struct multNode = new MulNode(multX, multY); graph.addWithoutUnique(multNode); } - multHalfFloatNode.replaceAtUsages(multNode); + PiNode piNode = null; + if (multHalfFloatNode.usages().filter(PiNode.class).isNotEmpty()) { + piNode = multHalfFloatNode.usages().filter(PiNode.class).first(); + } + if (piNode != null) { + piNode.replaceAtUsages(multNode); + piNode.safeDelete(); + } else { + multHalfFloatNode.replaceAtUsages(multNode); + } + multHalfFloatNode.safeDelete(); return multNode; } @@ -298,7 +189,17 @@ private static ValueNode replaceDiv(DivHalfFloatNode divHalfFloatNode, Structure FloatDivNode divNode = new FloatDivNode(divX, divY); graph.addWithoutUnique(divNode); - divHalfFloatNode.replaceAtUsages(divNode); + PiNode piNode = null; + if (divHalfFloatNode.usages().filter(PiNode.class).isNotEmpty()) { + piNode = divHalfFloatNode.usages().filter(PiNode.class).first(); + } + if (piNode != null) { + piNode.replaceAtUsages(divNode); + piNode.safeDelete(); + } else { + divHalfFloatNode.replaceAtUsages(divNode); + } + divHalfFloatNode.safeDelete(); return divNode; } @@ -378,4 +279,147 @@ private static void deleteFixed(Node node) { } } + @Override + public Optional notApplicableTo(GraphState graphState) { + return ALWAYS_APPLICABLE; + } + + protected void run(StructuredGraph graph, TornadoHighTierContext context) { + + for (ValueAnchorNode valueAnchorNode : graph.getNodes().filter(ValueAnchorNode.class)) { + ArrayList deletePi = new ArrayList(); + for (Node valueAnchorNodeUsage : valueAnchorNode.usages()) { + if (valueAnchorNodeUsage instanceof PiNode) { + PiNode piNode = (PiNode) valueAnchorNodeUsage; + piNode.replaceAtUsages(piNode.object()); + deletePi.add(piNode); + } + } + for (PiNode p : deletePi) { + p.safeDelete(); + } + deleteFixed(valueAnchorNode); + } + + // cleaup the reminder Pi nodes introduced since Graal 24.0.1 + for (PiNode piNode : graph.getNodes().filter(PiNode.class)) { + for (Node piNodeUsages : piNode.usages()) { + if (piNodeUsages instanceof SPIRVVectorValueNode) { + piNode.replaceAtUsages(piNode.object()); + piNode.safeDelete(); + } + } + } + // replace reads with halfFloat reads + for (JavaReadNode javaRead : graph.getNodes().filter(JavaReadNode.class)) { + if (javaRead.successors().first() instanceof NewInstanceNode) { + NewInstanceNode newInstanceNode = (NewInstanceNode) javaRead.successors().first(); + if (newInstanceNode.instanceClass().getAnnotation(HalfType.class) != null) { + if (newInstanceNode.successors().first() instanceof NewHalfFloatInstance) { + NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) newInstanceNode.successors().first(); + deleteFixed(newHalfFloatInstance); + } + AddressNode readingAddress = javaRead.getAddress(); + ReadHalfFloatNode readHalfFloatNode = new ReadHalfFloatNode(readingAddress); + graph.addWithoutUnique(readHalfFloatNode); + replaceFixed(javaRead, readHalfFloatNode); + newInstanceNode.replaceAtUsages(readHalfFloatNode); + deleteFixed(newInstanceNode); + } + } + } + + for (NewInstanceNode newInstanceNode : graph.getNodes().filter(NewInstanceNode.class)) { + if (newInstanceNode.instanceClass().getAnnotation(HalfType.class) != null) { + if (newInstanceNode.successors().first() instanceof NewHalfFloatInstance) { + NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) newInstanceNode.successors().first(); + ValueNode valueInput = newHalfFloatInstance.getValue(); + newInstanceNode.replaceAtUsages(valueInput); + deleteFixed(newInstanceNode); + deleteFixed(newHalfFloatInstance); + } + } + } + + // replace writes with halfFloat writes + for (JavaWriteNode javaWrite : graph.getNodes().filter(JavaWriteNode.class)) { + if (isWriteHalfFloat(javaWrite)) { + // This casting is safe to do as it is already checked by the isWriteHalfFloat function + HalfFloatPlaceholder placeholder = (HalfFloatPlaceholder) javaWrite.value(); + ValueNode writingValue; + if (javaWrite.predecessor() instanceof NewHalfFloatInstance) { + // if a new HalfFloat instance is written + NewHalfFloatInstance newHalfFloatInstance = (NewHalfFloatInstance) javaWrite.predecessor(); + writingValue = newHalfFloatInstance.getValue(); + if (newHalfFloatInstance.predecessor() instanceof NewInstanceNode) { + NewInstanceNode newInstanceNode = (NewInstanceNode) newHalfFloatInstance.predecessor(); + if (newInstanceNode.instanceClass().toString().contains("HalfFloat")) { + deleteFixed(newInstanceNode); + deleteFixed(newHalfFloatInstance); + } + } + } else { + // if the result of an operation or a stored value is written + writingValue = placeholder.getInput(); + } + placeholder.replaceAtUsages(writingValue); + placeholder.safeDelete(); + AddressNode writingAddress = javaWrite.getAddress(); + WriteHalfFloatNode writeHalfFloatNode = new WriteHalfFloatNode(writingAddress, writingValue); + graph.addWithoutUnique(writeHalfFloatNode); + replaceFixed(javaWrite, writeHalfFloatNode); + deleteFixed(javaWrite); + } + } + + // replace the half float operator nodes with the corresponding regular operators + replaceAddHalfFloatNodes(graph); + replaceSubHalfFloatNodes(graph); + replaceMultHalfFloatNodes(graph); + replaceDivHalfFloatNodes(graph); + + // add after the loadindexedvector nodes the marker node to fix the offset of its read + + for (LoadIndexedVectorNode loadIndexedVectorNode : graph.getNodes().filter(LoadIndexedVectorNode.class)) { + if (loadIndexedVectorNode.getSPIRVKind().isHalf()) { + VectorHalfRead vectorHalfRead; + if (loadIndexedVectorNode.index() instanceof ConstantNode) { + ConstantNode offset = (ConstantNode) loadIndexedVectorNode.index(); + int offsetValue = Integer.valueOf(offset.getValue().toValueString()); + vectorHalfRead = graph.addWithoutUnique(new VectorHalfRead(offsetValue)); + } else { + vectorHalfRead = graph.addWithoutUnique(new VectorHalfRead()); + } + graph.addAfterFixed(loadIndexedVectorNode, vectorHalfRead); + } + } + + for (SPIRVVectorValueNode vectorValueNode : graph.getNodes().filter(SPIRVVectorValueNode.class)) { + if (vectorValueNode.getSPIRVKind().isHalf()) { + for (Node vectorElement : vectorValueNode.inputs()) { + if (vectorElement instanceof VectorLoadElementNode) { + VectorLoadElementNode vectorLoad = (VectorLoadElementNode) vectorElement; + VectorLoadElementNode vectorLoadShort = new VectorLoadElementNode(SPIRVKind.OP_TYPE_FLOAT_16, vectorLoad.getVector(), vectorLoad.getLaneId()); + graph.addWithoutUnique(vectorLoadShort); + vectorLoad.replaceAtUsages(vectorLoadShort); + vectorLoad.safeDelete(); + } else if (vectorElement instanceof ConstantNode constantNode && constantNode.getValue().toValueString().contains("null")) { + Constant zeroValue = new RawConstant(0); + ConstantNode zero = new ConstantNode(zeroValue, StampFactory.forKind(JavaKind.Short)); + graph.addWithoutUnique(zero); + constantNode.replaceAtUsages(zero); + constantNode.safeDelete(); + } + } + } + } + + for (HalfFloatPlaceholder placeholder : graph.getNodes().filter(HalfFloatPlaceholder.class)) { + ValueNode input = placeholder.getInput(); + placeholder.replaceAtUsages(input); + placeholder.safeDelete(); + } + + } + } diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoHalfFloatVectorOffset.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoHalfFloatVectorOffset.java index 5b3496d16c..a582755139 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoHalfFloatVectorOffset.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoHalfFloatVectorOffset.java @@ -27,17 +27,17 @@ import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.RawConstant; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.LeftShiftNode; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.WriteNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.Phase; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.LeftShiftNode; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.WriteNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.Phase; import uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray; import uk.ac.manchester.tornado.drivers.spirv.graal.nodes.vector.SPIRVVectorValueNode; import uk.ac.manchester.tornado.runtime.graal.nodes.VectorHalfRead; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoParallelScheduler.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoParallelScheduler.java index 23be81b5b6..1b750bb0dd 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoParallelScheduler.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoParallelScheduler.java @@ -28,13 +28,13 @@ import java.util.Optional; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.drivers.spirv.graal.nodes.GlobalThreadIdNode; import uk.ac.manchester.tornado.drivers.spirv.graal.nodes.GlobalThreadSizeNode; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoSPIRVIntrinsicsReplacements.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoSPIRVIntrinsicsReplacements.java index 5616e487db..d84adfef15 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoSPIRVIntrinsicsReplacements.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoSPIRVIntrinsicsReplacements.java @@ -28,16 +28,16 @@ import java.util.Optional; -import org.graalvm.compiler.graph.NodeInputList; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.CallTargetNode; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.InvokeNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.NodeInputList; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.CallTargetNode; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.InvokeNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.phases.BasePhase; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoTaskSpecialization.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoTaskSpecialization.java index 988aa0169d..a81e342f2e 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoTaskSpecialization.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoTaskSpecialization.java @@ -33,29 +33,27 @@ import java.util.Optional; import java.util.concurrent.atomic.AtomicBoolean; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.graph.Graph; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedGuardNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.LogicConstantNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.calc.IntegerLessThanNode; -import org.graalvm.compiler.nodes.calc.IsNullNode; -import org.graalvm.compiler.nodes.extended.UnboxNode; -import org.graalvm.compiler.nodes.java.ArrayLengthNode; -import org.graalvm.compiler.nodes.java.LoadFieldNode; -import org.graalvm.compiler.nodes.util.GraphUtil; -import org.graalvm.compiler.phases.BasePhase; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.graph.Graph; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.LogicConstantNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.calc.IntegerLessThanNode; +import jdk.graal.compiler.nodes.calc.IsNullNode; +import jdk.graal.compiler.nodes.java.ArrayLengthNode; +import jdk.graal.compiler.nodes.java.LoadFieldNode; +import jdk.graal.compiler.nodes.util.GraphUtil; +import jdk.graal.compiler.phases.BasePhase; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaField; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoThreadScheduler.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoThreadScheduler.java index f72b9d7e2b..08a2795e56 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoThreadScheduler.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/phases/TornadoThreadScheduler.java @@ -26,11 +26,11 @@ import java.util.Optional; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.api.enums.TornadoDeviceType; import uk.ac.manchester.tornado.drivers.spirv.graal.nodes.LocalWorkGroupDimensionsNode; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/snippets/ReduceGPUSnippets.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/snippets/ReduceGPUSnippets.java index 8f6ba1b18d..6b042a52ac 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/snippets/ReduceGPUSnippets.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/graal/snippets/ReduceGPUSnippets.java @@ -24,16 +24,16 @@ */ package uk.ac.manchester.tornado.drivers.spirv.graal.snippets; -import org.graalvm.compiler.api.replacements.Snippet; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.java.NewArrayNode; -import org.graalvm.compiler.nodes.spi.LoweringTool; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.replacements.SnippetTemplate; -import org.graalvm.compiler.replacements.SnippetTemplate.SnippetInfo; -import org.graalvm.compiler.replacements.Snippets; +import jdk.graal.compiler.api.replacements.Snippet; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.java.NewArrayNode; +import jdk.graal.compiler.nodes.spi.LoweringTool; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.replacements.SnippetTemplate; +import jdk.graal.compiler.replacements.SnippetTemplate.SnippetInfo; +import jdk.graal.compiler.replacements.Snippets; import jdk.vm.ci.meta.JavaKind; import uk.ac.manchester.tornado.api.math.TornadoMath; diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/mm/SPIRVArrayWrapper.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/mm/SPIRVArrayWrapper.java index f8012b8e08..7f1a388af9 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/mm/SPIRVArrayWrapper.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/mm/SPIRVArrayWrapper.java @@ -63,7 +63,7 @@ public SPIRVArrayWrapper(SPIRVDeviceContext deviceContext, JavaKind javaKind, lo this.logger = new TornadoLogger(this.getClass()); this.arrayLengthOffset = TornadoCoreRuntime.getVMConfig().arrayOopDescLengthOffset(); - this.arrayHeaderSize = TornadoCoreRuntime.getVMConfig().getArrayBaseOffset(kind); + arrayHeaderSize = (int) TornadoOptions.PANAMA_OBJECT_HEADER_SIZE; } protected SPIRVArrayWrapper(final T array, final SPIRVDeviceContext device, final JavaKind kind, long batchSize) { diff --git a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/tests/TestSPIRVJITCompiler.java b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/tests/TestSPIRVJITCompiler.java index fdbc5c88bb..31dd33a796 100644 --- a/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/tests/TestSPIRVJITCompiler.java +++ b/tornado-drivers/spirv/src/main/java/uk/ac/manchester/tornado/drivers/spirv/tests/TestSPIRVJITCompiler.java @@ -27,7 +27,7 @@ import java.util.Arrays; import java.util.HashMap; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.api.annotations.Parallel; diff --git a/tornado-runtime/src/main/java/module-info.java b/tornado-runtime/src/main/java/module-info.java index 95d13d7e64..87b2b6616f 100644 --- a/tornado-runtime/src/main/java/module-info.java +++ b/tornado-runtime/src/main/java/module-info.java @@ -1,9 +1,37 @@ import uk.ac.manchester.tornado.runtime.TornadoBackendProvider; -open module tornado.runtime{requires java.logging;requires jdk.unsupported;requires org.graalvm.collections; +open module tornado.runtime { + requires java.logging; + requires jdk.unsupported; + requires org.graalvm.collections; + requires transitive jdk.internal.vm.ci; + requires transitive jdk.graal.compiler; + requires transitive tornado.api; + requires commons.math3; -requires transitive jdk.internal.vm.ci;requires transitive jdk.internal.vm.compiler;requires transitive tornado.api;requires commons.math3; + exports uk.ac.manchester.tornado.runtime; + exports uk.ac.manchester.tornado.runtime.analyzer; + exports uk.ac.manchester.tornado.runtime.common; + exports uk.ac.manchester.tornado.runtime.common.enums; + exports uk.ac.manchester.tornado.runtime.common.exceptions; + exports uk.ac.manchester.tornado.runtime.directives; + exports uk.ac.manchester.tornado.runtime.domain; + exports uk.ac.manchester.tornado.runtime.graal; + exports uk.ac.manchester.tornado.runtime.graal.backend; + exports uk.ac.manchester.tornado.runtime.graal.compiler; + exports uk.ac.manchester.tornado.runtime.graal.nodes; + exports uk.ac.manchester.tornado.runtime.graal.nodes.logic; + exports uk.ac.manchester.tornado.runtime.graal.nodes.calc; + exports uk.ac.manchester.tornado.runtime.graal.phases; + exports uk.ac.manchester.tornado.runtime.graph; + exports uk.ac.manchester.tornado.runtime.graph.nodes; + exports uk.ac.manchester.tornado.runtime.profiler; + exports uk.ac.manchester.tornado.runtime.sketcher; + exports uk.ac.manchester.tornado.runtime.tasks; + exports uk.ac.manchester.tornado.runtime.tasks.meta; + exports uk.ac.manchester.tornado.runtime.utils; + exports uk.ac.manchester.tornado.runtime.graal.phases.sketcher; + exports uk.ac.manchester.tornado.runtime.graal.nodes.interfaces; -exports uk.ac.manchester.tornado.runtime;exports uk.ac.manchester.tornado.runtime.analyzer;exports uk.ac.manchester.tornado.runtime.common;exports uk.ac.manchester.tornado.runtime.common.enums;exports uk.ac.manchester.tornado.runtime.common.exceptions;exports uk.ac.manchester.tornado.runtime.directives;exports uk.ac.manchester.tornado.runtime.domain;exports uk.ac.manchester.tornado.runtime.graal;exports uk.ac.manchester.tornado.runtime.graal.backend;exports uk.ac.manchester.tornado.runtime.graal.compiler;exports uk.ac.manchester.tornado.runtime.graal.nodes;exports uk.ac.manchester.tornado.runtime.graal.nodes.logic;exports uk.ac.manchester.tornado.runtime.graal.nodes.calc;exports uk.ac.manchester.tornado.runtime.graal.phases;exports uk.ac.manchester.tornado.runtime.graph;exports uk.ac.manchester.tornado.runtime.graph.nodes;exports uk.ac.manchester.tornado.runtime.profiler;exports uk.ac.manchester.tornado.runtime.sketcher;exports uk.ac.manchester.tornado.runtime.tasks;exports uk.ac.manchester.tornado.runtime.tasks.meta;exports uk.ac.manchester.tornado.runtime.utils;exports uk.ac.manchester.tornado.runtime.graal.phases.sketcher;exports uk.ac.manchester.tornado.runtime.graal.nodes.interfaces; - -uses TornadoBackendProvider;} + uses TornadoBackendProvider; +} diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoAcceleratorBackend.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoAcceleratorBackend.java index 9cc8e831b6..8f4019b090 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoAcceleratorBackend.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoAcceleratorBackend.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.runtime; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.phases.util.Providers; import uk.ac.manchester.tornado.api.TornadoBackend; import uk.ac.manchester.tornado.runtime.graal.backend.XPUBackend; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoBackendProvider.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoBackendProvider.java index c45016d6a8..3efbdfb43a 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoBackendProvider.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoBackendProvider.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.runtime; -import org.graalvm.compiler.options.OptionValues; +import jdk.graal.compiler.options.OptionValues; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import uk.ac.manchester.tornado.runtime.common.enums.TornadoBackends; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoCoreRuntime.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoCoreRuntime.java index 709a2c997c..ed97bc7ddc 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoCoreRuntime.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoCoreRuntime.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.runtime; -import static org.graalvm.compiler.debug.GraalError.guarantee; +import static jdk.graal.compiler.debug.GraalError.guarantee; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.shouldNotReachHere; import java.lang.reflect.Method; @@ -37,14 +37,14 @@ import java.util.stream.StreamSupport; import org.graalvm.collections.EconomicMap; -import org.graalvm.compiler.core.common.GraalOptions; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.hotspot.HotSpotGraalOptionValues; -import org.graalvm.compiler.lir.constopt.ConstantLoadOptimization; -import org.graalvm.compiler.lir.phases.PostAllocationOptimizationStage; -import org.graalvm.compiler.options.OptionKey; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.printer.GraalDebugHandlersFactory; +import jdk.graal.compiler.core.common.GraalOptions; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.hotspot.HotSpotGraalOptionValues; +import jdk.graal.compiler.lir.constopt.ConstantLoadOptimization; +import jdk.graal.compiler.lir.phases.PostAllocationOptimizationStage; +import jdk.graal.compiler.options.OptionKey; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.printer.GraalDebugHandlersFactory; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.meta.MetaAccessProvider; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoVMConfigAccess.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoVMConfigAccess.java index 5c58d7c09f..42d6f192f5 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoVMConfigAccess.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/TornadoVMConfigAccess.java @@ -50,19 +50,10 @@ public int getArrayBaseOffset(JavaKind kind) { return metaAccessProvider.getArrayBaseOffset(kind); } - public int getArrayIndexScale(JavaKind kind) { - return metaAccessProvider.getArrayIndexScale(kind); - } public int instanceKlassFieldsOffset() { if (fieldOffset == -1) { - String javaVersionString = System.getProperty("java.version"); - int javaVersion = Integer.parseInt(javaVersionString.split("\\.")[0]); - if (javaVersion <= 20) { - fieldOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array*"); - } else { fieldOffset = getFieldOffset("InstanceKlass::_fieldinfo_stream", Integer.class, "Array*"); - } } return fieldOffset; } diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/CodeAnalysis.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/CodeAnalysis.java index 6bf5ce0ec4..ba8fba93ed 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/CodeAnalysis.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/CodeAnalysis.java @@ -30,31 +30,31 @@ import java.lang.reflect.Method; import org.graalvm.collections.EconomicMap; -import org.graalvm.compiler.api.runtime.GraalJVMCICompiler; -import org.graalvm.compiler.code.CompilationResult; -import org.graalvm.compiler.core.GraalCompiler; -import org.graalvm.compiler.core.common.CompilationIdentifier; -import org.graalvm.compiler.core.common.CompilationRequestIdentifier; -import org.graalvm.compiler.core.target.Backend; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.debug.DebugDumpScope; -import org.graalvm.compiler.hotspot.HotSpotGraalOptionValues; -import org.graalvm.compiler.java.GraphBuilderPhase; -import org.graalvm.compiler.lir.asm.CompilationResultBuilderFactory; -import org.graalvm.compiler.lir.phases.LIRSuites; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; -import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins; -import org.graalvm.compiler.options.OptionKey; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.OptimisticOptimizations; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.tiers.HighTierContext; -import org.graalvm.compiler.phases.tiers.Suites; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.runtime.RuntimeProvider; +import jdk.graal.compiler.api.runtime.GraalJVMCICompiler; +import jdk.graal.compiler.code.CompilationResult; +import jdk.graal.compiler.core.GraalCompiler; +import jdk.graal.compiler.core.common.CompilationIdentifier; +import jdk.graal.compiler.core.common.CompilationRequestIdentifier; +import jdk.graal.compiler.core.target.Backend; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.debug.DebugDumpScope; +import jdk.graal.compiler.hotspot.HotSpotGraalOptionValues; +import jdk.graal.compiler.java.GraphBuilderPhase; +import jdk.graal.compiler.lir.asm.CompilationResultBuilderFactory; +import jdk.graal.compiler.lir.phases.LIRSuites; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.StructuredGraph.AllowAssumptions; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; +import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins; +import jdk.graal.compiler.options.OptionKey; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.OptimisticOptimizations; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.tiers.HighTierContext; +import jdk.graal.compiler.phases.tiers.Suites; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.runtime.RuntimeProvider; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.meta.MetaAccessProvider; @@ -62,6 +62,7 @@ import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.SpeculationLog; import jdk.vm.ci.runtime.JVMCI; +import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoInternalGraphBuilder; public class CodeAnalysis { @@ -95,7 +96,7 @@ public static StructuredGraph buildHighLevelGraalGraph(Object taskInputCode) { StructuredGraph graph = new StructuredGraph.Builder(options, getDebugContext(), AllowAssumptions.YES).speculationLog(speculationLog).method(resolvedJavaMethod) .compilationId(compilationIdentifier).build(); PhaseSuite graphBuilderSuite = new PhaseSuite<>(); - graphBuilderSuite.appendPhase(new GraphBuilderPhase(GraphBuilderConfiguration.getDefault(new Plugins(new InvocationPlugins())))); + graphBuilderSuite.appendPhase(new TornadoInternalGraphBuilder(GraphBuilderConfiguration.getDefault(new Plugins(new InvocationPlugins())))); graphBuilderSuite.apply(graph, new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.ALL)); getDebugContext().dump(DebugContext.BASIC_LEVEL, graph, "CodeToAnalyze"); return graph; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/MetaReduceTasks.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/MetaReduceTasks.java index 6e3c14e5e5..b239d3e002 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/MetaReduceTasks.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/MetaReduceTasks.java @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.HashMap; -import org.graalvm.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.StructuredGraph; /** * Mapping between the input tasks and the parameters indexes in which reduce diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/ReduceCodeAnalysis.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/ReduceCodeAnalysis.java index d0d250ec31..fa20915487 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/ReduceCodeAnalysis.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/ReduceCodeAnalysis.java @@ -32,30 +32,30 @@ import java.util.List; import java.util.Objects; -import org.graalvm.compiler.graph.Graph; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.InvokeNode; -import org.graalvm.compiler.nodes.LogicNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.MergeNode; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.StartNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.calc.BinaryArithmeticNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.calc.IntegerLessThanNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.nodes.java.ArrayLengthNode; -import org.graalvm.compiler.nodes.java.MethodCallTargetNode; -import org.graalvm.compiler.nodes.java.StoreIndexedNode; +import jdk.graal.compiler.graph.Graph; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.InvokeNode; +import jdk.graal.compiler.nodes.LogicNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.MergeNode; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.StartNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.BinaryArithmeticNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.calc.IntegerLessThanNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.nodes.java.ArrayLengthNode; +import jdk.graal.compiler.nodes.java.MethodCallTargetNode; +import jdk.graal.compiler.nodes.java.StoreIndexedNode; import uk.ac.manchester.tornado.api.annotations.Reduce; import uk.ac.manchester.tornado.api.common.PrebuiltTaskPackage; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/TaskUtils.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/TaskUtils.java index c47be0f65d..f014b94b52 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/TaskUtils.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/analyzer/TaskUtils.java @@ -33,7 +33,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import org.graalvm.compiler.bytecode.Bytecodes; +import jdk.graal.compiler.bytecode.Bytecodes; import jdk.vm.ci.meta.ConstantPool; import jdk.vm.ci.meta.JavaMethod; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/common/RuntimeUtilities.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/common/RuntimeUtilities.java index 769afa4863..4d74e3bd99 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/common/RuntimeUtilities.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/common/RuntimeUtilities.java @@ -42,11 +42,11 @@ import java.util.Arrays; import java.util.List; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.loop.BasicInductionVariable; -import org.graalvm.compiler.nodes.loop.LoopEx; -import org.graalvm.compiler.nodes.loop.LoopsData; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.loop.BasicInductionVariable; +import jdk.graal.compiler.nodes.loop.LoopEx; +import jdk.graal.compiler.nodes.loop.LoopsData; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaMethod; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/DummySnippetFactory.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/DummySnippetFactory.java index 7430edbb92..f7636949d6 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/DummySnippetFactory.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/DummySnippetFactory.java @@ -21,8 +21,8 @@ */ package uk.ac.manchester.tornado.runtime.graal; -import org.graalvm.compiler.replacements.SnippetCounter; -import org.graalvm.compiler.replacements.SnippetCounter.Group; +import jdk.graal.compiler.replacements.SnippetCounter; +import jdk.graal.compiler.replacements.SnippetCounter.Group; /* * * @author James Clarkson diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/TornadoLIRSuites.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/TornadoLIRSuites.java index ffb64321f7..e29c89ead5 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/TornadoLIRSuites.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/TornadoLIRSuites.java @@ -23,9 +23,9 @@ */ package uk.ac.manchester.tornado.runtime.graal; -import org.graalvm.compiler.lir.phases.LIRPhaseSuite; -import org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; -import org.graalvm.compiler.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; +import jdk.graal.compiler.lir.phases.LIRPhaseSuite; +import jdk.graal.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; +import jdk.graal.compiler.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoAllocationStage; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/TornadoSuites.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/TornadoSuites.java index 6298859a52..5e8e270d9b 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/TornadoSuites.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/TornadoSuites.java @@ -23,12 +23,12 @@ */ package uk.ac.manchester.tornado.runtime.graal; -import org.graalvm.compiler.lir.phases.LIRPhaseSuite; -import org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; -import org.graalvm.compiler.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.lir.phases.LIRPhaseSuite; +import jdk.graal.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; +import jdk.graal.compiler.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; import jdk.vm.ci.meta.MetaAccessProvider; import uk.ac.manchester.tornado.api.TornadoDeviceContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/backend/XPUBackend.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/backend/XPUBackend.java index 0d8765229f..04876c8b82 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/backend/XPUBackend.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/backend/XPUBackend.java @@ -21,17 +21,17 @@ */ package uk.ac.manchester.tornado.runtime.graal.backend; -import org.graalvm.compiler.core.common.CompilationIdentifier; -import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; -import org.graalvm.compiler.core.target.Backend; -import org.graalvm.compiler.lir.LIR; -import org.graalvm.compiler.lir.asm.CompilationResultBuilder; -import org.graalvm.compiler.lir.framemap.FrameMapBuilder; -import org.graalvm.compiler.lir.gen.LIRGenerationResult; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.core.common.CompilationIdentifier; +import jdk.graal.compiler.core.common.alloc.RegisterAllocationConfig; +import jdk.graal.compiler.core.target.Backend; +import jdk.graal.compiler.lir.LIR; +import jdk.graal.compiler.lir.asm.CompilationResultBuilder; +import jdk.graal.compiler.lir.framemap.FrameMapBuilder; +import jdk.graal.compiler.lir.gen.LIRGenerationResult; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.code.RegisterConfig; import jdk.vm.ci.meta.ResolvedJavaMethod; @@ -50,11 +50,6 @@ public Providers getProviders() { return super.getProviders(); } - @Override - public RegisterAllocationConfig newRegisterAllocationConfig(RegisterConfig registerConfig, String[] allocationRestrictedTo) { - return new RegisterAllocationConfig(registerConfig, allocationRestrictedTo); - } - public abstract String decodeDeopt(long value); public abstract TornadoSuitesProvider getTornadoSuites(); diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoCompilerConfiguration.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoCompilerConfiguration.java index 2336fafceb..155c0e0b41 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoCompilerConfiguration.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoCompilerConfiguration.java @@ -25,12 +25,12 @@ */ package uk.ac.manchester.tornado.runtime.graal.compiler; -import org.graalvm.compiler.lir.phases.LIRPhaseSuite; -import org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; -import org.graalvm.compiler.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.common.AddressLoweringByNodePhase; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.lir.phases.LIRPhaseSuite; +import jdk.graal.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; +import jdk.graal.compiler.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.common.AddressLoweringByNodePhase; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; import jdk.vm.ci.meta.MetaAccessProvider; import uk.ac.manchester.tornado.api.TornadoDeviceContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoCompilerIdentifier.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoCompilerIdentifier.java index 40e4f1e7bf..807eb151f9 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoCompilerIdentifier.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoCompilerIdentifier.java @@ -21,7 +21,7 @@ */ package uk.ac.manchester.tornado.runtime.graal.compiler; -import org.graalvm.compiler.core.common.CompilationIdentifier; +import jdk.graal.compiler.core.common.CompilationIdentifier; public class TornadoCompilerIdentifier implements CompilationIdentifier { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoConstantFieldProvider.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoConstantFieldProvider.java index 9dcbf643c6..1bd0dd22a1 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoConstantFieldProvider.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoConstantFieldProvider.java @@ -23,7 +23,7 @@ import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.ResolvedJavaField; -import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; +import jdk.graal.compiler.core.common.spi.ConstantFieldProvider; public class TornadoConstantFieldProvider implements ConstantFieldProvider { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoForeignCallsProvider.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoForeignCallsProvider.java index 3227607ca7..324163155d 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoForeignCallsProvider.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoForeignCallsProvider.java @@ -25,11 +25,11 @@ import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.unimplemented; -import org.graalvm.compiler.core.common.LIRKind; -import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor; -import org.graalvm.compiler.core.common.spi.ForeignCallLinkage; -import org.graalvm.compiler.core.common.spi.ForeignCallSignature; -import org.graalvm.compiler.core.common.spi.ForeignCallsProvider; +import jdk.graal.compiler.core.common.LIRKind; +import jdk.graal.compiler.core.common.spi.ForeignCallDescriptor; +import jdk.graal.compiler.core.common.spi.ForeignCallLinkage; +import jdk.graal.compiler.core.common.spi.ForeignCallSignature; +import jdk.graal.compiler.core.common.spi.ForeignCallsProvider; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoHighTier.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoHighTier.java index 2f62ad531e..b57cf86efc 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoHighTier.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoHighTier.java @@ -23,8 +23,8 @@ */ package uk.ac.manchester.tornado.runtime.graal.compiler; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoHighTierContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoInternalGraphBuilder.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoInternalGraphBuilder.java new file mode 100644 index 0000000000..0a669e867b --- /dev/null +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoInternalGraphBuilder.java @@ -0,0 +1,50 @@ +package uk.ac.manchester.tornado.runtime.graal.compiler; + +import jdk.graal.compiler.java.BytecodeParser; +import jdk.graal.compiler.java.GraphBuilderPhase; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import jdk.graal.compiler.nodes.graphbuilderconf.IntrinsicContext; +import jdk.graal.compiler.nodes.spi.CoreProviders; +import jdk.graal.compiler.phases.OptimisticOptimizations; +import jdk.vm.ci.meta.ResolvedJavaMethod; + +public class TornadoInternalGraphBuilder extends GraphBuilderPhase { + + public TornadoInternalGraphBuilder(GraphBuilderConfiguration config) { + super(config); + } + + @Override + public GraphBuilderPhase copyWithConfig(GraphBuilderConfiguration config) { + return new TornadoInternalGraphBuilder(config); + } + + @Override + protected Instance createInstance(CoreProviders providers, GraphBuilderConfiguration instanceGBConfig, OptimisticOptimizations optimisticOpts, IntrinsicContext initialIntrinsicContext) { + return new Instance(providers, instanceGBConfig, optimisticOpts, initialIntrinsicContext); + } + + public static class Instance extends GraphBuilderPhase.Instance { + + public Instance(CoreProviders providers, GraphBuilderConfiguration graphBuilderConfig, OptimisticOptimizations optimisticOpts, IntrinsicContext initialIntrinsicContext) { + super(providers, graphBuilderConfig, optimisticOpts, initialIntrinsicContext); + } + + @Override + protected BytecodeParser createBytecodeParser(StructuredGraph graph, BytecodeParser parent, ResolvedJavaMethod method, int entryBCI, IntrinsicContext intrinsicContext) { + return new TestBytecodeParser(this, graph, parent, method, entryBCI, intrinsicContext); + } + } + + /** + * A non-abstract subclass of {@link BytecodeParser} for testing purposes. + */ + static class TestBytecodeParser extends BytecodeParser { + protected TestBytecodeParser(GraphBuilderPhase.Instance graphBuilderInstance, StructuredGraph graph, BytecodeParser parent, ResolvedJavaMethod method, int entryBCI, + IntrinsicContext intrinsicContext) { + super(graphBuilderInstance, graph, parent, method, entryBCI, intrinsicContext); + } + } + +} diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoLowTier.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoLowTier.java index 6a039a2e0d..cfc38cfda2 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoLowTier.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoLowTier.java @@ -21,7 +21,7 @@ */ package uk.ac.manchester.tornado.runtime.graal.compiler; -import org.graalvm.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.PhaseSuite; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoLowTierContext; public abstract class TornadoLowTier extends PhaseSuite { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoMidTier.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoMidTier.java index 02e02f24a9..521878e2d1 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoMidTier.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoMidTier.java @@ -20,7 +20,7 @@ */ package uk.ac.manchester.tornado.runtime.graal.compiler; -import org.graalvm.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.PhaseSuite; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoMidTierContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoReplacements.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoReplacements.java index e0101f418f..1e1551ae8a 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoReplacements.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoReplacements.java @@ -23,25 +23,24 @@ */ package uk.ac.manchester.tornado.runtime.graal.compiler; -import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; -import org.graalvm.compiler.bytecode.BytecodeProvider; -import org.graalvm.compiler.java.GraphBuilderPhase; -import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; -import org.graalvm.compiler.nodes.graphbuilderconf.IntrinsicContext; -import org.graalvm.compiler.phases.OptimisticOptimizations; -import org.graalvm.compiler.phases.util.Providers; -import org.graalvm.compiler.printer.GraalDebugHandlersFactory; -import org.graalvm.compiler.replacements.ReplacementsImpl; +import jdk.graal.compiler.api.replacements.SnippetReflectionProvider; +import jdk.graal.compiler.bytecode.BytecodeProvider; +import jdk.graal.compiler.java.GraphBuilderPhase; +import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration; +import jdk.graal.compiler.nodes.graphbuilderconf.IntrinsicContext; +import jdk.graal.compiler.phases.OptimisticOptimizations; +import jdk.graal.compiler.phases.util.Providers; +import jdk.graal.compiler.printer.GraalDebugHandlersFactory; +import jdk.graal.compiler.replacements.ReplacementsImpl; import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.meta.ResolvedJavaMethod; public class TornadoReplacements extends ReplacementsImpl { - public TornadoReplacements(GraalDebugHandlersFactory graalDebugHandlersFactory, Providers providers, SnippetReflectionProvider snippetReflection, BytecodeProvider bytecodeProvider, + public TornadoReplacements(GraalDebugHandlersFactory graalDebugHandlersFactory, Providers providers, BytecodeProvider bytecodeProvider, TargetDescription target) { - super(graalDebugHandlersFactory, providers, snippetReflection, bytecodeProvider, target); - } + super(graalDebugHandlersFactory, providers, bytecodeProvider, target); } @Override protected GraphMaker createGraphMaker(ResolvedJavaMethod substitute, ResolvedJavaMethod original) { @@ -50,7 +49,7 @@ protected GraphMaker createGraphMaker(ResolvedJavaMethod substitute, ResolvedJav @Override protected GraphBuilderPhase.Instance createGraphBuilder(Providers providers1, GraphBuilderConfiguration graphBuilderConfig, OptimisticOptimizations optimisticOpts, IntrinsicContext initialIntrinsicContext) { - return new GraphBuilderPhase.Instance(providers1, graphBuilderConfig, optimisticOpts, initialIntrinsicContext); + return new TornadoInternalGraphBuilder.Instance(providers1, graphBuilderConfig, optimisticOpts, initialIntrinsicContext); } }; } diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoSketchTier.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoSketchTier.java index 7215d7b05a..429107e9a5 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoSketchTier.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoSketchTier.java @@ -23,17 +23,13 @@ */ package uk.ac.manchester.tornado.runtime.graal.compiler; -import static org.graalvm.compiler.core.common.GraalOptions.ConditionalElimination; -import static org.graalvm.compiler.core.phases.HighTier.Options.Inline; -import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; - -import org.graalvm.compiler.options.OptionValues; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.common.CanonicalizerPhase; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; -import org.graalvm.compiler.phases.common.IterativeConditionalEliminationPhase; -import org.graalvm.compiler.phases.common.inlining.InliningPhase; -import org.graalvm.compiler.phases.common.inlining.policy.InliningPolicy; +import jdk.graal.compiler.options.OptionValues; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.common.CanonicalizerPhase; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.phases.common.IterativeConditionalEliminationPhase; +import jdk.graal.compiler.phases.common.inlining.InliningPhase; +import jdk.graal.compiler.phases.common.inlining.policy.InliningPolicy; import uk.ac.manchester.tornado.runtime.common.TornadoOptions; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoHalfFloatFixedGuardElimination; @@ -51,6 +47,10 @@ import uk.ac.manchester.tornado.runtime.graal.phases.sketcher.TornadoReduceReplacement; import uk.ac.manchester.tornado.runtime.graal.phases.sketcher.TornadoStampResolver; +import static jdk.graal.compiler.core.common.GraalOptions.ConditionalElimination; +import static jdk.graal.compiler.core.phases.HighTier.Options.Inline; +import static jdk.graal.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; + public class TornadoSketchTier extends PhaseSuite { protected final CanonicalizerPhase.CustomSimplification customSimplification; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoSnippetReflectionProvider.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoSnippetReflectionProvider.java index 86233beb0c..27d7ac3b4a 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoSnippetReflectionProvider.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoSnippetReflectionProvider.java @@ -28,7 +28,7 @@ import java.lang.reflect.Executable; import java.lang.reflect.Field; -import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; +import jdk.graal.compiler.api.replacements.SnippetReflectionProvider; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoSuitesProvider.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoSuitesProvider.java index f494f34355..4567a52d3e 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoSuitesProvider.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/compiler/TornadoSuitesProvider.java @@ -23,8 +23,8 @@ */ package uk.ac.manchester.tornado.runtime.graal.compiler; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.tiers.HighTierContext; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.tiers.HighTierContext; public interface TornadoSuitesProvider { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/AbstractParallelNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/AbstractParallelNode.java index be26969c45..c22cee190d 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/AbstractParallelNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/AbstractParallelNode.java @@ -22,11 +22,11 @@ package uk.ac.manchester.tornado.runtime.graal.nodes; import jdk.vm.ci.meta.JavaKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; @NodeInfo public abstract class AbstractParallelNode extends FloatingNode implements Comparable { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/AddHalfFloatNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/AddHalfFloatNode.java index ae182fa02b..5c343ae3a6 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/AddHalfFloatNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/AddHalfFloatNode.java @@ -22,11 +22,11 @@ package uk.ac.manchester.tornado.runtime.graal.nodes; import jdk.vm.ci.meta.JavaKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; @NodeInfo(shortName = "FLOAT16(+)") public class AddHalfFloatNode extends ValueNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/AtomicAccessNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/AtomicAccessNode.java index 6c9484ca57..f6f117ecb5 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/AtomicAccessNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/AtomicAccessNode.java @@ -23,12 +23,12 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; @NodeInfo(shortName = "Atomic") public class AtomicAccessNode extends FloatingNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/DivHalfFloatNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/DivHalfFloatNode.java index 86229c4b52..605cca8266 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/DivHalfFloatNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/DivHalfFloatNode.java @@ -22,11 +22,11 @@ package uk.ac.manchester.tornado.runtime.graal.nodes; import jdk.vm.ci.meta.JavaKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; @NodeInfo(shortName = "FLOAT16(/)") public class DivHalfFloatNode extends ValueNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/GetGroupIdFixedWithNextNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/GetGroupIdFixedWithNextNode.java index 171c9e44b6..ce416fe2c2 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/GetGroupIdFixedWithNextNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/GetGroupIdFixedWithNextNode.java @@ -21,13 +21,13 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.Lowerable; -import org.graalvm.compiler.nodes.spi.LoweringTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.Lowerable; +import jdk.graal.compiler.nodes.spi.LoweringTool; import uk.ac.manchester.tornado.api.KernelContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/GlobalGroupSizeFixedWithNextNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/GlobalGroupSizeFixedWithNextNode.java index 6ef648e6a8..5c9999a492 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/GlobalGroupSizeFixedWithNextNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/GlobalGroupSizeFixedWithNextNode.java @@ -21,13 +21,13 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.Lowerable; -import org.graalvm.compiler.nodes.spi.LoweringTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.Lowerable; +import jdk.graal.compiler.nodes.spi.LoweringTool; import uk.ac.manchester.tornado.api.KernelContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/HalfFloatPlaceholder.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/HalfFloatPlaceholder.java index 9b232f03b5..1727d85463 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/HalfFloatPlaceholder.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/HalfFloatPlaceholder.java @@ -21,10 +21,10 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/LocalGroupSizeFixedWithNextNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/LocalGroupSizeFixedWithNextNode.java index f6a5f076d4..78a098b382 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/LocalGroupSizeFixedWithNextNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/LocalGroupSizeFixedWithNextNode.java @@ -21,13 +21,13 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.Lowerable; -import org.graalvm.compiler.nodes.spi.LoweringTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.Lowerable; +import jdk.graal.compiler.nodes.spi.LoweringTool; import uk.ac.manchester.tornado.api.KernelContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/MultHalfFloatNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/MultHalfFloatNode.java index 81ea3f97cd..cfe156336a 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/MultHalfFloatNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/MultHalfFloatNode.java @@ -22,11 +22,11 @@ package uk.ac.manchester.tornado.runtime.graal.nodes; import jdk.vm.ci.meta.JavaKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; @NodeInfo(shortName = "FLOAT16(*)") public class MultHalfFloatNode extends ValueNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/NewArrayNonVirtualizableNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/NewArrayNonVirtualizableNode.java index 7f9a9f8bac..e2fc300600 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/NewArrayNonVirtualizableNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/NewArrayNonVirtualizableNode.java @@ -21,14 +21,14 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.core.common.type.TypeReference; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FrameState; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.java.AbstractNewArrayNode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.core.common.type.TypeReference; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FrameState; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.java.AbstractNewArrayNode; import jdk.vm.ci.meta.ResolvedJavaType; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/NewHalfFloatInstance.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/NewHalfFloatInstance.java index 4dc1496ed1..00f8af3cb4 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/NewHalfFloatInstance.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/NewHalfFloatInstance.java @@ -21,12 +21,12 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; import jdk.vm.ci.meta.JavaKind; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValueNode; @NodeInfo public class NewHalfFloatInstance extends FixedWithNextNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/PanamaPrivateMemoryNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/PanamaPrivateMemoryNode.java index aae2efe93f..01bed950f5 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/PanamaPrivateMemoryNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/PanamaPrivateMemoryNode.java @@ -20,11 +20,11 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; import jdk.vm.ci.meta.ResolvedJavaType; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ParallelOffsetNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ParallelOffsetNode.java index 9e4f3607f3..c8966f5775 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ParallelOffsetNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ParallelOffsetNode.java @@ -23,9 +23,9 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; @NodeInfo(nameTemplate = "Offset") public class ParallelOffsetNode extends AbstractParallelNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ParallelRangeNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ParallelRangeNode.java index 62ce1ba80c..c659d168b5 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ParallelRangeNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ParallelRangeNode.java @@ -23,11 +23,11 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; @NodeInfo(nameTemplate = "Range") public class ParallelRangeNode extends AbstractParallelNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ParallelStrideNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ParallelStrideNode.java index 1dafa50a7d..d37e75c994 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ParallelStrideNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ParallelStrideNode.java @@ -23,9 +23,9 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; @NodeInfo(nameTemplate = "Stride") public class ParallelStrideNode extends AbstractParallelNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/StoreAtomicIndexedNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/StoreAtomicIndexedNode.java index 9001c28fe2..42e9ecb071 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/StoreAtomicIndexedNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/StoreAtomicIndexedNode.java @@ -25,17 +25,17 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FrameState; -import org.graalvm.compiler.nodes.StateSplit; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.extended.GuardingNode; -import org.graalvm.compiler.nodes.java.AccessIndexedNode; -import org.graalvm.compiler.nodes.spi.Lowerable; -import org.graalvm.compiler.nodes.spi.Virtualizable; -import org.graalvm.compiler.nodes.spi.VirtualizerTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FrameState; +import jdk.graal.compiler.nodes.StateSplit; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.extended.GuardingNode; +import jdk.graal.compiler.nodes.java.AccessIndexedNode; +import jdk.graal.compiler.nodes.spi.Lowerable; +import jdk.graal.compiler.nodes.spi.Virtualizable; +import jdk.graal.compiler.nodes.spi.VirtualizerTool; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/StoreAtomicIndexedNodeExtension.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/StoreAtomicIndexedNodeExtension.java index 2a10848a7d..f65c2f389a 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/StoreAtomicIndexedNodeExtension.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/StoreAtomicIndexedNodeExtension.java @@ -12,7 +12,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * @@ -26,14 +26,14 @@ package uk.ac.manchester.tornado.runtime.graal.nodes; -import static org.graalvm.compiler.nodeinfo.InputType.State; +import static jdk.graal.compiler.nodeinfo.InputType.State; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FrameState; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FrameState; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; @NodeInfo(nameTemplate = "AtomicIndexedStoreExtension") public class StoreAtomicIndexedNodeExtension extends FloatingNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/SubHalfFloatNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/SubHalfFloatNode.java index a0576f1e28..d0780667c1 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/SubHalfFloatNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/SubHalfFloatNode.java @@ -22,11 +22,11 @@ package uk.ac.manchester.tornado.runtime.graal.nodes; import jdk.vm.ci.meta.JavaKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; @NodeInfo(shortName = "FLOAT16(-)") public class SubHalfFloatNode extends ValueNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ThreadIdFixedWithNextNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ThreadIdFixedWithNextNode.java index 458b7deef9..8e545b168c 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ThreadIdFixedWithNextNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ThreadIdFixedWithNextNode.java @@ -21,13 +21,13 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.Lowerable; -import org.graalvm.compiler.nodes.spi.LoweringTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.Lowerable; +import jdk.graal.compiler.nodes.spi.LoweringTool; import uk.ac.manchester.tornado.api.KernelContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ThreadLocalIdFixedWithNextNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ThreadLocalIdFixedWithNextNode.java index e1bcb694d4..3bea13019c 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ThreadLocalIdFixedWithNextNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/ThreadLocalIdFixedWithNextNode.java @@ -21,13 +21,13 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.spi.Lowerable; -import org.graalvm.compiler.nodes.spi.LoweringTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.spi.Lowerable; +import jdk.graal.compiler.nodes.spi.LoweringTool; import uk.ac.manchester.tornado.api.KernelContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoDirectCallTargetNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoDirectCallTargetNode.java index 5ca8ee97f3..706b77d5d3 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoDirectCallTargetNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoDirectCallTargetNode.java @@ -24,11 +24,11 @@ import jdk.vm.ci.code.CallingConvention.Type; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.ResolvedJavaMethod; -import org.graalvm.compiler.core.common.type.StampPair; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.DirectCallTargetNode; -import org.graalvm.compiler.nodes.ValueNode; +import jdk.graal.compiler.core.common.type.StampPair; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.DirectCallTargetNode; +import jdk.graal.compiler.nodes.ValueNode; @NodeInfo public class TornadoDirectCallTargetNode extends DirectCallTargetNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoLoopsData.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoLoopsData.java index 4c718a4dbf..bcd6f0dd02 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoLoopsData.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoLoopsData.java @@ -21,8 +21,8 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.loop.LoopsData; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.loop.LoopsData; public class TornadoLoopsData extends LoopsData { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoReduceAddNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoReduceAddNode.java index bfd14fb50f..2404c0c280 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoReduceAddNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoReduceAddNode.java @@ -23,13 +23,13 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoReduceMulNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoReduceMulNode.java index 26a1df597f..ff25d1499b 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoReduceMulNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoReduceMulNode.java @@ -10,7 +10,7 @@ * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * @@ -23,15 +23,15 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; +import static jdk.graal.compiler.nodeinfo.NodeCycles.CYCLES_2; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoReduceSubNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoReduceSubNode.java index 855af34729..865516cdca 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoReduceSubNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/TornadoReduceSubNode.java @@ -23,13 +23,13 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.SubNode; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.ArithmeticLIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.SubNode; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/VectorHalfRead.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/VectorHalfRead.java index d1329ef227..7579bf1476 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/VectorHalfRead.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/VectorHalfRead.java @@ -22,10 +22,10 @@ package uk.ac.manchester.tornado.runtime.graal.nodes; import jdk.vm.ci.meta.JavaKind; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; @NodeInfo public class VectorHalfRead extends FixedWithNextNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/WriteAtomicNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/WriteAtomicNode.java index 480d4c30d2..2237df5616 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/WriteAtomicNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/WriteAtomicNode.java @@ -19,15 +19,15 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.FrameState; -import org.graalvm.compiler.nodes.StateSplit; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.spi.Lowerable; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.FrameState; +import jdk.graal.compiler.nodes.StateSplit; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.spi.Lowerable; import jdk.vm.ci.meta.JavaKind; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/WriteAtomicNodeExtension.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/WriteAtomicNodeExtension.java index a446fb4e7e..3b96c2cb79 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/WriteAtomicNodeExtension.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/WriteAtomicNodeExtension.java @@ -1,13 +1,13 @@ package uk.ac.manchester.tornado.runtime.graal.nodes; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.FrameState; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; - -import static org.graalvm.compiler.nodeinfo.InputType.State; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.FrameState; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; + +import static jdk.graal.compiler.nodeinfo.InputType.State; @NodeInfo(nameTemplate = "AtomicWriteExtension") public class WriteAtomicNodeExtension extends FloatingNode { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/calc/TornadoAddressArithmeticNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/calc/TornadoAddressArithmeticNode.java index 0337921c2f..e4df6f325b 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/calc/TornadoAddressArithmeticNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/calc/TornadoAddressArithmeticNode.java @@ -21,15 +21,15 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes.calc; -import org.graalvm.compiler.core.common.type.StampFactory; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.FloatingNode; -import org.graalvm.compiler.nodes.spi.LIRLowerable; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.core.common.type.StampFactory; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/interfaces/Floatable.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/interfaces/Floatable.java index 102f3104ba..d3e9ee7423 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/interfaces/Floatable.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/interfaces/Floatable.java @@ -22,7 +22,7 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes.interfaces; -import org.graalvm.compiler.nodes.calc.FloatingNode; +import jdk.graal.compiler.nodes.calc.FloatingNode; public interface Floatable { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/interfaces/LogicalCompareNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/interfaces/LogicalCompareNode.java index 35cf965a41..a1e280193f 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/interfaces/LogicalCompareNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/interfaces/LogicalCompareNode.java @@ -21,7 +21,7 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes.interfaces; -import org.graalvm.compiler.nodes.spi.LIRLowerable; +import jdk.graal.compiler.nodes.spi.LIRLowerable; public interface LogicalCompareNode extends LIRLowerable { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/logic/BinaryLogicalNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/logic/BinaryLogicalNode.java index 457d59dbd3..0f6485e002 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/logic/BinaryLogicalNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/logic/BinaryLogicalNode.java @@ -21,16 +21,16 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes.logic; -import org.graalvm.compiler.graph.IterableNodeType; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.LogicNode; -import org.graalvm.compiler.nodes.spi.Canonicalizable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.graph.IterableNodeType; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.LogicNode; +import jdk.graal.compiler.nodes.spi.Canonicalizable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.runtime.graal.nodes.interfaces.LogicalCompareNode; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/logic/UnaryLogicalNode.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/logic/UnaryLogicalNode.java index e361888fb0..4f81e0ac58 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/logic/UnaryLogicalNode.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/nodes/logic/UnaryLogicalNode.java @@ -21,16 +21,16 @@ */ package uk.ac.manchester.tornado.runtime.graal.nodes.logic; -import org.graalvm.compiler.graph.IterableNodeType; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.NodeClass; -import org.graalvm.compiler.lir.gen.LIRGeneratorTool; -import org.graalvm.compiler.nodeinfo.InputType; -import org.graalvm.compiler.nodeinfo.NodeInfo; -import org.graalvm.compiler.nodes.LogicNode; -import org.graalvm.compiler.nodes.spi.Canonicalizable; -import org.graalvm.compiler.nodes.spi.CanonicalizerTool; -import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; +import jdk.graal.compiler.graph.IterableNodeType; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.NodeClass; +import jdk.graal.compiler.lir.gen.LIRGeneratorTool; +import jdk.graal.compiler.nodeinfo.InputType; +import jdk.graal.compiler.nodeinfo.NodeInfo; +import jdk.graal.compiler.nodes.LogicNode; +import jdk.graal.compiler.nodes.spi.Canonicalizable; +import jdk.graal.compiler.nodes.spi.CanonicalizerTool; +import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.Value; import uk.ac.manchester.tornado.runtime.graal.nodes.interfaces.LogicalCompareNode; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoAllocationStage.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoAllocationStage.java index 031b1612f2..0225c53fb0 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoAllocationStage.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoAllocationStage.java @@ -21,8 +21,8 @@ */ package uk.ac.manchester.tornado.runtime.graal.phases; -import org.graalvm.compiler.lir.phases.AllocationPhase.AllocationContext; -import org.graalvm.compiler.lir.phases.LIRPhaseSuite; +import jdk.graal.compiler.lir.phases.AllocationPhase.AllocationContext; +import jdk.graal.compiler.lir.phases.LIRPhaseSuite; public class TornadoAllocationStage extends LIRPhaseSuite { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoHalfFloatFixedGuardElimination.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoHalfFloatFixedGuardElimination.java index edcb4f53bd..617c9279f9 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoHalfFloatFixedGuardElimination.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoHalfFloatFixedGuardElimination.java @@ -21,20 +21,19 @@ */ package uk.ac.manchester.tornado.runtime.graal.phases; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.FixedGuardNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.IsNullNode; +import jdk.graal.compiler.phases.BasePhase; +import uk.ac.manchester.tornado.runtime.graal.nodes.HalfFloatPlaceholder; + import java.util.ArrayList; import java.util.Optional; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.FixedGuardNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.IsNullNode; -import org.graalvm.compiler.phases.BasePhase; - -import uk.ac.manchester.tornado.runtime.graal.nodes.HalfFloatPlaceholder; - public class TornadoHalfFloatFixedGuardElimination extends BasePhase { private static void deleteFixed(Node node) { @@ -62,16 +61,24 @@ public Optional notApplicableTo(GraphState graphState) { protected void run(StructuredGraph graph, TornadoSketchTierContext context) { ArrayList nodesToBeDeleted = new ArrayList(); for (HalfFloatPlaceholder placeholderNode : graph.getNodes().filter(HalfFloatPlaceholder.class)) { - if (placeholderNode.getInput() instanceof PiNode placeholderInput) { - ValueNode halfFloatValue = placeholderInput.object(); - FixedGuardNode placeholderGuard = (FixedGuardNode) placeholderInput.getGuard(); - if (placeholderGuard.inputs().filter(IsNullNode.class).isNotEmpty()) { - IsNullNode isNullNode = placeholderGuard.inputs().filter(IsNullNode.class).first(); - nodesToBeDeleted.add(isNullNode); + if (placeholderNode.getInput() instanceof PiNode placeholderPi) { + if (placeholderPi.object() instanceof ValueNode valueNodeToKeep) { + if (valueNodeToKeep.usages().filter(IsNullNode.class).isNotEmpty()) { + IsNullNode isNullNode = valueNodeToKeep.usages().filter(IsNullNode.class).first(); + + if (isNullNode.usages().first() instanceof FixedGuardNode) { + nodesToBeDeleted.add(placeholderPi); + } + } + + FixedGuardNode placeholderGuard = (FixedGuardNode) placeholderPi.getGuard(); + if (placeholderGuard.inputs().filter(IsNullNode.class).isNotEmpty()) { + IsNullNode isNullNode = placeholderGuard.inputs().filter(IsNullNode.class).first(); + nodesToBeDeleted.add(isNullNode); + } + deleteFixed(placeholderGuard); + placeholderNode.setInput(valueNodeToKeep); } - deleteFixed(placeholderGuard); - placeholderNode.setInput(halfFloatValue); - nodesToBeDeleted.add(placeholderInput); } } diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoHighTierContext.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoHighTierContext.java index b8a543359c..0920775fdb 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoHighTierContext.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoHighTierContext.java @@ -21,10 +21,10 @@ */ package uk.ac.manchester.tornado.runtime.graal.phases; -import org.graalvm.compiler.phases.OptimisticOptimizations; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.tiers.HighTierContext; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.phases.OptimisticOptimizations; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.tiers.HighTierContext; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.runtime.common.BatchCompilationConfig; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoInliningPolicy.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoInliningPolicy.java index f9ace3ca97..f1bd0e9337 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoInliningPolicy.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoInliningPolicy.java @@ -21,7 +21,7 @@ */ package uk.ac.manchester.tornado.runtime.graal.phases; -import org.graalvm.compiler.phases.common.inlining.policy.InliningPolicy; +import jdk.graal.compiler.phases.common.inlining.policy.InliningPolicy; public interface TornadoInliningPolicy extends InliningPolicy { } diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoLowTierContext.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoLowTierContext.java index 9db42072a1..80d69efe9b 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoLowTierContext.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoLowTierContext.java @@ -21,9 +21,10 @@ */ package uk.ac.manchester.tornado.runtime.graal.phases; -import org.graalvm.compiler.phases.tiers.LowTierContext; -import org.graalvm.compiler.phases.tiers.TargetProvider; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.phases.tiers.LowTierContext; +import jdk.graal.compiler.phases.tiers.TargetProvider; +import jdk.graal.compiler.phases.util.Providers; + import uk.ac.manchester.tornado.runtime.tasks.meta.TaskDataContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoMidTierContext.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoMidTierContext.java index e2fdaa5e47..6734f5439a 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoMidTierContext.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoMidTierContext.java @@ -21,10 +21,10 @@ */ package uk.ac.manchester.tornado.runtime.graal.phases; -import org.graalvm.compiler.phases.OptimisticOptimizations; -import org.graalvm.compiler.phases.tiers.MidTierContext; -import org.graalvm.compiler.phases.tiers.TargetProvider; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.phases.OptimisticOptimizations; +import jdk.graal.compiler.phases.tiers.MidTierContext; +import jdk.graal.compiler.phases.tiers.TargetProvider; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.meta.ProfilingInfo; import jdk.vm.ci.meta.ResolvedJavaMethod; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoSketchTierContext.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoSketchTierContext.java index c961cb84ad..efa7f43b3b 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoSketchTierContext.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/TornadoSketchTierContext.java @@ -21,10 +21,10 @@ */ package uk.ac.manchester.tornado.runtime.graal.phases; -import org.graalvm.compiler.phases.OptimisticOptimizations; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.tiers.HighTierContext; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.phases.OptimisticOptimizations; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.tiers.HighTierContext; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.api.common.Access; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoApiReplacement.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoApiReplacement.java index 3f056290b5..d2a5bcf6d2 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoApiReplacement.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoApiReplacement.java @@ -29,18 +29,18 @@ import java.util.Map; import java.util.Optional; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FrameState; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.IntegerLessThanNode; -import org.graalvm.compiler.nodes.loop.InductionVariable; -import org.graalvm.compiler.nodes.loop.LoopEx; -import org.graalvm.compiler.nodes.loop.LoopsData; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FrameState; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.IntegerLessThanNode; +import jdk.graal.compiler.nodes.loop.InductionVariable; +import jdk.graal.compiler.nodes.loop.LoopEx; +import jdk.graal.compiler.nodes.loop.LoopsData; +import jdk.graal.compiler.phases.BasePhase; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.api.common.TornadoDevice; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoAutoParalleliser.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoAutoParalleliser.java index 37fb0dc73a..6bac136882 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoAutoParalleliser.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoAutoParalleliser.java @@ -30,19 +30,19 @@ import java.util.Set; import org.graalvm.collections.EconomicMap; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.calc.IntegerLessThanNode; -import org.graalvm.compiler.nodes.loop.InductionVariable; -import org.graalvm.compiler.nodes.loop.LoopEx; -import org.graalvm.compiler.nodes.loop.LoopsData; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.calc.IntegerLessThanNode; +import jdk.graal.compiler.nodes.loop.InductionVariable; +import jdk.graal.compiler.nodes.loop.LoopEx; +import jdk.graal.compiler.nodes.loop.LoopsData; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.api.exceptions.TornadoBailoutRuntimeException; import uk.ac.manchester.tornado.api.exceptions.TornadoCompilationException; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoBatchFunctionAnalysis.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoBatchFunctionAnalysis.java index 41fae94f34..03388f673b 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoBatchFunctionAnalysis.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoBatchFunctionAnalysis.java @@ -21,16 +21,16 @@ */ package uk.ac.manchester.tornado.runtime.graal.phases.sketcher; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.FrameState; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValuePhiNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.java.LoadIndexedNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.FrameState; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValuePhiNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.java.LoadIndexedNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoSketchTierContext; import java.util.HashSet; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoDataflowAnalysis.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoDataflowAnalysis.java index 5668c9dfa1..fb2db88838 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoDataflowAnalysis.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoDataflowAnalysis.java @@ -28,32 +28,32 @@ import java.util.Optional; import java.util.Queue; -import org.graalvm.compiler.core.common.type.ObjectStamp; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.BeginNode; -import org.graalvm.compiler.nodes.BinaryOpLogicNode; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.StartNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryArithmeticNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.java.LoadFieldNode; -import org.graalvm.compiler.nodes.java.LoadIndexedNode; -import org.graalvm.compiler.nodes.java.StoreFieldNode; -import org.graalvm.compiler.nodes.java.StoreIndexedNode; -import org.graalvm.compiler.nodes.memory.ReadNode; -import org.graalvm.compiler.nodes.memory.WriteNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.core.common.type.ObjectStamp; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.BeginNode; +import jdk.graal.compiler.nodes.BinaryOpLogicNode; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.StartNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryArithmeticNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.java.LoadFieldNode; +import jdk.graal.compiler.nodes.java.LoadIndexedNode; +import jdk.graal.compiler.nodes.java.StoreFieldNode; +import jdk.graal.compiler.nodes.java.StoreIndexedNode; +import jdk.graal.compiler.nodes.memory.ReadNode; +import jdk.graal.compiler.nodes.memory.WriteNode; +import jdk.graal.compiler.nodes.memory.address.AddressNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.BasePhase; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.MetaAccessProvider; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoFullInliningPolicy.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoFullInliningPolicy.java index 4b5fe786b1..4b6156d07a 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoFullInliningPolicy.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoFullInliningPolicy.java @@ -21,10 +21,10 @@ */ package uk.ac.manchester.tornado.runtime.graal.phases.sketcher; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.spi.Replacements; -import org.graalvm.compiler.phases.common.inlining.info.InlineInfo; -import org.graalvm.compiler.phases.common.inlining.walker.MethodInvocation; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.spi.Replacements; +import jdk.graal.compiler.phases.common.inlining.info.InlineInfo; +import jdk.graal.compiler.phases.common.inlining.walker.MethodInvocation; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoInliningPolicy; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoKernelContextReplacement.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoKernelContextReplacement.java index 22203f0c4e..3f2782057b 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoKernelContextReplacement.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoKernelContextReplacement.java @@ -26,14 +26,14 @@ import java.util.ArrayList; import java.util.Optional; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.extended.UnboxNode; -import org.graalvm.compiler.nodes.java.LoadFieldNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.extended.UnboxNode; +import jdk.graal.compiler.nodes.java.LoadFieldNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.api.KernelContext; import uk.ac.manchester.tornado.api.exceptions.TornadoRuntimeException; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoNativeTypeElimination.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoNativeTypeElimination.java index 04f220537b..758d8d060d 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoNativeTypeElimination.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoNativeTypeElimination.java @@ -25,22 +25,22 @@ import java.util.ArrayList; import java.util.Optional; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.ConstantNode; -import org.graalvm.compiler.nodes.FixedGuardNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.calc.IsNullNode; -import org.graalvm.compiler.nodes.calc.PointerEqualsNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.extended.LoadHubNode; -import org.graalvm.compiler.nodes.java.InstanceOfNode; -import org.graalvm.compiler.nodes.java.LoadFieldNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.ConstantNode; +import jdk.graal.compiler.nodes.FixedGuardNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.calc.IsNullNode; +import jdk.graal.compiler.nodes.calc.PointerEqualsNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.extended.LoadHubNode; +import jdk.graal.compiler.nodes.java.InstanceOfNode; +import jdk.graal.compiler.nodes.java.LoadFieldNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.api.exceptions.TornadoRuntimeException; import uk.ac.manchester.tornado.api.internal.annotations.SegmentElementSize; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoNumericPromotionPhase.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoNumericPromotionPhase.java index e7dfeb6a50..c08741484b 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoNumericPromotionPhase.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoNumericPromotionPhase.java @@ -23,17 +23,17 @@ import java.util.Optional; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.BinaryArithmeticNode; -import org.graalvm.compiler.nodes.calc.FixedBinaryNode; -import org.graalvm.compiler.nodes.calc.NarrowNode; -import org.graalvm.compiler.nodes.calc.ShiftNode; -import org.graalvm.compiler.nodes.calc.SignExtendNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.BinaryArithmeticNode; +import jdk.graal.compiler.nodes.calc.FixedBinaryNode; +import jdk.graal.compiler.nodes.calc.NarrowNode; +import jdk.graal.compiler.nodes.calc.ShiftNode; +import jdk.graal.compiler.nodes.calc.SignExtendNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoSketchTierContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoPanamaPrivateMemory.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoPanamaPrivateMemory.java index caa2c86774..de54ccbee7 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoPanamaPrivateMemory.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoPanamaPrivateMemory.java @@ -23,12 +23,12 @@ import java.util.Optional; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.java.NewArrayNode; -import org.graalvm.compiler.nodes.java.NewInstanceNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.java.NewArrayNode; +import jdk.graal.compiler.nodes.java.NewInstanceNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.graal.nodes.PanamaPrivateMemoryNode; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoSketchTierContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoPartialInliningPolicy.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoPartialInliningPolicy.java index 58c04f887f..959afa7201 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoPartialInliningPolicy.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoPartialInliningPolicy.java @@ -23,15 +23,15 @@ */ package uk.ac.manchester.tornado.runtime.graal.phases.sketcher; -import static org.graalvm.compiler.core.common.GraalOptions.MaximumDesiredSize; -import static org.graalvm.compiler.core.common.GraalOptions.MaximumInliningSize; +import static jdk.graal.compiler.core.common.GraalOptions.MaximumDesiredSize; +import static jdk.graal.compiler.core.common.GraalOptions.MaximumInliningSize; import static uk.ac.manchester.tornado.runtime.TornadoCoreRuntime.getDebugContext; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.spi.Replacements; -import org.graalvm.compiler.phases.common.inlining.InliningUtil; -import org.graalvm.compiler.phases.common.inlining.info.InlineInfo; -import org.graalvm.compiler.phases.common.inlining.walker.MethodInvocation; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.spi.Replacements; +import jdk.graal.compiler.phases.common.inlining.InliningUtil; +import jdk.graal.compiler.phases.common.inlining.info.InlineInfo; +import jdk.graal.compiler.phases.common.inlining.walker.MethodInvocation; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoInliningPolicy; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoReduceReplacement.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoReduceReplacement.java index 534fff4b9c..cf6bd3f5b8 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoReduceReplacement.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoReduceReplacement.java @@ -26,35 +26,35 @@ import java.lang.annotation.Annotation; import java.util.Optional; -import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.graph.iterators.NodeIterable; -import org.graalvm.compiler.nodes.EndNode; -import org.graalvm.compiler.nodes.FixedNode; -import org.graalvm.compiler.nodes.FixedWithNextNode; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.IfNode; -import org.graalvm.compiler.nodes.LoopBeginNode; -import org.graalvm.compiler.nodes.MergeNode; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.PiNode; -import org.graalvm.compiler.nodes.StartNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.nodes.calc.AddNode; -import org.graalvm.compiler.nodes.calc.BinaryArithmeticNode; -import org.graalvm.compiler.nodes.calc.BinaryNode; -import org.graalvm.compiler.nodes.calc.CompareNode; -import org.graalvm.compiler.nodes.calc.MulNode; -import org.graalvm.compiler.nodes.calc.SubNode; -import org.graalvm.compiler.nodes.extended.JavaReadNode; -import org.graalvm.compiler.nodes.extended.JavaWriteNode; -import org.graalvm.compiler.nodes.java.LoadFieldNode; -import org.graalvm.compiler.nodes.java.LoadIndexedNode; -import org.graalvm.compiler.nodes.java.StoreFieldNode; -import org.graalvm.compiler.nodes.java.StoreIndexedNode; -import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.graph.Node; +import jdk.graal.compiler.graph.iterators.NodeIterable; +import jdk.graal.compiler.nodes.EndNode; +import jdk.graal.compiler.nodes.FixedNode; +import jdk.graal.compiler.nodes.FixedWithNextNode; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.IfNode; +import jdk.graal.compiler.nodes.LoopBeginNode; +import jdk.graal.compiler.nodes.MergeNode; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.PiNode; +import jdk.graal.compiler.nodes.StartNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.nodes.calc.AddNode; +import jdk.graal.compiler.nodes.calc.BinaryArithmeticNode; +import jdk.graal.compiler.nodes.calc.BinaryNode; +import jdk.graal.compiler.nodes.calc.CompareNode; +import jdk.graal.compiler.nodes.calc.MulNode; +import jdk.graal.compiler.nodes.calc.SubNode; +import jdk.graal.compiler.nodes.extended.JavaReadNode; +import jdk.graal.compiler.nodes.extended.JavaWriteNode; +import jdk.graal.compiler.nodes.java.LoadFieldNode; +import jdk.graal.compiler.nodes.java.LoadIndexedNode; +import jdk.graal.compiler.nodes.java.StoreFieldNode; +import jdk.graal.compiler.nodes.java.StoreIndexedNode; +import jdk.graal.compiler.nodes.memory.address.OffsetAddressNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.api.annotations.Reduce; import uk.ac.manchester.tornado.api.exceptions.TornadoRuntimeException; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoStampResolver.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoStampResolver.java index d717ef8383..44ebf4b9cb 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoStampResolver.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graal/phases/sketcher/TornadoStampResolver.java @@ -25,13 +25,13 @@ import java.util.Optional; -import org.graalvm.compiler.core.common.type.Stamp; -import org.graalvm.compiler.nodes.GraphState; -import org.graalvm.compiler.nodes.NodeView; -import org.graalvm.compiler.nodes.PhiNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.phases.BasePhase; +import jdk.graal.compiler.core.common.type.Stamp; +import jdk.graal.compiler.nodes.GraphState; +import jdk.graal.compiler.nodes.NodeView; +import jdk.graal.compiler.nodes.PhiNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.phases.BasePhase; import uk.ac.manchester.tornado.runtime.graal.phases.TornadoSketchTierContext; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graph/TornadoExecutionContext.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graph/TornadoExecutionContext.java index 2d50558ec3..b41b1ea26d 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graph/TornadoExecutionContext.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/graph/TornadoExecutionContext.java @@ -509,15 +509,18 @@ private String canonicalizeId(String id) { public TornadoXPUDevice getDeviceForTask(String id) { TornadoDevice device = getTask(id).getDevice(); + TornadoXPUDevice tornadoDevice; if (device instanceof TornadoXPUDevice) { tornadoDevice = (TornadoXPUDevice) device; } else { throw new RuntimeException("Device " + device.getClass() + " not supported yet"); } + return getTask(id) == null ? null : tornadoDevice; } + public String getId() { return name; } @@ -574,6 +577,7 @@ public void dumpExecutionContextMeta() { final String ansiYellow = "\u001B[33m"; final String ansiPurple = "\u001B[35m"; final String ansiGreen = "\u001B[32m"; + System.out.println("-----------------------------------"); System.out.println(ansiCyan + "Device Table:" + ansiReset); for (int i = 0; i < devices.size(); i++) { diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/interpreter/TornadoVMInterpreter.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/interpreter/TornadoVMInterpreter.java index 3fd24fce84..c61703962f 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/interpreter/TornadoVMInterpreter.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/interpreter/TornadoVMInterpreter.java @@ -245,6 +245,7 @@ private Event execute(boolean isWarmup) { isWarmup = isWarmup || VIRTUAL_DEVICE_ENABLED; interpreterDevice.enableThreadSharing(); + if (isMemoryLimitEnabled() && graphExecutionContext.doesExceedExecutionPlanLimit()) { throw new TornadoMemoryException("OutofMemoryException due to executionPlan.withMemoryLimit of " + graphExecutionContext.getExecutionPlanMemoryLimit()); } @@ -937,6 +938,7 @@ static void logTransferToDeviceOnce(List allEvents, Object object, Torn tornadoVMBytecodeList.append(verbose).append("\n"); } + static void logTransferToDeviceAlways(Object object, TornadoXPUDevice deviceForInterpreter, long sizeBatch, long offset, final int eventList, StringBuilder tornadoVMBytecodeList) { String verbose = String.format("bc: %s [0x%x] %s on %s, size=%d, offset=%d [event list=%d]", InterpreterUtilities.debugHighLightBC("TRANSFER_HOST_TO_DEVICE_ALWAYS"), // object.hashCode(), // diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/profiler/FeatureExtractionUtilities.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/profiler/FeatureExtractionUtilities.java index 4ff9405852..68654b7a69 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/profiler/FeatureExtractionUtilities.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/profiler/FeatureExtractionUtilities.java @@ -32,7 +32,7 @@ import java.util.LinkedHashMap; import java.util.Map; -import org.graalvm.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.StructuredGraph; import uk.ac.manchester.tornado.api.TornadoDeviceContext; import uk.ac.manchester.tornado.runtime.common.Tornado; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/sketcher/Sketch.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/sketcher/Sketch.java index 8f6c1453cf..54b4d5a63d 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/sketcher/Sketch.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/sketcher/Sketch.java @@ -23,7 +23,7 @@ */ package uk.ac.manchester.tornado.runtime.sketcher; -import org.graalvm.compiler.graph.Graph; +import jdk.graal.compiler.graph.Graph; import uk.ac.manchester.tornado.api.common.Access; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/sketcher/SketchRequest.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/sketcher/SketchRequest.java index 1f3c737fff..bf2dcd2f67 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/sketcher/SketchRequest.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/sketcher/SketchRequest.java @@ -22,9 +22,9 @@ */ package uk.ac.manchester.tornado.runtime.sketcher; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.tiers.HighTierContext; -import org.graalvm.compiler.phases.util.Providers; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.tiers.HighTierContext; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.runtime.graal.compiler.TornadoSketchTier; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/sketcher/TornadoSketcher.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/sketcher/TornadoSketcher.java index 39ba115c08..aaf7f505ed 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/sketcher/TornadoSketcher.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/sketcher/TornadoSketcher.java @@ -25,7 +25,7 @@ */ package uk.ac.manchester.tornado.runtime.sketcher; -import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; +import static jdk.graal.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; import static uk.ac.manchester.tornado.api.exceptions.TornadoInternalError.guarantee; import static uk.ac.manchester.tornado.runtime.TornadoCoreRuntime.getDebugContext; import static uk.ac.manchester.tornado.runtime.TornadoCoreRuntime.getOptions; @@ -41,22 +41,21 @@ import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; -import org.graalvm.compiler.debug.DebugCloseable; -import org.graalvm.compiler.debug.DebugContext; -import org.graalvm.compiler.debug.DebugDumpScope; -import org.graalvm.compiler.debug.TimerKey; -import org.graalvm.compiler.nodes.CallTargetNode; -import org.graalvm.compiler.nodes.ParameterNode; -import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; -import org.graalvm.compiler.nodes.StructuredGraph.Builder; -import org.graalvm.compiler.nodes.ValueNode; -import org.graalvm.compiler.phases.OptimisticOptimizations; -import org.graalvm.compiler.phases.PhaseSuite; -import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; -import org.graalvm.compiler.phases.tiers.HighTierContext; -import org.graalvm.compiler.phases.util.Providers; - +import jdk.graal.compiler.debug.DebugCloseable; +import jdk.graal.compiler.debug.DebugContext; +import jdk.graal.compiler.debug.DebugDumpScope; +import jdk.graal.compiler.debug.TimerKey; +import jdk.graal.compiler.nodes.CallTargetNode; +import jdk.graal.compiler.nodes.ParameterNode; +import jdk.graal.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.nodes.StructuredGraph.AllowAssumptions; +import jdk.graal.compiler.nodes.StructuredGraph.Builder; +import jdk.graal.compiler.nodes.ValueNode; +import jdk.graal.compiler.phases.OptimisticOptimizations; +import jdk.graal.compiler.phases.PhaseSuite; +import jdk.graal.compiler.phases.common.DeadCodeEliminationPhase; +import jdk.graal.compiler.phases.tiers.HighTierContext; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.meta.ResolvedJavaMethod; import uk.ac.manchester.tornado.api.common.Access; import uk.ac.manchester.tornado.api.enums.TornadoVMBackendType; diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/tasks/ReduceTaskGraph.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/tasks/ReduceTaskGraph.java index 3dc0e4f4b0..862e050aa2 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/tasks/ReduceTaskGraph.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/tasks/ReduceTaskGraph.java @@ -36,8 +36,8 @@ import java.util.Map.Entry; import java.util.concurrent.atomic.AtomicInteger; -import org.graalvm.compiler.graph.Graph; -import org.graalvm.compiler.nodes.StructuredGraph; +import jdk.graal.compiler.graph.Graph; +import jdk.graal.compiler.nodes.StructuredGraph; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.code.InvalidInstalledCodeException; @@ -190,6 +190,7 @@ private static void inspectBinariesFPGA(String taskScheduleName, String graphNam for (int i = 0; i < binaries.length; i += 2) { String givenTaskName = binaries[i + 1].split(".device")[0]; if (givenTaskName.equals(idTaskGraph)) { + BackendSelectionContainer info = MetaDataUtils.resolveDriverDeviceIndexes(MetaDataUtils.getProperty(idTaskGraph + ".device")); int deviceNumber = info.deviceIndex(); @@ -208,6 +209,7 @@ private boolean isAheadOfTime() { return TornadoOptions.FPGA_BINARIES != null; } + private BackendSelectionContainer changeDriverAndDeviceIfNeeded(String taskScheduleName, String graphName, String taskName) { String idTaskGraph = graphName + "." + taskName; boolean isDeviceDefined = MetaDataUtils.getProperty(idTaskGraph + ".device") != null; @@ -219,6 +221,7 @@ private BackendSelectionContainer changeDriverAndDeviceIfNeeded(String taskSched TornadoRuntimeProvider.setProperty(taskScheduleName + "." + taskName + ".device", backendIndex + ":" + deviceNumber); return info; } + return null; } @@ -571,6 +574,7 @@ TaskGraph scheduleWithReduction(MetaReduceCodeAnalysis metaReduceTable) { for (REDUCE_OPERATION operation : operations) { final String newTaskSequentialName = SEQUENTIAL_TASK_REDUCE_NAME + counterSeqName.get(); String fullName = rewrittenTaskGraph.getTaskGraphName() + "." + newTaskSequentialName; + TornadoRuntimeProvider.setProperty(fullName + ".device", backendToRun + ":" + deviceToRun); inspectBinariesFPGA(taskScheduleReduceName, graphName, taskPackage.getId(), true); diff --git a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/tasks/TornadoTaskGraph.java b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/tasks/TornadoTaskGraph.java index dd75c5c09b..8af2e16b28 100644 --- a/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/tasks/TornadoTaskGraph.java +++ b/tornado-runtime/src/main/java/uk/ac/manchester/tornado/runtime/tasks/TornadoTaskGraph.java @@ -51,10 +51,12 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.graalvm.compiler.graph.Graph; -import org.graalvm.compiler.phases.util.Providers; - +import jdk.graal.compiler.graph.Graph; +import jdk.graal.compiler.phases.util.Providers; import jdk.vm.ci.meta.ResolvedJavaMethod; + + +import uk.ac.manchester.tornado.api.DRMode; import uk.ac.manchester.tornado.api.GridScheduler; import uk.ac.manchester.tornado.api.ImmutableTaskGraph; import uk.ac.manchester.tornado.api.KernelContext; @@ -1659,12 +1661,15 @@ private void runParallelTaskGraphs(int numDevices, Thread[] threads, Timer timer for (TaskPackage taskPackage : taskPackages) { String taskID = taskPackage.getId(); TornadoRuntimeProvider.setProperty(newTaskScheduleName + "." + taskID + ".device", "0:" + taskScheduleNumber); + if (TornadoOptions.DEBUG) { System.out.println("SET DEVICE: " + newTaskScheduleName + "." + taskID + ".device=0:" + taskScheduleNumber); } + task.addTask(taskPackage); } + for (StreamingObject streamingObject : outputModeObjects) { performStreamOutThreads(streamingObject.mode, task, streamingObject.object); } @@ -1888,6 +1893,7 @@ private void runAllTaskGraphsInAcceleratorsSequentially(int numDevices, Timer ti if (TornadoOptions.DEBUG) { System.out.println("SET DEVICE: " + newTaskScheduleName + "." + taskID + ".device=0:" + taskNumber); } + task.addTask(taskPackage); }