Skip to content

Commit

Permalink
Small tweak.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescarni committed Dec 22, 2024
1 parent f282f2a commit b8df128
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/llvm_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,14 +446,21 @@ void optimise_module(llvm::Module &M, llvm::TargetMachine &tm, unsigned opt_leve
}
}

#if LLVM_VERSION_MAJOR >= 18

// NOTE: explicitly disable scatter/gather when auto-vectorising
// as they can currently result in slowdowns:
//
// https://github.com/llvm/llvm-project/issues/91370
//
// NOTE: it seems like -mno-gather/scatter are available since
// LLVM 18.
for (auto &f : M) {
f.addFnAttr("no-gather");
f.addFnAttr("no-scatter");
}

#endif
}

// NOTE: adapted from here:
Expand Down

0 comments on commit b8df128

Please sign in to comment.