Skip to content

Commit 4c8d056

Browse files
committed
Revert "[CodeGen] Fix unconditional branch duplication issue in bbsections"
This reverts commit 994eb5a. Breaks buildbot `llvm-clang-x86_64-expensive-checks-debian` https://lab.llvm.org/buildbot/#/builders/16/builds/53620
1 parent 14c87ab commit 4c8d056

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

llvm/lib/CodeGen/BasicBlockSections.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ void llvm::sortBasicBlocksAndUpdateBranches(
258258
[[maybe_unused]] const MachineBasicBlock *EntryBlock = &MF.front();
259259
SmallVector<MachineBasicBlock *> PreLayoutFallThroughs(MF.getNumBlockIDs());
260260
for (auto &MBB : MF)
261-
PreLayoutFallThroughs[MBB.getNumber()] =
262-
MBB.getFallThrough(/*JumpToFallThrough=*/false);
261+
PreLayoutFallThroughs[MBB.getNumber()] = MBB.getFallThrough();
263262

264263
MF.sort(MBBCmp);
265264
assert(&MF.front() == EntryBlock &&

llvm/test/CodeGen/Generic/machine-function-splitter.ll

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions -mfs-psi-cutoff=0 -mfs-count-threshold=2000 | FileCheck %s --dump-input=always -check-prefixes=MFS-OPTS1,MFS-OPTS1-X86
77
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions -mfs-psi-cutoff=950000 | FileCheck %s -check-prefixes=MFS-OPTS2,MFS-OPTS2-X86
88
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions -mfs-split-ehcode | FileCheck %s -check-prefixes=MFS-EH-SPLIT,MFS-EH-SPLIT-X86
9-
; RUN: llc < %s -mtriple=x86_64 -split-machine-functions -O0 -mfs-psi-cutoff=0 -mfs-count-threshold=10000 | FileCheck %s -check-prefixes=MFS-O0,MFS-O0-X86
109

1110
; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu -enable-split-machine-functions -mfs-allow-unsupported-triple | FileCheck %s -check-prefixes=MFS-DEFAULTS,MFS-DEFAULTS-AARCH64
1211
; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu -enable-split-machine-functions -mfs-allow-unsupported-triple -mfs-psi-cutoff=0 -mfs-count-threshold=2000 | FileCheck %s --dump-input=always -check-prefixes=MFS-OPTS1,MFS-OPTS1-AARCH64
1312
; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu -enable-split-machine-functions -mfs-allow-unsupported-triple -mfs-psi-cutoff=950000 | FileCheck %s -check-prefixes=MFS-OPTS2,MFS-OPTS2-AARCH64
1413
; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu -enable-split-machine-functions -mfs-allow-unsupported-triple -mfs-split-ehcode | FileCheck %s -check-prefixes=MFS-EH-SPLIT,MFS-EH-SPLIT-AARCH64
15-
; RUN: llc < %s -mtriple=aarch64 -enable-split-machine-functions -O0 -mfs-allow-unsupported-triple -mfs-psi-cutoff=0 -mfs-count-threshold=10000 | FileCheck %s --dump-input=always -check-prefixes=MFS-O0,MFS-O0-AARCH64
1614

1715
; COM: Machine function splitting with AFDO profiles
1816
; RUN: sed 's/InstrProf/SampleProfile/g' %s > %t.ll
@@ -464,29 +462,6 @@ define void @foo15(i1 zeroext %0, i1 zeroext %1) nounwind !prof !27 {
464462
ret void
465463
}
466464

467-
define void @foo16(i1 zeroext %0) nounwind !prof !14 !section_prefix !15 {
468-
;; Check that an unconditional branch is only appended to a block
469-
;; if it would fall through to the wrong block otherwise.
470-
; MFS-O0-LABEL: foo16
471-
; MFS-O0-X86: jmp
472-
; MFS-O0-X86-NOT: jmp
473-
; MFS-O0-AARCH64: br
474-
; MFS-O0-AARCH64: br
475-
; MFS-O0-AARCH64-NOT: br
476-
; MFS-O0: .section .text.split.foo16
477-
; MFS-O0-NEXT: foo16.cold
478-
%2 = call i32 @baz()
479-
br i1 false, label %3, label %5, !prof !25
480-
481-
3: ; preds = %1
482-
%4 = call i32 @bar()
483-
unreachable
484-
485-
5: ; preds = %1
486-
%6 = tail call i32 @qux()
487-
ret void
488-
}
489-
490465
declare i32 @bar()
491466
declare i32 @baz()
492467
declare i32 @bam()

0 commit comments

Comments
 (0)