1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/Analysis/BlockFrequencyInfo/redundant_edges.ll
Duncan P. N. Exon Smith 27a3b015ef Revert part of "Cleanup some GraphTraits iteration code"
This reverts part of r300656, which caused a regression in
propagateMassToSuccessors by counting edges n^2 times, where n is the
number of edges from the source basic block to the same successor basic
block. The result was both incorrect and very slow to compute for large
values of n (e.g. switches with multiple cases that go to the same basic
block).

Patch by Andrew Scheidecker!

llvm-svn: 320208
2017-12-08 22:42:43 +00:00

23 lines
582 B
LLVM

; RUN: opt < %s -analyze -block-freq | FileCheck %s
; RUN: opt < %s -analyze -lazy-block-freq | FileCheck %s
; RUN: opt < %s -passes='print<block-freq>' -disable-output 2>&1 | FileCheck %s
define void @test1() {
; CHECK-LABEL: Printing analysis {{.*}} for function 'test1':
; CHECK-NEXT: block-frequency-info: test1
; CHECK-NEXT: entry: float = 1.0, int = [[ENTRY:[0-9]+]]
entry:
br label %loop
; CHECK-NEXT: loop: float = 32.0
loop:
switch i32 undef, label %loop [
i32 0, label %return
i32 1, label %return
]
; CHECK-NEXT: return: float = 1.0
return:
ret void
}