diff options
author | Justin Lebar <jlebar@google.com> | 2016-07-28 23:58:15 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-07-28 23:58:15 +0000 |
commit | 9cbc30103598be2d45e3c93991f2d356835860f5 (patch) | |
tree | 6231ecac604f76e76743829c12c2804896362caf /llvm/lib/IR/Function.cpp | |
parent | d240a889ad7d9be18a83f56cc723f77f74e2f8de (diff) | |
download | llvm-9cbc30103598be2d45e3c93991f2d356835860f5.zip llvm-9cbc30103598be2d45e3c93991f2d356835860f5.tar.gz llvm-9cbc30103598be2d45e3c93991f2d356835860f5.tar.bz2 |
Revert "Don't invoke getName() from Function::isIntrinsic().", rL276942.
This broke some out-of-tree AMDGPU tests that relied on the old behavior
wherein isIntrinsic() would return true for any function that starts
with "llvm.". And in general that change will not play nicely with
out-of-tree backends.
llvm-svn: 277087
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r-- | llvm/lib/IR/Function.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index d9c5924..e1223d0 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -488,7 +488,9 @@ static ArrayRef<const char *> findTargetSubtable(StringRef Name) { /// \brief This does the actual lookup of an intrinsic ID which /// matches the given function name. -static Intrinsic::ID lookupIntrinsicID(StringRef Name) { +static Intrinsic::ID lookupIntrinsicID(const ValueName *ValName) { + StringRef Name = ValName->getKey(); + ArrayRef<const char *> NameTable = findTargetSubtable(Name); int Idx = Intrinsic::lookupLLVMIntrinsicByName(NameTable, Name); if (Idx == -1) @@ -506,11 +508,12 @@ static Intrinsic::ID lookupIntrinsicID(StringRef Name) { } void Function::recalculateIntrinsicID() { - if (!hasLLVMReservedName()) { + const ValueName *ValName = this->getValueName(); + if (!ValName || !isIntrinsic()) { IntID = Intrinsic::not_intrinsic; return; } - IntID = lookupIntrinsicID(getName()); + IntID = lookupIntrinsicID(ValName); } /// Returns a stable mangling for the type specified for use in the name |