[clang] [HIP][SPIRV] Enable the SPIRV backend instead of the translator through an experimental flag. (PR #162282)
Shilei Tian via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 7 09:50:45 PDT 2025
Juan Manuel Martinez =?utf-8?q?CaamaƱo?= <juamarti at amd.com>,Manuel
Carrasco <Manuel.Carrasco at amd.com>,Manuel Carrasco <Manuel.Carrasco at amd.com>,Manuel
Carrasco <Manuel.Carrasco at amd.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/162282 at github.com>
================
@@ -0,0 +1,12 @@
+// COM: This test case validates the behavior of -amdgpu-use-experimental-spirv-backend
+
+// COM: Test that -amdgpu-use-experimental-spirv-backend calls llc with the SPIRV triple.
+// RUN: %clang -x hip %s --cuda-device-only --offload-arch=amdgcnspirv -amdgpu-use-experimental-spirv-backend -### 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-BACKEND
+// CHECK-SPIRV-BACKEND: "{{.*}}llc{{.*}}" "{{-mtriple=spirv64v[0-9]+\.[0-9]+-amd-amdhsa}}"
+
+// COM: Test that -no-amdgpu-use-experimental-spirv-backend calls the SPIRV translator
+// RUN: %clang -x hip %s --cuda-device-only --offload-arch=amdgcnspirv -no-amdgpu-use-experimental-spirv-backend -### 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-TRANSLATOR
+// CHECK-SPIRV-TRANSLATOR: "{{.*llvm-spirv.*}}" "{{--spirv-max-version=[0-9]+\.[0-9]}}"
+
+// COM: Test that by default we use the translator
+// RUN: %clang -x hip %s --cuda-device-only --offload-arch=amdgcnspirv -### 2>&1 | FileCheck %s --check-prefix=CHECK-SPIRV-TRANSLATOR
----------------
shiltian wrote:
missing an empty line at EoF
https://github.com/llvm/llvm-project/pull/162282
More information about the cfe-commits
mailing list