[llvm] [SPIRV] Add support for SPV_KHR_bit_instructions (PR #66215)

Ilia Diachkov via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 17 17:24:01 PDT 2023


================
@@ -884,6 +902,12 @@ void addInstrRequirements(const MachineInstr &MI,
   default:
     break;
   }
+
+  // If we require capability Shader, then we can remove the requirement for
+  // the BitInstructions capability, since Shader is a superset capability
+  // of BitInstructions.
+  Reqs.removeCapabilityIf(SPIRV::Capability::Shader,
+                          SPIRV::Capability::BitInstructions);
----------------
iliya-diyachkov wrote:

What if we can use `SPV_KHR_bit_instructions`, but `Shader` was added because of the presence of `OpTypeRuntimeArray`? Should `Shader` be removed in this case? 


https://github.com/llvm/llvm-project/pull/66215


More information about the llvm-commits mailing list