2010-12-03 04:17:34 +08:00
|
|
|
; RUN: llc < %s -mtriple=i386-apple-darwin8 -mattr=+sse2 | FileCheck %s --check-prefix=X32
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+sse2 | FileCheck %s --check-prefix=X64
|
2012-03-02 10:50:46 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=-sse3 | FileCheck %s --check-prefix=X64_BAD
|
2010-12-01 07:55:39 +08:00
|
|
|
|
|
|
|
; Sibcall optimization of expanded libcalls.
|
|
|
|
; rdar://8707777
|
|
|
|
|
|
|
|
define double @foo(double %a) nounwind readonly ssp {
|
|
|
|
entry:
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-LABEL: foo:
|
2013-12-05 13:19:12 +08:00
|
|
|
; X32: jmp L_sin$stub
|
2010-12-02 06:59:46 +08:00
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X64-LABEL: foo:
|
2010-12-02 06:59:46 +08:00
|
|
|
; X64: jmp _sin
|
2010-12-01 07:55:39 +08:00
|
|
|
%0 = tail call double @sin(double %a) nounwind readonly
|
|
|
|
ret double %0
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @bar(float %a) nounwind readonly ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; X32-LABEL: bar:
|
2013-12-05 13:19:12 +08:00
|
|
|
; X32: jmp L_sinf$stub
|
2010-12-02 06:59:46 +08:00
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; X64-LABEL: bar:
|
2010-12-02 06:59:46 +08:00
|
|
|
; X64: jmp _sinf
|
2010-12-01 07:55:39 +08:00
|
|
|
entry:
|
|
|
|
%0 = tail call float @sinf(float %a) nounwind readonly
|
|
|
|
ret float %0
|
|
|
|
}
|
|
|
|
|
2013-12-05 13:19:12 +08:00
|
|
|
; X32-LABEL: L_sin$stub:
|
2013-12-02 05:24:30 +08:00
|
|
|
; X32-NEXT: .indirect_symbol _sin
|
2013-12-05 13:19:12 +08:00
|
|
|
; X32-LABEL: L_sinf$stub:
|
2013-12-02 05:24:30 +08:00
|
|
|
; X32-NEXT: .indirect_symbol _sinf
|
|
|
|
|
2010-12-01 07:55:39 +08:00
|
|
|
declare float @sinf(float) nounwind readonly
|
|
|
|
|
|
|
|
declare double @sin(double) nounwind readonly
|
2012-03-02 10:50:46 +08:00
|
|
|
|
|
|
|
; rdar://10930395
|
|
|
|
%0 = type opaque
|
|
|
|
|
|
|
|
@"\01L_OBJC_SELECTOR_REFERENCES_2" = external hidden global i8*, section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"
|
|
|
|
|
|
|
|
define hidden { double, double } @foo2(%0* %self, i8* nocapture %_cmd) uwtable optsize ssp {
|
|
|
|
; X64_BAD: foo
|
|
|
|
; X64_BAD: call
|
|
|
|
; X64_BAD: call
|
|
|
|
; X64_BAD: call
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_2", align 8, !invariant.load !0
|
2012-03-02 10:50:46 +08:00
|
|
|
%2 = bitcast %0* %self to i8*
|
|
|
|
%3 = tail call { double, double } bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to { double, double } (i8*, i8*)*)(i8* %2, i8* %1) optsize
|
|
|
|
%4 = extractvalue { double, double } %3, 0
|
|
|
|
%5 = extractvalue { double, double } %3, 1
|
|
|
|
%6 = tail call double @floor(double %4) optsize
|
|
|
|
%7 = tail call double @floor(double %5) optsize
|
|
|
|
%insert.i.i = insertvalue { double, double } undef, double %6, 0
|
|
|
|
%insert5.i.i = insertvalue { double, double } %insert.i.i, double %7, 1
|
|
|
|
ret { double, double } %insert5.i.i
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i8* @objc_msgSend(i8*, i8*, ...)
|
|
|
|
|
|
|
|
declare double @floor(double) optsize
|
|
|
|
|
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 = !{}
|