1 ; RUN: llvm-profdata merge %S/Inputs/switch.proftext -o %T/switch.profdata
2 ; RUN: opt < %s -pgo-instr-use -pgo-profile-file=%T/switch.profdata -S | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
6 define i32 @_Z13test_switch_1i(i32 %i) {
8 switch i32 %i, label %sw.default [
16 %add = add nsw i32 %i, 2
20 %add2 = add nsw i32 %i, 100
24 %add4 = add nsw i32 %i, 4
28 %add5 = add nsw i32 %i, 1
32 %retv = phi i32 [ %add5, %sw.default ], [ %add4, %sw.bb3 ], [ %add2, %sw.bb1 ], [ %add, %sw.bb ]
36 ;CHECK: !0 = !{!"branch_weights", i32 3, i32 0, i32 0, i32 0}