diff options
author | Justin Holewinski <jholewinski@nvidia.com> | 2016-06-27 20:22:22 +0000 |
---|---|---|
committer | Justin Holewinski <jholewinski@nvidia.com> | 2016-06-27 20:22:22 +0000 |
commit | cb29fb4a980bcf6fb50baa7aec7b35d5822bdafd (patch) | |
tree | c3ec20a7011f02aa8fbb23ce5676cf581a8f1e01 /llvm/test/CodeGen/NVPTX | |
parent | 8121becac31168d7540f6915a6bc33473dcb3e36 (diff) | |
download | bcm5719-llvm-cb29fb4a980bcf6fb50baa7aec7b35d5822bdafd.tar.gz bcm5719-llvm-cb29fb4a980bcf6fb50baa7aec7b35d5822bdafd.zip |
Only emit extension for zeroext/signext arguments if type is < 32 bits
Reviewers: jingyue, jlebar
Subscribers: jholewinski
Differential Revision: http://reviews.llvm.org/D21756
llvm-svn: 273922
Diffstat (limited to 'llvm/test/CodeGen/NVPTX')
-rw-r--r-- | llvm/test/CodeGen/NVPTX/zeroext-32bit.ll | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/NVPTX/zeroext-32bit.ll b/llvm/test/CodeGen/NVPTX/zeroext-32bit.ll new file mode 100644 index 00000000000..c2f0ec4b144 --- /dev/null +++ b/llvm/test/CodeGen/NVPTX/zeroext-32bit.ll @@ -0,0 +1,26 @@ +; RUN: llc < %s -march=nvptx64 -mcpu=sm_30 | FileCheck %s + +; The zeroext attribute below should be silently ignored because +; we can pass a 32-bit integer across a function call without +; needing to extend it. + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64" +target triple = "nvptx64-unknown-cuda" + +; CHECK-LABEL: .visible .func zeroext_test +; CHECK-NOT: cvt.u32.u16 +define void @zeroext_test() { + tail call void @call1(i32 zeroext 0) + ret void +} + +declare void @call1(i32 zeroext) + +; CHECK-LABEL: .visible .func signext_test +; CHECK-NOT: cvt.s32.s16 +define void @signext_test() { + tail call void @call2(i32 zeroext 0) + ret void +} + +declare void @call2(i32 zeroext) |