diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-03-31 21:29:57 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-03-31 21:29:57 +0000 |
commit | ae272d718e882b18258a587ce111a4150d761b5e (patch) | |
tree | 79ee814eebc9b9e6cc4f4b9040b02bd838774757 /llvm/test/Transforms/InferFunctionAttrs | |
parent | 13f6da1d2c20ebb0c4f6600b4ea23d428ef20cc5 (diff) | |
download | bcm5719-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/test/Transforms/InferFunctionAttrs')
-rw-r--r-- | llvm/test/Transforms/InferFunctionAttrs/annotate.ll | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll index 1cb7ab137c0..8ac45df6e7e 100644 --- a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll +++ b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll @@ -1,6 +1,7 @@ ; RUN: opt < %s -inferattrs -S | FileCheck %s ; RUN: opt < %s -passes=inferattrs -S | FileCheck %s ; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -inferattrs -S | FileCheck -check-prefix=CHECK-POSIX %s +; RUN: opt < %s -mtriple=nvptx -inferattrs -S | FileCheck -check-prefix=CHECK-NVPTX %s declare i8* @fopen(i8*, i8*) ; CHECK: declare noalias i8* @fopen(i8* nocapture readonly, i8* nocapture readonly) [[G0:#[0-9]]] @@ -33,3 +34,7 @@ declare i32 @gettimeofday(i8*, i8*) ; CHECK: attributes [[G1]] = { nounwind readonly } ; CHECK-POSIX: attributes [[G0]] = { nounwind } ; CHECK-POSIX: attributes [[G2]] = { argmemonly } + +declare i32 @__nvvm_reflect(i8*) +; CHECK-NVPTX: declare i32 @__nvvm_reflect(i8*) [[G0:#[0-9]+]] +; CHECK-NVPTX: attributes [[G0]] = { nounwind readnone } |