Skip to content

Commit

Permalink
move some target specfific code to the backend
Browse files Browse the repository at this point in the history
  • Loading branch information
CRobeck committed Dec 12, 2024
1 parent b06b1c4 commit 73b64dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 0 additions & 6 deletions python/src/llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,6 @@ void init_triton_llvm(py::module &&m) {
"support on the AMD backend\n";
throw std::runtime_error(ErrMsg);
}
for (llvm::Function &f : mod->functions()) {
if (f.isIntrinsic() || f.isDeclaration())
continue;
f.addFnAttr("target-features", "+xnack");
f.addFnAttr(llvm::Attribute::SanitizeAddress);
}
AddressSanitizerOptions Opts;
mpm.addPass(AddressSanitizerPass(Opts));
}
Expand Down
3 changes: 3 additions & 0 deletions third_party/amd/backend/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ def make_llir(src, metadata, options):
fns[0].add_fn_attr("amdgpu-waves-per-eu", f"{options.waves_per_eu}")
denormal_mode = "preserve-sign" if options.allow_flush_denorm else "ieee"
fns[0].add_fn_attr("denormal-fp-math-f32", denormal_mode)
if os.environ.get("TRITON_ENABLE_ASAN", "0") == "1":
fns[0].add_fn_attr("target-features", target_features)
fns[0].add_fn_attr("sanitize_address")

# Hint the compiler that we'd like the firmware to set the kernel arguments
# to user SGPRs so that the kernel does not need to s_load its arguments
Expand Down

0 comments on commit 73b64dd

Please sign in to comment.