[llvm] [SPIR-V] Add support for SPV_INTEL_masked_gather_scatter extension (PR #185418)

Arseniy Obolenskiy via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 05:12:46 PDT 2026


================
@@ -3281,9 +3283,101 @@ void SPIRVEmitIntrinsics::parseFunDeclarations(Module &M) {
   }
 }
 
+bool SPIRVEmitIntrinsics::processMaskedMemIntrinsic(IntrinsicInst &I) {
+  const SPIRVSubtarget &ST = TM->getSubtarget<SPIRVSubtarget>(*I.getFunction());
+
+  if (I.getIntrinsicID() == Intrinsic::masked_gather) {
----------------
aobolensk wrote:

I'd rather leave it as is. From what I have tried it produces the code that is a little more compact than the current one, but it is also error-prone. For example, inside new function there will be `if (IID == Intrinsic::masked_gather)` and `else` block will assume that it is `scatter`. That is also not very good practice.

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


More information about the llvm-commits mailing list