llvm/llvm/lib/Target/BPF/BPFTargetMachine.cpp

//===-- BPFTargetMachine.cpp - Define TargetMachine for BPF ---------------===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// Implements the info about BPF target spec.
//
//===----------------------------------------------------------------------===//

#include "BPFTargetMachine.h"
#include "BPF.h"
#include "BPFTargetTransformInfo.h"
#include "MCTargetDesc/BPFMCAsmInfo.h"
#include "TargetInfo/BPFTargetInfo.h"
#include "llvm/CodeGen/GlobalISel/IRTranslator.h"
#include "llvm/CodeGen/GlobalISel/InstructionSelect.h"
#include "llvm/CodeGen/GlobalISel/Legalizer.h"
#include "llvm/CodeGen/GlobalISel/RegBankSelect.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/PassManager.h"
#include "llvm/InitializePasses.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Passes/PassBuilder.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/SimplifyCFG.h"
#include "llvm/Transforms/Utils/SimplifyCFGOptions.h"
#include <optional>
usingnamespacellvm;

static cl::
opt<bool> DisableMIPeephole("disable-bpf-peephole", cl::Hidden,
                            cl::desc("Disable machine peepholes for BPF"));

extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeBPFTarget() {}

// DataLayout: little or big endian
static std::string computeDataLayout(const Triple &TT) {}

static Reloc::Model getEffectiveRelocModel(std::optional<Reloc::Model> RM) {}

BPFTargetMachine::BPFTargetMachine(const Target &T, const Triple &TT,
                                   StringRef CPU, StringRef FS,
                                   const TargetOptions &Options,
                                   std::optional<Reloc::Model> RM,
                                   std::optional<CodeModel::Model> CM,
                                   CodeGenOptLevel OL, bool JIT)
    :{}

namespace {
// BPF Code Generator Pass Configuration Options.
class BPFPassConfig : public TargetPassConfig {};
}

TargetPassConfig *BPFTargetMachine::createPassConfig(PassManagerBase &PM) {}

static Expected<bool> parseBPFPreserveStaticOffsetOptions(StringRef Params) {}

void BPFTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {}

void BPFPassConfig::addIRPasses() {}

TargetTransformInfo
BPFTargetMachine::getTargetTransformInfo(const Function &F) const {}

// Install an instruction selector pass using
// the ISelDag to gen BPF code.
bool BPFPassConfig::addInstSelector() {}

void BPFPassConfig::addMachineSSAOptimization() {}

void BPFPassConfig::addPreEmitPass() {}

bool BPFPassConfig::addIRTranslator() {}

bool BPFPassConfig::addLegalizeMachineIR() {}

bool BPFPassConfig::addRegBankSelect() {}

bool BPFPassConfig::addGlobalInstructionSelect() {}