LLVM: lib/Target/Xtensa/XtensaTargetMachine.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

23#include

24

25using namespace llvm;

26

28

30}

31

34 bool IsLittle) {

35 std::string Ret = "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32";

36 return Ret;

37}

38

40 std::optionalReloc::Model RM) {

41 if (!RM || JIT)

43 return *RM;

44}

45

49 std::optionalReloc::Model RM,

50 std::optionalCodeModel::Model CM,

52 bool IsLittle)

59}

60

64 std::optionalReloc::Model RM,

65 std::optionalCodeModel::Model CM,

68

71 Attribute CPUAttr = F.getFnAttribute("target-cpu");

72 Attribute FSAttr = F.getFnAttribute("target-features");

73

76

78 if (I) {

79

80

81

83 I = std::make_unique(TargetTriple, CPU, FS, *this);

84 }

85 return I.get();

86}

87

91 return XtensaMachineFunctionInfo::create(Allocator,

93}

94

95namespace {

96

98public:

101

103 return getTM();

104 }

105

106 bool addInstSelector() override;

107 void addPreEmitPass() override;

108};

109}

110

111bool XtensaPassConfig::addInstSelector() {

113 return false;

114}

115

117

119 return new XtensaPassConfig(*this, PM);

120}

static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")

#define LLVM_EXTERNAL_VISIBILITY

static std::string computeDataLayout()

Target-Independent Code Generator Pass Configuration Options pass.

static Reloc::Model getEffectiveRelocModel(bool JIT, std::optional< Reloc::Model > RM)

LLVM_EXTERNAL_VISIBILITY void LLVMInitializeXtensaTarget()

StringRef getValueAsString() const

Return the attribute's value as a string.

bool isValid() const

Return true if the attribute is any kind of attribute.

Allocate memory in an ever growing pool, as if by bump-pointer.

implements a set of functionality in the TargetMachine class for targets that make use of the indepen...

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

std::string str() const

str - Get the contents as an std::string.

Triple TargetTriple

Triple string, CPU name, and target feature strings the TargetMachine instance is created with.

std::unique_ptr< const MCSubtargetInfo > STI

void resetTargetOptions(const Function &F) const

Reset the target options based on the function's attributes.

Target-Independent Code Generator Pass Configuration Options.

TargetSubtargetInfo - Generic base class for all target subtargets.

Target - Wrapper for Target specific information.

Triple - Helper class for working with autoconf configuration names.

TargetPassConfig * createPassConfig(PassManagerBase &PM) override

Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...

MachineFunctionInfo * createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F, const TargetSubtargetInfo *STI) const override

Create the target's instance of MachineFunctionInfo.

StringMap< std::unique_ptr< XtensaSubtarget > > SubtargetMap

XtensaTargetMachine(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, bool isLittle)

const XtensaSubtarget * getSubtargetImpl(const Function &F) const override

Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...

PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...

This is an optimization pass for GlobalISel generic memory operations.

FunctionPass * createXtensaISelDag(XtensaTargetMachine &TM, CodeGenOptLevel OptLevel)

CodeModel::Model getEffectiveCodeModel(std::optional< CodeModel::Model > CM, CodeModel::Model Default)

Helper method for getting the code model, returning Default if CM does not have a value.

char & BranchRelaxationPassID

BranchRelaxation - This pass replaces branches that need to jump further than is supported by a branc...

Target & getTheXtensaTarget()

CodeGenOptLevel

Code generation optimization level.

Implement std::hash so that hash_code can be used in STL containers.

MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...

RegisterTargetMachine - Helper template for registering a target machine implementation,...