OLD | NEW |
1 ; This tries to be a comprehensive test of i8 operations. | 1 ; This tries to be a comprehensive test of i8 operations. |
2 | 2 |
3 ; RUN: %p2i -i %s --args -O2 --verbose none \ | 3 ; RUN: %p2i -i %s --args -O2 --verbose none \ |
4 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 4 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
5 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 5 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
6 ; RUN: %p2i -i %s --args -Om1 --verbose none \ | 6 ; RUN: %p2i -i %s --args -Om1 --verbose none \ |
7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
9 ; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s | 9 ; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s |
10 | 10 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 %a_8 = trunc i32 %a to i8 | 269 %a_8 = trunc i32 %a to i8 |
270 %bptr = inttoptr i32 %b_iptr to i8* | 270 %bptr = inttoptr i32 %b_iptr to i8* |
271 %b_8 = load i8* %bptr, align 1 | 271 %b_8 = load i8* %bptr, align 1 |
272 %icmp = icmp ne i8 %a_8, %b_8 | 272 %icmp = icmp ne i8 %a_8, %b_8 |
273 %ret = zext i1 %icmp to i32 | 273 %ret = zext i1 %icmp to i32 |
274 ret i32 %ret | 274 ret i32 %ret |
275 } | 275 } |
276 ; CHECK-LABEL: icmp8BitMemSwapped | 276 ; CHECK-LABEL: icmp8BitMemSwapped |
277 ; CHECK: cmp {{[abcd]l|byte ptr}} | 277 ; CHECK: cmp {{[abcd]l|byte ptr}} |
278 | 278 |
| 279 define internal i32 @testPhi8(i32 %arg, i32 %arg2, i32 %arg3, i32 %arg4, i32 %ar
g5, i32 %arg6, i32 %arg7, i32 %arg8, i32 %arg9, i32 %arg10) { |
| 280 entry: |
| 281 %trunc = trunc i32 %arg to i8 |
| 282 %trunc2 = trunc i32 %arg2 to i8 |
| 283 %trunc3 = trunc i32 %arg3 to i8 |
| 284 %trunc4 = trunc i32 %arg4 to i8 |
| 285 %trunc5 = trunc i32 %arg5 to i8 |
| 286 %cmp1 = icmp sgt i32 %arg, 0 |
| 287 br i1 %cmp1, label %next, label %target |
| 288 next: |
| 289 %trunc6_16 = trunc i32 %arg6 to i16 |
| 290 %trunc7_16 = trunc i32 %arg7 to i16 |
| 291 %trunc8_16 = trunc i32 %arg8 to i16 |
| 292 %trunc9 = trunc i32 %arg9 to i8 |
| 293 %trunc10 = trunc i32 %arg10 to i8 |
| 294 %trunc7_8 = trunc i16 %trunc7_16 to i8 |
| 295 %trunc6_8 = trunc i16 %trunc6_16 to i8 |
| 296 %trunc8_8 = trunc i16 %trunc8_16 to i8 |
| 297 br label %target |
| 298 target: |
| 299 %merge1 = phi i1 [ %cmp1, %entry ], [ false, %next ] |
| 300 %merge2 = phi i8 [ %trunc, %entry ], [ %trunc6_8, %next ] |
| 301 %merge3 = phi i8 [ %trunc2, %entry ], [ %trunc7_8, %next ] |
| 302 %merge5 = phi i8 [ %trunc4, %entry ], [ %trunc9, %next ] |
| 303 %merge6 = phi i8 [ %trunc5, %entry ], [ %trunc10, %next ] |
| 304 %merge4 = phi i8 [ %trunc3, %entry ], [ %trunc8_8, %next ] |
| 305 %res1 = select i1 %merge1, i8 %merge2, i8 %merge3 |
| 306 %res2 = select i1 %merge1, i8 %merge4, i8 %merge5 |
| 307 %res1_2 = select i1 %merge1, i8 %res1, i8 %res2 |
| 308 %res123 = select i1 %merge1, i8 %merge6, i8 %res1_2 |
| 309 %result = zext i8 %res123 to i32 |
| 310 ret i32 %result |
| 311 } |
| 312 ; CHECK-LABEL: testPhi8 |
| 313 ; This assumes there will be some copy from an 8-bit register / stack slot. |
| 314 ; CHECK-DAG: mov {{.*}}, {{[a-d]}}l |
| 315 ; CHECK-DAG: mov {{.*}}, byte ptr |
| 316 ; CHECK-DAG: mov byte ptr {{.*}} |
| 317 |
279 ; ERRORS-NOT: ICE translation error | 318 ; ERRORS-NOT: ICE translation error |
280 ; DUMP-NOT: SZ | 319 ; DUMP-NOT: SZ |
OLD | NEW |