1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
4 declare float @llvm.amdgcn.cubeid(float, float, float)
6 define void @test(ptr %p) {
8 ; CHECK-NEXT: store volatile float 4.000000e+00, ptr [[P:%.*]]
9 ; CHECK-NEXT: store volatile float 2.000000e+00, ptr [[P]]
10 ; CHECK-NEXT: store volatile float 4.000000e+00, ptr [[P]]
11 ; CHECK-NEXT: store volatile float 2.000000e+00, ptr [[P]]
12 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
13 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
14 ; CHECK-NEXT: store volatile float 5.000000e+00, ptr [[P]]
15 ; CHECK-NEXT: store volatile float 2.000000e+00, ptr [[P]]
16 ; CHECK-NEXT: store volatile float 5.000000e+00, ptr [[P]]
17 ; CHECK-NEXT: store volatile float 2.000000e+00, ptr [[P]]
18 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
19 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
20 ; CHECK-NEXT: store volatile float 4.000000e+00, ptr [[P]]
21 ; CHECK-NEXT: store volatile float 3.000000e+00, ptr [[P]]
22 ; CHECK-NEXT: store volatile float 4.000000e+00, ptr [[P]]
23 ; CHECK-NEXT: store volatile float 3.000000e+00, ptr [[P]]
24 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
25 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
26 ; CHECK-NEXT: store volatile float 5.000000e+00, ptr [[P]]
27 ; CHECK-NEXT: store volatile float 3.000000e+00, ptr [[P]]
28 ; CHECK-NEXT: store volatile float 5.000000e+00, ptr [[P]]
29 ; CHECK-NEXT: store volatile float 3.000000e+00, ptr [[P]]
30 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
31 ; CHECK-NEXT: store volatile float 0.000000e+00, ptr [[P]]
32 ; CHECK-NEXT: store volatile float 4.000000e+00, ptr [[P]]
33 ; CHECK-NEXT: store volatile float 2.000000e+00, ptr [[P]]
34 ; CHECK-NEXT: store volatile float 4.000000e+00, ptr [[P]]
35 ; CHECK-NEXT: store volatile float 2.000000e+00, ptr [[P]]
36 ; CHECK-NEXT: store volatile float 1.000000e+00, ptr [[P]]
37 ; CHECK-NEXT: store volatile float 1.000000e+00, ptr [[P]]
38 ; CHECK-NEXT: store volatile float 5.000000e+00, ptr [[P]]
39 ; CHECK-NEXT: store volatile float 2.000000e+00, ptr [[P]]
40 ; CHECK-NEXT: store volatile float 5.000000e+00, ptr [[P]]
41 ; CHECK-NEXT: store volatile float 2.000000e+00, ptr [[P]]
42 ; CHECK-NEXT: store volatile float 1.000000e+00, ptr [[P]]
43 ; CHECK-NEXT: store volatile float 1.000000e+00, ptr [[P]]
44 ; CHECK-NEXT: store volatile float 4.000000e+00, ptr [[P]]
45 ; CHECK-NEXT: store volatile float 3.000000e+00, ptr [[P]]
46 ; CHECK-NEXT: store volatile float 4.000000e+00, ptr [[P]]
47 ; CHECK-NEXT: store volatile float 3.000000e+00, ptr [[P]]
48 ; CHECK-NEXT: store volatile float 1.000000e+00, ptr [[P]]
49 ; CHECK-NEXT: store volatile float 1.000000e+00, ptr [[P]]
50 ; CHECK-NEXT: store volatile float 5.000000e+00, ptr [[P]]
51 ; CHECK-NEXT: store volatile float 3.000000e+00, ptr [[P]]
52 ; CHECK-NEXT: store volatile float 5.000000e+00, ptr [[P]]
53 ; CHECK-NEXT: store volatile float 3.000000e+00, ptr [[P]]
54 ; CHECK-NEXT: store volatile float 1.000000e+00, ptr [[P]]
55 ; CHECK-NEXT: store volatile float 1.000000e+00, ptr [[P]]
56 ; CHECK-NEXT: ret void
58 %p3p4p5 = call float @llvm.amdgcn.cubeid(float +3.0, float +4.0, float +5.0)
59 store volatile float %p3p4p5, ptr %p
60 %p3p5p4 = call float @llvm.amdgcn.cubeid(float +3.0, float +5.0, float +4.0)
61 store volatile float %p3p5p4, ptr %p
62 %p4p3p5 = call float @llvm.amdgcn.cubeid(float +4.0, float +3.0, float +5.0)
63 store volatile float %p4p3p5, ptr %p
64 %p4p5p3 = call float @llvm.amdgcn.cubeid(float +4.0, float +5.0, float +3.0)
65 store volatile float %p4p5p3, ptr %p
66 %p5p3p4 = call float @llvm.amdgcn.cubeid(float +5.0, float +3.0, float +4.0)
67 store volatile float %p5p3p4, ptr %p
68 %p5p4p3 = call float @llvm.amdgcn.cubeid(float +5.0, float +4.0, float +3.0)
69 store volatile float %p5p4p3, ptr %p
70 %p3p4n5 = call float @llvm.amdgcn.cubeid(float +3.0, float +4.0, float -5.0)
71 store volatile float %p3p4n5, ptr %p
72 %p3p5n4 = call float @llvm.amdgcn.cubeid(float +3.0, float +5.0, float -4.0)
73 store volatile float %p3p5n4, ptr %p
74 %p4p3n5 = call float @llvm.amdgcn.cubeid(float +4.0, float +3.0, float -5.0)
75 store volatile float %p4p3n5, ptr %p
76 %p4p5n3 = call float @llvm.amdgcn.cubeid(float +4.0, float +5.0, float -3.0)
77 store volatile float %p4p5n3, ptr %p
78 %p5p3n4 = call float @llvm.amdgcn.cubeid(float +5.0, float +3.0, float -4.0)
79 store volatile float %p5p3n4, ptr %p
80 %p5p4n3 = call float @llvm.amdgcn.cubeid(float +5.0, float +4.0, float -3.0)
81 store volatile float %p5p4n3, ptr %p
82 %p3n4p5 = call float @llvm.amdgcn.cubeid(float +3.0, float -4.0, float +5.0)
83 store volatile float %p3n4p5, ptr %p
84 %p3n5p4 = call float @llvm.amdgcn.cubeid(float +3.0, float -5.0, float +4.0)
85 store volatile float %p3n5p4, ptr %p
86 %p4n3p5 = call float @llvm.amdgcn.cubeid(float +4.0, float -3.0, float +5.0)
87 store volatile float %p4n3p5, ptr %p
88 %p4n5p3 = call float @llvm.amdgcn.cubeid(float +4.0, float -5.0, float +3.0)
89 store volatile float %p4n5p3, ptr %p
90 %p5n3p4 = call float @llvm.amdgcn.cubeid(float +5.0, float -3.0, float +4.0)
91 store volatile float %p5n3p4, ptr %p
92 %p5n4p3 = call float @llvm.amdgcn.cubeid(float +5.0, float -4.0, float +3.0)
93 store volatile float %p5n4p3, ptr %p
94 %p3n4n5 = call float @llvm.amdgcn.cubeid(float +3.0, float -4.0, float -5.0)
95 store volatile float %p3n4n5, ptr %p
96 %p3n5n4 = call float @llvm.amdgcn.cubeid(float +3.0, float -5.0, float -4.0)
97 store volatile float %p3n5n4, ptr %p
98 %p4n3n5 = call float @llvm.amdgcn.cubeid(float +4.0, float -3.0, float -5.0)
99 store volatile float %p4n3n5, ptr %p
100 %p4n5n3 = call float @llvm.amdgcn.cubeid(float +4.0, float -5.0, float -3.0)
101 store volatile float %p4n5n3, ptr %p
102 %p5n3n4 = call float @llvm.amdgcn.cubeid(float +5.0, float -3.0, float -4.0)
103 store volatile float %p5n3n4, ptr %p
104 %p5n4n3 = call float @llvm.amdgcn.cubeid(float +5.0, float -4.0, float -3.0)
105 store volatile float %p5n4n3, ptr %p
106 %n3p4p5 = call float @llvm.amdgcn.cubeid(float -3.0, float +4.0, float +5.0)
107 store volatile float %n3p4p5, ptr %p
108 %n3p5p4 = call float @llvm.amdgcn.cubeid(float -3.0, float +5.0, float +4.0)
109 store volatile float %n3p5p4, ptr %p
110 %n4p3p5 = call float @llvm.amdgcn.cubeid(float -4.0, float +3.0, float +5.0)
111 store volatile float %n4p3p5, ptr %p
112 %n4p5p3 = call float @llvm.amdgcn.cubeid(float -4.0, float +5.0, float +3.0)
113 store volatile float %n4p5p3, ptr %p
114 %n5p3p4 = call float @llvm.amdgcn.cubeid(float -5.0, float +3.0, float +4.0)
115 store volatile float %n5p3p4, ptr %p
116 %n5p4p3 = call float @llvm.amdgcn.cubeid(float -5.0, float +4.0, float +3.0)
117 store volatile float %n5p4p3, ptr %p
118 %n3p4n5 = call float @llvm.amdgcn.cubeid(float -3.0, float +4.0, float -5.0)
119 store volatile float %n3p4n5, ptr %p
120 %n3p5n4 = call float @llvm.amdgcn.cubeid(float -3.0, float +5.0, float -4.0)
121 store volatile float %n3p5n4, ptr %p
122 %n4p3n5 = call float @llvm.amdgcn.cubeid(float -4.0, float +3.0, float -5.0)
123 store volatile float %n4p3n5, ptr %p
124 %n4p5n3 = call float @llvm.amdgcn.cubeid(float -4.0, float +5.0, float -3.0)
125 store volatile float %n4p5n3, ptr %p
126 %n5p3n4 = call float @llvm.amdgcn.cubeid(float -5.0, float +3.0, float -4.0)
127 store volatile float %n5p3n4, ptr %p
128 %n5p4n3 = call float @llvm.amdgcn.cubeid(float -5.0, float +4.0, float -3.0)
129 store volatile float %n5p4n3, ptr %p
130 %n3n4p5 = call float @llvm.amdgcn.cubeid(float -3.0, float -4.0, float +5.0)
131 store volatile float %n3n4p5, ptr %p
132 %n3n5p4 = call float @llvm.amdgcn.cubeid(float -3.0, float -5.0, float +4.0)
133 store volatile float %n3n5p4, ptr %p
134 %n4n3p5 = call float @llvm.amdgcn.cubeid(float -4.0, float -3.0, float +5.0)
135 store volatile float %n4n3p5, ptr %p
136 %n4n5p3 = call float @llvm.amdgcn.cubeid(float -4.0, float -5.0, float +3.0)
137 store volatile float %n4n5p3, ptr %p
138 %n5n3p4 = call float @llvm.amdgcn.cubeid(float -5.0, float -3.0, float +4.0)
139 store volatile float %n5n3p4, ptr %p
140 %n5n4p3 = call float @llvm.amdgcn.cubeid(float -5.0, float -4.0, float +3.0)
141 store volatile float %n5n4p3, ptr %p
142 %n3n4n5 = call float @llvm.amdgcn.cubeid(float -3.0, float -4.0, float -5.0)
143 store volatile float %n3n4n5, ptr %p
144 %n3n5n4 = call float @llvm.amdgcn.cubeid(float -3.0, float -5.0, float -4.0)
145 store volatile float %n3n5n4, ptr %p
146 %n4n3n5 = call float @llvm.amdgcn.cubeid(float -4.0, float -3.0, float -5.0)
147 store volatile float %n4n3n5, ptr %p
148 %n4n5n3 = call float @llvm.amdgcn.cubeid(float -4.0, float -5.0, float -3.0)
149 store volatile float %n4n5n3, ptr %p
150 %n5n3n4 = call float @llvm.amdgcn.cubeid(float -5.0, float -3.0, float -4.0)
151 store volatile float %n5n3n4, ptr %p
152 %n5n4n3 = call float @llvm.amdgcn.cubeid(float -5.0, float -4.0, float -3.0)
153 store volatile float %n5n4n3, ptr %p