[llvm] [SPIR-V][NewPM] Register SPIRVEmitIntrinsics with the new pass manager (PR #209966)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 22:14:17 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-spir-v

Author: Arseniy Obolenskiy (aobolensk)

<details>
<summary>Changes</summary>



---

Patch is 38.00 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/209966.diff


3 Files Affected:

- (modified) llvm/lib/Target/SPIRV/SPIRV.h (+1-1) 
- (modified) llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp (+133-122) 
- (modified) llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Target/SPIRV/SPIRV.h b/llvm/lib/Target/SPIRV/SPIRV.h
index 42c4ef149539e..f352bb1da5dca 100644
--- a/llvm/lib/Target/SPIRV/SPIRV.h
+++ b/llvm/lib/Target/SPIRV/SPIRV.h
@@ -49,7 +49,7 @@ void initializeSPIRVPostLegalizerPass(PassRegistry &);
 void initializeSPIRVStructurizerPass(PassRegistry &);
 void initializeSPIRVCBufferAccessLegacyPass(PassRegistry &);
 void initializeSPIRVPushConstantAccessLegacyPass(PassRegistry &);
-void initializeSPIRVEmitIntrinsicsPass(PassRegistry &);
+void initializeSPIRVEmitIntrinsicsLegacyPass(PassRegistry &);
 void initializeSPIRVLegalizePointerCastLegacyPass(PassRegistry &);
 void initializeSPIRVRegularizerLegacyPass(PassRegistry &);
 void initializeSPIRVMergeRegionExitTargetsLegacyPass(PassRegistry &);
diff --git a/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp b/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
index 19e1e71488ee3..e5afaa5c63e4b 100644
--- a/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
@@ -180,9 +180,8 @@ static std::optional<uint64_t> getByteAddressingMultiplier(Type *Ty) {
   return std::nullopt;
 }
 
-class SPIRVEmitIntrinsics
-    : public ModulePass,
-      public InstVisitor<SPIRVEmitIntrinsics, Instruction *> {
+class SPIRVEmitIntrinsicsImpl
+    : public InstVisitor<SPIRVEmitIntrinsicsImpl, Instruction *> {
   const SPIRVTargetMachine &TM;
   SPIRVGlobalRegistry *GR = nullptr;
   Function *CurrF = nullptr;
@@ -382,8 +381,7 @@ class SPIRVEmitIntrinsics
   Instruction *buildLogicalAccessChainFromGEP(GetElementPtrInst &GEP);
 
 public:
-  static char ID;
-  SPIRVEmitIntrinsics(const SPIRVTargetMachine &TM) : ModulePass(ID), TM(TM) {}
+  SPIRVEmitIntrinsicsImpl(const SPIRVTargetMachine &TM) : TM(TM) {}
   Instruction *visitInstruction(Instruction &I) { return &I; }
   Instruction *visitSwitchInst(SwitchInst &I);
   Instruction *visitGetElementPtrInst(GetElementPtrInst &I);
@@ -400,12 +398,21 @@ class SPIRVEmitIntrinsics
   Instruction *visitUnreachableInst(UnreachableInst &I);
   Instruction *visitCallInst(CallInst &I);
 
-  StringRef getPassName() const override { return "SPIRV emit intrinsics"; }
+  bool runOnModule(Module &M);
+};
 
-  bool runOnModule(Module &M) override;
+class SPIRVEmitIntrinsicsLegacy : public ModulePass {
+  const SPIRVTargetMachine &TM;
+
+public:
+  static char ID;
+  SPIRVEmitIntrinsicsLegacy(const SPIRVTargetMachine &TM)
+      : ModulePass(ID), TM(TM) {}
 
-  void getAnalysisUsage(AnalysisUsage &AU) const override {
-    ModulePass::getAnalysisUsage(AU);
+  StringRef getPassName() const override { return "SPIRV emit intrinsics"; }
+
+  bool runOnModule(Module &M) override {
+    return SPIRVEmitIntrinsicsImpl(TM).runOnModule(M);
   }
 };
 
@@ -432,9 +439,9 @@ Value *getPointerRoot(Value *I) {
 
 } // namespace
 
-char SPIRVEmitIntrinsics::ID = 0;
+char SPIRVEmitIntrinsicsLegacy::ID = 0;
 
-INITIALIZE_PASS(SPIRVEmitIntrinsics, "spirv-emit-intrinsics",
+INITIALIZE_PASS(SPIRVEmitIntrinsicsLegacy, "spirv-emit-intrinsics",
                 "SPIRV emit intrinsics", false, false)
 
 static inline bool isAssignTypeInstr(const Instruction *I) {
@@ -518,8 +525,8 @@ static void emitAssignName(Instruction *I, IRBuilder<> &B) {
   B.CreateIntrinsic(Intrinsic::spv_assign_name, {I->getType()}, Args);
 }
 
-void SPIRVEmitIntrinsics::replaceAllUsesWith(Value *Src, Value *Dest,
-                                             bool DeleteOld) {
+void SPIRVEmitIntrinsicsImpl::replaceAllUsesWith(Value *Src, Value *Dest,
+                                                 bool DeleteOld) {
   GR->replaceAllUsesWith(Src, Dest, DeleteOld);
   // Update uncomplete type records if any
   if (isTodoType(Src)) {
@@ -529,10 +536,10 @@ void SPIRVEmitIntrinsics::replaceAllUsesWith(Value *Src, Value *Dest,
   }
 }
 
-void SPIRVEmitIntrinsics::replaceAllUsesWithAndErase(IRBuilder<> &B,
-                                                     Instruction *Src,
-                                                     Instruction *Dest,
-                                                     bool DeleteOld) {
+void SPIRVEmitIntrinsicsImpl::replaceAllUsesWithAndErase(IRBuilder<> &B,
+                                                         Instruction *Src,
+                                                         Instruction *Dest,
+                                                         bool DeleteOld) {
   replaceAllUsesWith(Src, Dest, DeleteOld);
   std::string Name = Src->hasName() ? Src->getName().str() : "";
   Src->eraseFromParent();
@@ -574,8 +581,9 @@ static inline Type *restoreMutatedType(SPIRVGlobalRegistry *GR, Instruction *I,
 
 // Reconstruct type with nested element types according to deduced type info.
 // Return nullptr if no detailed type info is available.
-Type *SPIRVEmitIntrinsics::reconstructType(Value *Op, bool UnknownElemTypeI8,
-                                           bool IsPostprocessing) {
+Type *SPIRVEmitIntrinsicsImpl::reconstructType(Value *Op,
+                                               bool UnknownElemTypeI8,
+                                               bool IsPostprocessing) {
   Type *Ty = Op->getType();
   if (auto *OpI = dyn_cast<Instruction>(Op)) {
     Ty = restoreMutatedType(GR, OpI, Ty);
@@ -602,8 +610,8 @@ Type *SPIRVEmitIntrinsics::reconstructType(Value *Op, bool UnknownElemTypeI8,
   return nullptr;
 }
 
-CallInst *SPIRVEmitIntrinsics::buildSpvPtrcast(Function *F, Value *Op,
-                                               Type *ElemTy) {
+CallInst *SPIRVEmitIntrinsicsImpl::buildSpvPtrcast(Function *F, Value *Op,
+                                                   Type *ElemTy) {
   IRBuilder<> B(Op->getContext());
   if (auto *OpI = dyn_cast<Instruction>(Op)) {
     // spv_ptrcast's argument Op denotes an instruction that generates
@@ -625,7 +633,7 @@ CallInst *SPIRVEmitIntrinsics::buildSpvPtrcast(Function *F, Value *Op,
   return PtrCasted;
 }
 
-void SPIRVEmitIntrinsics::replaceUsesOfWithSpvPtrcast(
+void SPIRVEmitIntrinsicsImpl::replaceUsesOfWithSpvPtrcast(
     Value *Op, Type *ElemTy, Instruction *I,
     DenseMap<Function *, CallInst *> Ptrcasts) {
   Function *F = I->getParent()->getParent();
@@ -640,7 +648,7 @@ void SPIRVEmitIntrinsics::replaceUsesOfWithSpvPtrcast(
   I->replaceUsesOfWith(Op, PtrCastedI);
 }
 
-void SPIRVEmitIntrinsics::propagateElemType(
+void SPIRVEmitIntrinsicsImpl::propagateElemType(
     Value *Op, Type *ElemTy,
     DenseSet<std::pair<Value *, Value *>> &VisitedSubst) {
   DenseMap<Function *, CallInst *> Ptrcasts;
@@ -658,7 +666,7 @@ void SPIRVEmitIntrinsics::propagateElemType(
   }
 }
 
-void SPIRVEmitIntrinsics::propagateElemTypeRec(
+void SPIRVEmitIntrinsicsImpl::propagateElemTypeRec(
     Value *Op, Type *PtrElemTy, Type *CastElemTy,
     DenseSet<std::pair<Value *, Value *>> &VisitedSubst) {
   SmallPtrSet<Value *, 0> Visited;
@@ -667,7 +675,7 @@ void SPIRVEmitIntrinsics::propagateElemTypeRec(
                        std::move(Ptrcasts));
 }
 
-void SPIRVEmitIntrinsics::propagateElemTypeRec(
+void SPIRVEmitIntrinsicsImpl::propagateElemTypeRec(
     Value *Op, Type *PtrElemTy, Type *CastElemTy,
     DenseSet<std::pair<Value *, Value *>> &VisitedSubst,
     SmallPtrSetImpl<Value *> &Visited,
@@ -691,15 +699,14 @@ void SPIRVEmitIntrinsics::propagateElemTypeRec(
 // Set element pointer type to the given value of ValueTy and tries to
 // specify this type further (recursively) by Operand value, if needed.
 
-Type *
-SPIRVEmitIntrinsics::deduceElementTypeByValueDeep(Type *ValueTy, Value *Operand,
-                                                  bool UnknownElemTypeI8) {
+Type *SPIRVEmitIntrinsicsImpl::deduceElementTypeByValueDeep(
+    Type *ValueTy, Value *Operand, bool UnknownElemTypeI8) {
   SmallPtrSet<Value *, 0> Visited;
   return deduceElementTypeByValueDeep(ValueTy, Operand, Visited,
                                       UnknownElemTypeI8);
 }
 
-Type *SPIRVEmitIntrinsics::deduceElementTypeByValueDeep(
+Type *SPIRVEmitIntrinsicsImpl::deduceElementTypeByValueDeep(
     Type *ValueTy, Value *Operand, SmallPtrSetImpl<Value *> &Visited,
     bool UnknownElemTypeI8) {
   Type *Ty = ValueTy;
@@ -717,7 +724,7 @@ Type *SPIRVEmitIntrinsics::deduceElementTypeByValueDeep(
 }
 
 // Traverse User instructions to deduce an element pointer type of the operand.
-Type *SPIRVEmitIntrinsics::deduceElementTypeByUsersDeep(
+Type *SPIRVEmitIntrinsicsImpl::deduceElementTypeByUsersDeep(
     Value *Op, SmallPtrSetImpl<Value *> &Visited, bool UnknownElemTypeI8) {
   if (!Op || !isPointerTy(Op->getType()) || isa<ConstantPointerNull>(Op) ||
       isa<UndefValue>(Op))
@@ -754,14 +761,15 @@ static Type *getPointeeTypeByCallInst(StringRef DemangledName,
 
 // Deduce and return a successfully deduced Type of the Instruction,
 // or nullptr otherwise.
-Type *SPIRVEmitIntrinsics::deduceElementTypeHelper(Value *I,
-                                                   bool UnknownElemTypeI8) {
+Type *SPIRVEmitIntrinsicsImpl::deduceElementTypeHelper(Value *I,
+                                                       bool UnknownElemTypeI8) {
   SmallPtrSet<Value *, 0> Visited;
   return deduceElementTypeHelper(I, Visited, UnknownElemTypeI8);
 }
 
-void SPIRVEmitIntrinsics::maybeAssignPtrType(Type *&Ty, Value *Op, Type *RefTy,
-                                             bool UnknownElemTypeI8) {
+void SPIRVEmitIntrinsicsImpl::maybeAssignPtrType(Type *&Ty, Value *Op,
+                                                 Type *RefTy,
+                                                 bool UnknownElemTypeI8) {
   if (isUntypedPointerTy(RefTy)) {
     if (!UnknownElemTypeI8)
       return;
@@ -772,7 +780,7 @@ void SPIRVEmitIntrinsics::maybeAssignPtrType(Type *&Ty, Value *Op, Type *RefTy,
   Ty = RefTy;
 }
 
-bool SPIRVEmitIntrinsics::walkLogicalAccessChainDynamic(
+bool SPIRVEmitIntrinsicsImpl::walkLogicalAccessChainDynamic(
     Type *CurType, Value *Operand, uint64_t Multiplier,
     const std::function<void(Type *, uint64_t)> &OnLiteralIndexing,
     const std::function<void(Type *, Value *, uint64_t)> &OnDynamicIndexing) {
@@ -796,7 +804,7 @@ bool SPIRVEmitIntrinsics::walkLogicalAccessChainDynamic(
   return AT == nullptr;
 }
 
-bool SPIRVEmitIntrinsics::walkLogicalAccessChainConstant(
+bool SPIRVEmitIntrinsicsImpl::walkLogicalAccessChainConstant(
     Type *CurType, uint64_t Offset,
     const std::function<void(Type *, uint64_t)> &OnLiteralIndexing) {
   auto &DL = CurrF->getDataLayout();
@@ -838,7 +846,7 @@ bool SPIRVEmitIntrinsics::walkLogicalAccessChainConstant(
   return false;
 }
 
-bool SPIRVEmitIntrinsics::walkLogicalAccessChain(
+bool SPIRVEmitIntrinsicsImpl::walkLogicalAccessChain(
     GetElementPtrInst &GEP,
     const std::function<void(Type *, uint64_t)> &OnLiteralIndexing,
     const std::function<void(Type *, Value *, uint64_t)> &OnDynamicIndexing) {
@@ -862,8 +870,8 @@ bool SPIRVEmitIntrinsics::walkLogicalAccessChain(
                                        OnLiteralIndexing, OnDynamicIndexing);
 }
 
-Instruction *
-SPIRVEmitIntrinsics::buildLogicalAccessChainFromGEP(GetElementPtrInst &GEP) {
+Instruction *SPIRVEmitIntrinsicsImpl::buildLogicalAccessChainFromGEP(
+    GetElementPtrInst &GEP) {
   auto &DL = CurrF->getDataLayout();
   IRBuilder<> B(GEP.getParent());
   B.SetInsertPoint(&GEP);
@@ -913,7 +921,7 @@ SPIRVEmitIntrinsics::buildLogicalAccessChainFromGEP(GetElementPtrInst &GEP) {
   return NewI;
 }
 
-Type *SPIRVEmitIntrinsics::getGEPTypeLogical(GetElementPtrInst *GEP) {
+Type *SPIRVEmitIntrinsicsImpl::getGEPTypeLogical(GetElementPtrInst *GEP) {
 
   Type *CurType = GEP->getResultElementType();
 
@@ -924,7 +932,7 @@ Type *SPIRVEmitIntrinsics::getGEPTypeLogical(GetElementPtrInst *GEP) {
   return Interrupted ? GEP->getResultElementType() : CurType;
 }
 
-Type *SPIRVEmitIntrinsics::getGEPType(GetElementPtrInst *Ref) {
+Type *SPIRVEmitIntrinsicsImpl::getGEPType(GetElementPtrInst *Ref) {
   if (getByteAddressingMultiplier(Ref->getSourceElementType()) &&
       TM.getSubtargetImpl()->isLogicalSPIRV()) {
     return getGEPTypeLogical(Ref);
@@ -943,7 +951,7 @@ Type *SPIRVEmitIntrinsics::getGEPType(GetElementPtrInst *Ref) {
   return Ty;
 }
 
-Type *SPIRVEmitIntrinsics::deduceElementTypeHelper(
+Type *SPIRVEmitIntrinsicsImpl::deduceElementTypeHelper(
     Value *I, SmallPtrSetImpl<Value *> &Visited, bool UnknownElemTypeI8,
     bool IgnoreKnownType) {
   // allow to pass nullptr as an argument
@@ -1101,16 +1109,15 @@ Type *SPIRVEmitIntrinsics::deduceElementTypeHelper(
 // Re-create a type of the value if it has untyped pointer fields, also nested.
 // Return the original value type if no corrections of untyped pointer
 // information is found or needed.
-Type *SPIRVEmitIntrinsics::deduceNestedTypeHelper(User *U,
-                                                  bool UnknownElemTypeI8) {
+Type *SPIRVEmitIntrinsicsImpl::deduceNestedTypeHelper(User *U,
+                                                      bool UnknownElemTypeI8) {
   SmallPtrSet<Value *, 0> Visited;
   return deduceNestedTypeHelper(U, U->getType(), Visited, UnknownElemTypeI8);
 }
 
-Type *
-SPIRVEmitIntrinsics::deduceNestedTypeHelper(User *U, Type *OrigTy,
-                                            SmallPtrSetImpl<Value *> &Visited,
-                                            bool UnknownElemTypeI8) {
+Type *SPIRVEmitIntrinsicsImpl::deduceNestedTypeHelper(
+    User *U, Type *OrigTy, SmallPtrSetImpl<Value *> &Visited,
+    bool UnknownElemTypeI8) {
   if (!U)
     return OrigTy;
 
@@ -1187,7 +1194,8 @@ SPIRVEmitIntrinsics::deduceNestedTypeHelper(User *U, Type *OrigTy,
   return OrigTy;
 }
 
-Type *SPIRVEmitIntrinsics::deduceElementType(Value *I, bool UnknownElemTypeI8) {
+Type *SPIRVEmitIntrinsicsImpl::deduceElementType(Value *I,
+                                                 bool UnknownElemTypeI8) {
   if (Type *Ty = deduceElementTypeHelper(I, UnknownElemTypeI8))
     return Ty;
   if (!UnknownElemTypeI8)
@@ -1211,7 +1219,7 @@ static inline Type *getAtomicElemTy(SPIRVGlobalRegistry *GR, Instruction *I,
 
 // Try to deduce element type for a call base. Returns false if this is an
 // indirect function invocation, and true otherwise.
-bool SPIRVEmitIntrinsics::deduceOperandElementTypeCalledFunction(
+bool SPIRVEmitIntrinsicsImpl::deduceOperandElementTypeCalledFunction(
     CallInst *CI, SmallVector<std::pair<Value *, unsigned>> &Ops,
     Type *&KnownElemTy, bool &Incomplete) {
   Function *CalledF = CI->getCalledFunction();
@@ -1283,7 +1291,7 @@ bool SPIRVEmitIntrinsics::deduceOperandElementTypeCalledFunction(
 }
 
 // Try to deduce element type for a function pointer.
-void SPIRVEmitIntrinsics::deduceOperandElementTypeFunctionPointer(
+void SPIRVEmitIntrinsicsImpl::deduceOperandElementTypeFunctionPointer(
     CallInst *CI, SmallVector<std::pair<Value *, unsigned>> &Ops,
     Type *&KnownElemTy, bool IsPostprocessing) {
   Value *Op = CI->getCalledOperand();
@@ -1327,7 +1335,7 @@ void SPIRVEmitIntrinsics::deduceOperandElementTypeFunctionPointer(
       IsNewFTy ? FunctionType::get(RetTy, ArgTys, FTy->isVarArg()) : FTy;
 }
 
-bool SPIRVEmitIntrinsics::deduceOperandElementTypeFunctionRet(
+bool SPIRVEmitIntrinsicsImpl::deduceOperandElementTypeFunctionRet(
     Instruction *I, SmallPtrSetImpl<Instruction *> *IncompleteRets,
     const SmallPtrSetImpl<Value *> *AskOps, bool IsPostprocessing,
     Type *&KnownElemTy, Value *Op, Function *F) {
@@ -1374,7 +1382,7 @@ bool SPIRVEmitIntrinsics::deduceOperandElementTypeFunctionRet(
 // tries to deduce them. If the Instruction has Pointer operands with known
 // types which differ from expected, this function tries to insert a bitcast to
 // resolve the issue.
-void SPIRVEmitIntrinsics::deduceOperandElementType(
+void SPIRVEmitIntrinsicsImpl::deduceOperandElementType(
     Instruction *I, SmallPtrSetImpl<Instruction *> *IncompleteRets,
     const SmallPtrSetImpl<Value *> *AskOps, bool IsPostprocessing) {
   SmallVector<std::pair<Value *, unsigned>> Ops;
@@ -1577,9 +1585,9 @@ void SPIRVEmitIntrinsics::deduceOperandElementType(
   TypeValidated.insert(I);
 }
 
-void SPIRVEmitIntrinsics::replaceMemInstrUses(Instruction *Old,
-                                              Instruction *New,
-                                              IRBuilder<> &B) {
+void SPIRVEmitIntrinsicsImpl::replaceMemInstrUses(Instruction *Old,
+                                                  Instruction *New,
+                                                  IRBuilder<> &B) {
   while (!Old->user_empty()) {
     auto *U = Old->user_back();
     if (isAssignTypeInstr(U)) {
@@ -1626,8 +1634,8 @@ void SPIRVEmitIntrinsics::replaceMemInstrUses(Instruction *Old,
 }
 
 // Lower a poison or undef Op to its placeholder intrinsic.
-Value *SPIRVEmitIntrinsics::lowerUndefOrPoison(Value *Op, IRBuilder<> &B,
-                                               bool HasPoisonExt) {
+Value *SPIRVEmitIntrinsicsImpl::lowerUndefOrPoison(Value *Op, IRBuilder<> &B,
+                                                   bool HasPoisonExt) {
   auto *UV = dyn_cast<UndefValue>(Op);
   if (!UV)
     return nullptr;
@@ -1659,7 +1667,7 @@ Value *SPIRVEmitIntrinsics::lowerUndefOrPoison(Value *Op, IRBuilder<> &B,
 // Replace aggregate undef or poison operands and extension-enabled scalar
 // poison operands with placeholder intrinsics. Scalar undef is left as is. See
 // lowerUndefOrPoison.
-void SPIRVEmitIntrinsics::preprocessUndefsAndPoisons(IRBuilder<> &B) {
+void SPIRVEmitIntrinsicsImpl::preprocessUndefsAndPoisons(IRBuilder<> &B) {
   const SPIRVSubtarget *STI = TM.getSubtargetImpl(*CurrF);
   bool HasPoisonExt =
       STI->canUseExtension(SPIRV::Extension::SPV_KHR_poison_freeze);
@@ -1698,7 +1706,7 @@ void SPIRVEmitIntrinsics::preprocessUndefsAndPoisons(IRBuilder<> &B) {
 // target type. Casting null always yields null, and this avoids SPIR-V
 // lowering issues where the null gets typed as an integer instead of a
 // pointer.
-void SPIRVEmitIntrinsics::simplifyNullAddrSpaceCasts() {
+void SPIRVEmitIntrinsicsImpl::simplifyNullAddrSpaceCasts() {
   for (Instruction &I : make_early_inc_range(instructions(CurrF)))
     if (auto *ASC = dyn_cast<AddrSpaceCastInst>(&I))
       if (isa<ConstantPointerNull>(ASC->getPointerOperand())) {
@@ -1727,8 +1735,8 @@ static bool isAggregateValueIdInstr(const Instruction &I) {
 // Give each multi-register aggregate arm of an aggregate PHI/select/freeze a
 // single value-id by reassembling it with extractvalue + insertvalue, so the
 // arm matches the result once it is mutated to a value-id.
-void SPIRVEmitIntrinsics::insertCompositeAggregateArms(Instruction *I,
-                                                       IRBuilder<> &B) {
+void SPIRVEmitIntrinsicsImpl::insertCompositeAggregateArms(Instruction *I,
+                                                           IRBuilder<> &B) {
   auto *Phi = dyn_cast<PHINode>(I);
   for (Use &U : I->operands()) {
     Value *Op = U.get();
@@ -1750,7 +1758,7 @@ void SPIRVEmitIntrinsics::insertCompositeAggregateArms(Instruction *I,
   }
 }
 
-void SPIRVEmitIntrinsics::preprocessCompositeConstants(IRBuilder<> &B) {
+void SPIRVEmitIntrinsicsImpl::preprocessCompositeConstants(IRBuilder<> &B) {
   const SPIRVSubtarget *STI = TM.getSubtargetImpl(*CurrF);
   bool HasPoisonExt =
       STI->canUseExtension(SPIRV::Extension::SPV_KHR_poison_freeze);
@@ -1864,7 +1872,7 @@ static void addSaturatedDecorationToIntrinsic(Instruction *I, IRBuilder<> &B) {
     createSaturatedConversionDecoration(I, B);
 }
 
-Instruction *SPIRVEmitIntrinsics::visitCallInst(CallInst &Call) {
+Instruction *SPIRVEmitIntrinsicsImpl::visitCallInst(CallInst &Call) {
   if (!Call.isInlineAsm())
     return &Call;
 
@@ -1890,8 +1898,8 @@ Instruction *SPIRVEmitIntrinsics::visitCallInst(CallInst &Call) {
 }
 
 // Use a tip about rounding mode to create a decoration.
-void SPIRVEmitIntrinsics::useRoundingMode(ConstrainedFPIntrinsic *FPI,
-                                          IRBuilder<> &B) {
+void SPIRVEmitIntrinsicsImpl::useRoundingMode(ConstrainedFPIntrinsic *FPI,
+                                              IRBuilder<> &B) {
   std::optional<RoundingMode> RM = FPI->getRoundingMode();
   if (!RM.has_value())
     return;
@@ -1923,7 +1931,7 @@ void SPIRVEmitIntrinsics::useRoundingMode(ConstrainedFPIntrinsic *FPI,
   createRoundingModeDecoration(FPI, RoundingModeDeco, B);
 }
 
-Instruction *SPIRVEmitIntrinsics::visitSwitchInst(SwitchInst &I) {
+Instruction *SPIRVEmitIntrinsicsImpl::visitSwitchInst(SwitchInst &I) {
  ...
[truncated]

``````````

</details>


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


More information about the llvm-commits mailing list