brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · e962642 Raw
71 lines · plain
1; RUN: opt %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline-act.prof2 3; Sample profile should have non-empty ACT passed to inliner4 5; int t;6; bool foo(int value) {7;   switch(value) {8;     case 0:9;     case 1:10;     case 3:11;       return true;12;     default:13;       return false;14;   }15; }16; void bar(int i) {17;   if (foo(i))18;     t *= 2;19; }20 21target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"22target triple = "x86_64-unknown-linux-gnu"23 24@t = global i32 0, align 425 26; Function Attrs: nounwind uwtable27define zeroext i1 @_Z3fooi(i32) {28  %switch.tableidx = sub i32 %0, 029  %2 = icmp ult i32 %switch.tableidx, 430  br i1 %2, label %switch.lookup, label %331 32switch.lookup:                                    ; preds = %133  %switch.cast = trunc i32 %switch.tableidx to i434  %switch.shiftamt = mul i4 %switch.cast, 135  %switch.downshift = lshr i4 -5, %switch.shiftamt36  %switch.masked = trunc i4 %switch.downshift to i137  ret i1 %switch.masked38 39; <label>:3:                                      ; preds = %140  ret i1 false41}42 43; Function Attrs: nounwind uwtable44define void @_Z3bari(i32) !dbg !9 {45  %2 = call zeroext i1 @_Z3fooi(i32 %0), !dbg !1046  br i1 %2, label %3, label %6, !dbg !1047 48; <label>:3:                                      ; preds = %149  %4 = load i32, ptr @t, align 450  %5 = shl nsw i32 %4, 151  store i32 %5, ptr @t, align 452  br label %653 54; <label>:6:                                      ; preds = %3, %155  ret void56}57 58!llvm.dbg.cu = !{!0}59!llvm.module.flags = !{!3}60!llvm.ident = !{!4}61 62!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 (trunk 272227) (llvm/trunk 272226)", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2)63!1 = !DIFile(filename: "test.cc", directory: "./")64!2 = !{}65!3 = !{i32 2, !"Debug Info Version", i32 3}66!4 = !{!"clang version 3.9.0 (trunk 272227) (llvm/trunk 272226)"}67!6 = !DISubroutineType(types: !2)68!9 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 14, type: !6, isLocal: false, isDefinition: true, scopeLine: 14, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2)69!10 = !DILocation(line: 15, column: 7, scope: !9)70!11 = !DILocation(line: 16, column: 7, scope: !9)71