Skip to content

Commit

Permalink
Temporary workaround for test_assert failure (triton-lang#1293)
Browse files Browse the repository at this point in the history
This is related to the issue (triton-lang#1176) that internallinkage breaks
test_subprocess::test_assert.
The bug is caused by wrong __devicelib_assert_fail behavior when it is
optimized by inlining or dead argument elimination.
It is reported to IGC.
Until it is resolved, I changed the workaround specific to
__devicelib_assert_fail, so that other SPIR library functions can be
statically linked.
  • Loading branch information
hwnam831 authored Jun 10, 2024
1 parent 0dba702 commit 1152b35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/src/llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,10 @@ void init_triton_llvm(py::module &&m) {
// linkage as a signifier of kernel functions.
for (llvm::Function &fn : dstMod->functions()) {
if (externalFns.count(fn.getName().str())) {
// FIXME: Temporary workaround to avoid marking SPIR_FUNC functions
// with InternalLinkage, which causes test_subprocess.py::test_assert
// to fail.
if (fn.getCallingConv() == CallingConv::SPIR_FUNC)
// FIXME: Temporary workaround to avoid __devicelib_assert_fail
// optimization with InternalLinkage, which causes
// test_subprocess.py::test_assert to fail.
if (fn.getName().str() == "__devicelib_assert_fail")
continue;
fn.setLinkage(llvm::GlobalValue::InternalLinkage);
}
Expand Down

0 comments on commit 1152b35

Please sign in to comment.