LLVM: lib/CodeGen/LowLevelTypeUtils.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

18using namespace llvm;

19

22 auto EC = VTy->getElementCount();

24 if (EC.isScalar())

25 return ScalarTy;

27 }

28

30 unsigned AddrSpace = PTy->getAddressSpace();

31 return LLT::pointer(AddrSpace, DL.getPointerSizeInBits(AddrSpace));

32 }

33

34 if (Ty.isSized() && !Ty.isScalableTargetExtTy()) {

35

36

37 auto SizeInBits = DL.getTypeSizeInBits(&Ty);

38 assert(SizeInBits != 0 && "invalid zero-sized type");

40 }

41

42 if (Ty.isTokenTy())

44

45 return LLT();

46}

47

49 if (!Ty.isVector())

51

54 Ty.getElementCount());

55}

56

58 if (Ty.isVector()) {

61 }

62

64}

65

67 if (!Ty.isVector())

69

71 Ty.getVectorElementType().getSizeInBits());

72}

73

75 assert(Ty.isScalar() && "Expected a scalar type.");

76 switch (Ty.getSizeInBits()) {

77 case 16:

79 case 32:

81 case 64:

83 case 128:

85 }

87}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

This file declares a class to represent arbitrary precision floating point values and provide a varie...

MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL

Implement a low-level type suitable for MachineInstr level instruction selection.

static const fltSemantics & IEEEsingle()

static const fltSemantics & IEEEquad()

static const fltSemantics & IEEEdouble()

static const fltSemantics & IEEEhalf()

A parsed version of the target data layout string in and methods for querying it.

static constexpr LLT vector(ElementCount EC, unsigned ScalarSizeInBits)

Get a low-level vector of some number of elements and element width.

static constexpr LLT scalar(unsigned SizeInBits)

Get a low-level scalar or aggregate "bag of bits".

static constexpr LLT pointer(unsigned AddressSpace, unsigned SizeInBits)

Get a low-level pointer in the given address space.

static constexpr LLT token()

Get a low-level token; just a scalar with zero bits (or no size).

static constexpr LLT scalarOrVector(ElementCount EC, LLT ScalarTy)

This is an important class for using LLVM in a threaded context.

static MVT getVectorVT(MVT VT, unsigned NumElements)

static MVT getIntegerVT(unsigned BitWidth)

The instances of the Type class are immutable: once they are created, they are never changed.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

This is an optimization pass for GlobalISel generic memory operations.

decltype(auto) dyn_cast(const From &Val)

dyn_cast - Return the argument parameter cast to the specified type.

LLVM_ABI const llvm::fltSemantics & getFltSemanticForLLT(LLT Ty)

Get the appropriate floating point arithmetic semantic based on the bit size of the given scalar LLT.

Definition LowLevelTypeUtils.cpp:74

LLVM_ABI MVT getMVTForLLT(LLT Ty)

Get a rough equivalent of an MVT for a given LLT.

Definition LowLevelTypeUtils.cpp:48

LLVM_ABI LLT getLLTForMVT(MVT Ty)

Get a rough equivalent of an LLT for a given MVT.

Definition LowLevelTypeUtils.cpp:66

LLVM_ABI EVT getApproximateEVTForLLT(LLT Ty, LLVMContext &Ctx)

Definition LowLevelTypeUtils.cpp:57

LLVM_ABI LLT getLLTForType(Type &Ty, const DataLayout &DL)

Construct a low-level type based on an LLVM type.

Definition LowLevelTypeUtils.cpp:20

static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements, bool IsScalable=false)

Returns the EVT that represents a vector NumElements in length, where each element is of type VT.

static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth)

Returns the EVT that represents an integer with the given number of bits.