2013-04-13 14:12:46 +08:00
|
|
|
; REQUIRES: asserts
|
2017-08-02 08:28:10 +08:00
|
|
|
; RUN: llc < %s -verify-machineinstrs -mtriple=i686-- -mcpu=core2 -pre-RA-sched=source -enable-misched -verify-misched -debug-only=machine-scheduler -o - 2>&1 > /dev/null | FileCheck %s
|
2013-04-13 14:07:40 +08:00
|
|
|
;
|
|
|
|
; Test scheduling of copy instructions.
|
|
|
|
;
|
|
|
|
; Argument copies should be hoisted to the top of the block.
|
|
|
|
; Return copies should be sunk to the end.
|
|
|
|
; MUL_HiLo PhysReg use copies should be just above the mul.
|
|
|
|
; MUL_HiLo PhysReg def copies should be just below the mul.
|
|
|
|
;
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: *** Final schedule for %bb.1 ***
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $eax = COPY
|
|
|
|
; CHECK-NEXT: MUL32r %{{[0-9]+}}:gr32, implicit-def $eax, implicit-def $edx, implicit-def dead $eflags, implicit $eax
|
|
|
|
; CHECK-NEXT: COPY $e{{[ad]}}x
|
|
|
|
; CHECK-NEXT: COPY $e{{[ad]}}x
|
2013-04-13 14:07:40 +08:00
|
|
|
; CHECK: DIVSSrm
|
|
|
|
define i64 @mulhoist(i32 %a, i32 %b) #0 {
|
|
|
|
entry:
|
|
|
|
br label %body
|
|
|
|
|
|
|
|
body:
|
|
|
|
%convb = sitofp i32 %b to float
|
|
|
|
; Generates an iMUL64r to legalize types.
|
|
|
|
%aa = zext i32 %a to i64
|
|
|
|
%mul = mul i64 %aa, 74383
|
|
|
|
; Do some dependent long latency stuff.
|
|
|
|
%trunc = trunc i64 %mul to i32
|
|
|
|
%convm = sitofp i32 %trunc to float
|
|
|
|
%divm = fdiv float %convm, 0.75
|
|
|
|
;%addmb = fadd float %divm, %convb
|
|
|
|
;%divmb = fdiv float %addmb, 0.125
|
|
|
|
; Do some independent long latency stuff.
|
|
|
|
%conva = sitofp i32 %a to float
|
|
|
|
%diva = fdiv float %conva, 0.75
|
|
|
|
%addab = fadd float %diva, %convb
|
|
|
|
%divab = fdiv float %addab, 0.125
|
|
|
|
br label %end
|
|
|
|
|
|
|
|
end:
|
|
|
|
%val = fptosi float %divab to i64
|
|
|
|
%add = add i64 %mul, %val
|
|
|
|
ret i64 %add
|
|
|
|
}
|
|
|
|
|
2013-08-23 05:28:54 +08:00
|
|
|
attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
|
2013-04-13 14:07:40 +08:00
|
|
|
|
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 = !{!"float", !1}
|
|
|
|
!1 = !{!"omnipotent char", !2}
|
|
|
|
!2 = !{!"Simple C/C++ TBAA"}
|