OLD | NEW |
1 ; This is a smoke test of constant blinding and constant pooling. | 1 ; This is a smoke test of constant blinding and constant pooling. |
2 | 2 |
3 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ | 3 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ |
4 ; RUN: -sz-seed=1 -randomize-pool-immediates=randomize \ | 4 ; RUN: -sz-seed=1 -randomize-pool-immediates=randomize \ |
5 ; RUN: -randomize-pool-threshold=0x1 \ | 5 ; RUN: -randomize-pool-threshold=0x1 \ |
6 ; RUN: | FileCheck %s --check-prefix=BLINDINGO2 | 6 ; RUN: | FileCheck %s --check-prefix=BLINDINGO2 |
7 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ | 7 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ |
8 ; RUN: -sz-seed=1 -randomize-pool-immediates=randomize \ | 8 ; RUN: -sz-seed=1 -randomize-pool-immediates=randomize \ |
9 ; RUN: -randomize-pool-threshold=0x1 \ | 9 ; RUN: -randomize-pool-threshold=0x1 \ |
10 ; RUN: | FileCheck %s --check-prefix=BLINDINGOM1 | 10 ; RUN: | FileCheck %s --check-prefix=BLINDINGOM1 |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 ; BLINDINGO2-LABEL: add_arg_plus_200000 | 27 ; BLINDINGO2-LABEL: add_arg_plus_200000 |
28 ; BLINDINGO2: mov [[REG:e[a-z]*]],0x669f4eea | 28 ; BLINDINGO2: mov [[REG:e[a-z]*]],0x669f4eea |
29 ; BLINDINGO2-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x669c41aa{{[]]}} | 29 ; BLINDINGO2-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x669c41aa{{[]]}} |
30 | 30 |
31 ; BLINDINGOM1-LABEL: add_arg_plus_200000 | 31 ; BLINDINGOM1-LABEL: add_arg_plus_200000 |
32 ; BLINDINGOM1: mov [[REG:e[a-z]*]],0x669f4eea | 32 ; BLINDINGOM1: mov [[REG:e[a-z]*]],0x669f4eea |
33 ; BLINDINGOM1-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x669c41aa{{[]]}} | 33 ; BLINDINGOM1-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x669c41aa{{[]]}} |
34 | 34 |
35 ; POOLING-LABEL: add_arg_plus_200000 | 35 ; POOLING-LABEL: add_arg_plus_200000 |
36 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32$00030
d40 | 36 ; POOLING: mov e{{[a-z]*}},{{(DWORD PTR )?}}ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i3
2$00030d40 |
37 } | 37 } |
38 | 38 |
39 define internal float @load_arg_plus_200000(float* %arg) { | 39 define internal float @load_arg_plus_200000(float* %arg) { |
40 entry: | 40 entry: |
41 %arg.int = ptrtoint float* %arg to i32 | 41 %arg.int = ptrtoint float* %arg to i32 |
42 %addr.int = add i32 %arg.int, 200000 | 42 %addr.int = add i32 %arg.int, 200000 |
43 %addr.ptr = inttoptr i32 %addr.int to float* | 43 %addr.ptr = inttoptr i32 %addr.int to float* |
44 %addr.load = load float, float* %addr.ptr, align 4 | 44 %addr.load = load float, float* %addr.ptr, align 4 |
45 ret float %addr.load | 45 ret float %addr.load |
46 ; BLINDINGO2-LABEL: load_arg_plus_200000 | 46 ; BLINDINGO2-LABEL: load_arg_plus_200000 |
47 ; BLINDINGO2: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}+0x69ed4ee7{{[]]}} | 47 ; BLINDINGO2: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}+0x69ed4ee7{{[]]}} |
48 | 48 |
49 ; BLINDINGOM1-LABEL: load_arg_plus_200000 | 49 ; BLINDINGOM1-LABEL: load_arg_plus_200000 |
50 ; BLINDINGOM1: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}-0x69ea41a7{{[]]}} | 50 ; BLINDINGOM1: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}-0x69ea41a7{{[]]}} |
51 | 51 |
52 ; POOLING-LABEL: load_arg_plus_200000 | 52 ; POOLING-LABEL: load_arg_plus_200000 |
53 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32$00030
d40 | 53 ; POOLING: mov e{{[a-z]*}},{{(DWORD PTR )?}}ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i3
2$00030d40 |
54 } | 54 } |
55 | 55 |
56 define internal i64 @add_arg_plus_64bits(i32 %arg) { | 56 define internal i64 @add_arg_plus_64bits(i32 %arg) { |
57 entry: | 57 entry: |
58 %0 = sext i32 %arg to i64 | 58 %0 = sext i32 %arg to i64 |
59 %res = add i64 90000000000, %0 | 59 %res = add i64 90000000000, %0 |
60 ret i64 %res | 60 ret i64 %res |
61 | 61 |
62 ; BLINDINGO2-LABEL: add_arg_plus_64bits | 62 ; BLINDINGO2-LABEL: add_arg_plus_64bits |
63 ; BLINDINGO2: sar [[RHI:e[a-z]*]],0x1f | 63 ; BLINDINGO2: sar [[RHI:e[a-z]*]],0x1f |
64 ; BLINDINGO2: mov [[RLO:e[a-z]*]],0x61a345a8 | 64 ; BLINDINGO2: mov [[RLO:e[a-z]*]],0x61a345a8 |
65 ; BLINDINGO2-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x6d3841a8{{[]]}} | 65 ; BLINDINGO2-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x6d3841a8{{[]]}} |
66 | 66 |
67 ; BLINDINGOM1-LABEL: add_arg_plus_64bits | 67 ; BLINDINGOM1-LABEL: add_arg_plus_64bits |
68 ; BLINDINGOM1: sar [[RHI:e[a-z]*]],0x1f | 68 ; BLINDINGOM1: sar [[RHI:e[a-z]*]],0x1f |
69 ; BLINDINGOM1: mov [[RLO:e[a-z]*]],0x61a345a8 | 69 ; BLINDINGOM1: mov [[RLO:e[a-z]*]],0x61a345a8 |
70 ; BLINDINGOM1-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x6d3841a8{{[]]}} | 70 ; BLINDINGOM1-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x6d3841a8{{[]]}} |
71 | 71 |
72 ; POOLING-LABEL: add_arg_plus_64bits | 72 ; POOLING-LABEL: add_arg_plus_64bits |
73 ; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32$f46b0
400 | 73 ; POOLING: mov e{{[a-z]*}},{{(DWORD PTR )?}}ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i3
2$f46b0400 |
74 } | 74 } |
75 | 75 |
76 define internal i64 @load_arg_plus_64bits(i64* %arg) { | 76 define internal i64 @load_arg_plus_64bits(i64* %arg) { |
77 entry: | 77 entry: |
78 %arg.int = ptrtoint i64* %arg to i32 | 78 %arg.int = ptrtoint i64* %arg to i32 |
79 %arg.new = add i32 %arg.int, 90000 | 79 %arg.new = add i32 %arg.int, 90000 |
80 %arg.ptr = inttoptr i32 %arg.new to i64* | 80 %arg.ptr = inttoptr i32 %arg.new to i64* |
81 %arg.load = load i64, i64* %arg.ptr, align 1 | 81 %arg.load = load i64, i64* %arg.ptr, align 1 |
82 ret i64 %arg.load | 82 ret i64 %arg.load |
83 | 83 |
84 ; BLINDINGO2-LABEL: load_arg_plus_64bits | 84 ; BLINDINGO2-LABEL: load_arg_plus_64bits |
85 ; BLINDINGO2: lea e{{[a-z]*}},{{[[]}}e{{[a-z]*}}+0x7087a139{{[]]}} | 85 ; BLINDINGO2: lea e{{[a-z]*}},{{[[]}}e{{[a-z]*}}+0x7087a139{{[]]}} |
86 ; BLINDINGO2: mov e{{[a-z]*}},DWORD PTR {{[[]}}e{{[a-z]*}}-0x708641a9{{[]]}} | 86 ; BLINDINGO2: mov e{{[a-z]*}},DWORD PTR {{[[]}}e{{[a-z]*}}-0x708641a9{{[]]}} |
87 | 87 |
88 ; BLINDINGOM1-LABEL: load_arg_plus_64bits | 88 ; BLINDINGOM1-LABEL: load_arg_plus_64bits |
89 ; BLINDINGOM1: mov e{{[a-z]*}},0x7087a139 | 89 ; BLINDINGOM1: mov e{{[a-z]*}},0x7087a139 |
90 ; BLINDINGOM1-NEXT: lea e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x708641a9{{[]]}} | 90 ; BLINDINGOM1-NEXT: lea e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x708641a9{{[]]}} |
91 | 91 |
92 ; POOLING-LABEL: load_arg_plus_64bits | 92 ; POOLING-LABEL: load_arg_plus_64bits |
93 ; POOLING: mov e{{[a-z]x}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32$00000
004 | 93 ; POOLING: mov e{{[a-z]x}},{{(DWORD PTR )?}}ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i3
2$00000004 |
94 } | 94 } |
95 | 95 |
96 define internal i32 @add_const_8bits(i32 %a) { | 96 define internal i32 @add_const_8bits(i32 %a) { |
97 entry: | 97 entry: |
98 %a_8 = trunc i32 %a to i8 | 98 %a_8 = trunc i32 %a to i8 |
99 %add = add i8 %a_8, 123 | 99 %add = add i8 %a_8, 123 |
100 %ret = zext i8 %add to i32 | 100 %ret = zext i8 %add to i32 |
101 ret i32 %ret | 101 ret i32 %ret |
102 | 102 |
103 ; BLINDINGO2-LABEL: add_const_8bits | 103 ; BLINDINGO2-LABEL: add_const_8bits |
104 ; BLINDINGO2: mov e{{[a-z]*}},0x73d44225 | 104 ; BLINDINGO2: mov e{{[a-z]*}},0x73d44225 |
105 ; BLINDINGO2-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x73d441aa{{[]]}} | 105 ; BLINDINGO2-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x73d441aa{{[]]}} |
106 | 106 |
107 ; BLINDINGOM1-LABEL: add_const_8bits | 107 ; BLINDINGOM1-LABEL: add_const_8bits |
108 ; BLINDINGOM1: mov e{{[a-z]*}},0x73d44225 | 108 ; BLINDINGOM1: mov e{{[a-z]*}},0x73d44225 |
109 ; BLINDINGOM1-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x73d441aa{{[]]}} | 109 ; BLINDINGOM1-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x73d441aa{{[]]}} |
110 | 110 |
111 ; POOLING-LABEL: add_const_8bits | 111 ; POOLING-LABEL: add_const_8bits |
112 ; POOLING: mov {{[a-z]l}},BYTE PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i8$0000007b | 112 ; POOLING: mov {{[a-z]l}},{{(BYTE PTR )?}}ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i8$0
000007b |
113 } | 113 } |
114 | 114 |
115 define internal i32 @add_const_16bits(i32 %a) { | 115 define internal i32 @add_const_16bits(i32 %a) { |
116 entry: | 116 entry: |
117 %a_16 = trunc i32 %a to i16 | 117 %a_16 = trunc i32 %a to i16 |
118 %add = add i16 %a_16, 32766 | 118 %add = add i16 %a_16, 32766 |
119 %ret = zext i16 %add to i32 | 119 %ret = zext i16 %add to i32 |
120 ret i32 %ret | 120 ret i32 %ret |
121 | 121 |
122 ; BLINDINGO2-LABEL: add_const_16bits | 122 ; BLINDINGO2-LABEL: add_const_16bits |
123 ; BLINDINGO2: mov e{{[a-z]*}},0x7722c1a5 | 123 ; BLINDINGO2: mov e{{[a-z]*}},0x7722c1a5 |
124 ; BLINDINGO2-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x772241a7{{[]]}} | 124 ; BLINDINGO2-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x772241a7{{[]]}} |
125 | 125 |
126 ; BLINDINGOM1-LABEL: add_const_16bits | 126 ; BLINDINGOM1-LABEL: add_const_16bits |
127 ; BLINDINGOM1: mov e{{[a-z]*}},0x7722c1a5 | 127 ; BLINDINGOM1: mov e{{[a-z]*}},0x7722c1a5 |
128 ; BLINDINGOM1-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x772241a7{{[]]}} | 128 ; BLINDINGOM1-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x772241a7{{[]]}} |
129 | 129 |
130 ; POOLING-LABEL: add_const_16bits | 130 ; POOLING-LABEL: add_const_16bits |
131 ; POOLING: mov {{[a-z]x}},WORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i16$00007ff
e | 131 ; POOLING: mov {{[a-z]x}},{{(WORD PTR )?}}ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i16$
00007ffe |
132 | 132 |
133 } | 133 } |
OLD | NEW |