Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: test/Transforms/NaCl/constant-vector-rematerialization.ll

Issue 1151093004: Changes from 3.7 merge to files not in upstream (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 ; RUN: opt < %s -backend-canonicalize -S | FileCheck %s 1 ; RUN: opt < %s -backend-canonicalize -S | FileCheck %s
2 2
3 ; Test that constant vectors that were globalized get rematerialized properly. 3 ; Test that constant vectors that were globalized get rematerialized properly.
4 4
5 ; The datalayout is needed to determine the alignment of the globals. 5 ; The datalayout is needed to determine the alignment of the globals.
6 target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64 :64:64-p:32:32:32-v128:32:32" 6 target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64 :64:64-p:32:32:32-v128:32:32"
7 7
8 @veci32 = internal constant [4 x i32] [i32 1, i32 2, i32 3, i32 4] 8 @veci32 = internal constant [4 x i32] [i32 1, i32 2, i32 3, i32 4]
9 @veci32zero = internal constant [4 x i32] zeroinitializer 9 @veci32zero = internal constant [4 x i32] zeroinitializer
10 10
11 @veci8 = internal constant [16 x i8] [i8 255, i8 255, i8 255, i8 0, i8 255, i8 2 55, i8 0, i8 255, i8 255, i8 0, i8 255, i8 255, i8 0, i8 255, i8 255, i8 255] 11 @veci8 = internal constant [16 x i8] [i8 255, i8 255, i8 255, i8 0, i8 255, i8 2 55, i8 0, i8 255, i8 255, i8 0, i8 255, i8 255, i8 0, i8 255, i8 255, i8 255]
12 @veci8zero = internal constant [16 x i8] zeroinitializer 12 @veci8zero = internal constant [16 x i8] zeroinitializer
13 13
14 define <4 x i32> @test_vec_i32() { 14 define <4 x i32> @test_vec_i32() {
15 %bc = bitcast [4 x i32]* @veci32 to <4 x i32>* 15 %bc = bitcast [4 x i32]* @veci32 to <4 x i32>*
16 %v = load <4 x i32>* %bc 16 %v = load <4 x i32>, <4 x i32>* %bc
17 ret <4 x i32> %v 17 ret <4 x i32> %v
18 } 18 }
19 ; CHECK-LABEL: @test_vec_i32( 19 ; CHECK-LABEL: @test_vec_i32(
20 ; CHECK-NEXT: ret <4 x i32> <i32 1, i32 2, i32 3, i32 4> 20 ; CHECK-NEXT: ret <4 x i32> <i32 1, i32 2, i32 3, i32 4>
21 21
22 define <4 x i32> @test_vec_i32_zero() { 22 define <4 x i32> @test_vec_i32_zero() {
23 %bc = bitcast [4 x i32]* @veci32zero to <4 x i32>* 23 %bc = bitcast [4 x i32]* @veci32zero to <4 x i32>*
24 %v = load <4 x i32>* %bc 24 %v = load <4 x i32>, <4 x i32>* %bc
25 ret <4 x i32> %v 25 ret <4 x i32> %v
26 } 26 }
27 ; CHECK-LABEL: @test_vec_i32_zero( 27 ; CHECK-LABEL: @test_vec_i32_zero(
28 ; CHECK-NEXT: ret <4 x i32> zeroinitializer 28 ; CHECK-NEXT: ret <4 x i32> zeroinitializer
29 29
30 define <4 x i32> @test_vec_i8() { 30 define <4 x i32> @test_vec_i8() {
31 %bc = bitcast [16 x i8]* @veci8 to <4 x i32>* 31 %bc = bitcast [16 x i8]* @veci8 to <4 x i32>*
32 %v = load <4 x i32>* %bc 32 %v = load <4 x i32>, <4 x i32>* %bc
33 ret <4 x i32> %v 33 ret <4 x i32> %v
34 } 34 }
35 ; CHECK-LABEL: @test_vec_i8( 35 ; CHECK-LABEL: @test_vec_i8(
36 ; CHECK-NEXT: ret <4 x i32> <i32 16777215, i32 -16711681, i32 -65281, i32 -256> 36 ; CHECK-NEXT: ret <4 x i32> <i32 16777215, i32 -16711681, i32 -65281, i32 -256>
37 37
38 define <4 x i32> @test_vec_i8_zero() { 38 define <4 x i32> @test_vec_i8_zero() {
39 %bc = bitcast [16 x i8]* @veci8zero to <4 x i32>* 39 %bc = bitcast [16 x i8]* @veci8zero to <4 x i32>*
40 %v = load <4 x i32>* %bc 40 %v = load <4 x i32>, <4 x i32>* %bc
41 ret <4 x i32> %v 41 ret <4 x i32> %v
42 } 42 }
43 ; CHECK-LABEL: @test_vec_i8_zero( 43 ; CHECK-LABEL: @test_vec_i8_zero(
44 ; CHECK-NEXT: ret <4 x i32> zeroinitializer 44 ; CHECK-NEXT: ret <4 x i32> zeroinitializer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698