Skip to content

Commit

Permalink
[NFC] Fix LLVM TargetInfo printf issue. (#2040)
Browse files Browse the repository at this point in the history
The Intel GPU `printf` requires the format string is located uniform
constant space.
Add "TritonGen::UniformConstant" attribute to the definition of format
string to match the requirement of `printf`.
  • Loading branch information
chengjunlu authored Aug 29, 2024
1 parent b103b3b commit 6218819
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions third_party/intel/lib/TritonIntelGPUToLLVM/TargetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ void TargetInfo::printf(RewriterBase &rewriter, StringRef msg,
llvm::SmallString<64> msgNewline(msg);
msgNewline.push_back('\n');
msgNewline.push_back('\0');
Value msgValue =
LLVM::addStringToModule(UnknownLoc::get(rewriter.getContext()), rewriter,
"printfFormat_", msgNewline);
Value msgValue = LLVM::intel::addStringToModule(
UnknownLoc::get(rewriter.getContext()), rewriter, "printfFormat_",
msgNewline, /*AddressSpace*/ TritonGEN::kUniformConstant);
printf(rewriter, msgValue, msgNewline.size_in_bytes(), args);
}

Expand Down

0 comments on commit 6218819

Please sign in to comment.