How to force Visual Studio compiler to generate inline instructions for intrinsic functions?

张皓然 0 Reputation points
2025-10-12T04:16:29.0533333+00:00

When I turned on /Oi and declared #pragma intrinsic(memset), etc., and compile, Visual Studio still generates calls to memset, etc. Later I found the reason:User's image The question is, how to force the compiler to generate inline instructions for intrinsic functions instead of calls to those functions (even if it will result in lower performance)?

Developer technologies | C++
Developer technologies | C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.