diff options
| author | Grigory Pastukhov <99913765+grigorypas@users.noreply.github.com> | 2025-11-04 11:01:50 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-04 11:01:50 -0800 |
| commit | 7398591148f4351b38404304d8e2acb80651aaf3 (patch) | |
| tree | f6be82f9151293cd29c03fd2e49431ecb8893270 /llvm/lib | |
| parent | 2bc22ea02edda5926f3e53f141def9bf212ac1db (diff) | |
| download | llvm-7398591148f4351b38404304d8e2acb80651aaf3.zip llvm-7398591148f4351b38404304d8e2acb80651aaf3.tar.gz llvm-7398591148f4351b38404304d8e2acb80651aaf3.tar.bz2 | |
[CodeGen] Add skipFunction() check to MachineFunctionSplitter (#166260)
MachineFunctionSplitter was missing a skipFunction() check, causing it
to incorrectly split functions that should be skipped (e.g., functions
with optnone attribute).
This patch adds an early skipFunction() check in runOnMachineFunction()
to ensure these functions are never split, regardless of profile data
availability or other splitting conditions.
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/MachineFunctionSplitter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineFunctionSplitter.cpp b/llvm/lib/CodeGen/MachineFunctionSplitter.cpp index c31454a..b5d3092 100644 --- a/llvm/lib/CodeGen/MachineFunctionSplitter.cpp +++ b/llvm/lib/CodeGen/MachineFunctionSplitter.cpp @@ -129,6 +129,9 @@ static bool isColdBlock(const MachineBasicBlock &MBB, } bool MachineFunctionSplitter::runOnMachineFunction(MachineFunction &MF) { + if (skipFunction(MF.getFunction())) + return false; + // Do not split functions when -basic-block-sections=all is specified. if (MF.getTarget().getBBSectionsType() == llvm::BasicBlockSection::All) return false; |
