mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 23:45:25 +08:00
[NFC][LLVM][CodeGen] Create header file for MIRFSDiscriminator options (#163438)
Extract extern variable declaration into a header per https://discourse.llvm.org/t/rfc-cs-changes-for-standalone-variables/88581
This commit is contained in:
22
llvm/include/llvm/CodeGen/MIRFSDiscriminatorOptions.h
Normal file
22
llvm/include/llvm/CodeGen/MIRFSDiscriminatorOptions.h
Normal file
@@ -0,0 +1,22 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Command line options for MIR Flow Sensitive discriminators.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_CODEGEN_MIRFSDISCRIMINATOR_OPTIONS_H
|
||||
#define LLVM_CODEGEN_MIRFSDISCRIMINATOR_OPTIONS_H
|
||||
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
|
||||
namespace llvm {
|
||||
extern cl::opt<bool> ImprovedFSDiscriminator;
|
||||
} // namespace llvm
|
||||
|
||||
#endif // LLVM_CODEGEN_MIRFSDISCRIMINATOR_OPTIONS_H
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/ADT/DenseSet.h"
|
||||
#include "llvm/Analysis/BlockFrequencyInfoImpl.h"
|
||||
#include "llvm/CodeGen/MIRFSDiscriminatorOptions.h"
|
||||
#include "llvm/CodeGen/Passes.h"
|
||||
#include "llvm/IR/DebugInfoMetadata.h"
|
||||
#include "llvm/IR/Function.h"
|
||||
@@ -35,13 +36,10 @@ using namespace sampleprofutil;
|
||||
|
||||
// TODO(xur): Remove this option and related code once we make true as the
|
||||
// default.
|
||||
namespace llvm {
|
||||
cl::opt<bool> ImprovedFSDiscriminator(
|
||||
cl::opt<bool> llvm::ImprovedFSDiscriminator(
|
||||
"improved-fs-discriminator", cl::Hidden, cl::init(false),
|
||||
cl::desc("New FS discriminators encoding (incompatible with the original "
|
||||
"encoding)"));
|
||||
} // namespace llvm
|
||||
|
||||
char MIRAddFSDiscriminators::ID = 0;
|
||||
|
||||
INITIALIZE_PASS(MIRAddFSDiscriminators, DEBUG_TYPE,
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/ADT/DenseSet.h"
|
||||
#include "llvm/Analysis/BlockFrequencyInfoImpl.h"
|
||||
#include "llvm/CodeGen/MIRFSDiscriminatorOptions.h"
|
||||
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
|
||||
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
|
||||
#include "llvm/CodeGen/MachineDominators.h"
|
||||
@@ -62,9 +63,6 @@ static cl::opt<bool> ViewBFIAfter("fs-viewbfi-after", cl::Hidden,
|
||||
cl::init(false),
|
||||
cl::desc("View BFI after MIR loader"));
|
||||
|
||||
namespace llvm {
|
||||
extern cl::opt<bool> ImprovedFSDiscriminator;
|
||||
}
|
||||
char MIRProfileLoaderPass::ID = 0;
|
||||
|
||||
INITIALIZE_PASS_BEGIN(MIRProfileLoaderPass, DEBUG_TYPE,
|
||||
|
||||
Reference in New Issue
Block a user