[LLVMdev] Inefficiency in Intrinsic::getName in Function.cpp?

Michael Ilseman michael.ilseman at gmail.com
Mon Apr 25 15:12:29 PDT 2011

I was looking over Function.cpp and saw that for every call to
Intrinsic::getName, the entire intrinsic table (about a thousand
references to strings) gets copied over for the initialization of
Table. Is there a reason for why this is done, or would it be better
for Table to be static, so that this initialization only happens on
the first call? Perhaps this is optimized away for the release build,
but for the debug build I'm running it seems to redo the
initialization on every call.

  const char * const Table[] = {
#include "llvm/Intrinsics.gen"

More information about the llvm-dev mailing list