69 lines · plain
1; RUN: opt < %s -icp-lto -passes=pgo-icall-prom -S | FileCheck %s --check-prefix=ICP2target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"3target triple = "x86_64-unknown-linux-gnu"4 5@_ZTISt9exception = external constant ptr6@pfptr = global ptr null, align 87 8define internal i32 @_ZL4bar1v() !PGOFuncName !0 {9entry:10 ret i32 100 11}12 13; Function Attrs: uwtable14define i32 @_Z3fooi(i32 %x) local_unnamed_addr personality ptr @__gxx_personality_v0 {15entry:16 %tobool = icmp eq i32 %x, 017 br i1 %tobool, label %if.end, label %cleanup18 19if.end: ; preds = %entry20 %fptr = load ptr, ptr @pfptr, align 821; ICP: [[CMP_IC1:%[0-9]+]] = icmp eq ptr %fptr, @_ZL4bar1v22; ICP: br i1 [[CMP_IC1]], label %[[TRUE_LABEL_IC1:.*]], label %[[FALSE_LABEL_IC1:.*]], !prof [[BRANCH_WEIGHT:![0-9]+]]23; ICP:[[TRUE_LABEL_IC1]]:24; ICP: invoke i32 @_ZL4bar1v()25; ICP: to label %[[DCALL_NORMAL_DEST_IC1:.*]] unwind label %lpad26; ICP:[[FALSE_LABEL_IC1]]:27 %call = invoke i32 %fptr()28 to label %cleanup unwind label %lpad, !prof !129 30; ICP:[[DCALL_NORMAL_DEST_IC1]]:31; ICP: br label %cleanup32 33lpad: ; preds = %if.end34 %0 = landingpad { ptr, i32 }35 cleanup36 catch ptr @_ZTISt9exception37 %1 = extractvalue { ptr, i32 } %0, 138 %2 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTISt9exception)39 %matches = icmp eq i32 %1, %240 br i1 %matches, label %catch, label %ehcleanup41 42catch: ; preds = %lpad43 %3 = extractvalue { ptr, i32 } %0, 044 %4 = tail call ptr @__cxa_begin_catch(ptr %3)45 tail call void @__cxa_end_catch()46 br label %cleanup47 48cleanup: ; preds = %catch, %if.end, %entry49; ICP-NOT: %[0-9]+ = phi 50 ret i32 051 52ehcleanup: ; preds = %lpad53 resume { ptr, i32 } %054}55 56declare i32 @_Z3barv() local_unnamed_addr57 58declare i32 @__gxx_personality_v0(...)59 60; Function Attrs: nounwind readnone61declare i32 @llvm.eh.typeid.for(ptr)62 63declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr64 65declare void @__cxa_end_catch() local_unnamed_addr66 67!0 = !{!"invoke.ll:_ZL4bar1v"}68!1 = !{!"VP", i32 0, i64 10000, i64 -2732222848796217051, i64 10000}69