Lines Matching refs:constant
1 // RUN: mlir-opt -allow-unregistered-dialect %s -split-input-file -test-constant-fold | FileCheck %s
8 // CHECK: [[C:%.+]] = constant 6.{{0*}}e+00 : f32
11 %0 = constant 4.5 : f32
12 %1 = constant 1.5 : f32
27 %0 = constant 4.5 : f32
28 %1 = constant 1.5 : f32
30 // CHECK-NEXT: [[C:%.+]] = constant 6.{{0*}}e+00 : f32
41 %0 = constant dense<4.5> : tensor<4xf32>
42 %1 = constant dense<1.5> : tensor<4xf32>
44 // CHECK-NEXT: [[C:%.+]] = constant dense<6.{{0*}}e+00> : tensor<4xf32>
55 %0 = constant dense<[1.5, 2.5, 3.5, 4.5]> : tensor<4xf32>
56 %1 = constant dense<[1.5, 2.5, 3.5, 4.5]> : tensor<4xf32>
58 …// CHECK-NEXT: [[C:%.+]] = constant dense<[3.{{0*}}e+00, 5.{{0*}}e+00, 7.{{0*}}e+00, 9.{{0*}}e+00]…
69 %0 = constant dense<[1.5, 2.5, 3.5, 4.5]> : tensor<4xf32>
70 %1 = constant dense<1.5> : tensor<4xf32>
72 …// CHECK-NEXT: [[C:%.+]] = constant dense<[3.{{0*}}e+00, 4.{{0*}}e+00, 5.{{0*}}e+00, 6.{{0*}}e+00]…
83 %0 = constant 1 : i32
84 %1 = constant 5 : i32
86 // CHECK-NEXT: [[C:%.+]] = constant 6 : i32
99 %c1 = constant 1 : i1
100 %cAllOnes_32 = constant 4294967295 : i32
102 // CHECK: [[C31:%.*]] = constant 31 : i32
103 %c31 = constant 31 : i32
119 // CHECK: [[C31:%.*]] = constant 31 : index
120 %c31 = constant 31 : index
121 %c_AllOnes = constant -1 : index
134 %cAllOnes_32 = constant dense<4294967295> : tensor<2xi32>
136 // CHECK: [[C31:%.*]] = constant dense<31> : tensor<2xi32>
137 %c31 = constant dense<31> : tensor<2xi32>
139 // CHECK: [[CMIXED:%.*]] = constant dense<[31, -1]> : tensor<2xi32>
140 %c_mixed = constant dense<[31, 4294967295]> : tensor<2xi32>
159 %cAllOnes_32 = constant dense<4294967295> : vector<2xi32>
161 // CHECK: [[C31:%.*]] = constant dense<31> : vector<2xi32>
162 %c31 = constant dense<31> : vector<2xi32>
164 // CHECK: [[CMIXED:%.*]] = constant dense<[31, -1]> : vector<2xi32>
165 %c_mixed = constant dense<[31, 4294967295]> : vector<2xi32>
183 %0 = constant dense<1> : vector<8xi32>
184 %1 = constant dense<5> : vector<8xi32>
186 // CHECK-NEXT: [[C:%.+]] = constant dense<6> : vector<8xi32>
197 %0 = constant 4.5 : f32
198 %1 = constant 1.5 : f32
200 // CHECK-NEXT: [[C:%.+]] = constant 3.{{0*}}e+00 : f32
211 %0 = constant dense<4.5> : vector<4xf32>
212 %1 = constant dense<1.5> : vector<4xf32>
214 // CHECK-NEXT: [[C:%.+]] = constant dense<3.{{0*}}e+00> : vector<4xf32>
226 %0 = constant 4 : i32
227 %1 = constant 1 : i32
228 %2 = constant 0 : i32
230 // CHECK-NEXT:[[C3:%.+]] = constant 3 : i32
242 %0 = constant dense<4> : tensor<4xi32>
243 %1 = constant dense<1> : tensor<4xi32>
245 // CHECK-NEXT: [[C:%.+]] = constant dense<3> : tensor<4xi32>
256 %c177 = constant 177 : index
257 %c211 = constant 211 : index
258 %N = constant 1075 : index
260 // CHECK:[[C1159:%.+]] = constant 1159 : index
261 // CHECK:[[C1152:%.+]] = constant 1152 : index
267 // CHECK:[[C42:%.+]] = constant 42 : index
278 %0 = constant 4.5 : f32
279 %1 = constant 1.5 : f32
281 // CHECK-NEXT: [[C:%.+]] = constant 6.75{{0*}}e+00 : f32
292 %0 = constant dense<4.5> : tensor<4xf32>
293 %1 = constant dense<1.5> : tensor<4xf32>
295 // CHECK-NEXT: [[C:%.+]] = constant dense<6.75{{0*}}e+00> : tensor<4xf32>
306 // CHECK-DAG: [[C0:%.+]] = constant 0
307 %z = constant 0 : i32
308 // CHECK-DAG: [[C6:%.+]] = constant 6
309 %0 = constant 6 : i32
310 %1 = constant 2 : i32
312 // CHECK-NEXT: [[C3:%.+]] = constant 3 : i32
315 %3 = constant -2 : i32
317 // CHECK-NEXT: [[CM3:%.+]] = constant -3 : i32
331 // CHECK-DAG: [[C0:%.+]] = constant dense<0>
332 %z = constant dense<0> : tensor<4xi32>
333 // CHECK-DAG: [[C6:%.+]] = constant dense<6>
334 %0 = constant dense<6> : tensor<4xi32>
335 %1 = constant dense<2> : tensor<4xi32>
337 // CHECK-NEXT: [[C3:%.+]] = constant dense<3> : tensor<4xi32>
340 %3 = constant dense<-2> : tensor<4xi32>
342 // CHECK-NEXT: [[CM3:%.+]] = constant dense<-3> : tensor<4xi32>
356 %z = constant 0 : i32
357 // CHECK-DAG: [[C6:%.+]] = constant 6
358 %0 = constant 6 : i32
359 %1 = constant 2 : i32
361 // CHECK-DAG: [[C3:%.+]] = constant 3 : i32
364 %3 = constant -2 : i32
367 // CHECK-DAG: [[C0:%.+]] = constant 0 : i32
382 %z = constant dense<0> : tensor<4xi32>
383 // CHECK-DAG: [[C6:%.+]] = constant dense<6>
384 %0 = constant dense<6> : tensor<4xi32>
385 %1 = constant dense<2> : tensor<4xi32>
387 // CHECK-DAG: [[C3:%.+]] = constant dense<3> : tensor<4xi32>
390 %3 = constant dense<-2> : tensor<4xi32>
393 // CHECK-DAG: [[C0:%.+]] = constant dense<0> : tensor<4xi32>
407 // CHECK-DAG: [[C0:%.+]] = constant 0
408 %z = constant 0 : i32
409 // CHECK-DAG: [[C6:%.+]] = constant 7
410 %0 = constant 7 : i32
411 %1 = constant 2 : i32
414 // CHECK-NEXT: [[C3:%.+]] = constant 3 : i32
417 %3 = constant -2 : i32
420 // CHECK-NEXT: [[CM3:%.+]] = constant -4 : i32
423 %5 = constant -9 : i32
426 // CHECK-NEXT: [[CM4:%.+]] = constant -5 : i32
429 %7 = constant -13 : i32
432 // CHECK-NEXT: [[CM5:%.+]] = constant 6 : i32
445 // CHECK-DAG: [[C0:%.+]] = constant 0
446 %z = constant 0 : i32
447 // CHECK-DAG: [[C6:%.+]] = constant 7
448 %0 = constant 7 : i32
449 %1 = constant 2 : i32
452 // CHECK-NEXT: [[C3:%.+]] = constant 4 : i32
455 %3 = constant -2 : i32
458 // CHECK-NEXT: [[CM3:%.+]] = constant -3 : i32
461 %5 = constant -9 : i32
464 // CHECK-NEXT: [[CM4:%.+]] = constant -4 : i32
467 %7 = constant -15 : i32
470 // CHECK-NEXT: [[CM5:%.+]] = constant 8 : i32
483 %0 = constant 5 : i32
484 %1 = constant 2 : i32
485 %2 = constant 1 : i32
486 %3 = constant -2 : i32
488 // CHECK-NEXT:[[C1:%.+]] = constant 1 : i32
491 // CHECK-NEXT:[[C0:%.+]] = constant 0 : i32
502 %0 = constant 5 : i32
503 %1 = constant 2 : i32
504 %2 = constant 1 : i32
505 %3 = constant -2 : i32
507 // CHECK-DAG:[[C1:%.+]] = constant 1 : i32
509 // CHECK-DAG:[[C5:%.+]] = constant 5 : i32
511 // CHECK-DAG:[[C0:%.+]] = constant 0 : i32
522 %0 = constant 4 : i32
523 %1 = constant 2 : i32
525 // CHECK-NEXT:[[C8:%.+]] = constant 8 : i32
536 %0 = constant dense<4> : vector<4xi32>
537 %1 = constant dense<2> : vector<4xi32>
539 // CHECK-NEXT: [[C:%.+]] = constant dense<8> : vector<4xi32>
549 // CHECK:[[C4:%.+]] = constant 4 : index
550 %c1 = constant 1 : index
561 %c42 = constant 42 : i32
562 %cm1 = constant -1 : i32
563 // CHECK-DAG: [[F:%.+]] = constant false
564 // CHECK-DAG: [[T:%.+]] = constant true
592 %c42 = constant 42. : f32
593 %cm1 = constant -1. : f32
594 // CHECK-DAG: [[F:%.+]] = constant false
595 // CHECK-DAG: [[T:%.+]] = constant true
635 %c42 = constant 42. : f32
636 %cqnan = constant 0xFFFFFFFF : f32
637 // CHECK-DAG: [[F:%.+]] = constant false
638 // CHECK-DAG: [[T:%.+]] = constant true
678 %c42 = constant 42. : f32
679 %cpinf = constant 0x7F800000 : f32
680 // CHECK-DAG: [[F:%.+]] = constant false
681 // CHECK-DAG: [[T:%.+]] = constant true
721 %const_0 = constant 0 : index
722 %const_1 = constant 1 : index
723 %const_3 = constant 3 : index
726 // CHECK-NEXT: [[C4:%.+]] = constant 4.{{0*}}e+00 : f32
727 %0 = constant dense<4.0> : tensor<4xf32>
731 // CHECK-NEXT: [[CM2:%.+]] = constant -2.{{0*}}e+00 : f16
732 %1 = constant sparse<[[0, 0, 0], [1, 1, 1]], [-5.0, -2.0]> : vector<4x4x4xf16>
736 // CHECK-NEXT: [[C0:%.+]] = constant 0.{{0*}}e+00 : f16
737 %2 = constant sparse<[[1, 1, 1]], [-2.0]> : vector<1x1x1xf16>
741 // CHECK-NEXT: [[C64:%.+]] = constant 64 : i32
742 %3 = constant dense<[[[1, -2, 1, 36]], [[0, 2, -1, 64]]]> : tensor<2x1x4xi32>
753 %const_0 = constant dense<[[[1, -2, 1, 36]], [[0, 2, -1, 64]]]> : tensor<2x1x4xi32>
755 // Fold a rank into a constant
756 // CHECK-NEXT: [[C3:%.+]] = constant 3 : index
767 // Fold a rank into a constant
768 // CHECK-NEXT: [[C2:%.+]] = constant 2 : index
780 // CHECK-NEXT: constant 2
782 %0 = constant 1 : i32
788 // CHECK-NEXT: constant 2
790 %0 = constant 1 : i32
802 // CHECK-NEXT: constant 2
805 %0 = constant 1 : i32
814 %c = constant 1.0 : f32
819 // CHECK-NEXT: [[V:%.*]] = constant dense<1.000000e+00> : vector<4xf32>
820 // CHECK-NEXT: [[T:%.*]] = constant dense<1.000000e+00> : tensor<4xf32>