Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes in Utility.h to address review comments from PR#992 #1068

Merged
merged 2 commits into from
May 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions third_party/intel/lib/TritonIntelGPUToLLVM/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,18 @@ static Value getStackPointer(PatternRewriter &rewriter,
LLVM::LLVMPointerType ptrTy = ptr_ty(
rewriter.getContext(), TritonGEN::TritonGENMemorySpace::kWorkgroup);
if (mod->getAttrOfType<IntegerAttr>("triton_gpu.shared").getInt() == 0)
return rewriter.create<LLVM::UndefOp>(funcOp.getLoc(), ptrTy);
return rewriter.create<LLVM::PoisonOp>(funcOp.getLoc(), ptrTy);
return funcOp.getArgument(funcOp.getNumArguments() - 1);
}

static Value getSharedMemoryBase(Location loc,
ConversionPatternRewriter &rewriter,
Operation *op) {
auto ptrTy = LLVM::LLVMPointerType::get(rewriter.getContext(), 3);
FunctionOpInterface func =
op->template getParentOfType<FunctionOpInterface>();
auto ptrTy = LLVM::LLVMPointerType::get(
rewriter.getContext(), TritonGEN::TritonGENMemorySpace::kWorkgroup);
FunctionOpInterface func = op->getParentOfType<FunctionOpInterface>();
assert(op->hasAttr("allocation.offset"));
size_t offset = op->getAttr("allocation.offset")
.cast<IntegerAttr>()
size_t offset = cast<IntegerAttr>(op->getAttr("allocation.offset"))
.getValue()
.getZExtValue();
Value offVal = i32_val(offset);
Expand Down