mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
f43849e9c7
This patch introduces the heat coloring of the Call Printer which is based on the relative "hotness" of each function. The patch is a part of sequence of three patches, related to graphs Heat Coloring. Another feature added is the flag similar to "-cfg-dot-filename-prefix", which allows to write the graph into a named .pdf Reviewers: rcorcs, apilipenko, davidxl, sfertile, fedor.sergeev, eraman, bollu Differential Revision: https://reviews.llvm.org/D77172
22 lines
885 B
LLVM
22 lines
885 B
LLVM
; RUN: opt < %s -analyze -dot-cfg -cfg-heat-colors -cfg-dot-filename-prefix=%t 2>/dev/null
|
|
; RUN: FileCheck %s -input-file=%t.f.dot --check-prefixes=CHECK-CFG,CHECK-BOTH
|
|
; RUN: opt %s -dot-callgraph -callgraph-heat-colors -callgraph-dot-filename-prefix=%t 2>/dev/null
|
|
; RUN: FileCheck %s -input-file=%t.callgraph.dot --check-prefix=CHECK-BOTH
|
|
|
|
; CHECK-BOTH: color="#{{[(a-z)(0-9)]+}}", style={{[a-z]+}}, fillcolor="#{{[(a-z)(0-9)]+}}"
|
|
; CHECK-CFG: color="#{{[(a-z)(0-9)]+}}", style={{[a-z]+}}, fillcolor="#{{[(a-z)(0-9)]+}}"
|
|
; CHECK-CFG: color="#{{[(a-z)(0-9)]+}}", style={{[a-z]+}}, fillcolor="#{{[(a-z)(0-9)]+}}"
|
|
|
|
define void @f(i32) {
|
|
entry:
|
|
%check = icmp sgt i32 %0, 0
|
|
br i1 %check, label %if, label %exit, !prof !0
|
|
|
|
if: ; preds = %entry
|
|
br label %exit
|
|
exit: ; preds = %entry, %if
|
|
ret void
|
|
}
|
|
|
|
!0 = !{!"branch_weights", i32 1, i32 200}
|