From 2e948bf0acf6a9675beb6b717e7b65b07db98279 Mon Sep 17 00:00:00 2001 From: "Si, Yudong" Date: Fri, 26 Jul 2024 02:44:27 +0000 Subject: [PATCH] Add debug code for capture failure details --- .../intel/lib/TritonIntelGPUToLLVM/Utility.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/third_party/intel/lib/TritonIntelGPUToLLVM/Utility.h b/third_party/intel/lib/TritonIntelGPUToLLVM/Utility.h index f9a96da26b..a3b6e1ec7c 100644 --- a/third_party/intel/lib/TritonIntelGPUToLLVM/Utility.h +++ b/third_party/intel/lib/TritonIntelGPUToLLVM/Utility.h @@ -12,6 +12,7 @@ #include "intel/include/Dialect/TritonGEN/IR/TritonGENDialect.h" #include "intel/include/Dialect/TritonIntelGPU/IR/Dialect.h" #include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h" +#include "mlir/IR/BuiltinOps.h" #include "triton/Conversion/TritonGPUToLLVM/Utility.h" #include "triton/Dialect/Triton/IR/Utility.h" #include "llvm/Support/ErrorHandling.h" @@ -105,12 +106,18 @@ static Value getSharedMemoryBase(Location loc, auto ptrTy = LLVM::LLVMPointerType::get( rewriter.getContext(), TritonGEN::TritonGENMemorySpace::kWorkgroup); FunctionOpInterface func = op->getParentOfType(); - size_t offset = 0; - if (op->hasAttr("allocation.offset")) { - offset = cast(op->getAttr("allocation.offset")) - .getValue() - .getZExtValue(); + // CI debugging usage here + if (!op->hasAttr("allocation.offset")) { + auto mod = op->getParentOfType(); + llvm::errs() << "op: " << *op << "\n"; + llvm::errs() << "mod:" << mod << "\n"; + llvm::errs().flush(); + + assert(false && "debug"); } + size_t offset = cast(op->getAttr("allocation.offset")) + .getValue() + .getZExtValue(); Value offVal = i32_val(offset); Value base = gep(ptrTy, i8_ty, LLVM::intel::getStackPointer(rewriter, func), offVal);