2014-02-13 22:44:26 +08:00
|
|
|
; RUN: llc < %s -O0 -regalloc=fast -no-integrated-as | FileCheck %s
|
2010-05-06 07:07:41 +08:00
|
|
|
; PR6520
|
2010-05-07 09:45:38 +08:00
|
|
|
|
2010-05-06 07:07:41 +08:00
|
|
|
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"
|
|
|
|
target triple = "i386-apple-darwin10.0.0"
|
|
|
|
|
|
|
|
%0 = type { i8*, i8*, i32 }
|
|
|
|
|
|
|
|
define i8* @func() nounwind ssp {
|
|
|
|
entry:
|
|
|
|
%retval = alloca i8*, align 4 ; <i8**> [#uses=2]
|
|
|
|
%ret = alloca i8*, align 4 ; <i8**> [#uses=2]
|
|
|
|
%p = alloca i8*, align 4 ; <i8**> [#uses=1]
|
|
|
|
%t = alloca i32, align 4 ; <i32*> [#uses=1]
|
|
|
|
; The earlyclobber $1 should only appear once. It should not be shared.
|
|
|
|
; CHECK: deafbeef, [[REG:%e.x]]
|
|
|
|
; CHECK-NOT: [[REG]]
|
|
|
|
; CHECK: InlineAsm End
|
|
|
|
%0 = call %0 asm "mov $$0xdeafbeef, $1\0A\09mov $$0xcafebabe, $0\0A\09mov $0, $2\0A\09", "=&r,=&r,=&{cx},~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0 ; <%0> [#uses=3]
|
|
|
|
%asmresult = extractvalue %0 %0, 0 ; <i8*> [#uses=1]
|
|
|
|
%asmresult1 = extractvalue %0 %0, 1 ; <i8*> [#uses=1]
|
|
|
|
%asmresult2 = extractvalue %0 %0, 2 ; <i32> [#uses=1]
|
|
|
|
store i8* %asmresult, i8** %ret
|
|
|
|
store i8* %asmresult1, i8** %p
|
|
|
|
store i32 %asmresult2, i32* %t
|
2015-02-28 05:17:42 +08:00
|
|
|
%tmp = load i8*, i8** %ret ; <i8*> [#uses=1]
|
2010-05-06 07:07:41 +08:00
|
|
|
store i8* %tmp, i8** %retval
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load i8*, i8** %retval ; <i8*> [#uses=1]
|
2010-05-06 07:07:41 +08:00
|
|
|
ret i8* %1
|
|
|
|
}
|
|
|
|
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
|
|
|
!0 = !{i32 79}
|