[llvm] [SPIRV] Add SPV_KHR_ray_query lowering (PR #202048)

Julian Klappenbach via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 14 18:45:13 PDT 2026


https://github.com/jklappenbach updated https://github.com/llvm/llvm-project/pull/202048

>From ca88059aa587659ec19f9a8743114c57898171da Mon Sep 17 00:00:00 2001
From: Julian Klappenbach <julian at twilight.digital>
Date: Sat, 6 Jun 2026 11:14:11 -0400
Subject: [PATCH 1/2] [SPIRV] Add SPV_KHR_ray_query lowering

Make ray query (SPV_KHR_ray_query) reachable from the Vulkan/Shader flavor via
llvm.spv intrinsics + GlobalISel selection (the texture / cooperative-matrix
pattern), since the OpenCL __spirv_* builtin path is isShader()-gated off.

- SPIRVInstrInfo.td: OpType{RayQuery,AccelerationStructure}KHR opaque types, and
  OpRayQuery{Initialize,Proceed,GetIntersectionType,
  GetIntersectionPrimitiveIndex}KHR.
- SPIRVBuiltins.td: spirv.{RayQueryKHR,AccelerationStructureKHR} builtin types,
  lowered flavor-agnostically by the existing BuiltinType machinery.
- IntrinsicsSPIRV.td: llvm.spv.ray_query.{initialize,proceed,
  get_intersection_type,get_intersection_primitive_index}. The ray query object
  is a function-local variable pointer; the ops are side-effecting.
- SPIRVInstructionSelector.cpp: GlobalISel selection for the four ops; the
  opaque types are side-effect-free.
- SPIRVModuleAnalysis.cpp / SPIRVSymbolicOperands.td: the RayQueryKHR capability
  and SPV_KHR_ray_query extension requirement on the opaque types.
- Tests: ray_query_{type,ops,kernel}.ll, acceleration_structure_type.ll.
---
 llvm/include/llvm/IR/IntrinsicsSPIRV.td       | 14 ++++-
 llvm/lib/Target/SPIRV/SPIRVBuiltins.td        |  2 +
 llvm/lib/Target/SPIRV/SPIRVInstrInfo.td       | 15 ++++++
 .../Target/SPIRV/SPIRVInstructionSelector.cpp | 28 ++++++++++
 llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp | 16 ++++++
 .../lib/Target/SPIRV/SPIRVSymbolicOperands.td |  1 +
 .../acceleration_structure_type.ll            | 17 +++++++
 .../SPV_KHR_ray_query/ray_query_kernel.ll     | 51 +++++++++++++++++++
 .../SPV_KHR_ray_query/ray_query_ops.ll        | 21 ++++++++
 .../SPV_KHR_ray_query/ray_query_type.ll       | 19 +++++++
 10 files changed, 183 insertions(+), 1 deletion(-)
 create mode 100644 llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/acceleration_structure_type.ll
 create mode 100644 llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_kernel.ll
 create mode 100644 llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_ops.ll
 create mode 100644 llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_type.ll

diff --git a/llvm/include/llvm/IR/IntrinsicsSPIRV.td b/llvm/include/llvm/IR/IntrinsicsSPIRV.td
index 1e758f9f63f49..c70ca849df91c 100644
--- a/llvm/include/llvm/IR/IntrinsicsSPIRV.td
+++ b/llvm/include/llvm/IR/IntrinsicsSPIRV.td
@@ -360,5 +360,17 @@ def int_spv_rsqrt : DefaultAttrsIntrinsic<[LLVMMatchType<0>], [llvm_anyfloat_ty]
   def int_spv_unpackhalf2x16 : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [llvm_i32_ty], [IntrNoMem]>;
   def int_spv_packhalf2x16 : DefaultAttrsIntrinsic<[llvm_anyint_ty], [llvm_anyfloat_ty], [IntrNoMem]>;
 
-
+  // SPV_KHR_ray_query operations. The ray query object is a function-local
+  // pointer to target("spirv.RayQueryKHR") and is mutated, so no IntrNoMem.
+  def int_spv_ray_query_initialize
+    : Intrinsic<[], [llvm_ptr_ty, llvm_any_ty, llvm_i32_ty, llvm_i32_ty,
+                     llvm_v3f32_ty, llvm_float_ty, llvm_v3f32_ty, llvm_float_ty]>;
+  def int_spv_ray_query_proceed
+    : Intrinsic<[llvm_i1_ty], [llvm_ptr_ty]>;
+  def int_spv_ray_query_get_intersection_type
+    : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty]>;
+  // The primitive index of the candidate or committed intersection.
+  // Args: rq ptr, intersection (0/1).
+  def int_spv_ray_query_get_intersection_primitive_index
+    : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty, llvm_i32_ty]>;
 }
