1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu -verify-machineinstrs -O2 < %s | FileCheck %s
4 ;; https://llvm.org/PR47468
6 ;; PHI elimination should place copies BEFORE the inline asm, not
7 ;; after, even if the inline-asm uses as an input the same value as
10 declare void @foo(i8*)
12 define void @test1(i8* %arg, i8** %mem) nounwind {
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: pushq %r14
16 ; CHECK-NEXT: pushq %rbx
17 ; CHECK-NEXT: pushq %rax
18 ; CHECK-NEXT: movq %rsi, %r14
19 ; CHECK-NEXT: .Ltmp0: # Block address taken
20 ; CHECK-NEXT: .LBB0_1: # %loop
21 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
22 ; CHECK-NEXT: movq (%r14), %rbx
23 ; CHECK-NEXT: callq foo@PLT
24 ; CHECK-NEXT: movq %rbx, %rdi
27 ; CHECK-NEXT: # %bb.2: # %end
28 ; CHECK-NEXT: addq $8, %rsp
29 ; CHECK-NEXT: popq %rbx
30 ; CHECK-NEXT: popq %r14
36 %a = phi i8* [ %arg, %entry ], [ %b, %loop ]
37 %b = load i8*, i8** %mem, align 8
38 call void @foo(i8* %a)
39 callbr void asm sideeffect "", "*m,X"(i8* %b, i8* blockaddress(@test1, %loop))
40 to label %end [label %loop]