File: masked_intrinsics.ll

package info (click to toggle)
llvm-toolchain-3.9 1%3A3.9.1-8
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 441,060 kB
  • ctags: 428,777
  • sloc: cpp: 2,546,577; ansic: 538,318; asm: 119,677; objc: 103,316; python: 102,148; sh: 27,847; pascal: 5,626; ml: 5,510; perl: 5,293; lisp: 4,801; makefile: 2,177; xml: 686; cs: 362; php: 212; csh: 117
file content (66 lines) | stat: -rw-r--r-- 2,760 bytes parent folder | download | duplicates (3)
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
58
59
60
61
62
63
64
65
66
; RUN: opt -instcombine -S < %s | FileCheck %s

declare <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* %ptrs, i32, <2 x i1> %mask, <2 x double> %src0)
declare void @llvm.masked.store.v2f64.p0v2f64(<2 x double> %val, <2 x double>* %ptrs, i32, <2 x i1> %mask)
declare <2 x double> @llvm.masked.gather.v2f64(<2 x double*> %ptrs, i32, <2 x i1> %mask, <2 x double> %passthru)
declare void @llvm.masked.scatter.v2f64(<2 x double> %val, <2 x double*> %ptrs, i32, <2 x i1> %mask)

define <2 x double> @load_zeromask(<2 x double>* %ptr, <2 x double> %passthru)  {
  %res = call <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* %ptr, i32 1, <2 x i1> zeroinitializer, <2 x double> %passthru)
  ret <2 x double> %res

; CHECK-LABEL: @load_zeromask(
; CHECK-NEXT:  ret <2 x double> %passthru
}

define <2 x double> @load_onemask(<2 x double>* %ptr, <2 x double> %passthru)  {
  %res = call <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* %ptr, i32 2, <2 x i1> <i1 1, i1 1>, <2 x double> %passthru)
  ret <2 x double> %res

; CHECK-LABEL: @load_onemask(
; CHECK-NEXT:  %unmaskedload = load <2 x double>, <2 x double>* %ptr, align 2
; CHECK-NEXT:  ret <2 x double> %unmaskedload
}

define <2 x double> @load_undefmask(<2 x double>* %ptr, <2 x double> %passthru)  {
  %res = call <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* %ptr, i32 2, <2 x i1> <i1 1, i1 undef>, <2 x double> %passthru)
  ret <2 x double> %res

; CHECK-LABEL: @load_undefmask(
; CHECK-NEXT:  %unmaskedload = load <2 x double>, <2 x double>* %ptr, align 2
; CHECK-NEXT:  ret <2 x double> %unmaskedload
}

define void @store_zeromask(<2 x double>* %ptr, <2 x double> %val)  {
  call void @llvm.masked.store.v2f64.p0v2f64(<2 x double> %val, <2 x double>* %ptr, i32 3, <2 x i1> zeroinitializer)
  ret void

; CHECK-LABEL: @store_zeromask(
; CHECK-NEXT:  ret void
}

define void @store_onemask(<2 x double>* %ptr, <2 x double> %val)  {
  call void @llvm.masked.store.v2f64.p0v2f64(<2 x double> %val, <2 x double>* %ptr, i32 4, <2 x i1> <i1 1, i1 1>)
  ret void

; CHECK-LABEL: @store_onemask(
; CHECK-NEXT:  store <2 x double> %val, <2 x double>* %ptr, align 4
; CHECK-NEXT:  ret void
}

define <2 x double> @gather_zeromask(<2 x double*> %ptrs, <2 x double> %passthru)  {
  %res = call <2 x double> @llvm.masked.gather.v2f64(<2 x double*> %ptrs, i32 5, <2 x i1> zeroinitializer, <2 x double> %passthru)
  ret <2 x double> %res

; CHECK-LABEL: @gather_zeromask(
; CHECK-NEXT:  ret <2 x double> %passthru
}

define void @scatter_zeromask(<2 x double*> %ptrs, <2 x double> %val)  {
  call void @llvm.masked.scatter.v2f64(<2 x double> %val, <2 x double*> %ptrs, i32 6, <2 x i1> zeroinitializer)
  ret void

; CHECK-LABEL: @scatter_zeromask(
; CHECK-NEXT:  ret void
}