From c3910823c741eb3ad6f977bda82d7b55101499ef Mon Sep 17 00:00:00 2001 From: Nick Sarnie Date: Sat, 11 Jan 2025 04:02:53 +0900 Subject: [PATCH] [clang][Driver][SPIR-V] Make tool names consistent (#122343) Some use `SPIRV` and some use `SPIR-V`, just use `SPIR-V` which is what we use normally. I noticed this when fixing the test in https://github.com/llvm/llvm-project/pull/122310. Signed-off-by: Sarnie, Nick --- clang/lib/Driver/ToolChains/SPIRV.h | 4 ++-- clang/test/Driver/spirv-openmp-toolchain.c | 2 +- clang/test/Driver/spirv-toolchain.cl | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/clang/lib/Driver/ToolChains/SPIRV.h b/clang/lib/Driver/ToolChains/SPIRV.h index 44187084e34ec4..6223d55eca6435 100644 --- a/clang/lib/Driver/ToolChains/SPIRV.h +++ b/clang/lib/Driver/ToolChains/SPIRV.h @@ -43,7 +43,7 @@ class LLVM_LIBRARY_VISIBILITY Translator : public Tool { class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { public: - Linker(const ToolChain &TC) : Tool("SPIRV::Linker", "spirv-link", TC) {} + Linker(const ToolChain &TC) : Tool("SPIR-V::Linker", "spirv-link", TC) {} bool hasIntegratedCPP() const override { return false; } bool isLinkJob() const override { return true; } void ConstructJob(Compilation &C, const JobAction &JA, @@ -54,7 +54,7 @@ class LLVM_LIBRARY_VISIBILITY Linker final : public Tool { class LLVM_LIBRARY_VISIBILITY Assembler final : public Tool { public: - Assembler(const ToolChain &TC) : Tool("SPIRV::Assembler", "spirv-as", TC) {} + Assembler(const ToolChain &TC) : Tool("SPIR-V::Assembler", "spirv-as", TC) {} bool hasIntegratedAssembler() const override { return false; } bool hasIntegratedCPP() const override { return false; } void ConstructJob(Compilation &C, const JobAction &JA, diff --git a/clang/test/Driver/spirv-openmp-toolchain.c b/clang/test/Driver/spirv-openmp-toolchain.c index 3d585d78e86c21..5a76bf70e7ed35 100644 --- a/clang/test/Driver/spirv-openmp-toolchain.c +++ b/clang/test/Driver/spirv-openmp-toolchain.c @@ -45,7 +45,7 @@ // CHECK-BINDINGS-TEMPS: "spirv64-intel" - "clang", inputs: ["[[INPUT]]"], output: "[[DEVICE_PP:.+]]" // CHECK-BINDINGS-TEMPS: "spirv64-intel" - "clang", inputs: ["[[DEVICE_PP]]", "[[HOST_BC]]"], output: "[[DEVICE_TEMP_BC:.+]]" // CHECK-BINDINGS-TEMPS: "spirv64-intel" - "SPIR-V::Translator", inputs: ["[[DEVICE_TEMP_BC]]"], output: "[[DEVICE_ASM:.+]]" -// CHECK-BINDINGS-TEMPS: "spirv64-intel" - "SPIRV::Assembler", inputs: ["[[DEVICE_ASM]]"], output: "[[DEVICE_SPV:.+]]" +// CHECK-BINDINGS-TEMPS: "spirv64-intel" - "SPIR-V::Assembler", inputs: ["[[DEVICE_ASM]]"], output: "[[DEVICE_SPV:.+]]" // CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "Offload::Packager", inputs: ["[[DEVICE_SPV]]"], output: "[[DEVICE_IMAGE:.+]]" // CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "clang", inputs: ["[[HOST_BC]]", "[[DEVICE_IMAGE]]"], output: "[[HOST_ASM:.+]]" // CHECK-BINDINGS-TEMPS: "x86_64-unknown-linux-gnu" - "clang::as", inputs: ["[[HOST_ASM]]"], output: "[[HOST_OBJ:.+]]" diff --git a/clang/test/Driver/spirv-toolchain.cl b/clang/test/Driver/spirv-toolchain.cl index 33c7bc0a63adfc..fd29dbe71e9105 100644 --- a/clang/test/Driver/spirv-toolchain.cl +++ b/clang/test/Driver/spirv-toolchain.cl @@ -70,6 +70,16 @@ // SPLINK: {{llvm-spirv.*"}} [[BC]] "-o" [[SPV2:".*o"]] // SPLINK: {{spirv-link.*"}} [[SPV1]] [[SPV2]] "-o" "a.out" +//----------------------------------------------------------------------------- +// Check bindings when linking when multiple input files are passed. +// RUN: %clang -### -target spirv64 -ccc-print-bindings %s %s 2>&1 | FileCheck --check-prefix=SPLINK-BINDINGS %s + +// SPLINK-BINDINGS: "clang", inputs: [[[CL:".*cl"]]], output: [[BC1:".*bc"]] +// SPLINK-BINDINGS: "SPIR-V::Translator", inputs: [[[BC1]]], output: [[OBJ1:".*o"]] +// SPLINK-BINDINGS: "clang", inputs: [[[CL]]], output: [[BC2:".*bc"]] +// SPLINK-BINDINGS: "SPIR-V::Translator", inputs: [[[BC2]]], output: [[OBJ2:".*o"]] +// SPLINK-BINDINGS: "SPIR-V::Linker", inputs: [[[OBJ1]], [[OBJ2]]], output: "a.out" + //----------------------------------------------------------------------------- // Check external vs internal object emission. // RUN: %clang -### --target=spirv64 -fno-integrated-objemitter %s 2>&1 | FileCheck --check-prefix=XTOR %s