diff options
author | Michael Ilseman <milseman@apple.com> | 2012-12-19 23:17:20 +0000 |
---|---|---|
committer | Michael Ilseman <milseman@apple.com> | 2012-12-19 23:17:20 +0000 |
commit | f846f16c92590379e900d01812e828e83b759cee (patch) | |
tree | 44b01d6f2d2da35339c228a018261d963da819d1 /include/llvm/Function.h | |
parent | 18e7211068c9d2c6204512f9c468ee179818a4b6 (diff) |
Refactor isIntrinsic() to be quicker, and change classof() (and thus, isa<IntrinsicInst>()) to use it. This decreases the number of occurrences of the slow-path string matching performed by getIntrinsicID().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170602 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Function.h')
-rw-r--r-- | include/llvm/Function.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h index ce7ae2646b..2f555e89d8 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -147,7 +147,7 @@ public: /// defined in llvm/Intrinsics.h. /// unsigned getIntrinsicID() const LLVM_READONLY; - bool isIntrinsic() const { return getIntrinsicID() != 0; } + bool isIntrinsic() const { return getName().startswith("llvm."); } /// getCallingConv()/setCallingConv(CC) - These method get and set the /// calling convention of this function. The enum values for the known |