================
@@ -2120,6 +2123,32 @@ bool 
SPIRVInstructionSelector::selectSplatVector(Register ResVReg,
   return MIB.constrainAllUses(TII, TRI, RBI);
 }
 
+bool SPIRVInstructionSelector::selectClip(Register ResVReg,
+                                          const SPIRVType *ResType,
+                                          MachineInstr &I) const {
+
+  unsigned Opcode;
+
+  if (STI.isAtLeastSPIRVVer(VersionTuple(1, 6))) {
+    if (!STI.canUseExtension(
+            SPIRV::Extension::SPV_EXT_demote_to_helper_invocation))
+      report_fatal_error(
+          "llvm.spv.clip intrinsic: this instruction requires the following "
+          "SPIR-V extension: SPV_EXT_demote_to_helper_invocation",
+          false);
----------------
inbelic wrote:

```suggestion
  if (STI.isAtLeastSPIRVVer(VersionTuple(1, 6)) ||
      
STI.canUseExtension(SPIRV::Extension::SPV_EXT_demote_to_helper_invocation))) {
```

My understanding is that the extension is used to specify the capability is 
available when we don't have a spirv version that enables it by default. So we 
can use it if the minimum version is allowed or the extension is enabled.

https://github.com/llvm/llvm-project/pull/114588
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to