brintos

brintos / llvm-project-archived public Read only

0
0
Text · 940 B · 2490fbd Raw
34 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=x86_64-apple-darwin < %s | FileCheck %s3 4; This test checks that we don't try to narrow the volatile load by selecting5; the pattern below into a testb instruction.6 7define void @testb_volatile(ptr%ptrptr) {8; CHECK-LABEL: testb_volatile:9; CHECK:       ## %bb.0: ## %entry10; CHECK-NEXT:    movq (%rdi), %rax11; CHECK-NEXT:    testl $1, (%rax)12; CHECK-NEXT:    jne LBB0_113; CHECK-NEXT:  ## %bb.2: ## %exit14; CHECK-NEXT:    movl $1, (%rax)15; CHECK-NEXT:    retq16; CHECK-NEXT:  LBB0_1: ## %bb217; CHECK-NEXT:    movl $0, (%rax)18; CHECK-NEXT:    retq19entry:20  %ptr = load ptr, ptr %ptrptr, align 821  %vol_load = load volatile i32, ptr %ptr, align 422  %and = and i32 %vol_load, 123  %cmp = icmp eq i32 %and, 024  br i1 %cmp, label %exit, label %bb225 26bb2:27  store i32 0, ptr%ptr, align 428  ret void29 30exit:31  store i32 1, ptr%ptr, align 432  ret void33}34