diff --git a/llvm/lib/Target/SPIRV/SPIRVBuiltins.td b/llvm/lib/Target/SPIRV/SPIRVBuiltins.td
index 806d283ff715f..75f75b3ae1b4c 100644
--- a/llvm/lib/Target/SPIRV/SPIRVBuiltins.td
+++ b/llvm/lib/Target/SPIRV/SPIRVBuiltins.td
@@ -1810,6 +1810,8 @@ def : BuiltinType<"spirv.SignedImage", OpTypeImage>;
 def : BuiltinType<"spirv.SampledImage", OpTypeSampledImage>;
 def : BuiltinType<"spirv.Pipe", OpTypePipe>;
 def : BuiltinType<"spirv.CooperativeMatrixKHR", OpTypeCooperativeMatrixKHR>;
+def : BuiltinType<"spirv.RayQueryKHR", OpTypeRayQueryKHR>;
+def : BuiltinType<"spirv.AccelerationStructureKHR", OpTypeAccelerationStructureKHR>;
 
 //===----------------------------------------------------------------------===//
 // Class matching an OpenCL builtin type name to an equivalent SPIR-V
diff --git a/llvm/lib/Target/SPIRV/SPIRVInstrInfo.td b/llvm/lib/Target/SPIRV/SPIRVInstrInfo.td
index 66e5d2f6a626e..33090ebae805b 100644
--- a/llvm/lib/Target/SPIRV/SPIRVInstrInfo.td
+++ b/llvm/lib/Target/SPIRV/SPIRVInstrInfo.td
@@ -213,6 +213,21 @@ def OpTypeCooperativeMatrixNV: Op<5358, (outs TYPE:$res),
 def OpTypeCooperativeMatrixKHR: Op<4456, (outs TYPE:$res),
                   (ins TYPE:$compType, ID:$scope, ID:$rows, ID:$cols, ID:$use),
                   "$res = OpTypeCooperativeMatrixKHR $compType $scope $rows $cols $use">;
+def OpTypeRayQueryKHR: Op<4472, (outs TYPE:$res), (ins),
+                  "$res = OpTypeRayQueryKHR">;
+def OpTypeAccelerationStructureKHR: Op<5341, (outs TYPE:$res), (ins),
+                  "$res = OpTypeAccelerationStructureKHR">;
+def OpRayQueryInitializeKHR: Op<4473, (outs),
+                  (ins ID:$rq, ID:$accel, ID:$flags, ID:$mask, ID:$origin, ID:$tmin, ID:$dir, ID:$tmax),
+                  "OpRayQueryInitializeKHR $rq $accel $flags $mask $origin $tmin $dir $tmax">;
+def OpRayQueryProceedKHR: Op<4477, (outs ID:$res), (ins TYPE:$resType, ID:$rq),
+                  "$res = OpRayQueryProceedKHR $resType $rq">;
+def OpRayQueryGetIntersectionTypeKHR: Op<4479, (outs ID:$res),
+                  (ins TYPE:$resType, ID:$rq, ID:$intersection),
+                  "$res = OpRayQueryGetIntersectionTypeKHR $resType $rq $intersection">;
+def OpRayQueryGetIntersectionPrimitiveIndexKHR: Op<6023, (outs ID:$res),
+                  (ins TYPE:$resType, ID:$rq, ID:$intersection),
+                  "$res = OpRayQueryGetIntersectionPrimitiveIndexKHR $resType $rq $intersection">;
 
 // 3.42.7 Constant-Creation Instructions
 
