summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/TargetLibraryInfo.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-03-31 21:29:57 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-03-31 21:29:57 +0000
commitae272d718e882b18258a587ce111a4150d761b5e (patch)
tree79ee814eebc9b9e6cc4f4b9040b02bd838774757 /llvm/lib/Analysis/TargetLibraryInfo.cpp
parent13f6da1d2c20ebb0c4f6600b4ea23d428ef20cc5 (diff)
downloadbcm5719-llvm-ae272d718e882b18258a587ce111a4150d761b5e.tar.gz
bcm5719-llvm-ae272d718e882b18258a587ce111a4150d761b5e.zip
[NVPTX] Infer __nvvm_reflect as nounwind, readnone
This patch simply mirrors the attributes we give to @llvm.nvvm.reflect to the __nvvm_reflect libdevice call. This shaves about 30% of the code in libdevice away because of CSE opportunities. It's also helps us figure out that libdevice implementations of transcendental functions don't have side-effects. llvm-svn: 265060
Diffstat (limited to 'llvm/lib/Analysis/TargetLibraryInfo.cpp')
-rw-r--r--llvm/lib/Analysis/TargetLibraryInfo.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp
index 3bd54c47e60..ab667ab7b6a 100644
--- a/llvm/lib/Analysis/TargetLibraryInfo.cpp
+++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp
@@ -396,8 +396,12 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T,
//
// FIXME: Having no standard library prevents e.g. many fastmath
// optimizations, so this situation should be fixed.
- if (T.isNVPTX())
+ if (T.isNVPTX()) {
TLI.disableAllFunctions();
+ TLI.setAvailable(LibFunc::nvvm_reflect);
+ } else {
+ TLI.setUnavailable(LibFunc::nvvm_reflect);
+ }
TLI.addVectorizableFunctionsFromVecLib(ClVectorLibrary);
}
OpenPOWER on IntegriCloud