================
@@ -1629,6 +1629,22 @@ void addInstrRequirements(const MachineInstr &MI,
     }
     break;
   }
+  case SPIRV::OpTypeVectorIdEXT: {
+    if (!ST.canUseExtension(SPIRV::Extension::SPV_EXT_long_vector))
+      reportFatalUsageError("OpTypeVectorIdEXT requires the following SPIR-V "
+                            "extension: SPV_EXT_long_vector extension");
+    Reqs.addExtension(SPIRV::Extension::SPV_EXT_long_vector);
+    Reqs.addCapability(SPIRV::Capability::LongVectorEXT);
+    assert(MI.getOperand(1).isReg());
+    const MachineRegisterInfo &MRI = MI.getMF()->getRegInfo();
+    SPIRVTypeInst ElemTypeDef = MRI.getVRegDef(MI.getOperand(1).getReg());
+    if (ElemTypeDef->getOpcode() == SPIRV::OpTypePointer &&
+        ST.canUseExtension(SPIRV::Extension::SPV_INTEL_masked_gather_scatter)) 
{
+      Reqs.addExtension(SPIRV::Extension::SPV_INTEL_masked_gather_scatter);
+      Reqs.addCapability(SPIRV::Capability::MaskedGatherScatterINTEL);
+    }
----------------
AlexVlx wrote:

Possibly, but there is appeal to keeping the cases separate for e.g. debugging 
/ readability. One option would be to move the handling of pointer element 
types into a separate function, and call it here?

https://github.com/llvm/llvm-project/pull/210279
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to