[llvm] [SPIR-V] Add pass to remove spv_ptrcast intrinsics (PR #128896)

Vyacheslav Levytskyy via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 03:19:41 PST 2025


================
@@ -142,23 +136,10 @@ class SPIRVEmitIntrinsics
   void preprocessCompositeConstants(IRBuilder<> &B);
   void preprocessUndefs(IRBuilder<> &B);
 
-  CallInst *buildIntrWithMD(Intrinsic::ID IntrID, ArrayRef<Type *> Types,
-                            Value *Arg, Value *Arg2, ArrayRef<Constant *> Imms,
-                            IRBuilder<> &B) {
-    SmallVector<Value *, 4> Args;
-    Args.push_back(Arg2);
-    Args.push_back(buildMD(Arg));
-    for (auto *Imm : Imms)
-      Args.push_back(Imm);
-    return B.CreateIntrinsic(IntrID, {Types}, Args);
-  }
-
   Type *reconstructType(Value *Op, bool UnknownElemTypeI8,
                         bool IsPostprocessing);
 
   void buildAssignType(IRBuilder<> &B, Type *ElemTy, Value *Arg);
----------------
VyacheslavLevytskyy wrote:

Probably it'd be better to keep buildAssignType close to buildAssignPtr, even if all current users are within EmitIntrinsics.

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


More information about the llvm-commits mailing list