LLVM: lib/Target/BPF/BPFSubtarget.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

21

22using namespace llvm;

23

24#define DEBUG_TYPE "bpf-subtarget"

25

26#define GET_SUBTARGETINFO_TARGET_DESC

27#define GET_SUBTARGETINFO_CTOR

28#include "BPFGenSubtargetInfo.inc"

29

31 cl::desc("Disable ldsx insns"));

33 cl::desc("Disable movsx insns"));

35 cl::desc("Disable bswap insns"));

39 cl::desc("Disable gotol insn"));

42 cl::desc("Disable BPF_ST (immediate store) insn"));

45 cl::desc("Disable load-acquire and store-release insns"));

47 cl::desc("Disable gotox insn"));

48

49void BPFSubtarget::anchor() {}

50

53 initializeEnvironment();

54 initSubtargetFeatures(CPU, FS);

56 return *this;

57}

58

59void BPFSubtarget::initializeEnvironment() {

73}

74

75void BPFSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {

76 if (CPU.empty())

77 CPU = "v3";

78 if (CPU == "probe")

80 if (CPU == "generic" || CPU == "v1")

81 return;

82 if (CPU == "v2") {

84 return;

85 }

86 if (CPU == "v3") {

90 return;

91 }

92 if (CPU == "v4") {

104 return;

105 }

106}

107

112 TLInfo(TM, *this) {

114

119

122}

123

127

131

135

This file describes how to lower LLVM calls to machine code calls.

This file declares the targeting of the Machinelegalizer class for BPF.

This file declares the targeting of the RegisterBankInfo class for BPF.

static cl::opt< bool > Disable_gotox("disable-gotox", cl::Hidden, cl::init(false), cl::desc("Disable gotox insn"))

static cl::opt< bool > Disable_sdiv_smod("disable-sdiv-smod", cl::Hidden, cl::init(false), cl::desc("Disable sdiv/smod insns"))

static cl::opt< bool > Disable_ldsx("disable-ldsx", cl::Hidden, cl::init(false), cl::desc("Disable ldsx insns"))

static cl::opt< bool > Disable_gotol("disable-gotol", cl::Hidden, cl::init(false), cl::desc("Disable gotol insn"))

static cl::opt< bool > Disable_load_acq_store_rel("disable-load-acq-store-rel", cl::Hidden, cl::init(false), cl::desc("Disable load-acquire and store-release insns"))

static cl::opt< bool > Disable_movsx("disable-movsx", cl::Hidden, cl::init(false), cl::desc("Disable movsx insns"))

static cl::opt< bool > Disable_StoreImm("disable-storeimm", cl::Hidden, cl::init(false), cl::desc("Disable BPF_ST (immediate store) insn"))

static cl::opt< bool > Disable_bswap("disable-bswap", cl::Hidden, cl::init(false), cl::desc("Disable bswap insns"))

This class provides the information for the BPF target legalizer for GlobalISel.

BPFSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)

Definition BPFSubtarget.cpp:108

InstructionSelector * getInstructionSelector() const override

Definition BPFSubtarget.cpp:128

BPFSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)

Definition BPFSubtarget.cpp:51

std::unique_ptr< InstructionSelector > InstSelector

std::unique_ptr< LegalizerInfo > Legalizer

std::unique_ptr< CallLowering > CallLoweringInfo

const CallLowering * getCallLowering() const override

Definition BPFSubtarget.cpp:124

std::unique_ptr< RegisterBankInfo > RegBankInfo

const BPFRegisterInfo * getRegisterInfo() const override

const RegisterBankInfo * getRegBankInfo() const override

Definition BPFSubtarget.cpp:136

bool AllowsMisalignedMemAccess

const BPFTargetLowering * getTargetLowering() const override

const LegalizerInfo * getLegalizerInfo() const override

Definition BPFSubtarget.cpp:132

void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)

Holds all the information related to register banks.

StringRef - Represent a constant reference to a string, i.e.

Primary interface to the complete machine description for the target machine.

Triple - Helper class for working with autoconf configuration names.

initializer< Ty > init(const Ty &Val)

LLVM_ABI StringRef getHostCPUNameForBPF()

This is an optimization pass for GlobalISel generic memory operations.

InstructionSelector * createBPFInstructionSelector(const BPFTargetMachine &, const BPFSubtarget &, const BPFRegisterBankInfo &)