summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp b/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
index 16922ab9256..030a6464522 100644
--- a/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
@@ -924,6 +924,15 @@ static bool inferPrototypeAttributes(Function &F,
Changed |= setOnlyReadsMemory(F, 2);
return Changed;
+ // int __nvvm_reflect(const char *)
+ case LibFunc::nvvm_reflect:
+ if (FTy->getNumParams() != 1 || !isa<PointerType>(FTy->getParamType(0)))
+ return false;
+
+ Changed |= setDoesNotAccessMemory(F);
+ Changed |= setDoesNotThrow(F);
+ return Changed;
+
default:
// FIXME: It'd be really nice to cover all the library functions we're
// aware of here.
OpenPOWER on IntegriCloud