@@ -441,7 +441,7 @@ class AMDGPULowerModuleLDS {
441441 return KernelSet;
442442
443443 for (Function &Func : M.functions ()) {
444- if (Func.isDeclaration () || !isKernelLDS (& Func))
444+ if (Func.isDeclaration () || !isKernel ( Func))
445445 continue ;
446446 for (GlobalVariable *GV : LDSUsesInfo.indirect_access [&Func]) {
447447 if (VariableSet.contains (GV)) {
@@ -555,7 +555,7 @@ class AMDGPULowerModuleLDS {
555555 for (Function &Func : M->functions ()) {
556556 if (Func.isDeclaration ())
557557 continue ;
558- if (!isKernelLDS (& Func))
558+ if (!isKernel ( Func))
559559 continue ;
560560
561561 if (KernelsThatAllocateTableLDS.contains (&Func) ||
@@ -703,15 +703,15 @@ class AMDGPULowerModuleLDS {
703703 return false ;
704704 }
705705 Function *F = I->getFunction ();
706- return !isKernelLDS ( F);
706+ return !isKernel (* F);
707707 });
708708
709709 // Replace uses of module scope variable from kernel functions that
710710 // allocate the module scope variable, otherwise leave them unchanged
711711 // Record on each kernel whether the module scope global is used by it
712712
713713 for (Function &Func : M.functions ()) {
714- if (Func.isDeclaration () || !isKernelLDS (& Func))
714+ if (Func.isDeclaration () || !isKernel ( Func))
715715 continue ;
716716
717717 if (KernelsThatAllocateModuleLDS.contains (&Func)) {
@@ -743,7 +743,7 @@ class AMDGPULowerModuleLDS {
743743
744744 DenseMap<Function *, LDSVariableReplacement> KernelToReplacement;
745745 for (Function &Func : M.functions ()) {
746- if (Func.isDeclaration () || !isKernelLDS (& Func))
746+ if (Func.isDeclaration () || !isKernel ( Func))
747747 continue ;
748748
749749 DenseSet<GlobalVariable *> KernelUsedVariables;
@@ -828,7 +828,7 @@ class AMDGPULowerModuleLDS {
828828 // semantics. Setting the alignment here allows this IR pass to accurately
829829 // predict the exact constant at which it will be allocated.
830830
831- assert (isKernelLDS ( func));
831+ assert (isKernel (* func));
832832
833833 LLVMContext &Ctx = M.getContext ();
834834 const DataLayout &DL = M.getDataLayout ();
@@ -878,7 +878,7 @@ class AMDGPULowerModuleLDS {
878878 for (auto &func : OrderedKernels) {
879879
880880 if (KernelsThatIndirectlyAllocateDynamicLDS.contains (func)) {
881- assert (isKernelLDS ( func));
881+ assert (isKernel (* func));
882882 if (!func->hasName ()) {
883883 reportFatalUsageError (" anonymous kernels cannot use LDS variables" );
884884 }
@@ -912,7 +912,7 @@ class AMDGPULowerModuleLDS {
912912 auto *I = dyn_cast<Instruction>(U.getUser ());
913913 if (!I)
914914 continue ;
915- if (isKernelLDS ( I->getFunction ()))
915+ if (isKernel (* I->getFunction ()))
916916 continue ;
917917
918918 replaceUseWithTableLookup (M, Builder, table, GV, U, nullptr );
@@ -928,7 +928,7 @@ class AMDGPULowerModuleLDS {
928928 for (Use &U : GV->uses ()) {
929929 if (auto *I = dyn_cast<Instruction>(U.getUser ())) {
930930 Function *F = I->getFunction ();
931- if (isKernelLDS ( F) && F != KF) {
931+ if (isKernel (* F) && F != KF) {
932932 NeedsReplacement = true ;
933933 break ;
934934 }
@@ -945,7 +945,7 @@ class AMDGPULowerModuleLDS {
945945 for (Use &U : make_early_inc_range (GV->uses ())) {
946946 if (auto *I = dyn_cast<Instruction>(U.getUser ())) {
947947 Function *F = I->getFunction ();
948- if (!isKernelLDS ( F) || F == KF) {
948+ if (!isKernel (* F) || F == KF) {
949949 U.getUser ()->replaceUsesOfWith (GV, NewGV);
950950 }
951951 }
@@ -997,7 +997,7 @@ class AMDGPULowerModuleLDS {
997997 std::vector<Function *> OrderedKernels;
998998 for (auto &K : LDSUsesInfo.direct_access ) {
999999 Function *F = K.first ;
1000- assert (isKernelLDS ( F));
1000+ assert (isKernel (* F));
10011001 OrderedKernels.push_back (F);
10021002 }
10031003 OrderedKernels = sortByName (std::move (OrderedKernels));
@@ -1033,7 +1033,7 @@ class AMDGPULowerModuleLDS {
10331033 }
10341034 // Also erase those special LDS variables from indirect_access.
10351035 for (auto &K : LDSUsesInfo.indirect_access ) {
1036- assert (isKernelLDS ( K.first ));
1036+ assert (isKernel (* K.first ));
10371037 for (GlobalVariable *GV : K.second ) {
10381038 if (isNamedBarrier (*GV))
10391039 K.second .erase (GV);
@@ -1058,7 +1058,7 @@ class AMDGPULowerModuleLDS {
10581058 VariableFunctionMap LDSToKernelsThatNeedToAccessItIndirectly;
10591059 for (auto &K : LDSUsesInfo.indirect_access ) {
10601060 Function *F = K.first ;
1061- assert (isKernelLDS ( F));
1061+ assert (isKernel (* F));
10621062 for (GlobalVariable *GV : K.second ) {
10631063 LDSToKernelsThatNeedToAccessItIndirectly[GV].insert (F);
10641064 }
@@ -1157,7 +1157,7 @@ class AMDGPULowerModuleLDS {
11571157 const DataLayout &DL = M.getDataLayout ();
11581158
11591159 for (Function &Func : M.functions ()) {
1160- if (Func.isDeclaration () || !isKernelLDS (& Func))
1160+ if (Func.isDeclaration () || !isKernel ( Func))
11611161 continue ;
11621162
11631163 // All three of these are optional. The first variable is allocated at
0 commit comments