It caused assertions to fire when building Chromium:
lib/CodeGen/LiveDebugValues.cpp:331: bool
{anonymous}::LiveDebugValues::OpenRangesSet::empty() const: Assertion
`Vars.empty() == VarLocs.empty() && "open ranges are inconsistent"' failed.
See https://crbug.com/992871#c3 for how to reproduce.
> Patch https://reviews.llvm.org/D43256 introduced more aggressive loop layout optimization which depends on profile information. If profile information is not available, the statically estimated profile information(generated by BranchProbabilityInfo.cpp) is used. If user program doesn't behave as BranchProbabilityInfo.cpp expected, the layout may be worse.
>
> To be conservative this patch restores the original layout algorithm in plain mode. But user can still try the aggressive layout optimization with -force-precise-rotation-cost=true.
>
> Differential Revision: https://reviews.llvm.org/D65673
llvm-svn: 368579
37 lines
767 B
LLVM
37 lines
767 B
LLVM
; RUN: llc -mtriple=i686-linux < %s | FileCheck %s
|
|
|
|
|
|
define i32 @bar(i32 %count) {
|
|
; Test checks that basic block backedge2 is not moved before header,
|
|
; because it can't reduce taken branches.
|
|
; Later backedge1 and backedge2 is rotated before loop header.
|
|
; CHECK-LABEL: bar
|
|
; CHECK: %.entry
|
|
; CHECK: %.header
|
|
; CHECK: %.backedge1
|
|
; CHECK: %.backedge2
|
|
; CHECK: %.exit
|
|
.entry:
|
|
%c = shl nsw i32 %count, 2
|
|
br label %.header
|
|
|
|
.header:
|
|
%val1 = call i32 @foo()
|
|
%cond1 = icmp sgt i32 %val1, 1
|
|
br i1 %cond1, label %.exit, label %.backedge1
|
|
|
|
.backedge1:
|
|
%val2 = call i32 @foo()
|
|
%cond2 = icmp sgt i32 %val2, 1
|
|
br i1 %cond2, label %.header, label %.backedge2
|
|
|
|
.backedge2:
|
|
%val3 = call i32 @foo()
|
|
br label %.header
|
|
|
|
.exit:
|
|
ret i32 %c
|
|
}
|
|
|
|
declare i32 @foo()
|