File: vector-of-pointer-to-vector.ll

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (99 lines) | stat: -rw-r--r-- 5,085 bytes parent folder | download
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt %s -passes='function(scalarizer,dce)' -scalarize-load-store -S | FileCheck %s
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-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"

define <1 x i32> @f1(<1 x <1 x i32>*> %src, i32 %index) {
; CHECK-LABEL: @f1(
; CHECK-NEXT:    [[INDEX_IS_0:%.*]] = icmp eq i32 [[INDEX:%.*]], 0
; CHECK-NEXT:    [[SRC_I0:%.*]] = extractelement <1 x <1 x i32>*> [[SRC:%.*]], i32 0
; CHECK-NEXT:    [[DOTUPTO0:%.*]] = select i1 [[INDEX_IS_0]], <1 x i32>* [[SRC_I0]], <1 x i32>* undef
; CHECK-NEXT:    [[DOTUPTO0_I0:%.*]] = bitcast <1 x i32>* [[DOTUPTO0]] to i32*
; CHECK-NEXT:    [[DOTI0:%.*]] = load i32, i32* [[DOTUPTO0_I0]], align 4
; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <1 x i32> poison, i32 [[DOTI0]], i32 0
; CHECK-NEXT:    ret <1 x i32> [[TMP1]]
;
  %1 = extractelement <1 x <1 x i32>*> %src, i32 %index
  %2 = load <1 x i32>, <1 x i32>* %1, align 4
  ret <1 x i32> %2
}

define <1 x i32> @f1b(<1 x <1 x i32>*> %src) {
; CHECK-LABEL: @f1b(
; CHECK-NEXT:    [[SRC_I0:%.*]] = extractelement <1 x <1 x i32>*> [[SRC:%.*]], i32 0
; CHECK-NEXT:    [[SRC_I0_I0:%.*]] = bitcast <1 x i32>* [[SRC_I0]] to i32*
; CHECK-NEXT:    [[DOTI0:%.*]] = load i32, i32* [[SRC_I0_I0]], align 4
; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <1 x i32> poison, i32 [[DOTI0]], i32 0
; CHECK-NEXT:    ret <1 x i32> [[TMP1]]
;
  %1 = extractelement <1 x <1 x i32>*> %src, i32 0
  %2 = load <1 x i32>, <1 x i32>* %1, align 4
  ret <1 x i32> %2
}

define <2 x i32> @f2(<1 x <2 x i32>*> %src, i32 %index) {
; CHECK-LABEL: @f2(
; CHECK-NEXT:    [[INDEX_IS_0:%.*]] = icmp eq i32 [[INDEX:%.*]], 0
; CHECK-NEXT:    [[SRC_I0:%.*]] = extractelement <1 x <2 x i32>*> [[SRC:%.*]], i32 0
; CHECK-NEXT:    [[DOTUPTO0:%.*]] = select i1 [[INDEX_IS_0]], <2 x i32>* [[SRC_I0]], <2 x i32>* undef
; CHECK-NEXT:    [[DOTUPTO0_I0:%.*]] = bitcast <2 x i32>* [[DOTUPTO0]] to i32*
; CHECK-NEXT:    [[DOTUPTO0_I1:%.*]] = getelementptr i32, i32* [[DOTUPTO0_I0]], i32 1
; CHECK-NEXT:    [[DOTI0:%.*]] = load i32, i32* [[DOTUPTO0_I0]], align 4
; CHECK-NEXT:    [[DOTI1:%.*]] = load i32, i32* [[DOTUPTO0_I1]], align 4
; CHECK-NEXT:    [[DOTUPTO01:%.*]] = insertelement <2 x i32> poison, i32 [[DOTI0]], i32 0
; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x i32> [[DOTUPTO01]], i32 [[DOTI1]], i32 1
; CHECK-NEXT:    ret <2 x i32> [[TMP1]]
;
  %1 = extractelement <1 x <2 x i32>*> %src, i32 %index
  %2 = load <2 x i32>, <2 x i32>* %1, align 4
  ret <2 x i32> %2
}

define <2 x i32> @f2b(<1 x <2 x i32>*> %src) {
; CHECK-LABEL: @f2b(
; CHECK-NEXT:    [[SRC_I0:%.*]] = extractelement <1 x <2 x i32>*> [[SRC:%.*]], i32 0
; CHECK-NEXT:    [[SRC_I0_I0:%.*]] = bitcast <2 x i32>* [[SRC_I0]] to i32*
; CHECK-NEXT:    [[SRC_I0_I1:%.*]] = getelementptr i32, i32* [[SRC_I0_I0]], i32 1
; CHECK-NEXT:    [[DOTI0:%.*]] = load i32, i32* [[SRC_I0_I0]], align 4
; CHECK-NEXT:    [[DOTI1:%.*]] = load i32, i32* [[SRC_I0_I1]], align 4
; CHECK-NEXT:    [[DOTUPTO0:%.*]] = insertelement <2 x i32> poison, i32 [[DOTI0]], i32 0
; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x i32> [[DOTUPTO0]], i32 [[DOTI1]], i32 1
; CHECK-NEXT:    ret <2 x i32> [[TMP1]]
;
  %1 = extractelement <1 x <2 x i32>*> %src, i32 0
  %2 = load <2 x i32>, <2 x i32>* %1, align 4
  ret <2 x i32> %2
}

define void @f3(<1 x <2 x i32>*> %src, i32 %index, <2 x i32> %val) {
; CHECK-LABEL: @f3(
; CHECK-NEXT:    [[VAL_I0:%.*]] = extractelement <2 x i32> [[VAL:%.*]], i32 0
; CHECK-NEXT:    [[VAL_I1:%.*]] = extractelement <2 x i32> [[VAL]], i32 1
; CHECK-NEXT:    [[INDEX_IS_0:%.*]] = icmp eq i32 [[INDEX:%.*]], 0
; CHECK-NEXT:    [[SRC_I0:%.*]] = extractelement <1 x <2 x i32>*> [[SRC:%.*]], i32 0
; CHECK-NEXT:    [[DOTUPTO0:%.*]] = select i1 [[INDEX_IS_0]], <2 x i32>* [[SRC_I0]], <2 x i32>* undef
; CHECK-NEXT:    [[DOTUPTO0_I0:%.*]] = bitcast <2 x i32>* [[DOTUPTO0]] to i32*
; CHECK-NEXT:    [[DOTUPTO0_I1:%.*]] = getelementptr i32, i32* [[DOTUPTO0_I0]], i32 1
; CHECK-NEXT:    store i32 [[VAL_I0]], i32* [[DOTUPTO0_I0]], align 4
; CHECK-NEXT:    store i32 [[VAL_I1]], i32* [[DOTUPTO0_I1]], align 4
; CHECK-NEXT:    ret void
;
  %1 = extractelement <1 x <2 x i32>*> %src, i32 %index
  store <2 x i32> %val, <2 x i32>* %1, align 4
  ret void
}

define void @f3b(<1 x <2 x i32>*> %src, <2 x i32> %val) {
; CHECK-LABEL: @f3b(
; CHECK-NEXT:    [[VAL_I0:%.*]] = extractelement <2 x i32> [[VAL:%.*]], i32 0
; CHECK-NEXT:    [[VAL_I1:%.*]] = extractelement <2 x i32> [[VAL]], i32 1
; CHECK-NEXT:    [[SRC_I0:%.*]] = extractelement <1 x <2 x i32>*> [[SRC:%.*]], i32 0
; CHECK-NEXT:    [[SRC_I0_I0:%.*]] = bitcast <2 x i32>* [[SRC_I0]] to i32*
; CHECK-NEXT:    [[SRC_I0_I1:%.*]] = getelementptr i32, i32* [[SRC_I0_I0]], i32 1
; CHECK-NEXT:    store i32 [[VAL_I0]], i32* [[SRC_I0_I0]], align 4
; CHECK-NEXT:    store i32 [[VAL_I1]], i32* [[SRC_I0_I1]], align 4
; CHECK-NEXT:    ret void
;
  %1 = extractelement <1 x <2 x i32>*> %src, i32 0
  store <2 x i32> %val, <2 x i32>* %1, align 4
  ret void
}