File: bug26185.ll

package info (click to toggle)
llvm-toolchain-7 1%3A7.0.1-8
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 733,456 kB
  • sloc: cpp: 3,776,651; ansic: 633,271; asm: 350,301; python: 142,716; objc: 107,612; sh: 22,626; lisp: 11,056; perl: 7,999; pascal: 6,742; ml: 5,537; awk: 3,536; makefile: 2,557; cs: 2,027; xml: 841; ruby: 156
file content (57 lines) | stat: -rw-r--r-- 1,658 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
; RUN: llc < %s -march=nvptx -mcpu=sm_35 | FileCheck %s

; Verify that we correctly emit code for i8 ldg/ldu. We do not expose 8-bit
; registers in the backend, so these loads need special handling.

target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
target triple = "nvptx64-unknown-unknown"

; CHECK-LABEL: ex_zext
define void @ex_zext(i8* noalias readonly %data, i32* %res) {
entry:
; CHECK: ld.global.nc.u8
  %val = load i8, i8* %data
; CHECK: cvt.u32.u8
  %valext = zext i8 %val to i32
  store i32 %valext, i32* %res
  ret void
}

; CHECK-LABEL: ex_sext
define void @ex_sext(i8* noalias readonly %data, i32* %res) {
entry:
; CHECK: ld.global.nc.u8
  %val = load i8, i8* %data
; CHECK: cvt.s32.s8
  %valext = sext i8 %val to i32
  store i32 %valext, i32* %res
  ret void
}

; CHECK-LABEL: ex_zext_v2
define void @ex_zext_v2(<2 x i8>* noalias readonly %data, <2 x i32>* %res) {
entry:
; CHECK: ld.global.nc.v2.u8
  %val = load <2 x i8>, <2 x i8>* %data
; CHECK: cvt.u32.u16
  %valext = zext <2 x i8> %val to <2 x i32>
  store <2 x i32> %valext, <2 x i32>* %res
  ret void
}

; CHECK-LABEL: ex_sext_v2
define void @ex_sext_v2(<2 x i8>* noalias readonly %data, <2 x i32>* %res) {
entry:
; CHECK: ld.global.nc.v2.u8
  %val = load <2 x i8>, <2 x i8>* %data
; CHECK: cvt.s32.s8
  %valext = sext <2 x i8> %val to <2 x i32>
  store <2 x i32> %valext, <2 x i32>* %res
  ret void
}

!nvvm.annotations = !{!0,!1,!2,!3}
!0 = !{void (i8*, i32*)* @ex_zext, !"kernel", i32 1}
!1 = !{void (i8*, i32*)* @ex_sext, !"kernel", i32 1}
!2 = !{void (<2 x i8>*, <2 x i32>*)* @ex_zext_v2, !"kernel", i32 1}
!3 = !{void (<2 x i8>*, <2 x i32>*)* @ex_sext_v2, !"kernel", i32 1}