This patch adds support for inline assembly address operands using the "p" constraint on X86 and SystemZ. This was in fact broken on X86 (see example at https://reviews.llvm.org/D110267, Nov 23). These operands should probably be treated the same as memory operands by CodeGenPrepare, which have been commented with "TODO" there. Review: Xiang Zhang and Ulrich Weigand Differential Revision: https://reviews.llvm.org/D122220
12 lines
325 B
LLVM
12 lines
325 B
LLVM
; RUN: llc -mtriple=x86_64-unknown-unknown -no-integrated-as < %s 2>&1 | FileCheck %s
|
|
|
|
define i8* @foo(i8* %ptr) {
|
|
; CHECK-LABEL: foo:
|
|
%1 = tail call i8* asm "lea $1, $0", "=r,p,~{dirflag},~{fpsr},~{flags}"(i8* %ptr)
|
|
; CHECK: #APP
|
|
; CHECK-NEXT: lea (%rdi), %rax
|
|
; CHECK-NEXT: #NO_APP
|
|
ret i8* %1
|
|
; CHECK-NEXT: retq
|
|
}
|