| OLD | NEW |
| 1 ; This tests the NaCl intrinsics not related to atomic operations. | 1 ; This tests the NaCl intrinsics not related to atomic operations. |
| 2 | 2 |
| 3 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s | 3 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s |
| 4 ; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck %s | 4 ; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck %s |
| 5 | 5 |
| 6 ; Do another run w/ O2 and a different check-prefix (otherwise O2 and Om1 | 6 ; Do another run w/ O2 and a different check-prefix (otherwise O2 and Om1 |
| 7 ; share the same "CHECK" prefix). This separate run helps check that | 7 ; share the same "CHECK" prefix). This separate run helps check that |
| 8 ; some code is optimized out. | 8 ; some code is optimized out. |
| 9 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s --check-prefix=CHECKO2REM | 9 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s --check-prefix=CHECKO2REM |
| 10 | 10 |
| 11 ; TODO: The next two lines cause this test to fail. | 11 ; RUN: %llvm2ice -O2 --verbose none %s | llvm-mc -x86-asm-syntax=intel |
| 12 ; RUIN: %llvm2ice -O2 --verbose none %s | llvm-mc -x86-asm-syntax=intel | 12 ; RUN: %llvm2ice -Om1 --verbose none %s | llvm-mc -x86-asm-syntax=intel |
| 13 ; RUIN: %llvm2ice -Om1 --verbose none %s | llvm-mc -x86-asm-syntax=intel | |
| 14 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 13 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
| 15 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s | 14 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
| 16 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ | 15 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ |
| 17 ; RUN: | FileCheck --check-prefix=DUMP %s | 16 ; RUN: | FileCheck --check-prefix=DUMP %s |
| 18 | 17 |
| 19 declare i8* @llvm.nacl.read.tp() | 18 declare i8* @llvm.nacl.read.tp() |
| 20 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) | 19 declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) |
| 21 declare void @llvm.memmove.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) | 20 declare void @llvm.memmove.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1) |
| 22 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) | 21 declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1) |
| 23 declare void @llvm.nacl.longjmp(i8*, i32) | 22 declare void @llvm.nacl.longjmp(i8*, i32) |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 ; CHECK: mov [[REG_RES:e.*]], 63 | 302 ; CHECK: mov [[REG_RES:e.*]], 63 |
| 304 ; CHECK: cmovne [[REG_RES]], [[REG_TMP]] | 303 ; CHECK: cmovne [[REG_RES]], [[REG_TMP]] |
| 305 ; CHECK: xor [[REG_RES]], 31 | 304 ; CHECK: xor [[REG_RES]], 31 |
| 306 | 305 |
| 307 define i32 @test_ctlz_32_const() { | 306 define i32 @test_ctlz_32_const() { |
| 308 entry: | 307 entry: |
| 309 %r = call i32 @llvm.ctlz.i32(i32 123456, i1 0) | 308 %r = call i32 @llvm.ctlz.i32(i32 123456, i1 0) |
| 310 ret i32 %r | 309 ret i32 %r |
| 311 } | 310 } |
| 312 ; Could potentially constant fold this, but the front-end should have done that. | 311 ; Could potentially constant fold this, but the front-end should have done that. |
| 312 ; The dest operand must be a register and the source operand must be a register |
| 313 ; or memory. |
| 313 ; CHECK-LABEL: test_ctlz_32_const | 314 ; CHECK-LABEL: test_ctlz_32_const |
| 314 ; CHECK: bsr | 315 ; CHECK: bsr e{{.*}}, {{.*}}e{{.*}} |
| 315 | 316 |
| 316 define i32 @test_ctlz_32_ignored(i32 %x) { | 317 define i32 @test_ctlz_32_ignored(i32 %x) { |
| 317 entry: | 318 entry: |
| 318 %ignored = call i32 @llvm.ctlz.i32(i32 %x, i1 0) | 319 %ignored = call i32 @llvm.ctlz.i32(i32 %x, i1 0) |
| 319 ret i32 1 | 320 ret i32 1 |
| 320 } | 321 } |
| 321 ; CHECKO2REM-LABEL: test_ctlz_32_ignored | 322 ; CHECKO2REM-LABEL: test_ctlz_32_ignored |
| 322 ; CHECKO2REM-NOT: bsr | 323 ; CHECKO2REM-NOT: bsr |
| 323 | 324 |
| 324 define i64 @test_ctlz_64(i64 %x) { | 325 define i64 @test_ctlz_64(i64 %x) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 339 ; CHECK: cmove [[REG_RES2]], [[REG_RES1]] | 340 ; CHECK: cmove [[REG_RES2]], [[REG_RES1]] |
| 340 ; CHECK: mov {{.*}}, 0 | 341 ; CHECK: mov {{.*}}, 0 |
| 341 | 342 |
| 342 define i32 @test_ctlz_64_const(i64 %x) { | 343 define i32 @test_ctlz_64_const(i64 %x) { |
| 343 entry: | 344 entry: |
| 344 %r = call i64 @llvm.ctlz.i64(i64 123456789012, i1 0) | 345 %r = call i64 @llvm.ctlz.i64(i64 123456789012, i1 0) |
| 345 %r2 = trunc i64 %r to i32 | 346 %r2 = trunc i64 %r to i32 |
| 346 ret i32 %r2 | 347 ret i32 %r2 |
| 347 } | 348 } |
| 348 ; CHECK-LABEL: test_ctlz_64_const | 349 ; CHECK-LABEL: test_ctlz_64_const |
| 349 ; CHECK: bsr | 350 ; CHECK: bsr e{{.*}}, {{.*}}e{{.*}} |
| 350 ; CHECK: bsr | 351 ; CHECK: bsr e{{.*}}, {{.*}}e{{.*}} |
| 352 |
| 351 | 353 |
| 352 define i32 @test_ctlz_64_ignored(i64 %x) { | 354 define i32 @test_ctlz_64_ignored(i64 %x) { |
| 353 entry: | 355 entry: |
| 354 %ignored = call i64 @llvm.ctlz.i64(i64 1234567890, i1 0) | 356 %ignored = call i64 @llvm.ctlz.i64(i64 1234567890, i1 0) |
| 355 ret i32 2 | 357 ret i32 2 |
| 356 } | 358 } |
| 357 ; CHECKO2REM-LABEL: test_ctlz_64_ignored | 359 ; CHECKO2REM-LABEL: test_ctlz_64_ignored |
| 358 ; CHECKO2REM-NOT: bsr | 360 ; CHECKO2REM-NOT: bsr |
| 359 | 361 |
| 360 define i32 @test_cttz_32(i32 %x) { | 362 define i32 @test_cttz_32(i32 %x) { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 } | 454 } |
| 453 ; CHECK-LABEL: test_stacksave_multiple | 455 ; CHECK-LABEL: test_stacksave_multiple |
| 454 ; At least 3 copies of esp, but probably more from having to do the allocas. | 456 ; At least 3 copies of esp, but probably more from having to do the allocas. |
| 455 ; CHECK: mov {{.*}}, esp | 457 ; CHECK: mov {{.*}}, esp |
| 456 ; CHECK: mov {{.*}}, esp | 458 ; CHECK: mov {{.*}}, esp |
| 457 ; CHECK: mov {{.*}}, esp | 459 ; CHECK: mov {{.*}}, esp |
| 458 ; CHECK: mov esp, {{.*}} | 460 ; CHECK: mov esp, {{.*}} |
| 459 | 461 |
| 460 ; ERRORS-NOT: ICE translation error | 462 ; ERRORS-NOT: ICE translation error |
| 461 ; DUMP-NOT: SZ | 463 ; DUMP-NOT: SZ |
| OLD | NEW |