[compiler-rt] [llvm] [nsan] Emit calls to optimized functions (PR #98900)

Alexander Shaposhnikov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 16:19:49 PDT 2024


================
@@ -493,6 +493,59 @@ class ValueToShadowMap {
   DenseMap<Value *, Value *> Map;
 };
 
+// Template parameter is the number of functions
+template <size_t N> class NsanMemOpFn {
----------------
alexander-shaposhnikov wrote:

After taking a closer look - maybe push it even further and drop the template parameter ?
The number of sized variants is known in the constructor (Sized.size()),
std::array can be replaced with SmallVector (don't think the size of the data structure is a particular concern here).
p.s. If the code in getFunctionFor is specific to a particular value of N, we should add a comment and an assert (or asserts).

https://github.com/llvm/llvm-project/pull/98900


More information about the llvm-commits mailing list