[PATCH] D52605: [CodeGen] avoid broken successor probability in MBB dump
Hiroshi Inoue via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 27 22:29:19 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL343297: [CodeGen] fix broken successor probability in MBB dump (authored by inouehrs, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D52605?vs=167278&id=167431#toc
Repository:
rL LLVM
https://reviews.llvm.org/D52605
Files:
llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
llvm/trunk/test/Other/X86/mbb-dump.ll
Index: llvm/trunk/test/Other/X86/mbb-dump.ll
===================================================================
--- llvm/trunk/test/Other/X86/mbb-dump.ll
+++ llvm/trunk/test/Other/X86/mbb-dump.ll
@@ -0,0 +1,25 @@
+; RUN: llc < %s 2>&1 -print-after=machine-scheduler -mtriple=x86_64-unknown-unknown | FileCheck %s
+
+; expected MBB dump output
+; # *** IR Dump After Machine Instruction Scheduler ***:
+; # Machine code for function foo: NoPHIs, TracksLiveness
+;
+; 0B bb.0 (%ir-block.0):
+; successors: %bb.1(0x80000000); %bb.1(100.00%)
+;
+; 16B bb.1.next:
+; ; predecessors: %bb.0
+
+; previously, it was broken as
+; successors: %bb.1(0x80000000); %bb.1(200.00%)
+
+define void @foo(){
+; CHECK: IR Dump After Machine Instruction Scheduler
+; CHECK: bb.0
+; CHECK: 100.0
+; CHECK: bb.1
+ br label %next
+
+next:
+ ret void
+}
Index: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
+++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
@@ -362,7 +362,7 @@
// Print human readable probabilities as comments.
OS << "; ";
for (auto I = succ_begin(), E = succ_end(); I != E; ++I) {
- const BranchProbability &BP = *getProbabilityIterator(I);
+ const BranchProbability &BP = getSuccProbability(I);
if (I != succ_begin())
OS << ", ";
OS << printMBBReference(**I) << '('
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52605.167431.patch
Type: text/x-patch
Size: 1452 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180928/92006df0/attachment.bin>
More information about the llvm-commits
mailing list