Add a version of Intrinsic::getName which is more efficient when there are no overloads.
authorPete Cooper <peter_cooper@apple.com>
Thu, 18 Aug 2016 18:30:54 +0000 (18:30 +0000)
committerPete Cooper <peter_cooper@apple.com>
Thu, 18 Aug 2016 18:30:54 +0000 (18:30 +0000)
commita8db71e8407922ab7e2e8279e59749d8ce222e0d
tree998f2dbb444ef4766f0f9d46dc2402a0879d6d8d
parentc33b837af399c75bc1dec0aaa1d5b3944964b1c6
Add a version of Intrinsic::getName which is more efficient when there are no overloads.

When running 'opt -O2 verify-uselistorder-nodbg.lto.bc', there are 33m allocations.  8.2m
come from std::string allocations in Intrinsic::getName().  Turns out this method only
returns a std::string because it needs to handle overloads, but that is not the common case.

This adds an overload of getName which just returns a StringRef when there are no overloads
and so saves on the allocations.

llvm-svn: 279113
llvm/include/llvm/IR/Intrinsics.h
llvm/lib/IR/Function.cpp