2012-12-01 09:22:41 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-macosx -enable-misched \
|
|
|
|
; RUN: -verify-machineinstrs | FileCheck %s
|
|
|
|
;
|
|
|
|
; Test LiveInterval update handling of DBG_VALUE.
|
|
|
|
; rdar://12777252.
|
|
|
|
;
|
|
|
|
; CHECK: %entry
|
|
|
|
; CHECK: DEBUG_VALUE: hg
|
MachineSink: Fix and tweak critical-edge breaking heuristic.
Per original comment, the intention of this loop
is to go ahead and break the critical edge
(in order to sink this instruction) if there's
reason to believe doing so might "unblock" the
sinking of additional instructions that define
registers used by this one. The idea is that if
we have a few instructions to sink "together"
breaking the edge might be worthwhile.
This commit makes a few small changes
to help better realize this goal:
First, modify the loop to ignore registers
defined by this instruction. We don't
sink definitions of physical registers,
and sinking an SSA definition isn't
going to unblock an upstream instruction.
Second, ignore uses of physical registers.
Instructions that define physical registers are
rejected for sinking, and so moving this one
won't enable moving any defining instructions.
As an added bonus, while virtual register
use-def chains are generally small due
to SSA goodness, iteration over the uses
and definitions (used by hasOneNonDBGUse)
for physical registers like EFLAGS
can be rather expensive in practice.
(This is the original reason for looking at this)
Finally, to keep things simple continue
to only consider this trick for registers that
have a single use (via hasOneNonDBGUse),
but to avoid spuriously breaking critical edges
only do so if the definition resides
in the same MBB and therefore this one directly
blocks it from being sunk as well.
If sinking them together is meant to be,
let the iterative nature of this pass
sink the definition into this block first.
Update tests to accomodate this change,
add new testcase where sinking avoids pipeline stalls.
llvm-svn: 192608
2013-10-15 00:57:17 +08:00
|
|
|
; CHECK: j
|
2012-12-01 09:22:41 +08:00
|
|
|
|
|
|
|
%struct.node.0.27 = type { i16, double, [3 x double], i32, i32 }
|
|
|
|
%struct.hgstruct.2.29 = type { %struct.bnode.1.28*, [3 x double], double, [3 x double] }
|
|
|
|
%struct.bnode.1.28 = type { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x double], double, %struct.bnode.1.28*, %struct.bnode.1.28* }
|
|
|
|
|
|
|
|
declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
|
|
|
|
|
|
|
|
define signext i16 @subdivp(%struct.node.0.27* nocapture %p, double %dsq, double %tolsq, %struct.hgstruct.2.29* nocapture byval align 8 %hg) nounwind uwtable readonly ssp {
|
|
|
|
entry:
|
|
|
|
call void @llvm.dbg.declare(metadata !{%struct.hgstruct.2.29* %hg}, metadata !4)
|
|
|
|
%type = getelementptr inbounds %struct.node.0.27* %p, i64 0, i32 0
|
2013-05-01 01:52:57 +08:00
|
|
|
%0 = load i16* %type, align 2
|
2012-12-01 09:22:41 +08:00
|
|
|
%cmp = icmp eq i16 %0, 1
|
|
|
|
br i1 %cmp, label %return, label %for.cond.preheader
|
|
|
|
|
|
|
|
for.cond.preheader: ; preds = %entry
|
|
|
|
%arrayidx6.1 = getelementptr inbounds %struct.hgstruct.2.29* %hg, i64 0, i32 1, i64 1
|
|
|
|
%cmp22 = fcmp olt double 0.000000e+00, %dsq
|
|
|
|
%conv24 = zext i1 %cmp22 to i16
|
|
|
|
br label %return
|
|
|
|
|
|
|
|
return: ; preds = %for.cond.preheader, %entry
|
|
|
|
%retval.0 = phi i16 [ %conv24, %for.cond.preheader ], [ 0, %entry ]
|
|
|
|
ret i16 %retval.0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
2013-11-23 05:49:45 +08:00
|
|
|
!llvm.module.flags = !{!12}
|
2012-12-01 09:22:41 +08:00
|
|
|
|
2014-07-26 00:05:18 +08:00
|
|
|
!0 = metadata !{i32 786449, metadata !11, i32 12, metadata !"clang version 3.3 (trunk 168918) (llvm/trunk 168920)", i1 true, metadata !"", i32 0, metadata !2, metadata !2, metadata !13, metadata !2, null, metadata !""} ; [ DW_TAG_compile_unit ] [MultiSource/Benchmarks/Olden/bh/newbh.c] [DW_LANG_C99]
|
2014-02-04 09:23:52 +08:00
|
|
|
!2 = metadata !{}
|
2012-12-01 09:22:41 +08:00
|
|
|
!4 = metadata !{i32 786689, null, metadata !"hg", metadata !5, i32 67109589, metadata !6, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [hg] [line 725]
|
2013-03-18 05:13:55 +08:00
|
|
|
!5 = metadata !{i32 786473, metadata !11} ; [ DW_TAG_file_type ]
|
2013-03-20 08:26:26 +08:00
|
|
|
!6 = metadata !{i32 786454, metadata !11, null, metadata !"hgstruct", i32 492, i64 0, i64 0, i64 0, i32 0, metadata !7} ; [ DW_TAG_typedef ] [hgstruct] [line 492, size 0, align 0, offset 0] [from ]
|
2013-09-07 05:03:58 +08:00
|
|
|
!7 = metadata !{i32 786451, metadata !11, null, metadata !"", i32 487, i64 512, i64 64, i32 0, i32 0, null, null, i32 0, null, i32 0, null} ; [ DW_TAG_structure_type ] [line 487, size 512, align 64, offset 0] [def] [from ]
|
2013-03-18 05:13:55 +08:00
|
|
|
!11 = metadata !{metadata !"MultiSource/Benchmarks/Olden/bh/newbh.c", metadata !"MultiSource/Benchmarks/Olden/bh"}
|
2013-11-23 05:49:45 +08:00
|
|
|
!12 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
|
2014-07-26 00:05:18 +08:00
|
|
|
!13 = metadata !{metadata !14}
|
|
|
|
!14 = metadata !{i32 786478, metadata !11, metadata !5, metadata !"subdivp", metadata !"subdivp", null, i32 0, metadata !15, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 true, i16 (%struct.node.0.27*, double, double, %struct.hgstruct.2.29* )* @subdivp, null, null, null, i32 1} ; [ DW_TAG_subprogram ] [def] [subdivp]
|
|
|
|
!15 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !16, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
|
|
|
|
!16 = metadata !{null}
|