Skip to content

Commit 05adafe

Browse files
authored
[LLVM] Pass NVPTX triple to LibaryAnalysis (#7170)
NVPTX has some suboptimal lowerings like that memset. By doing this, we avoid hitting these lowerings.
1 parent 6da35a7 commit 05adafe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

python/src/llvm.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,14 @@ void init_triton_llvm(py::module &&m) {
316316
CGSCCAnalysisManager cgam;
317317
ModuleAnalysisManager mam;
318318

319+
if (arch.empty()) {
320+
llvm::TargetLibraryInfoImpl TLII;
321+
TLII.disableAllFunctions();
322+
fam.registerPass([TLII = std::move(TLII)] {
323+
return llvm::TargetLibraryAnalysis(TLII);
324+
});
325+
}
326+
319327
PassInstrumentationCallbacks *instrCbPtr = nullptr;
320328
PassInstrumentationCallbacks passInstrCb;
321329
StandardInstrumentations standardInstr(mod->getContext(),

0 commit comments

Comments
 (0)