Skip to content

Commit 8545a9f

Browse files
Temporarily add back LLVM::getStackPointer
Fix build failure from `b39c1e1`. Signed-off-by: Whitney Tsang <[email protected]>
1 parent 2a7a540 commit 8545a9f

File tree

1 file changed

+13
-0
lines changed
  • include/triton/Conversion/TritonGPUToLLVM

1 file changed

+13
-0
lines changed

include/triton/Conversion/TritonGPUToLLVM/Utility.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
417430
inline Value getGlobalScratchPtr(Location loc, RewriterBase &rewriter,
418431
FunctionOpInterface funcOp,
419432
Value allocOffset = {}) {

0 commit comments

Comments
 (0)