File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
include/triton/Conversion/TritonGPUToLLVM Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -414,6 +414,19 @@ inline bool isKernel(FunctionOpInterface funcOp) {
414414 return funcOp.getVisibility () == SymbolTable::Visibility::Public;
415415}
416416
417+ inline Value getStackPointer (RewriterBase &rewriter,
418+ FunctionOpInterface funcOp) {
419+ // See NOTE: [Additional Function Arguments]
420+ if (!isKernel (funcOp)) {
421+ return funcOp.getArgument (funcOp.getNumArguments () - 2 );
422+ }
423+
424+ auto mod = funcOp->getParentOfType <ModuleOp>();
425+ auto globalBase = dyn_cast<LLVM::GlobalOp>(mod.lookupSymbol (" global_smem" ));
426+ assert (globalBase);
427+ return rewriter.create <LLVM::AddressOfOp>(funcOp.getLoc (), globalBase);
428+ }
429+
417430inline Value getGlobalScratchPtr (Location loc, RewriterBase &rewriter,
418431 FunctionOpInterface funcOp,
419432 Value allocOffset = {}) {
You can’t perform that action at this time.
0 commit comments