brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · 128ab15 Raw
73 lines · plain
1; RUN: opt < %s -passes=pgo-icall-prom -S | FileCheck %s --check-prefix=ICALL-PROM2 3target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"4target triple = "x86_64-unknown-linux-gnu"5 6@foo = common global ptr null, align 87 8define ptr @func1() {9  ret ptr null10}11 12define ptr @func2() {13  ret ptr null14}15 16define ptr @func3() {17  ret ptr null18}19 20define ptr @func4() {21  ret ptr null22}23 24define ptr @bar() {25entry:26  %tmp = load ptr, ptr @foo, align 827; ICALL-PROM:   [[CMP1:%[0-9]+]] = icmp eq ptr %tmp, @func428; ICALL-PROM:   br i1 [[CMP1]], label %if.true.direct_targ, label %[[L1:[0-9]+]], !prof [[BRANCH_WEIGHT1:![0-9]+]]29; ICALL-PROM: if.true.direct_targ:30; ICALL-PROM:   [[DIRCALL_RET1:%[0-9]+]] = musttail call ptr @func4()31; ICALL-PROM:   ret ptr [[DIRCALL_RET1]]32; ICALL-PROM: [[L1]]:33; ICALL-PROM:   [[CMP2:%[0-9]+]] = icmp eq ptr %tmp, @func234; ICALL-PROM:   br i1 [[CMP2]], label %if.true.direct_targ1, label %[[L2:[0-9]+]], !prof [[BRANCH_WEIGHT2:![0-9]+]]35; ICALL-PROM: if.true.direct_targ1:36; ICALL-PROM:   [[DIRCALL_RET2:%[0-9]+]] = musttail call ptr @func2()37; ICALL-PROM:   ret ptr [[DIRCALL_RET2]]38; ICALL-PROM: [[L2]]:39; ICALL-PROM:   [[CMP3:%[0-9]+]] = icmp eq ptr %tmp, @func340; ICALL-PROM:   br i1 [[CMP3]], label %if.true.direct_targ2, label %[[L3:[0-9]+]], !prof [[BRANCH_WEIGHT3:![0-9]+]]41; ICALL-PROM: if.true.direct_targ2:42; ICALL-PROM:   [[DIRCALL_RET3:%[0-9]+]] = musttail call ptr @func3()43; ICALL-PROM:   ret ptr [[DIRCALL_RET3]]44; ICALL-PROM: [[L3]]:45; ICALL-PROM:   %call = musttail call ptr %tmp()46; ICALL-PROM:   ret ptr %call47  %call = musttail call ptr %tmp(), !prof !148  ret ptr %call49}50 51define ptr @bar2() {52entry:53  %tmp = load ptr, ptr @foo, align 854; ICALL-PROM:   [[CMP1:%[0-9]+]] = icmp eq ptr %tmp, @func455; ICALL-PROM:   br i1 [[CMP1]], label %if.true.direct_targ, label %[[L4:[0-9]+]], !prof [[BRANCH_WEIGHT4:![0-9]+]]56; ICALL-PROM: if.true.direct_targ:57; ICALL-PROM:   [[DIRCALL_RET1:%[0-9]+]] = musttail call ptr @func4()58; ICALL-PROM:   ret ptr [[DIRCALL_RET1]]59; ICALL-PROM: [[L4]]:60; ICALL-PROM:   %call = musttail call ptr %tmp()61; ICALL-PROM:   ret ptr %call62  %call = musttail call ptr %tmp(), !prof !263  ret ptr %call64}65 66!1 = !{!"VP", i32 0, i64 1600, i64 7651369219802541373, i64 1030, i64 -4377547752858689819, i64 410, i64 -6929281286627296573, i64 150, i64 -2545542355363006406, i64 10}67!2 = !{!"VP", i32 0, i64 100, i64 7651369219802541373, i64 100}68 69; ICALL-PROM: [[BRANCH_WEIGHT1]] = !{!"branch_weights", i32 1030, i32 570}70; ICALL-PROM: [[BRANCH_WEIGHT2]] = !{!"branch_weights", i32 410, i32 160}71; ICALL-PROM: [[BRANCH_WEIGHT3]] = !{!"branch_weights", i32 150, i32 10}72; ICALL-PROM: [[BRANCH_WEIGHT4]] = !{!"branch_weights", i32 100, i32 0}73