Skip to content

Commit

Permalink
Add debug code for capture failure details (#1707)
Browse files Browse the repository at this point in the history
We can't reproduce the failure locally. This change aims to wait next
failure and capture details in CI.
  • Loading branch information
ESI-SYD authored Jul 26, 2024
1 parent 9e96abb commit c9b8754
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions third_party/intel/lib/TritonIntelGPUToLLVM/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,16 @@ static Value getSharedMemoryBase(Location loc,
auto ptrTy = LLVM::LLVMPointerType::get(
rewriter.getContext(), TritonGEN::TritonGENMemorySpace::kWorkgroup);
FunctionOpInterface func = op->getParentOfType<FunctionOpInterface>();
size_t offset = 0;
if (op->hasAttr("allocation.offset")) {
offset = cast<IntegerAttr>(op->getAttr("allocation.offset"))
.getValue()
.getZExtValue();
// CI debugging usage here
if (!op->hasAttr("allocation.offset")) {
auto mod = op->getParentOfType<ModuleOp>();
llvm::errs() << "op: " << *op << "\n";
llvm::errs() << "mod:" << mod << "\n";
llvm_unreachable("missing allocation.offset");
}
size_t offset = cast<IntegerAttr>(op->getAttr("allocation.offset"))
.getValue()
.getZExtValue();
Value offVal = i32_val(offset);
Value base =
gep(ptrTy, i8_ty, LLVM::intel::getStackPointer(rewriter, func), offVal);
Expand Down

0 comments on commit c9b8754

Please sign in to comment.