OLD | NEW |
1 ; RUN: opt -pnacl-abi-simplify-postopt %s -S | \ | 1 ; RUN: opt -pnacl-abi-simplify-postopt %s -S | \ |
2 ; RUN: opt -backend-canonicalize -S | FileCheck %s | 2 ; RUN: opt -backend-canonicalize -S | FileCheck %s |
3 | 3 |
4 ; Test that the SIMD game of life example from the NaCl SDK has an inner loop | 4 ; Test that the SIMD game of life example from the NaCl SDK has an inner loop |
5 ; that contains the expected shufflevector instructions. First run the ABI | 5 ; that contains the expected shufflevector instructions. First run the ABI |
6 ; simplifications on the code, then run the translator's peepholes. | 6 ; simplifications on the code, then run the translator's peepholes. |
7 ; | 7 ; |
8 ; The stable PNaCl bitcode ABI doesn't have shufflevector nor constant vectors, | 8 ; The stable PNaCl bitcode ABI doesn't have shufflevector nor constant vectors, |
9 ; it instead has insertelement, extractelement and load from globals. Note that | 9 ; it instead has insertelement, extractelement and load from globals. Note that |
10 ; `undef` becomes `0` in the constants. | 10 ; `undef` becomes `0` in the constants. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 ; CHECK-NEXT: shufflevector <16 x i8> %and, <16 x i8> <i8 0, i8 -1, i8 0, i8 0
, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, <16 x
i32> <i32 16, i32 8, i32 16, i32 17, i32 16, i32 9, i32 16, i32 17, i32 16, i32
10, i32 16, i32 17, i32 16, i32 11, i32 16, i32 17> | 48 ; CHECK-NEXT: shufflevector <16 x i8> %and, <16 x i8> <i8 0, i8 -1, i8 0, i8 0
, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, <16 x
i32> <i32 16, i32 8, i32 16, i32 17, i32 16, i32 9, i32 16, i32 17, i32 16, i32
10, i32 16, i32 17, i32 16, i32 11, i32 16, i32 17> |
49 ; CHECK-NEXT: shufflevector <16 x i8> %and, <16 x i8> <i8 0, i8 -1, i8 0, i8 0
, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, <16 x
i32> <i32 16, i32 12, i32 16, i32 17, i32 16, i32 13, i32 16, i32 17, i32 16, i
32 14, i32 16, i32 17, i32 16, i32 15, i32 16, i32 17> | 49 ; CHECK-NEXT: shufflevector <16 x i8> %and, <16 x i8> <i8 0, i8 -1, i8 0, i8 0
, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, <16 x
i32> <i32 16, i32 12, i32 16, i32 17, i32 16, i32 13, i32 16, i32 17, i32 16, i
32 14, i32 16, i32 17, i32 16, i32 15, i32 16, i32 17> |
50 ; CHECK-NOT: load | 50 ; CHECK-NOT: load |
51 ; CHECK-NOT: insertelement | 51 ; CHECK-NOT: insertelement |
52 ; CHECK-NOT: extractelement | 52 ; CHECK-NOT: extractelement |
53 %shuffle18 = shufflevector <16 x i8> %and, <16 x i8> <i8 0, i8 -1, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef>, <16 x i32> <i32 16, i32 0, i32
16, i32 17, i32 16, i32 1, i32 16, i32 17, i32 16, i32 2, i32 16, i32 17, i32 1
6, i32 3, i32 16, i32 17> | 53 %shuffle18 = shufflevector <16 x i8> %and, <16 x i8> <i8 0, i8 -1, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef>, <16 x i32> <i32 16, i32 0, i32
16, i32 17, i32 16, i32 1, i32 16, i32 17, i32 16, i32 2, i32 16, i32 17, i32 1
6, i32 3, i32 16, i32 17> |
54 %shuffle19 = shufflevector <16 x i8> %and, <16 x i8> <i8 0, i8 -1, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef>, <16 x i32> <i32 16, i32 4, i32
16, i32 17, i32 16, i32 5, i32 16, i32 17, i32 16, i32 6, i32 16, i32 17, i32 1
6, i32 7, i32 16, i32 17> | 54 %shuffle19 = shufflevector <16 x i8> %and, <16 x i8> <i8 0, i8 -1, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef>, <16 x i32> <i32 16, i32 4, i32
16, i32 17, i32 16, i32 5, i32 16, i32 17, i32 16, i32 6, i32 16, i32 17, i32 1
6, i32 7, i32 16, i32 17> |
55 %shuffle20 = shufflevector <16 x i8> %and, <16 x i8> <i8 0, i8 -1, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef>, <16 x i32> <i32 16, i32 8, i32
16, i32 17, i32 16, i32 9, i32 16, i32 17, i32 16, i32 10, i32 16, i32 17, i32
16, i32 11, i32 16, i32 17> | 55 %shuffle20 = shufflevector <16 x i8> %and, <16 x i8> <i8 0, i8 -1, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef>, <16 x i32> <i32 16, i32 8, i32
16, i32 17, i32 16, i32 9, i32 16, i32 17, i32 16, i32 10, i32 16, i32 17, i32
16, i32 11, i32 16, i32 17> |
56 %shuffle21 = shufflevector <16 x i8> %and, <16 x i8> <i8 0, i8 -1, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef>, <16 x i32> <i32 16, i32 12, i3
2 16, i32 17, i32 16, i32 13, i32 16, i32 17, i32 16, i32 14, i32 16, i32 17, i3
2 16, i32 15, i32 16, i32 17> | 56 %shuffle21 = shufflevector <16 x i8> %and, <16 x i8> <i8 0, i8 -1, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i
8 undef, i8 undef, i8 undef, i8 undef, i8 undef>, <16 x i32> <i32 16, i32 12, i3
2 16, i32 17, i32 16, i32 13, i32 16, i32 17, i32 16, i32 14, i32 16, i32 17, i3
2 16, i32 15, i32 16, i32 17> |
57 store <16 x i8> %shuffle18, <16 x i8>* %pixel_line, align 16 | 57 store <16 x i8> %shuffle18, <16 x i8>* %pixel_line, align 16 |
58 %add.ptr22 = getelementptr inbounds <16 x i8>* %pixel_line, i32 1 | 58 %add.ptr22 = getelementptr inbounds <16 x i8>, <16 x i8>* %pixel_line, i32 1 |
59 store <16 x i8> %shuffle19, <16 x i8>* %add.ptr22, align 16 | 59 store <16 x i8> %shuffle19, <16 x i8>* %add.ptr22, align 16 |
60 %add.ptr23 = getelementptr inbounds <16 x i8>* %pixel_line, i32 2 | 60 %add.ptr23 = getelementptr inbounds <16 x i8>, <16 x i8>* %pixel_line, i32 2 |
61 store <16 x i8> %shuffle20, <16 x i8>* %add.ptr23, align 16 | 61 store <16 x i8> %shuffle20, <16 x i8>* %add.ptr23, align 16 |
62 %add.ptr24 = getelementptr inbounds <16 x i8>* %pixel_line, i32 3 | 62 %add.ptr24 = getelementptr inbounds <16 x i8>, <16 x i8>* %pixel_line, i32 3 |
63 store <16 x i8> %shuffle21, <16 x i8>* %add.ptr24, align 16 | 63 store <16 x i8> %shuffle21, <16 x i8>* %add.ptr24, align 16 |
64 %and25 = and <16 x i8> %and, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,
i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1> | 64 %and25 = and <16 x i8> %and, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1,
i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1> |
65 ret <16 x i8> %and25 | 65 ret <16 x i8> %and25 |
66 } | 66 } |
OLD | NEW |