Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:26

0001 //===- BasicBlockSectionUtils.h - Utilities for basic block sections     --===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_CODEGEN_BASICBLOCKSECTIONUTILS_H
0010 #define LLVM_CODEGEN_BASICBLOCKSECTIONUTILS_H
0011 
0012 #include "llvm/ADT/STLExtras.h"
0013 #include "llvm/Support/CommandLine.h"
0014 
0015 namespace llvm {
0016 
0017 extern cl::opt<std::string> BBSectionsColdTextPrefix;
0018 
0019 class MachineFunction;
0020 class MachineBasicBlock;
0021 
0022 using MachineBasicBlockComparator =
0023     function_ref<bool(const MachineBasicBlock &, const MachineBasicBlock &)>;
0024 
0025 void sortBasicBlocksAndUpdateBranches(MachineFunction &MF,
0026                                       MachineBasicBlockComparator MBBCmp);
0027 
0028 void avoidZeroOffsetLandingPad(MachineFunction &MF);
0029 
0030 /// This checks if the source of this function has drifted since this binary was
0031 /// profiled previously.
0032 /// For now, we are piggy backing on what PGO does to
0033 /// detect this with instrumented profiles.  PGO emits an hash of the IR and
0034 /// checks if the hash has changed.  Advanced basic block layout is usually done
0035 /// on top of PGO optimized binaries and hence this check works well in
0036 /// practice.
0037 bool hasInstrProfHashMismatch(MachineFunction &MF);
0038 
0039 } // end namespace llvm
0040 
0041 #endif // LLVM_CODEGEN_BASICBLOCKSECTIONUTILS_H