summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-07-28 23:58:15 +0000
committerJustin Lebar <jlebar@google.com>2016-07-28 23:58:15 +0000
commit9cbc30103598be2d45e3c93991f2d356835860f5 (patch)
tree6231ecac604f76e76743829c12c2804896362caf /llvm/lib/IR/Function.cpp
parentd240a889ad7d9be18a83f56cc723f77f74e2f8de (diff)
downloadbcm5719-llvm-9cbc30103598be2d45e3c93991f2d356835860f5.tar.gz
bcm5719-llvm-9cbc30103598be2d45e3c93991f2d356835860f5.zip
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.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index d9c59241ddf..e1223d0d033 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
OpenPOWER on IntegriCloud