<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 29, 2015 at 11:18 AM, Dehao Chen via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dehao<br>
Date: Tue Sep 29 13:18:49 2015<br>
New Revision: 248814<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=248814&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=248814&view=rev</a><br>
Log:<br>
Revert r248810 which breaks tests.<br></blockquote><div><br>It's handy to provide a reference to whichever buildbot/test result/etc was broken by the change, just in case anyone is investigating a similar failure, or if someone in the future goes to make a similar change.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Removed:<br>
llvm/trunk/test/Transforms/SampleProfile/Inputs/cfg.prof<br>
llvm/trunk/test/Transforms/SampleProfile/cfg.ll<br>
Modified:<br>
llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp<br>
<br>
Modified: llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp?rev=248814&r1=248813&r2=248814&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp?rev=248814&r1=248813&r2=248814&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp Tue Sep 29 13:18:49 2015<br>
@@ -253,8 +253,6 @@ unsigned SampleProfileLoader::getBlockWe<br>
if (InstWeight > Weight)<br>
Weight = InstWeight;<br>
}<br>
- if (Weight > 0)<br>
- VisitedBlocks.insert(BB);<br>
Entry.first->second = Weight;<br>
return Weight;<br>
}<br>
@@ -306,7 +304,8 @@ void SampleProfileLoader::findEquivalenc<br>
for (auto *BB2 : Descendants) {<br>
bool IsDomParent = DomTree->dominates(BB2, BB1);<br>
bool IsInSameLoop = LI->getLoopFor(BB1) == LI->getLoopFor(BB2);<br>
- if (BB1 != BB2 && IsDomParent && IsInSameLoop) {<br>
+ if (BB1 != BB2 && VisitedBlocks.insert(BB2).second && IsDomParent &&<br>
+ IsInSameLoop) {<br>
EquivalenceClass[BB2] = BB1;<br>
<br>
// If BB2 is heavier than BB1, make BB2 have the same weight<br>
<br>
Removed: llvm/trunk/test/Transforms/SampleProfile/Inputs/cfg.prof<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SampleProfile/Inputs/cfg.prof?rev=248813&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SampleProfile/Inputs/cfg.prof?rev=248813&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/Transforms/SampleProfile/Inputs/cfg.prof (original)<br>
+++ llvm/trunk/test/Transforms/SampleProfile/Inputs/cfg.prof (removed)<br>
@@ -1,10 +0,0 @@<br>
-main:15680:0<br>
-1: 2500<br>
-4: 1000<br>
-5: 1000<br>
-6: 800<br>
-7: 500<br>
-9: 10226<br>
-10: 2243<br>
-16: 0<br>
-18: 0<br>
<br>
Removed: llvm/trunk/test/Transforms/SampleProfile/cfg.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SampleProfile/cfg.ll?rev=248813&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SampleProfile/cfg.ll?rev=248813&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/Transforms/SampleProfile/cfg.ll (original)<br>
+++ llvm/trunk/test/Transforms/SampleProfile/cfg.ll (removed)<br>
@@ -1,239 +0,0 @@<br>
-; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/cfg.prof | opt -analyze -branch-prob | FileCheck %s<br>
-<br>
-; Original C++ code for this test case:<br>
-;<br>
-; #include <stdio.h><br>
-; #include <stdlib.h><br>
-<br>
-; int main(int argc, char *argv[]) {<br>
-; if (argc < 2)<br>
-; return 1;<br>
-; double result;<br>
-; int limit = atoi(argv[1]);<br>
-; if (limit > 100) {<br>
-; double s = 23.041968 * atoi(argv[2]);<br>
-; for (int u = 0; u < limit; u++) {<br>
-; double x = s;<br>
-; s = x + 3.049 + (double)u;<br>
-; s -= s + 3.94 / x * 0.32;<br>
-; }<br>
-; result = s;<br>
-; } else {<br>
-; result = atoi(argv[2]);<br>
-; }<br>
-; printf("result is %lf\n", result);<br>
-; return 0;<br>
-; }<br>
-<br>
-@.str = private unnamed_addr constant [15 x i8] c"result is %lf\0A\00", align 1<br>
-<br>
-; Function Attrs: uwtable<br>
-define i32 @main(i32 %argc, i8** %argv) #0 {<br>
-; CHECK: Printing analysis 'Branch Probability Analysis' for function 'main':<br>
-<br>
-entry:<br>
- %retval = alloca i32, align 4<br>
- %argc.addr = alloca i32, align 4<br>
- %argv.addr = alloca i8**, align 8<br>
- %result = alloca double, align 8<br>
- %limit = alloca i32, align 4<br>
- %s = alloca double, align 8<br>
- %u = alloca i32, align 4<br>
- %x = alloca double, align 8<br>
- store i32 0, i32* %retval, align 4<br>
- store i32 %argc, i32* %argc.addr, align 4<br>
- call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !16, metadata !17), !dbg !18<br>
- store i8** %argv, i8*** %argv.addr, align 8<br>
- call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !19, metadata !17), !dbg !20<br>
- %0 = load i32, i32* %argc.addr, align 4, !dbg !21<br>
- %cmp = icmp slt i32 %0, 2, !dbg !23<br>
- br i1 %cmp, label %if.then, label %if.end, !dbg !24<br>
-; CHECK: edge entry -> if.then probability is 0x4ccccccd / 0x80000000 = 60.00%<br>
-; CHECK: edge entry -> if.end probability is 0x33333333 / 0x80000000 = 40.00%<br>
-<br>
-if.then: ; preds = %entry<br>
- store i32 1, i32* %retval, align 4, !dbg !25<br>
- br label %return, !dbg !25<br>
-<br>
-if.end: ; preds = %entry<br>
- call void @llvm.dbg.declare(metadata double* %result, metadata !26, metadata !17), !dbg !27<br>
- call void @llvm.dbg.declare(metadata i32* %limit, metadata !28, metadata !17), !dbg !29<br>
- %1 = load i8**, i8*** %argv.addr, align 8, !dbg !30<br>
- %arrayidx = getelementptr inbounds i8*, i8** %1, i64 1, !dbg !30<br>
- %2 = load i8*, i8** %arrayidx, align 8, !dbg !30<br>
- %call = call i32 @atoi(i8* %2) #4, !dbg !31<br>
- store i32 %call, i32* %limit, align 4, !dbg !29<br>
- %3 = load i32, i32* %limit, align 4, !dbg !32<br>
- %cmp1 = icmp sgt i32 %3, 100, !dbg !34<br>
- br i1 %cmp1, label %if.then.2, label %if.else, !dbg !35<br>
-; CHECK: edge if.end -> if.then.2 probability is 0x66666666 / 0x80000000 = 80.00%<br>
-; CHECK: edge if.end -> if.else probability is 0x1999999a / 0x80000000 = 20.00%<br>
-<br>
-if.then.2: ; preds = %if.end<br>
- call void @llvm.dbg.declare(metadata double* %s, metadata !36, metadata !17), !dbg !38<br>
- %4 = load i8**, i8*** %argv.addr, align 8, !dbg !39<br>
- %arrayidx3 = getelementptr inbounds i8*, i8** %4, i64 2, !dbg !39<br>
- %5 = load i8*, i8** %arrayidx3, align 8, !dbg !39<br>
- %call4 = call i32 @atoi(i8* %5) #4, !dbg !40<br>
- %conv = sitofp i32 %call4 to double, !dbg !40<br>
- %mul = fmul double 0x40370ABE6A337A81, %conv, !dbg !41<br>
- store double %mul, double* %s, align 8, !dbg !38<br>
- call void @llvm.dbg.declare(metadata i32* %u, metadata !42, metadata !17), !dbg !44<br>
- store i32 0, i32* %u, align 4, !dbg !44<br>
- br label %for.cond, !dbg !45<br>
-<br>
-for.cond: ; preds = %for.inc, %if.then.2<br>
- %6 = load i32, i32* %u, align 4, !dbg !46<br>
- %7 = load i32, i32* %limit, align 4, !dbg !48<br>
- %cmp5 = icmp slt i32 %6, %7, !dbg !49<br>
- br i1 %cmp5, label %for.body, label %for.end, !dbg !50<br>
-<br>
-for.body: ; preds = %for.cond<br>
- call void @llvm.dbg.declare(metadata double* %x, metadata !51, metadata !17), !dbg !53<br>
- %8 = load double, double* %s, align 8, !dbg !54<br>
- store double %8, double* %x, align 8, !dbg !53<br>
- %9 = load double, double* %x, align 8, !dbg !55<br>
- %add = fadd double %9, 3.049000e+00, !dbg !56<br>
- %10 = load i32, i32* %u, align 4, !dbg !57<br>
- %conv6 = sitofp i32 %10 to double, !dbg !57<br>
- %add7 = fadd double %add, %conv6, !dbg !58<br>
- store double %add7, double* %s, align 8, !dbg !59<br>
- %11 = load double, double* %s, align 8, !dbg !60<br>
- %12 = load double, double* %x, align 8, !dbg !61<br>
- %div = fdiv double 3.940000e+00, %12, !dbg !62<br>
- %mul8 = fmul double %div, 3.200000e-01, !dbg !63<br>
- %add9 = fadd double %11, %mul8, !dbg !64<br>
- %13 = load double, double* %s, align 8, !dbg !65<br>
- %sub = fsub double %13, %add9, !dbg !65<br>
- store double %sub, double* %s, align 8, !dbg !65<br>
- br label %for.inc, !dbg !66<br>
-<br>
-for.inc: ; preds = %for.body<br>
- %14 = load i32, i32* %u, align 4, !dbg !67<br>
- %inc = add nsw i32 %14, 1, !dbg !67<br>
- store i32 %inc, i32* %u, align 4, !dbg !67<br>
- br label %for.cond, !dbg !68<br>
-<br>
-for.end: ; preds = %for.cond<br>
- %15 = load double, double* %s, align 8, !dbg !69<br>
- store double %15, double* %result, align 8, !dbg !70<br>
- br label %if.end.13, !dbg !71<br>
-<br>
-if.else: ; preds = %if.end<br>
- %16 = load i8**, i8*** %argv.addr, align 8, !dbg !72<br>
- %arrayidx10 = getelementptr inbounds i8*, i8** %16, i64 2, !dbg !72<br>
- %17 = load i8*, i8** %arrayidx10, align 8, !dbg !72<br>
- %call11 = call i32 @atoi(i8* %17) #4, !dbg !74<br>
- %conv12 = sitofp i32 %call11 to double, !dbg !74<br>
- store double %conv12, double* %result, align 8, !dbg !75<br>
- br label %if.end.13<br>
-<br>
-if.end.13: ; preds = %if.else, %for.end<br>
- %18 = load double, double* %result, align 8, !dbg !76<br>
- %call14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0), double %18), !dbg !77<br>
- store i32 0, i32* %retval, align 4, !dbg !78<br>
- br label %return, !dbg !78<br>
-<br>
-return: ; preds = %if.end.13, %if.then<br>
- %19 = load i32, i32* %retval, align 4, !dbg !79<br>
- ret i32 %19, !dbg !79<br>
-}<br>
-<br>
-; Function Attrs: nounwind readnone<br>
-declare void @llvm.dbg.declare(metadata, metadata, metadata) #1<br>
-<br>
-; Function Attrs: nounwind readonly<br>
-declare i32 @atoi(i8*) #2<br>
-<br>
-declare i32 @printf(i8*, ...) #3<br>
-<br>
-attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
-attributes #1 = { nounwind readnone }<br>
-attributes #2 = { nounwind readonly "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
-attributes #3 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
-attributes #4 = { nounwind readonly }<br>
-<br>
-!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0}<br>
-!llvm.module.flags = !{!13, !14}<br>
-!llvm.ident = !{!15}<br>
-<br>
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 248211) (llvm/trunk 248217)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !5)<br>
-!1 = !DIFile(filename: "test.cc", directory: "/ssd/llvm_commit")<br>
-!2 = !{}<br>
-!3 = !{!4}<br>
-!4 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float)<br>
-!5 = !{!6}<br>
-!6 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 4, type: !7, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, function: i32 (i32, i8**)* @main, variables: !2)<br>
-!7 = !DISubroutineType(types: !8)<br>
-!8 = !{!9, !9, !10}<br>
-!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
-!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64, align: 64)<br>
-!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64, align: 64)<br>
-!12 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)<br>
-!13 = !{i32 2, !"Dwarf Version", i32 4}<br>
-!14 = !{i32 2, !"Debug Info Version", i32 3}<br>
-!15 = !{!"clang version 3.8.0 (trunk 248211) (llvm/trunk 248217)"}<br>
-!16 = !DILocalVariable(name: "argc", arg: 1, scope: !6, file: !1, line: 4, type: !9)<br>
-!17 = !DIExpression()<br>
-!18 = !DILocation(line: 4, column: 15, scope: !6)<br>
-!19 = !DILocalVariable(name: "argv", arg: 2, scope: !6, file: !1, line: 4, type: !10)<br>
-!20 = !DILocation(line: 4, column: 27, scope: !6)<br>
-!21 = !DILocation(line: 5, column: 8, scope: !22)<br>
-!22 = distinct !DILexicalBlock(scope: !6, file: !1, line: 5, column: 8)<br>
-!23 = !DILocation(line: 5, column: 13, scope: !22)<br>
-!24 = !DILocation(line: 5, column: 8, scope: !6)<br>
-!25 = !DILocation(line: 6, column: 6, scope: !22)<br>
-!26 = !DILocalVariable(name: "result", scope: !6, file: !1, line: 7, type: !4)<br>
-!27 = !DILocation(line: 7, column: 11, scope: !6)<br>
-!28 = !DILocalVariable(name: "limit", scope: !6, file: !1, line: 8, type: !9)<br>
-!29 = !DILocation(line: 8, column: 8, scope: !6)<br>
-!30 = !DILocation(line: 8, column: 21, scope: !6)<br>
-!31 = !DILocation(line: 8, column: 16, scope: !6)<br>
-!32 = !DILocation(line: 9, column: 8, scope: !33)<br>
-!33 = distinct !DILexicalBlock(scope: !6, file: !1, line: 9, column: 8)<br>
-!34 = !DILocation(line: 9, column: 14, scope: !33)<br>
-!35 = !DILocation(line: 9, column: 8, scope: !6)<br>
-!36 = !DILocalVariable(name: "s", scope: !37, file: !1, line: 10, type: !4)<br>
-!37 = distinct !DILexicalBlock(scope: !33, file: !1, line: 9, column: 21)<br>
-!38 = !DILocation(line: 10, column: 13, scope: !37)<br>
-!39 = !DILocation(line: 10, column: 34, scope: !37)<br>
-!40 = !DILocation(line: 10, column: 29, scope: !37)<br>
-!41 = !DILocation(line: 10, column: 27, scope: !37)<br>
-!42 = !DILocalVariable(name: "u", scope: !43, file: !1, line: 11, type: !9)<br>
-!43 = distinct !DILexicalBlock(scope: !37, file: !1, line: 11, column: 6)<br>
-!44 = !DILocation(line: 11, column: 15, scope: !43)<br>
-!45 = !DILocation(line: 11, column: 11, scope: !43)<br>
-!46 = !DILocation(line: 11, column: 22, scope: !47)<br>
-!47 = distinct !DILexicalBlock(scope: !43, file: !1, line: 11, column: 6)<br>
-!48 = !DILocation(line: 11, column: 26, scope: !47)<br>
-!49 = !DILocation(line: 11, column: 24, scope: !47)<br>
-!50 = !DILocation(line: 11, column: 6, scope: !43)<br>
-!51 = !DILocalVariable(name: "x", scope: !52, file: !1, line: 12, type: !4)<br>
-!52 = distinct !DILexicalBlock(scope: !47, file: !1, line: 11, column: 38)<br>
-!53 = !DILocation(line: 12, column: 15, scope: !52)<br>
-!54 = !DILocation(line: 12, column: 19, scope: !52)<br>
-!55 = !DILocation(line: 13, column: 12, scope: !52)<br>
-!56 = !DILocation(line: 13, column: 14, scope: !52)<br>
-!57 = !DILocation(line: 13, column: 32, scope: !52)<br>
-!58 = !DILocation(line: 13, column: 22, scope: !52)<br>
-!59 = !DILocation(line: 13, column: 10, scope: !52)<br>
-!60 = !DILocation(line: 14, column: 13, scope: !52)<br>
-!61 = !DILocation(line: 14, column: 24, scope: !52)<br>
-!62 = !DILocation(line: 14, column: 22, scope: !52)<br>
-!63 = !DILocation(line: 14, column: 26, scope: !52)<br>
-!64 = !DILocation(line: 14, column: 15, scope: !52)<br>
-!65 = !DILocation(line: 14, column: 10, scope: !52)<br>
-!66 = !DILocation(line: 15, column: 6, scope: !52)<br>
-!67 = !DILocation(line: 11, column: 34, scope: !47)<br>
-!68 = !DILocation(line: 11, column: 6, scope: !47)<br>
-!69 = !DILocation(line: 16, column: 15, scope: !37)<br>
-!70 = !DILocation(line: 16, column: 13, scope: !37)<br>
-!71 = !DILocation(line: 17, column: 4, scope: !37)<br>
-!72 = !DILocation(line: 18, column: 20, scope: !73)<br>
-!73 = distinct !DILexicalBlock(scope: !33, file: !1, line: 17, column: 11)<br>
-!74 = !DILocation(line: 18, column: 15, scope: !73)<br>
-!75 = !DILocation(line: 18, column: 13, scope: !73)<br>
-!76 = !DILocation(line: 20, column: 30, scope: !6)<br>
-!77 = !DILocation(line: 20, column: 4, scope: !6)<br>
-!78 = !DILocation(line: 21, column: 4, scope: !6)<br>
-!79 = !DILocation(line: 22, column: 2, scope: !6)<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>