diff --git a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
index c3f21fe025bd5..153d3b31c152d 100644
--- a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
@@ -444,6 +444,7 @@ class SPIRVInstructionSelector : public InstructionSelector {
   bool selectGatherIntrinsic(Register &ResVReg, SPIRVTypeInst ResType,
                              MachineInstr &I) const;
   bool selectImageWriteIntrinsic(MachineInstr &I) const;
+  bool selectRayQueryInitialize(MachineInstr &I) const;
   bool selectResourceGetPointer(Register &ResVReg, SPIRVTypeInst ResType,
                                 MachineInstr &I) const;
   bool selectPushConstantGetPointer(Register &ResVReg, SPIRVTypeInst ResType,
@@ -772,6 +773,8 @@ static bool isOpcodeWithNoSideEffects(unsigned Opcode) {
   case SPIRV::OpTypeAccelerationStructureNV:
   case SPIRV::OpTypeCooperativeMatrixNV:
   case SPIRV::OpTypeCooperativeMatrixKHR:
+  case SPIRV::OpTypeRayQueryKHR:
+  case SPIRV::OpTypeAccelerationStructureKHR:
     return true;
   default:
     return false;
@@ -1592,6 +1595,16 @@ bool SPIRVInstructionSelector::selectSincos(Register ResVReg,
   return false;
 }
 
+bool SPIRVInstructionSelector::selectRayQueryInitialize(MachineInstr &I) const {
+  // Operands 1..8: rq ptr, accel, rayFlags, cullMask, origin, tMin, dir, tMax.
+  auto MIB = BuildMI(*I.getParent(), I, I.getDebugLoc(),
+                     TII.get(SPIRV::OpRayQueryInitializeKHR));
+  for (unsigned i = 1; i < I.getNumOperands(); ++i)
+    MIB.addUse(I.getOperand(i).getReg());
+  MIB.constrainAllUses(TII, TRI, RBI);
+  return true;
+}
+
 bool SPIRVInstructionSelector::selectOpWithSrcs(Register ResVReg,
                                                 SPIRVTypeInst ResType,
                                                 MachineInstr &I,
@@ -4708,6 +4721,21 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg,
       report_fatal_error("incompatible result and operand types in a bitcast");
     return selectOpWithSrcs(ResVReg, ResType, I, {OpReg}, SPIRV::OpBitcast);
   }
+  case Intrinsic::spv_ray_query_initialize:
+    return selectRayQueryInitialize(I);
+  case Intrinsic::spv_ray_query_proceed:
+    return selectOpWithSrcs(ResVReg, ResType, I, {I.getOperand(2).getReg()},
+                            SPIRV::OpRayQueryProceedKHR);
+  case Intrinsic::spv_ray_query_get_intersection_type:
+    return selectOpWithSrcs(
+        ResVReg, ResType, I,
+        {I.getOperand(2).getReg(), I.getOperand(3).getReg()},
+        SPIRV::OpRayQueryGetIntersectionTypeKHR);
+  case Intrinsic::spv_ray_query_get_intersection_primitive_index:
+    return selectOpWithSrcs(
+        ResVReg, ResType, I,
+        {I.getOperand(2).getReg(), I.getOperand(3).getReg()},
+        SPIRV::OpRayQueryGetIntersectionPrimitiveIndexKHR);
   case Intrinsic::spv_unref_global:
   case Intrinsic::spv_init_global: {
     MachineInstr *MI = MRI->getVRegDef(I.getOperand(1).getReg());
diff --git a/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp b/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
index 49d9dc95603ca..31162dc6e6b61 100644
--- a/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
@@ -2068,6 +2068,22 @@ void addInstrRequirements(const MachineInstr &MI,
       Reqs.addCapability(SPIRV::Capability::AsmINTEL);
     }
     break;
+  case SPIRV::OpTypeRayQueryKHR:
+    if (!ST.canUseExtension(SPIRV::Extension::SPV_KHR_ray_query))
+      report_fatal_error("OpTypeRayQueryKHR type requires the "
+                         "following SPIR-V extension: SPV_KHR_ray_query",
+                         false);
+    Reqs.addExtension(SPIRV::Extension::SPV_KHR_ray_query);
+    Reqs.addCapability(SPIRV::Capability::RayQueryKHR);
+    break;
+  case SPIRV::OpTypeAccelerationStructureKHR:
+    if (!ST.canUseExtension(SPIRV::Extension::SPV_KHR_ray_query))
+      report_fatal_error("OpTypeAccelerationStructureKHR type requires the "
+                         "following SPIR-V extension: SPV_KHR_ray_query",
+                         false);
+    Reqs.addExtension(SPIRV::Extension::SPV_KHR_ray_query);
+    Reqs.addCapability(SPIRV::Capability::RayQueryKHR);
+    break;
   case SPIRV::OpTypeCooperativeMatrixKHR: {
     if (!ST.canUseExtension(SPIRV::Extension::SPV_KHR_cooperative_matrix))
       report_fatal_error(
diff --git a/llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td b/llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td
index c38f9e2d0243a..72c5c70e15d0c 100644
--- a/llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td
+++ b/llvm/lib/Target/SPIRV/SPIRVSymbolicOperands.td
@@ -603,6 +603,7 @@ defm HostAccessINTEL : CapabilityOperand<6188, 0, 0, [SPV_INTEL_global_variable_
 defm GlobalVariableFPGADecorationsINTEL : CapabilityOperand<6189, 0, 0, [SPV_INTEL_global_variable_fpga_decorations], []>;
 defm CacheControlsINTEL : CapabilityOperand<6441, 0, 0, [SPV_INTEL_cache_controls], []>;
 defm CooperativeMatrixKHR : CapabilityOperand<6022, 0, 0, [SPV_KHR_cooperative_matrix], []>;
+defm RayQueryKHR : CapabilityOperand<4472, 0, 0, [SPV_KHR_ray_query], []>;
 defm ArithmeticFenceEXT : CapabilityOperand<6144, 0, 0, [SPV_EXT_arithmetic_fence], []>;
 defm AbortKHR : CapabilityOperand<5120, 0, 0, [SPV_KHR_abort], []>;
 defm SplitBarrierINTEL : CapabilityOperand<6141, 0, 0, [SPV_INTEL_split_barrier], []>;
diff --git a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/acceleration_structure_type.ll b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/acceleration_structure_type.ll
new file mode 100644
index 0000000000000..a0417e3d6f003
--- /dev/null
+++ b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/acceleration_structure_type.ll
@@ -0,0 +1,17 @@
+; Check that target("spirv.AccelerationStructureKHR") lowers to
+; OpTypeAccelerationStructureKHR, gated by the RayQueryKHR capability and the
+; SPV_KHR_ray_query extension.
+
+; RUN: not llc -O0 -mtriple=spirv-unknown-vulkan1.3-compute %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-vulkan1.3-compute --spirv-ext=+SPV_KHR_ray_query %s -o - | FileCheck %s
+
+; CHECK-ERROR: LLVM ERROR: OpTypeAccelerationStructureKHR type requires the following SPIR-V extension: SPV_KHR_ray_query
+
+; CHECK-DAG: OpCapability RayQueryKHR
+; CHECK-DAG: OpExtension "SPV_KHR_ray_query"
+; CHECK-DAG: {{%[0-9]+}} = OpTypeAccelerationStructureKHR
+
+define spir_func void @use_accel(target("spirv.AccelerationStructureKHR") %as) {
+entry:
+  ret void
+}
diff --git a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_kernel.ll b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_kernel.ll
new file mode 100644
index 0000000000000..93a8c18e54eb4
--- /dev/null
+++ b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_kernel.ll
@@ -0,0 +1,51 @@
+; A GLCompute kernel using SPV_KHR_ray_query against a descriptor-bound
+; acceleration structure (a UniformConstant global decorated DescriptorSet and
+; Binding, materialized via llvm.spv.resource.handlefrombinding). It initializes
+; a ray, proceeds over candidates, inspects the candidate intersection type, and
+; reads the committed type. The module must pass spirv-val --target-env vulkan1.3.
+
+; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-vulkan1.3-compute --spirv-ext=+SPV_KHR_ray_query %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan1.3-compute --spirv-ext=+SPV_KHR_ray_query %s -o - -filetype=obj | spirv-val --target-env vulkan1.3 %}
+
+; CHECK-DAG: OpCapability RayQueryKHR
+; CHECK-DAG: OpExtension "SPV_KHR_ray_query"
+; CHECK-DAG: OpEntryPoint GLCompute %[[#entry:]] "main"
+; CHECK-DAG: OpDecorate %[[#AS:]] DescriptorSet 0
+; CHECK-DAG: OpDecorate %[[#AS]] Binding 0
+; CHECK-DAG: %[[#ASTy:]] = OpTypeAccelerationStructureKHR
+; CHECK-DAG: %[[#RQTy:]] = OpTypeRayQueryKHR
+; CHECK: %[[#RQ:]] = OpVariable %[[#]] Function
+; CHECK: OpRayQueryInitializeKHR %[[#RQ]]
+; CHECK: %[[#]] = OpRayQueryProceedKHR
+; CHECK: %[[#]] = OpRayQueryGetIntersectionTypeKHR
+
+ at .str.as = private unnamed_addr constant [3 x i8] c"as\00", align 1
+
+define void @main() local_unnamed_addr #0 {
+entry:
+  %as = tail call target("spirv.AccelerationStructureKHR")
+      @llvm.spv.resource.handlefrombinding.tspirv.AccelerationStructureKHR(
+          i32 0, i32 0, i32 1, i32 0, ptr nonnull @.str.as)
+  %rq = alloca target("spirv.RayQueryKHR"), align 8
+  call void @llvm.spv.ray.query.initialize(ptr %rq,
+      target("spirv.AccelerationStructureKHR") %as,
+      i32 0, i32 255,
+      <3 x float> zeroinitializer, float 0.000000e+00,
+      <3 x float> <float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>,
+      float 0.000000e+00)
+  br label %loop.header
+
+loop.header:
+  %more = call i1 @llvm.spv.ray.query.proceed(ptr %rq)
+  br i1 %more, label %loop.body, label %loop.exit
+
+loop.body:
+  %cand = call i32 @llvm.spv.ray.query.get.intersection.type(ptr %rq, i32 0)
+  br label %loop.header
+
+loop.exit:
+  %committed = call i32 @llvm.spv.ray.query.get.intersection.type(ptr %rq, i32 1)
+  ret void
+}
+
+attributes #0 = { "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" }
diff --git a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_ops.ll b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_ops.ll
new file mode 100644
index 0000000000000..3a437833e29de
--- /dev/null
+++ b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_ops.ll
@@ -0,0 +1,21 @@
+; SPV_KHR_ray_query operations via llvm.spv.ray.query.* intrinsics and GlobalISel
+; selection, used because the __spirv_* builtin path is OpenCL-only and cannot
+; lower ray query, which is a Vulkan-only extension.
+
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-vulkan1.3-compute --spirv-ext=+SPV_KHR_ray_query %s -o - | FileCheck %s
+
+; CHECK-DAG: OpCapability RayQueryKHR
+; CHECK-DAG: OpExtension "SPV_KHR_ray_query"
+; CHECK-DAG: %[[#RQTy:]] = OpTypeRayQueryKHR
+; CHECK: OpRayQueryInitializeKHR
+; CHECK: %[[#]] = OpRayQueryProceedKHR
+; CHECK: %[[#]] = OpRayQueryGetIntersectionTypeKHR
+
+define void @ray_query_ops(target("spirv.AccelerationStructureKHR") %as) {
+entry:
+  %rq = alloca target("spirv.RayQueryKHR"), align 8
+  call void @llvm.spv.ray.query.initialize(ptr %rq, target("spirv.AccelerationStructureKHR") %as, i32 0, i32 255, <3 x float> zeroinitializer, float 0.000000e+00, <3 x float> <float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>, float 1.000000e+03)
+  %p = call i1 @llvm.spv.ray.query.proceed(ptr %rq)
+  %t = call i32 @llvm.spv.ray.query.get.intersection.type(ptr %rq, i32 0)
+  ret void
+}
diff --git a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_type.ll b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_type.ll
new file mode 100644
index 0000000000000..32cc80c30d9c7
--- /dev/null
+++ b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_type.ll
@@ -0,0 +1,19 @@
+; Check that target("spirv.RayQueryKHR") lowers to OpTypeRayQueryKHR under the
+; Vulkan flavor, gated behind the RayQueryKHR capability and the SPV_KHR_ray_query
+; extension, and that it errors cleanly without the extension enabled.
+
+; RUN: not llc -O0 -mtriple=spirv-unknown-vulkan1.3-compute %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-vulkan1.3-compute --spirv-ext=+SPV_KHR_ray_query %s -o - | FileCheck %s
+
+; CHECK-ERROR: LLVM ERROR: OpTypeRayQueryKHR type requires the following SPIR-V extension: SPV_KHR_ray_query
+
+; CHECK-DAG: OpCapability RayQueryKHR
+; CHECK-DAG: OpExtension "SPV_KHR_ray_query"
+; CHECK-DAG: {{%[0-9]+}} = OpTypeRayQueryKHR
+
+; A by-value parameter of the opaque type forces OpTypeRayQueryKHR into the module
+; (referenced by OpTypeFunction — cannot be eliminated like an unused local).
+define spir_func void @use_ray_query(target("spirv.RayQueryKHR") %rq) {
+entry:
+  ret void
+}

>From 79e93308d306d4f9d62815190d54aeeae2e96559 Mon Sep 17 00:00:00 2001
From: Julian Klappenbach <julian at twilight.digital>
Date: Thu, 11 Jun 2026 20:03:46 -0400
Subject: [PATCH 2/2] [SPIRV] Use plain ASCII in ray_query_type.ll comment

Replace a non-ASCII em-dash in a test comment with plain ASCII.
---
 .../SPIRV/extensions/SPV_KHR_ray_query/ray_query_type.ll        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_type.ll b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_type.ll
index 32cc80c30d9c7..647d93f3dae49 100644
--- a/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_type.ll
+++ b/llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_ray_query/ray_query_type.ll
@@ -12,7 +12,7 @@
 ; CHECK-DAG: {{%[0-9]+}} = OpTypeRayQueryKHR
 
 ; A by-value parameter of the opaque type forces OpTypeRayQueryKHR into the module
-; (referenced by OpTypeFunction — cannot be eliminated like an unused local).
+; (referenced by OpTypeFunction, so it is not eliminated like an unused local).
 define spir_func void @use_ray_query(target("spirv.RayQueryKHR") %rq) {
 entry:
   ret void



More information about the llvm-commits mailing list