1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s
4 ; PR46195 - https://bugs.llvm.org/show_bug.cgi?id=46195
5 ; It is not safe to sink the load after the call.
7 define void @translate(ptr %ptr) nounwind {
8 ; CHECK-LABEL: translate:
10 ; CHECK-NEXT: pushq %rbp
11 ; CHECK-NEXT: pushq %rbx
12 ; CHECK-NEXT: pushq %rax
13 ; CHECK-NEXT: movq %rdi, %rbx
14 ; CHECK-NEXT: movl $-32707, %ebp # imm = 0x803D
15 ; CHECK-NEXT: andl (%rdi), %ebp
16 ; CHECK-NEXT: callq maybe_mutate@PLT
17 ; CHECK-NEXT: orl $514, %ebp # imm = 0x202
18 ; CHECK-NEXT: movw %bp, (%rbx)
19 ; CHECK-NEXT: addq $8, %rsp
20 ; CHECK-NEXT: popq %rbx
21 ; CHECK-NEXT: popq %rbp
23 %i0 = load i16, ptr %ptr, align 4
24 call void @maybe_mutate(ptr %ptr)
25 %i1 = and i16 %i0, -32707
27 store i16 %i2, ptr %ptr, align 4
31 declare void @maybe_mutate(ptr)