Skip to content

Commit 67eb58e

Browse files
committed
Fix the bug and address comment
1 parent 5064384 commit 67eb58e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

llvm/lib/CodeGen/MachineFunctionSplitter.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,17 @@ static bool isColdBlock(const MachineBasicBlock &MBB,
129129
}
130130

131131
bool MachineFunctionSplitter::runOnMachineFunction(MachineFunction &MF) {
132+
if (skipFunction(MF.getFunction()))
133+
return false;
134+
132135
// Do not split functions when -basic-block-sections=all is specified.
133136
if (MF.getTarget().getBBSectionsType() == llvm::BasicBlockSection::All)
134137
return false;
135138
// We target functions with profile data. Static information in the form
136139
// of exception handling code may be split to cold if user passes the
137140
// mfs-split-ehcode flag.
138141
bool UseProfileData = MF.getFunction().hasProfileData();
139-
if (!skipFunction(MF.getFunction()) && !UseProfileData && !SplitAllEHCode)
142+
if (!UseProfileData && !SplitAllEHCode)
140143
return false;
141144

142145
const TargetInstrInfo &TII = *MF.getSubtarget().getInstrInfo();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; REQUIRES: x86-registered-target
22

3-
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions | FileCheck %s
3+
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -split-machine-functions -O0 -mfs-psi-cutoff=0 -mfs-count-threshold=10000 | FileCheck %s
44

55
;; Check that functions with optnone attribute are not split.
66
; CHECK-LABEL: foo_optnone:

0 commit comments

Comments
 (0)