parent
84965031a7
commit
a9cb538a74
|
@ -27,7 +27,6 @@ class formatted_raw_ostream;
|
||||||
|
|
||||||
class AssemblyAnnotationWriter {
|
class AssemblyAnnotationWriter {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual ~AssemblyAnnotationWriter();
|
virtual ~AssemblyAnnotationWriter();
|
||||||
|
|
||||||
/// emitFunctionAnnot - This may be implemented to emit a string right before
|
/// emitFunctionAnnot - This may be implemented to emit a string right before
|
||||||
|
|
|
@ -120,9 +120,11 @@ public:
|
||||||
|
|
||||||
EndAttrKinds ///< Sentinal value useful for loops
|
EndAttrKinds ///< Sentinal value useful for loops
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AttributeImpl *pImpl;
|
AttributeImpl *pImpl;
|
||||||
Attribute(AttributeImpl *A) : pImpl(A) {}
|
Attribute(AttributeImpl *A) : pImpl(A) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Attribute() : pImpl(nullptr) {}
|
Attribute() : pImpl(nullptr) {}
|
||||||
|
|
||||||
|
@ -226,6 +228,7 @@ public:
|
||||||
ReturnIndex = 0U,
|
ReturnIndex = 0U,
|
||||||
FunctionIndex = ~0U
|
FunctionIndex = ~0U
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class AttrBuilder;
|
friend class AttrBuilder;
|
||||||
friend class AttributeSetImpl;
|
friend class AttributeSetImpl;
|
||||||
|
@ -249,8 +252,8 @@ private:
|
||||||
ArrayRef<std::pair<unsigned,
|
ArrayRef<std::pair<unsigned,
|
||||||
AttributeSetNode*> > Attrs);
|
AttributeSetNode*> > Attrs);
|
||||||
|
|
||||||
|
|
||||||
explicit AttributeSet(AttributeSetImpl *LI) : pImpl(LI) {}
|
explicit AttributeSet(AttributeSetImpl *LI) : pImpl(LI) {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AttributeSet() : pImpl(nullptr) {}
|
AttributeSet() : pImpl(nullptr) {}
|
||||||
|
|
||||||
|
@ -439,6 +442,7 @@ class AttrBuilder {
|
||||||
uint64_t StackAlignment;
|
uint64_t StackAlignment;
|
||||||
uint64_t DerefBytes;
|
uint64_t DerefBytes;
|
||||||
uint64_t DerefOrNullBytes;
|
uint64_t DerefOrNullBytes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AttrBuilder()
|
AttrBuilder()
|
||||||
: Attrs(0), Alignment(0), StackAlignment(0), DerefBytes(0),
|
: Attrs(0), Alignment(0), StackAlignment(0), DerefBytes(0),
|
||||||
|
|
|
@ -69,6 +69,7 @@ private:
|
||||||
}
|
}
|
||||||
return CallSiteBase();
|
return CallSiteBase();
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// isCall - true if a CallInst is enclosed.
|
/// isCall - true if a CallInst is enclosed.
|
||||||
/// Note that !isCall() does not mean it is an InvokeInst enclosed,
|
/// Note that !isCall() does not mean it is an InvokeInst enclosed,
|
||||||
|
@ -253,13 +254,13 @@ public:
|
||||||
uint64_t getDereferenceableBytes(uint16_t i) const {
|
uint64_t getDereferenceableBytes(uint16_t i) const {
|
||||||
CALLSITE_DELEGATE_GETTER(getDereferenceableBytes(i));
|
CALLSITE_DELEGATE_GETTER(getDereferenceableBytes(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Extract the number of dereferenceable_or_null bytes for a call or
|
/// @brief Extract the number of dereferenceable_or_null bytes for a call or
|
||||||
/// parameter (0=unknown).
|
/// parameter (0=unknown).
|
||||||
uint64_t getDereferenceableOrNullBytes(uint16_t i) const {
|
uint64_t getDereferenceableOrNullBytes(uint16_t i) const {
|
||||||
CALLSITE_DELEGATE_GETTER(getDereferenceableOrNullBytes(i));
|
CALLSITE_DELEGATE_GETTER(getDereferenceableOrNullBytes(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Return true if the call should not be treated as a call to a
|
/// \brief Return true if the call should not be treated as a call to a
|
||||||
/// builtin.
|
/// builtin.
|
||||||
bool isNoBuiltin() const {
|
bool isNoBuiltin() const {
|
||||||
|
|
|
@ -85,13 +85,13 @@ public:
|
||||||
/// isConstantUsed - Return true if the constant has users other than constant
|
/// isConstantUsed - Return true if the constant has users other than constant
|
||||||
/// exprs and other dangling things.
|
/// exprs and other dangling things.
|
||||||
bool isConstantUsed() const;
|
bool isConstantUsed() const;
|
||||||
|
|
||||||
enum PossibleRelocationsTy {
|
enum PossibleRelocationsTy {
|
||||||
NoRelocation = 0,
|
NoRelocation = 0,
|
||||||
LocalRelocation = 1,
|
LocalRelocation = 1,
|
||||||
GlobalRelocations = 2
|
GlobalRelocations = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
/// getRelocationInfo - This method classifies the entry according to
|
/// getRelocationInfo - This method classifies the entry according to
|
||||||
/// whether or not it may generate a relocation entry. This must be
|
/// whether or not it may generate a relocation entry. This must be
|
||||||
/// conservative, so if it might codegen to a relocatable entry, it should say
|
/// conservative, so if it might codegen to a relocatable entry, it should say
|
||||||
|
@ -107,7 +107,7 @@ public:
|
||||||
///
|
///
|
||||||
/// FIXME: This really should not be in VMCore.
|
/// FIXME: This really should not be in VMCore.
|
||||||
PossibleRelocationsTy getRelocationInfo() const;
|
PossibleRelocationsTy getRelocationInfo() const;
|
||||||
|
|
||||||
/// getAggregateElement - For aggregates (struct/array/vector) return the
|
/// getAggregateElement - For aggregates (struct/array/vector) return the
|
||||||
/// constant that corresponds to the specified element if possible, or null if
|
/// constant that corresponds to the specified element if possible, or null if
|
||||||
/// not. This can return null if the element index is a ConstantExpr, or if
|
/// not. This can return null if the element index is a ConstantExpr, or if
|
||||||
|
|
|
@ -207,7 +207,7 @@ public:
|
||||||
/// Make this range have the bit width given by \p BitWidth. The
|
/// Make this range have the bit width given by \p BitWidth. The
|
||||||
/// value is zero extended, truncated, or left alone to make it that width.
|
/// value is zero extended, truncated, or left alone to make it that width.
|
||||||
ConstantRange zextOrTrunc(uint32_t BitWidth) const;
|
ConstantRange zextOrTrunc(uint32_t BitWidth) const;
|
||||||
|
|
||||||
/// Make this range have the bit width given by \p BitWidth. The
|
/// Make this range have the bit width given by \p BitWidth. The
|
||||||
/// value is sign extended, truncated, or left alone to make it that width.
|
/// value is sign extended, truncated, or left alone to make it that width.
|
||||||
ConstantRange sextOrTrunc(uint32_t BitWidth) const;
|
ConstantRange sextOrTrunc(uint32_t BitWidth) const;
|
||||||
|
@ -258,7 +258,7 @@ public:
|
||||||
/// Return a new range that is the logical not of the current set.
|
/// Return a new range that is the logical not of the current set.
|
||||||
///
|
///
|
||||||
ConstantRange inverse() const;
|
ConstantRange inverse() const;
|
||||||
|
|
||||||
/// Print out the bounds to a stream.
|
/// Print out the bounds to a stream.
|
||||||
///
|
///
|
||||||
void print(raw_ostream &OS) const;
|
void print(raw_ostream &OS) const;
|
||||||
|
|
|
@ -36,11 +36,12 @@ class StringRef;
|
||||||
/// @brief Integer representation type
|
/// @brief Integer representation type
|
||||||
class IntegerType : public Type {
|
class IntegerType : public Type {
|
||||||
friend class LLVMContextImpl;
|
friend class LLVMContextImpl;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit IntegerType(LLVMContext &C, unsigned NumBits) : Type(C, IntegerTyID){
|
explicit IntegerType(LLVMContext &C, unsigned NumBits) : Type(C, IntegerTyID){
|
||||||
setSubclassData(NumBits);
|
setSubclassData(NumBits);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// This enum is just used to hold constants we need for IntegerType.
|
/// This enum is just used to hold constants we need for IntegerType.
|
||||||
enum {
|
enum {
|
||||||
|
@ -90,7 +91,6 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// FunctionType - Class to represent function types
|
/// FunctionType - Class to represent function types
|
||||||
///
|
///
|
||||||
class FunctionType : public Type {
|
class FunctionType : public Type {
|
||||||
|
@ -108,7 +108,7 @@ public:
|
||||||
/// FunctionType::get - Create a FunctionType taking no parameters.
|
/// FunctionType::get - Create a FunctionType taking no parameters.
|
||||||
///
|
///
|
||||||
static FunctionType *get(Type *Result, bool isVarArg);
|
static FunctionType *get(Type *Result, bool isVarArg);
|
||||||
|
|
||||||
/// isValidReturnType - Return true if the specified type is valid as a return
|
/// isValidReturnType - Return true if the specified type is valid as a return
|
||||||
/// type.
|
/// type.
|
||||||
static bool isValidReturnType(Type *RetTy);
|
static bool isValidReturnType(Type *RetTy);
|
||||||
|
@ -167,7 +167,6 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// StructType - Class to represent struct types. There are two different kinds
|
/// StructType - Class to represent struct types. There are two different kinds
|
||||||
/// of struct types: Literal structs and Identified structs.
|
/// of struct types: Literal structs and Identified structs.
|
||||||
///
|
///
|
||||||
|
@ -207,8 +206,8 @@ class StructType : public CompositeType {
|
||||||
/// a identified type that has an empty name.
|
/// a identified type that has an empty name.
|
||||||
///
|
///
|
||||||
void *SymbolTableEntry;
|
void *SymbolTableEntry;
|
||||||
public:
|
|
||||||
|
|
||||||
|
public:
|
||||||
/// StructType::create - This creates an identified struct.
|
/// StructType::create - This creates an identified struct.
|
||||||
static StructType *create(LLVMContext &Context, StringRef Name);
|
static StructType *create(LLVMContext &Context, StringRef Name);
|
||||||
static StructType *create(LLVMContext &Context);
|
static StructType *create(LLVMContext &Context);
|
||||||
|
@ -229,7 +228,7 @@ public:
|
||||||
/// StructType::get - Create an empty structure type.
|
/// StructType::get - Create an empty structure type.
|
||||||
///
|
///
|
||||||
static StructType *get(LLVMContext &Context, bool isPacked = false);
|
static StructType *get(LLVMContext &Context, bool isPacked = false);
|
||||||
|
|
||||||
/// StructType::get - This static method is a convenience method for creating
|
/// StructType::get - This static method is a convenience method for creating
|
||||||
/// structure types by specifying the elements as arguments. Note that this
|
/// structure types by specifying the elements as arguments. Note that this
|
||||||
/// method always returns a non-packed struct, and requires at least one
|
/// method always returns a non-packed struct, and requires at least one
|
||||||
|
@ -237,11 +236,11 @@ public:
|
||||||
static StructType *get(Type *elt1, ...) LLVM_END_WITH_NULL;
|
static StructType *get(Type *elt1, ...) LLVM_END_WITH_NULL;
|
||||||
|
|
||||||
bool isPacked() const { return (getSubclassData() & SCDB_Packed) != 0; }
|
bool isPacked() const { return (getSubclassData() & SCDB_Packed) != 0; }
|
||||||
|
|
||||||
/// isLiteral - Return true if this type is uniqued by structural
|
/// isLiteral - Return true if this type is uniqued by structural
|
||||||
/// equivalence, false if it is a struct definition.
|
/// equivalence, false if it is a struct definition.
|
||||||
bool isLiteral() const { return (getSubclassData() & SCDB_IsLiteral) != 0; }
|
bool isLiteral() const { return (getSubclassData() & SCDB_IsLiteral) != 0; }
|
||||||
|
|
||||||
/// isOpaque - Return true if this is a type with an identity that has no body
|
/// isOpaque - Return true if this is a type with an identity that has no body
|
||||||
/// specified yet. These prints as 'opaque' in .ll files.
|
/// specified yet. These prints as 'opaque' in .ll files.
|
||||||
bool isOpaque() const { return (getSubclassData() & SCDB_HasBody) == 0; }
|
bool isOpaque() const { return (getSubclassData() & SCDB_HasBody) == 0; }
|
||||||
|
@ -251,12 +250,12 @@ public:
|
||||||
|
|
||||||
/// hasName - Return true if this is a named struct that has a non-empty name.
|
/// hasName - Return true if this is a named struct that has a non-empty name.
|
||||||
bool hasName() const { return SymbolTableEntry != nullptr; }
|
bool hasName() const { return SymbolTableEntry != nullptr; }
|
||||||
|
|
||||||
/// getName - Return the name for this struct type if it has an identity.
|
/// getName - Return the name for this struct type if it has an identity.
|
||||||
/// This may return an empty string for an unnamed struct type. Do not call
|
/// This may return an empty string for an unnamed struct type. Do not call
|
||||||
/// this on an literal type.
|
/// this on an literal type.
|
||||||
StringRef getName() const;
|
StringRef getName() const;
|
||||||
|
|
||||||
/// setName - Change the name of this type to the specified name, or to a name
|
/// setName - Change the name of this type to the specified name, or to a name
|
||||||
/// with a suffix if there is a collision. Do not call this on an literal
|
/// with a suffix if there is a collision. Do not call this on an literal
|
||||||
/// type.
|
/// type.
|
||||||
|
@ -265,11 +264,10 @@ public:
|
||||||
/// setBody - Specify a body for an opaque identified type.
|
/// setBody - Specify a body for an opaque identified type.
|
||||||
void setBody(ArrayRef<Type*> Elements, bool isPacked = false);
|
void setBody(ArrayRef<Type*> Elements, bool isPacked = false);
|
||||||
void setBody(Type *elt1, ...) LLVM_END_WITH_NULL;
|
void setBody(Type *elt1, ...) LLVM_END_WITH_NULL;
|
||||||
|
|
||||||
/// isValidElementType - Return true if the specified type is valid as a
|
/// isValidElementType - Return true if the specified type is valid as a
|
||||||
/// element type.
|
/// element type.
|
||||||
static bool isValidElementType(Type *ElemTy);
|
static bool isValidElementType(Type *ElemTy);
|
||||||
|
|
||||||
|
|
||||||
// Iterator access to the elements.
|
// Iterator access to the elements.
|
||||||
typedef Type::subtype_iterator element_iterator;
|
typedef Type::subtype_iterator element_iterator;
|
||||||
|
@ -327,7 +325,6 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// ArrayType - Class to represent array types.
|
/// ArrayType - Class to represent array types.
|
||||||
///
|
///
|
||||||
class ArrayType : public SequentialType {
|
class ArrayType : public SequentialType {
|
||||||
|
@ -336,6 +333,7 @@ class ArrayType : public SequentialType {
|
||||||
ArrayType(const ArrayType &) = delete;
|
ArrayType(const ArrayType &) = delete;
|
||||||
const ArrayType &operator=(const ArrayType &) = delete;
|
const ArrayType &operator=(const ArrayType &) = delete;
|
||||||
ArrayType(Type *ElType, uint64_t NumEl);
|
ArrayType(Type *ElType, uint64_t NumEl);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// ArrayType::get - This static method is the primary way to construct an
|
/// ArrayType::get - This static method is the primary way to construct an
|
||||||
/// ArrayType
|
/// ArrayType
|
||||||
|
@ -362,6 +360,7 @@ class VectorType : public SequentialType {
|
||||||
VectorType(const VectorType &) = delete;
|
VectorType(const VectorType &) = delete;
|
||||||
const VectorType &operator=(const VectorType &) = delete;
|
const VectorType &operator=(const VectorType &) = delete;
|
||||||
VectorType(Type *ElType, unsigned NumEl);
|
VectorType(Type *ElType, unsigned NumEl);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// VectorType::get - This static method is the primary way to construct an
|
/// VectorType::get - This static method is the primary way to construct an
|
||||||
/// VectorType.
|
/// VectorType.
|
||||||
|
@ -440,13 +439,13 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// PointerType - Class to represent pointers.
|
/// PointerType - Class to represent pointers.
|
||||||
///
|
///
|
||||||
class PointerType : public SequentialType {
|
class PointerType : public SequentialType {
|
||||||
PointerType(const PointerType &) = delete;
|
PointerType(const PointerType &) = delete;
|
||||||
const PointerType &operator=(const PointerType &) = delete;
|
const PointerType &operator=(const PointerType &) = delete;
|
||||||
explicit PointerType(Type *ElType, unsigned AddrSpace);
|
explicit PointerType(Type *ElType, unsigned AddrSpace);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// PointerType::get - This constructs a pointer to an object of the specified
|
/// PointerType::get - This constructs a pointer to an object of the specified
|
||||||
/// type in a numbered address space.
|
/// type in a numbered address space.
|
||||||
|
|
|
@ -47,6 +47,7 @@ template<> struct ilist_traits<Argument>
|
||||||
static void noteHead(Argument*, Argument*) {}
|
static void noteHead(Argument*, Argument*) {}
|
||||||
|
|
||||||
static ValueSymbolTable *getSymTab(Function *ItemParent);
|
static ValueSymbolTable *getSymTab(Function *ItemParent);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable ilist_half_node<Argument> Sentinel;
|
mutable ilist_half_node<Argument> Sentinel;
|
||||||
};
|
};
|
||||||
|
@ -268,13 +269,13 @@ public:
|
||||||
uint64_t getDereferenceableBytes(unsigned i) const {
|
uint64_t getDereferenceableBytes(unsigned i) const {
|
||||||
return AttributeSets.getDereferenceableBytes(i);
|
return AttributeSets.getDereferenceableBytes(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Extract the number of dereferenceable_or_null bytes for a call or
|
/// @brief Extract the number of dereferenceable_or_null bytes for a call or
|
||||||
/// parameter (0=unknown).
|
/// parameter (0=unknown).
|
||||||
uint64_t getDereferenceableOrNullBytes(unsigned i) const {
|
uint64_t getDereferenceableOrNullBytes(unsigned i) const {
|
||||||
return AttributeSets.getDereferenceableOrNullBytes(i);
|
return AttributeSets.getDereferenceableOrNullBytes(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Determine if the function does not access memory.
|
/// @brief Determine if the function does not access memory.
|
||||||
bool doesNotAccessMemory() const {
|
bool doesNotAccessMemory() const {
|
||||||
return AttributeSets.hasAttribute(AttributeSet::FunctionIndex,
|
return AttributeSets.hasAttribute(AttributeSet::FunctionIndex,
|
||||||
|
@ -424,7 +425,6 @@ public:
|
||||||
///
|
///
|
||||||
void eraseFromParent() override;
|
void eraseFromParent() override;
|
||||||
|
|
||||||
|
|
||||||
/// Get the underlying elements of the Function... the basic block list is
|
/// Get the underlying elements of the Function... the basic block list is
|
||||||
/// empty for external functions.
|
/// empty for external functions.
|
||||||
///
|
///
|
||||||
|
@ -457,7 +457,6 @@ public:
|
||||||
inline ValueSymbolTable &getValueSymbolTable() { return *SymTab; }
|
inline ValueSymbolTable &getValueSymbolTable() { return *SymTab; }
|
||||||
inline const ValueSymbolTable &getValueSymbolTable() const { return *SymTab; }
|
inline const ValueSymbolTable &getValueSymbolTable() const { return *SymTab; }
|
||||||
|
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// BasicBlock iterator forwarding functions
|
// BasicBlock iterator forwarding functions
|
||||||
//
|
//
|
||||||
|
|
|
@ -52,6 +52,7 @@ protected:
|
||||||
/// \brief Common base class shared among various IRBuilders.
|
/// \brief Common base class shared among various IRBuilders.
|
||||||
class IRBuilderBase {
|
class IRBuilderBase {
|
||||||
DebugLoc CurDbgLocation;
|
DebugLoc CurDbgLocation;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BasicBlock *BB;
|
BasicBlock *BB;
|
||||||
BasicBlock::iterator InsertPt;
|
BasicBlock::iterator InsertPt;
|
||||||
|
@ -59,8 +60,8 @@ protected:
|
||||||
|
|
||||||
MDNode *DefaultFPMathTag;
|
MDNode *DefaultFPMathTag;
|
||||||
FastMathFlags FMF;
|
FastMathFlags FMF;
|
||||||
public:
|
|
||||||
|
|
||||||
|
public:
|
||||||
IRBuilderBase(LLVMContext &context, MDNode *FPMathTag = nullptr)
|
IRBuilderBase(LLVMContext &context, MDNode *FPMathTag = nullptr)
|
||||||
: Context(context), DefaultFPMathTag(FPMathTag), FMF() {
|
: Context(context), DefaultFPMathTag(FPMathTag), FMF() {
|
||||||
ClearInsertionPoint();
|
ClearInsertionPoint();
|
||||||
|
@ -515,6 +516,7 @@ template<bool preserveNames = true, typename T = ConstantFolder,
|
||||||
typename Inserter = IRBuilderDefaultInserter<preserveNames> >
|
typename Inserter = IRBuilderDefaultInserter<preserveNames> >
|
||||||
class IRBuilder : public IRBuilderBase, public Inserter {
|
class IRBuilder : public IRBuilderBase, public Inserter {
|
||||||
T Folder;
|
T Folder;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IRBuilder(LLVMContext &C, const T &F, Inserter I = Inserter(),
|
IRBuilder(LLVMContext &C, const T &F, Inserter I = Inserter(),
|
||||||
MDNode *FPMathTag = nullptr)
|
MDNode *FPMathTag = nullptr)
|
||||||
|
@ -737,6 +739,7 @@ private:
|
||||||
I->setFastMathFlags(FMF);
|
I->setFastMathFlags(FMF);
|
||||||
return I;
|
return I;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Value *CreateAdd(Value *LHS, Value *RHS, const Twine &Name = "",
|
Value *CreateAdd(Value *LHS, Value *RHS, const Twine &Name = "",
|
||||||
bool HasNUW = false, bool HasNSW = false) {
|
bool HasNUW = false, bool HasNSW = false) {
|
||||||
|
@ -1372,11 +1375,13 @@ public:
|
||||||
|
|
||||||
return CreateBitCast(V, DestTy, Name);
|
return CreateBitCast(V, DestTy, Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// \brief Provided to resolve 'CreateIntCast(Ptr, Ptr, "...")', giving a
|
// \brief Provided to resolve 'CreateIntCast(Ptr, Ptr, "...")', giving a
|
||||||
// compile time error, instead of converting the string to bool for the
|
// compile time error, instead of converting the string to bool for the
|
||||||
// isSigned parameter.
|
// isSigned parameter.
|
||||||
Value *CreateIntCast(Value *, Type *, const char *) = delete;
|
Value *CreateIntCast(Value *, Type *, const char *) = delete;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Value *CreateFPCast(Value *V, Type *DestTy, const Twine &Name = "") {
|
Value *CreateFPCast(Value *V, Type *DestTy, const Twine &Name = "") {
|
||||||
if (V->getType() == DestTy)
|
if (V->getType() == DestTy)
|
||||||
|
@ -1740,7 +1745,6 @@ public:
|
||||||
|
|
||||||
// Create wrappers for C Binding types (see CBindingWrapping.h).
|
// Create wrappers for C Binding types (see CBindingWrapping.h).
|
||||||
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(IRBuilder<>, LLVMBuilderRef)
|
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(IRBuilder<>, LLVMBuilderRef)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -57,15 +57,15 @@ private:
|
||||||
/// When the ConstantUniqueMap merges two types and makes two InlineAsms
|
/// When the ConstantUniqueMap merges two types and makes two InlineAsms
|
||||||
/// identical, it destroys one of them with this method.
|
/// identical, it destroys one of them with this method.
|
||||||
void destroyConstant();
|
void destroyConstant();
|
||||||
public:
|
|
||||||
|
|
||||||
|
public:
|
||||||
/// InlineAsm::get - Return the specified uniqued inline asm string.
|
/// InlineAsm::get - Return the specified uniqued inline asm string.
|
||||||
///
|
///
|
||||||
static InlineAsm *get(FunctionType *Ty, StringRef AsmString,
|
static InlineAsm *get(FunctionType *Ty, StringRef AsmString,
|
||||||
StringRef Constraints, bool hasSideEffects,
|
StringRef Constraints, bool hasSideEffects,
|
||||||
bool isAlignStack = false,
|
bool isAlignStack = false,
|
||||||
AsmDialect asmDialect = AD_ATT);
|
AsmDialect asmDialect = AD_ATT);
|
||||||
|
|
||||||
bool hasSideEffects() const { return HasSideEffects; }
|
bool hasSideEffects() const { return HasSideEffects; }
|
||||||
bool isAlignStack() const { return IsAlignStack; }
|
bool isAlignStack() const { return IsAlignStack; }
|
||||||
AsmDialect getDialect() const { return Dialect; }
|
AsmDialect getDialect() const { return Dialect; }
|
||||||
|
@ -75,11 +75,11 @@ public:
|
||||||
PointerType *getType() const {
|
PointerType *getType() const {
|
||||||
return reinterpret_cast<PointerType*>(Value::getType());
|
return reinterpret_cast<PointerType*>(Value::getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getFunctionType - InlineAsm's are always pointers to functions.
|
/// getFunctionType - InlineAsm's are always pointers to functions.
|
||||||
///
|
///
|
||||||
FunctionType *getFunctionType() const;
|
FunctionType *getFunctionType() const;
|
||||||
|
|
||||||
const std::string &getAsmString() const { return AsmString; }
|
const std::string &getAsmString() const { return AsmString; }
|
||||||
const std::string &getConstraintString() const { return Constraints; }
|
const std::string &getConstraintString() const { return Constraints; }
|
||||||
|
|
||||||
|
@ -95,9 +95,9 @@ public:
|
||||||
isOutput, // '=x'
|
isOutput, // '=x'
|
||||||
isClobber // '~x'
|
isClobber // '~x'
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::vector<std::string> ConstraintCodeVector;
|
typedef std::vector<std::string> ConstraintCodeVector;
|
||||||
|
|
||||||
struct SubConstraintInfo {
|
struct SubConstraintInfo {
|
||||||
/// MatchingInput - If this is not -1, this is an output constraint where an
|
/// MatchingInput - If this is not -1, this is an output constraint where an
|
||||||
/// input constraint is required to match it (e.g. "0"). The value is the
|
/// input constraint is required to match it (e.g. "0"). The value is the
|
||||||
|
@ -114,12 +114,12 @@ public:
|
||||||
typedef std::vector<SubConstraintInfo> SubConstraintInfoVector;
|
typedef std::vector<SubConstraintInfo> SubConstraintInfoVector;
|
||||||
struct ConstraintInfo;
|
struct ConstraintInfo;
|
||||||
typedef std::vector<ConstraintInfo> ConstraintInfoVector;
|
typedef std::vector<ConstraintInfo> ConstraintInfoVector;
|
||||||
|
|
||||||
struct ConstraintInfo {
|
struct ConstraintInfo {
|
||||||
/// Type - The basic type of the constraint: input/output/clobber
|
/// Type - The basic type of the constraint: input/output/clobber
|
||||||
///
|
///
|
||||||
ConstraintPrefix Type;
|
ConstraintPrefix Type;
|
||||||
|
|
||||||
/// isEarlyClobber - "&": output operand writes result before inputs are all
|
/// isEarlyClobber - "&": output operand writes result before inputs are all
|
||||||
/// read. This is only ever set for an output operand.
|
/// read. This is only ever set for an output operand.
|
||||||
bool isEarlyClobber;
|
bool isEarlyClobber;
|
||||||
|
@ -129,48 +129,48 @@ public:
|
||||||
/// constraint number that matches this one (for example, if this is
|
/// constraint number that matches this one (for example, if this is
|
||||||
/// constraint #0 and constraint #4 has the value "0", this will be 4).
|
/// constraint #0 and constraint #4 has the value "0", this will be 4).
|
||||||
signed char MatchingInput;
|
signed char MatchingInput;
|
||||||
|
|
||||||
/// hasMatchingInput - Return true if this is an output constraint that has
|
/// hasMatchingInput - Return true if this is an output constraint that has
|
||||||
/// a matching input constraint.
|
/// a matching input constraint.
|
||||||
bool hasMatchingInput() const { return MatchingInput != -1; }
|
bool hasMatchingInput() const { return MatchingInput != -1; }
|
||||||
|
|
||||||
/// isCommutative - This is set to true for a constraint that is commutative
|
/// isCommutative - This is set to true for a constraint that is commutative
|
||||||
/// with the next operand.
|
/// with the next operand.
|
||||||
bool isCommutative;
|
bool isCommutative;
|
||||||
|
|
||||||
/// isIndirect - True if this operand is an indirect operand. This means
|
/// isIndirect - True if this operand is an indirect operand. This means
|
||||||
/// that the address of the source or destination is present in the call
|
/// that the address of the source or destination is present in the call
|
||||||
/// instruction, instead of it being returned or passed in explicitly. This
|
/// instruction, instead of it being returned or passed in explicitly. This
|
||||||
/// is represented with a '*' in the asm string.
|
/// is represented with a '*' in the asm string.
|
||||||
bool isIndirect;
|
bool isIndirect;
|
||||||
|
|
||||||
/// Code - The constraint code, either the register name (in braces) or the
|
/// Code - The constraint code, either the register name (in braces) or the
|
||||||
/// constraint letter/number.
|
/// constraint letter/number.
|
||||||
ConstraintCodeVector Codes;
|
ConstraintCodeVector Codes;
|
||||||
|
|
||||||
/// isMultipleAlternative - '|': has multiple-alternative constraints.
|
/// isMultipleAlternative - '|': has multiple-alternative constraints.
|
||||||
bool isMultipleAlternative;
|
bool isMultipleAlternative;
|
||||||
|
|
||||||
/// multipleAlternatives - If there are multiple alternative constraints,
|
/// multipleAlternatives - If there are multiple alternative constraints,
|
||||||
/// this array will contain them. Otherwise it will be empty.
|
/// this array will contain them. Otherwise it will be empty.
|
||||||
SubConstraintInfoVector multipleAlternatives;
|
SubConstraintInfoVector multipleAlternatives;
|
||||||
|
|
||||||
/// The currently selected alternative constraint index.
|
/// The currently selected alternative constraint index.
|
||||||
unsigned currentAlternativeIndex;
|
unsigned currentAlternativeIndex;
|
||||||
|
|
||||||
/// Default constructor.
|
/// Default constructor.
|
||||||
ConstraintInfo();
|
ConstraintInfo();
|
||||||
|
|
||||||
/// Parse - Analyze the specified string (e.g. "=*&{eax}") and fill in the
|
/// Parse - Analyze the specified string (e.g. "=*&{eax}") and fill in the
|
||||||
/// fields in this structure. If the constraint string is not understood,
|
/// fields in this structure. If the constraint string is not understood,
|
||||||
/// return true, otherwise return false.
|
/// return true, otherwise return false.
|
||||||
bool Parse(StringRef Str, ConstraintInfoVector &ConstraintsSoFar);
|
bool Parse(StringRef Str, ConstraintInfoVector &ConstraintsSoFar);
|
||||||
|
|
||||||
/// selectAlternative - Point this constraint to the alternative constraint
|
/// selectAlternative - Point this constraint to the alternative constraint
|
||||||
/// indicated by the index.
|
/// indicated by the index.
|
||||||
void selectAlternative(unsigned index);
|
void selectAlternative(unsigned index);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// ParseConstraints - Split up the constraint string into the specific
|
/// ParseConstraints - Split up the constraint string into the specific
|
||||||
/// constraints and their prefixes. If this returns an empty vector, and if
|
/// constraints and their prefixes. If this returns an empty vector, and if
|
||||||
/// the constraint string itself isn't empty, there was an error parsing.
|
/// the constraint string itself isn't empty, there was an error parsing.
|
||||||
|
@ -181,13 +181,12 @@ public:
|
||||||
ConstraintInfoVector ParseConstraints() const {
|
ConstraintInfoVector ParseConstraints() const {
|
||||||
return ParseConstraints(Constraints);
|
return ParseConstraints(Constraints);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return V->getValueID() == Value::InlineAsmVal;
|
return V->getValueID() == Value::InlineAsmVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// These are helper methods for dealing with flags in the INLINEASM SDNode
|
// These are helper methods for dealing with flags in the INLINEASM SDNode
|
||||||
// in the backend.
|
// in the backend.
|
||||||
//
|
//
|
||||||
|
@ -204,7 +203,7 @@ public:
|
||||||
// code.
|
// code.
|
||||||
// Else:
|
// Else:
|
||||||
// Bit 30-16 - The register class ID to use for the operand.
|
// Bit 30-16 - The register class ID to use for the operand.
|
||||||
|
|
||||||
enum : uint32_t {
|
enum : uint32_t {
|
||||||
// Fixed operands on an INLINEASM SDNode.
|
// Fixed operands on an INLINEASM SDNode.
|
||||||
Op_InputChain = 0,
|
Op_InputChain = 0,
|
||||||
|
@ -265,13 +264,13 @@ public:
|
||||||
|
|
||||||
Flag_MatchingOperand = 0x80000000
|
Flag_MatchingOperand = 0x80000000
|
||||||
};
|
};
|
||||||
|
|
||||||
static unsigned getFlagWord(unsigned Kind, unsigned NumOps) {
|
static unsigned getFlagWord(unsigned Kind, unsigned NumOps) {
|
||||||
assert(((NumOps << 3) & ~0xffff) == 0 && "Too many inline asm operands!");
|
assert(((NumOps << 3) & ~0xffff) == 0 && "Too many inline asm operands!");
|
||||||
assert(Kind >= Kind_RegUse && Kind <= Kind_Mem && "Invalid Kind");
|
assert(Kind >= Kind_RegUse && Kind <= Kind_Mem && "Invalid Kind");
|
||||||
return Kind | (NumOps << 3);
|
return Kind | (NumOps << 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getFlagWordForMatchingOp - Augment an existing flag word returned by
|
/// getFlagWordForMatchingOp - Augment an existing flag word returned by
|
||||||
/// getFlagWord with information indicating that this input operand is tied
|
/// getFlagWord with information indicating that this input operand is tied
|
||||||
/// to a previous output operand.
|
/// to a previous output operand.
|
||||||
|
@ -356,7 +355,6 @@ public:
|
||||||
RC = High - 1;
|
RC = High - 1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
|
|
@ -51,8 +51,8 @@ protected:
|
||||||
virtual BasicBlock *getSuccessorV(unsigned idx) const = 0;
|
virtual BasicBlock *getSuccessorV(unsigned idx) const = 0;
|
||||||
virtual unsigned getNumSuccessorsV() const = 0;
|
virtual unsigned getNumSuccessorsV() const = 0;
|
||||||
virtual void setSuccessorV(unsigned idx, BasicBlock *B) = 0;
|
virtual void setSuccessorV(unsigned idx, BasicBlock *B) = 0;
|
||||||
public:
|
|
||||||
|
|
||||||
|
public:
|
||||||
/// Return the number of successors that this terminator has.
|
/// Return the number of successors that this terminator has.
|
||||||
unsigned getNumSuccessors() const {
|
unsigned getNumSuccessors() const {
|
||||||
return getNumSuccessorsV();
|
return getNumSuccessorsV();
|
||||||
|
@ -271,7 +271,6 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// UnaryInstruction Class
|
// UnaryInstruction Class
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -289,6 +288,7 @@ protected:
|
||||||
: Instruction(Ty, iType, &Op<0>(), 1, IAE) {
|
: Instruction(Ty, iType, &Op<0>(), 1, IAE) {
|
||||||
Op<0>() = V;
|
Op<0>() = V;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// allocate space for exactly one operand
|
// allocate space for exactly one operand
|
||||||
void *operator new(size_t s) {
|
void *operator new(size_t s) {
|
||||||
|
@ -327,6 +327,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(UnaryInstruction, Value)
|
||||||
|
|
||||||
class BinaryOperator : public Instruction {
|
class BinaryOperator : public Instruction {
|
||||||
void *operator new(size_t, unsigned) = delete;
|
void *operator new(size_t, unsigned) = delete;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void init(BinaryOps iType);
|
void init(BinaryOps iType);
|
||||||
BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty,
|
BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty,
|
||||||
|
@ -403,7 +404,7 @@ public:
|
||||||
BO->setHasNoSignedWrap(true);
|
BO->setHasNoSignedWrap(true);
|
||||||
return BO;
|
return BO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BinaryOperator *CreateNUW(BinaryOps Opc, Value *V1, Value *V2,
|
static BinaryOperator *CreateNUW(BinaryOps Opc, Value *V1, Value *V2,
|
||||||
const Twine &Name = "") {
|
const Twine &Name = "") {
|
||||||
BinaryOperator *BO = Create(Opc, V1, V2, Name);
|
BinaryOperator *BO = Create(Opc, V1, V2, Name);
|
||||||
|
@ -422,7 +423,7 @@ public:
|
||||||
BO->setHasNoUnsignedWrap(true);
|
BO->setHasNoUnsignedWrap(true);
|
||||||
return BO;
|
return BO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BinaryOperator *CreateExact(BinaryOps Opc, Value *V1, Value *V2,
|
static BinaryOperator *CreateExact(BinaryOps Opc, Value *V1, Value *V2,
|
||||||
const Twine &Name = "") {
|
const Twine &Name = "") {
|
||||||
BinaryOperator *BO = Create(Opc, V1, V2, Name);
|
BinaryOperator *BO = Create(Opc, V1, V2, Name);
|
||||||
|
@ -471,7 +472,7 @@ public:
|
||||||
DEFINE_HELPERS(LShr, Exact) // CreateExactLShr
|
DEFINE_HELPERS(LShr, Exact) // CreateExactLShr
|
||||||
|
|
||||||
#undef DEFINE_HELPERS
|
#undef DEFINE_HELPERS
|
||||||
|
|
||||||
/// Helper functions to construct and inspect unary operations (NEG and NOT)
|
/// Helper functions to construct and inspect unary operations (NEG and NOT)
|
||||||
/// via binary operators SUB and XOR:
|
/// via binary operators SUB and XOR:
|
||||||
///
|
///
|
||||||
|
@ -549,7 +550,7 @@ public:
|
||||||
/// Convenience method to copy supported wrapping, exact, and fast-math flags
|
/// Convenience method to copy supported wrapping, exact, and fast-math flags
|
||||||
/// from V to this instruction.
|
/// from V to this instruction.
|
||||||
void copyIRFlags(const Value *V);
|
void copyIRFlags(const Value *V);
|
||||||
|
|
||||||
/// Logical 'and' of any supported wrapping, exact, and fast-math flags of
|
/// Logical 'and' of any supported wrapping, exact, and fast-math flags of
|
||||||
/// V and this instruction.
|
/// V and this instruction.
|
||||||
void andIRFlags(const Value *V);
|
void andIRFlags(const Value *V);
|
||||||
|
@ -582,6 +583,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BinaryOperator, Value)
|
||||||
/// @brief Base class of casting instructions.
|
/// @brief Base class of casting instructions.
|
||||||
class CastInst : public UnaryInstruction {
|
class CastInst : public UnaryInstruction {
|
||||||
void anchor() override;
|
void anchor() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// @brief Constructor with insert-before-instruction semantics for subclasses
|
/// @brief Constructor with insert-before-instruction semantics for subclasses
|
||||||
CastInst(Type *Ty, unsigned iType, Value *S,
|
CastInst(Type *Ty, unsigned iType, Value *S,
|
||||||
|
@ -595,6 +597,7 @@ protected:
|
||||||
: UnaryInstruction(Ty, iType, S, InsertAtEnd) {
|
: UnaryInstruction(Ty, iType, S, InsertAtEnd) {
|
||||||
setName(NameStr);
|
setName(NameStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Provides a way to construct any of the CastInst subclasses using an
|
/// Provides a way to construct any of the CastInst subclasses using an
|
||||||
/// opcode instead of the subclass's constructor. The opcode must be in the
|
/// opcode instead of the subclass's constructor. The opcode must be in the
|
||||||
|
@ -873,6 +876,7 @@ public:
|
||||||
class CmpInst : public Instruction {
|
class CmpInst : public Instruction {
|
||||||
void *operator new(size_t, unsigned) = delete;
|
void *operator new(size_t, unsigned) = delete;
|
||||||
CmpInst() = delete;
|
CmpInst() = delete;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CmpInst(Type *ty, Instruction::OtherOps op, unsigned short pred,
|
CmpInst(Type *ty, Instruction::OtherOps op, unsigned short pred,
|
||||||
Value *LHS, Value *RHS, const Twine &Name = "",
|
Value *LHS, Value *RHS, const Twine &Name = "",
|
||||||
|
@ -883,6 +887,7 @@ protected:
|
||||||
BasicBlock *InsertAtEnd);
|
BasicBlock *InsertAtEnd);
|
||||||
|
|
||||||
void anchor() override; // Out of line virtual method.
|
void anchor() override; // Out of line virtual method.
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// This enumeration lists the possible predicates for CmpInst subclasses.
|
/// This enumeration lists the possible predicates for CmpInst subclasses.
|
||||||
/// Values in the range 0-31 are reserved for FCmpInst, while values in the
|
/// Values in the range 0-31 are reserved for FCmpInst, while values in the
|
||||||
|
@ -969,7 +974,6 @@ public:
|
||||||
bool isFPPredicate() const { return isFPPredicate(getPredicate()); }
|
bool isFPPredicate() const { return isFPPredicate(getPredicate()); }
|
||||||
bool isIntPredicate() const { return isIntPredicate(getPredicate()); }
|
bool isIntPredicate() const { return isIntPredicate(getPredicate()); }
|
||||||
|
|
||||||
|
|
||||||
/// For example, EQ -> NE, UGT -> ULE, SLT -> SGE,
|
/// For example, EQ -> NE, UGT -> ULE, SLT -> SGE,
|
||||||
/// OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
|
/// OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
|
||||||
/// @returns the inverse predicate for the instruction's current predicate.
|
/// @returns the inverse predicate for the instruction's current predicate.
|
||||||
|
@ -1076,6 +1080,7 @@ public:
|
||||||
}
|
}
|
||||||
return Type::getInt1Ty(opnd_type->getContext());
|
return Type::getInt1Ty(opnd_type->getContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Shadow Value::setValueSubclassData with a private forwarding method so that
|
// Shadow Value::setValueSubclassData with a private forwarding method so that
|
||||||
// subclasses cannot accidentally use it.
|
// subclasses cannot accidentally use it.
|
||||||
|
@ -1084,7 +1089,6 @@ private:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// FIXME: these are redundant if CmpInst < BinaryOperator
|
// FIXME: these are redundant if CmpInst < BinaryOperator
|
||||||
template <>
|
template <>
|
||||||
struct OperandTraits<CmpInst> : public FixedNumOperandTraits<CmpInst, 2> {
|
struct OperandTraits<CmpInst> : public FixedNumOperandTraits<CmpInst, 2> {
|
||||||
|
|
|
@ -88,7 +88,6 @@
|
||||||
#define LAST_OTHER_INST(num)
|
#define LAST_OTHER_INST(num)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// Terminator Instructions - These instructions are used to terminate a basic
|
// Terminator Instructions - These instructions are used to terminate a basic
|
||||||
// block of the program. Every basic block must end with one of these
|
// block of the program. Every basic block must end with one of these
|
||||||
// instructions for it to be a well formed basic block.
|
// instructions for it to be a well formed basic block.
|
||||||
|
|
|
@ -158,6 +158,7 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Shadow Instruction::setInstructionSubclassData with a private forwarding
|
// Shadow Instruction::setInstructionSubclassData with a private forwarding
|
||||||
// method so that subclasses cannot accidentally use it.
|
// method so that subclasses cannot accidentally use it.
|
||||||
|
@ -166,7 +167,6 @@ private:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// LoadInst Class
|
// LoadInst Class
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -176,6 +176,7 @@ private:
|
||||||
///
|
///
|
||||||
class LoadInst : public UnaryInstruction {
|
class LoadInst : public UnaryInstruction {
|
||||||
void AssertOK();
|
void AssertOK();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -290,7 +291,6 @@ public:
|
||||||
return getPointerOperand()->getType()->getPointerAddressSpace();
|
return getPointerOperand()->getType()->getPointerAddressSpace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||||
static inline bool classof(const Instruction *I) {
|
static inline bool classof(const Instruction *I) {
|
||||||
return I->getOpcode() == Instruction::Load;
|
return I->getOpcode() == Instruction::Load;
|
||||||
|
@ -298,6 +298,7 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Shadow Instruction::setInstructionSubclassData with a private forwarding
|
// Shadow Instruction::setInstructionSubclassData with a private forwarding
|
||||||
// method so that subclasses cannot accidentally use it.
|
// method so that subclasses cannot accidentally use it.
|
||||||
|
@ -306,7 +307,6 @@ private:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// StoreInst Class
|
// StoreInst Class
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -316,6 +316,7 @@ private:
|
||||||
class StoreInst : public Instruction {
|
class StoreInst : public Instruction {
|
||||||
void *operator new(size_t, unsigned) = delete;
|
void *operator new(size_t, unsigned) = delete;
|
||||||
void AssertOK();
|
void AssertOK();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -344,7 +345,6 @@ public:
|
||||||
SynchronizationScope SynchScope,
|
SynchronizationScope SynchScope,
|
||||||
BasicBlock *InsertAtEnd);
|
BasicBlock *InsertAtEnd);
|
||||||
|
|
||||||
|
|
||||||
/// isVolatile - Return true if this is a store to a volatile memory
|
/// isVolatile - Return true if this is a store to a volatile memory
|
||||||
/// location.
|
/// location.
|
||||||
///
|
///
|
||||||
|
@ -422,6 +422,7 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Shadow Instruction::setInstructionSubclassData with a private forwarding
|
// Shadow Instruction::setInstructionSubclassData with a private forwarding
|
||||||
// method so that subclasses cannot accidentally use it.
|
// method so that subclasses cannot accidentally use it.
|
||||||
|
@ -445,6 +446,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(StoreInst, Value)
|
||||||
class FenceInst : public Instruction {
|
class FenceInst : public Instruction {
|
||||||
void *operator new(size_t, unsigned) = delete;
|
void *operator new(size_t, unsigned) = delete;
|
||||||
void Init(AtomicOrdering Ordering, SynchronizationScope SynchScope);
|
void Init(AtomicOrdering Ordering, SynchronizationScope SynchScope);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -496,6 +498,7 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Shadow Instruction::setInstructionSubclassData with a private forwarding
|
// Shadow Instruction::setInstructionSubclassData with a private forwarding
|
||||||
// method so that subclasses cannot accidentally use it.
|
// method so that subclasses cannot accidentally use it.
|
||||||
|
@ -517,6 +520,7 @@ class AtomicCmpXchgInst : public Instruction {
|
||||||
void Init(Value *Ptr, Value *Cmp, Value *NewVal,
|
void Init(Value *Ptr, Value *Cmp, Value *NewVal,
|
||||||
AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering,
|
AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering,
|
||||||
SynchronizationScope SynchScope);
|
SynchronizationScope SynchScope);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -648,6 +652,7 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Shadow Instruction::setInstructionSubclassData with a private forwarding
|
// Shadow Instruction::setInstructionSubclassData with a private forwarding
|
||||||
// method so that subclasses cannot accidentally use it.
|
// method so that subclasses cannot accidentally use it.
|
||||||
|
@ -673,6 +678,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(AtomicCmpXchgInst, Value)
|
||||||
///
|
///
|
||||||
class AtomicRMWInst : public Instruction {
|
class AtomicRMWInst : public Instruction {
|
||||||
void *operator new(size_t, unsigned) = delete;
|
void *operator new(size_t, unsigned) = delete;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -795,6 +801,7 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init(BinOp Operation, Value *Ptr, Value *Val,
|
void Init(BinOp Operation, Value *Ptr, Value *Val,
|
||||||
AtomicOrdering Ordering, SynchronizationScope SynchScope);
|
AtomicOrdering Ordering, SynchronizationScope SynchScope);
|
||||||
|
@ -1078,10 +1085,8 @@ GetElementPtrInst::GetElementPtrInst(Type *PointeeType, Value *Ptr,
|
||||||
init(Ptr, IdxList, NameStr);
|
init(Ptr, IdxList, NameStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GetElementPtrInst, Value)
|
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GetElementPtrInst, Value)
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// ICmpInst Class
|
// ICmpInst Class
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -1226,7 +1231,6 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -1381,6 +1385,7 @@ class CallInst : public Instruction {
|
||||||
explicit CallInst(Value *F, const Twine &NameStr,
|
explicit CallInst(Value *F, const Twine &NameStr,
|
||||||
Instruction *InsertBefore);
|
Instruction *InsertBefore);
|
||||||
CallInst(Value *F, const Twine &NameStr, BasicBlock *InsertAtEnd);
|
CallInst(Value *F, const Twine &NameStr, BasicBlock *InsertAtEnd);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -1569,7 +1574,7 @@ public:
|
||||||
uint64_t getDereferenceableOrNullBytes(unsigned i) const {
|
uint64_t getDereferenceableOrNullBytes(unsigned i) const {
|
||||||
return AttributeList.getDereferenceableOrNullBytes(i);
|
return AttributeList.getDereferenceableOrNullBytes(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Return true if the call should not be treated as a call to a
|
/// \brief Return true if the call should not be treated as a call to a
|
||||||
/// builtin.
|
/// builtin.
|
||||||
bool isNoBuiltin() const {
|
bool isNoBuiltin() const {
|
||||||
|
@ -1728,7 +1733,6 @@ CallInst::CallInst(FunctionType *Ty, Value *Func, ArrayRef<Value *> Args,
|
||||||
init(Ty, Func, Args, NameStr);
|
init(Ty, Func, Args, NameStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Note: if you get compile errors about private methods then
|
// Note: if you get compile errors about private methods then
|
||||||
// please update your code to use the high-level operand
|
// please update your code to use the high-level operand
|
||||||
// interfaces. See line 943 above.
|
// interfaces. See line 943 above.
|
||||||
|
@ -1762,6 +1766,7 @@ class SelectInst : public Instruction {
|
||||||
init(C, S1, S2);
|
init(C, S1, S2);
|
||||||
setName(NameStr);
|
setName(NameStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -1862,6 +1867,7 @@ class ExtractElementInst : public Instruction {
|
||||||
Instruction *InsertBefore = nullptr);
|
Instruction *InsertBefore = nullptr);
|
||||||
ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr,
|
ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr,
|
||||||
BasicBlock *InsertAtEnd);
|
BasicBlock *InsertAtEnd);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -1892,7 +1898,6 @@ public:
|
||||||
return cast<VectorType>(getVectorOperand()->getType());
|
return cast<VectorType>(getVectorOperand()->getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Transparently provide more efficient getOperand methods.
|
/// Transparently provide more efficient getOperand methods.
|
||||||
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
|
DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
|
||||||
|
|
||||||
|
@ -2038,7 +2043,6 @@ public:
|
||||||
return Mask;
|
return Mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
||||||
static inline bool classof(const Instruction *I) {
|
static inline bool classof(const Instruction *I) {
|
||||||
return I->getOpcode() == Instruction::ShuffleVector;
|
return I->getOpcode() == Instruction::ShuffleVector;
|
||||||
|
@ -2164,7 +2168,6 @@ ExtractValueInst::ExtractValueInst(Value *Agg,
|
||||||
init(Idxs, NameStr);
|
init(Idxs, NameStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// InsertValueInst Class
|
// InsertValueInst Class
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -2337,6 +2340,7 @@ class PHINode : public Instruction {
|
||||||
setName(NameStr);
|
setName(NameStr);
|
||||||
allocHungoffUses(ReservedSpace);
|
allocHungoffUses(ReservedSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// allocHungoffUses - this is more complicated than the generic
|
// allocHungoffUses - this is more complicated than the generic
|
||||||
// User::allocHungoffUses, because we have to allocate Uses for the incoming
|
// User::allocHungoffUses, because we have to allocate Uses for the incoming
|
||||||
|
@ -2497,7 +2501,8 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
private:
|
|
||||||
|
private:
|
||||||
void growOperands();
|
void growOperands();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2524,8 +2529,10 @@ class LandingPadInst : public Instruction {
|
||||||
/// the number actually in use.
|
/// the number actually in use.
|
||||||
unsigned ReservedSpace;
|
unsigned ReservedSpace;
|
||||||
LandingPadInst(const LandingPadInst &LP);
|
LandingPadInst(const LandingPadInst &LP);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum ClauseType { Catch, Filter };
|
enum ClauseType { Catch, Filter };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void *operator new(size_t, unsigned) = delete;
|
void *operator new(size_t, unsigned) = delete;
|
||||||
// Allocate space for exactly zero operands.
|
// Allocate space for exactly zero operands.
|
||||||
|
@ -2636,6 +2643,7 @@ private:
|
||||||
Instruction *InsertBefore = nullptr);
|
Instruction *InsertBefore = nullptr);
|
||||||
ReturnInst(LLVMContext &C, Value *retVal, BasicBlock *InsertAtEnd);
|
ReturnInst(LLVMContext &C, Value *retVal, BasicBlock *InsertAtEnd);
|
||||||
explicit ReturnInst(LLVMContext &C, BasicBlock *InsertAtEnd);
|
explicit ReturnInst(LLVMContext &C, BasicBlock *InsertAtEnd);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -2672,7 +2680,8 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
private:
|
|
||||||
|
private:
|
||||||
BasicBlock *getSuccessorV(unsigned idx) const override;
|
BasicBlock *getSuccessorV(unsigned idx) const override;
|
||||||
unsigned getNumSuccessorsV() const override;
|
unsigned getNumSuccessorsV() const override;
|
||||||
void setSuccessorV(unsigned idx, BasicBlock *B) override;
|
void setSuccessorV(unsigned idx, BasicBlock *B) override;
|
||||||
|
@ -2711,6 +2720,7 @@ class BranchInst : public TerminatorInst {
|
||||||
BranchInst(BasicBlock *IfTrue, BasicBlock *InsertAtEnd);
|
BranchInst(BasicBlock *IfTrue, BasicBlock *InsertAtEnd);
|
||||||
BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
|
BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
|
||||||
BasicBlock *InsertAtEnd);
|
BasicBlock *InsertAtEnd);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -2775,6 +2785,7 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BasicBlock *getSuccessorV(unsigned idx) const override;
|
BasicBlock *getSuccessorV(unsigned idx) const override;
|
||||||
unsigned getNumSuccessorsV() const override;
|
unsigned getNumSuccessorsV() const override;
|
||||||
|
@ -2821,25 +2832,23 @@ class SwitchInst : public TerminatorInst {
|
||||||
/// constructor also autoinserts at the end of the specified BasicBlock.
|
/// constructor also autoinserts at the end of the specified BasicBlock.
|
||||||
SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
|
SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
|
||||||
BasicBlock *InsertAtEnd);
|
BasicBlock *InsertAtEnd);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
SwitchInst *cloneImpl() const;
|
SwitchInst *cloneImpl() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// -2
|
// -2
|
||||||
static const unsigned DefaultPseudoIndex = static_cast<unsigned>(~0L-1);
|
static const unsigned DefaultPseudoIndex = static_cast<unsigned>(~0L-1);
|
||||||
|
|
||||||
template <class SwitchInstTy, class ConstantIntTy, class BasicBlockTy>
|
template <class SwitchInstTy, class ConstantIntTy, class BasicBlockTy>
|
||||||
class CaseIteratorT {
|
class CaseIteratorT {
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
SwitchInstTy *SI;
|
SwitchInstTy *SI;
|
||||||
unsigned Index;
|
unsigned Index;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef CaseIteratorT<SwitchInstTy, ConstantIntTy, BasicBlockTy> Self;
|
typedef CaseIteratorT<SwitchInstTy, ConstantIntTy, BasicBlockTy> Self;
|
||||||
|
|
||||||
/// Initializes case iterator for given SwitchInst and for given
|
/// Initializes case iterator for given SwitchInst and for given
|
||||||
|
@ -3083,6 +3092,7 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BasicBlock *getSuccessorV(unsigned idx) const override;
|
BasicBlock *getSuccessorV(unsigned idx) const override;
|
||||||
unsigned getNumSuccessorsV() const override;
|
unsigned getNumSuccessorsV() const override;
|
||||||
|
@ -3095,7 +3105,6 @@ struct OperandTraits<SwitchInst> : public HungoffOperandTraits<2> {
|
||||||
|
|
||||||
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SwitchInst, Value)
|
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SwitchInst, Value)
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// IndirectBrInst Class
|
// IndirectBrInst Class
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -3128,6 +3137,7 @@ class IndirectBrInst : public TerminatorInst {
|
||||||
/// here to make memory allocation more efficient. This constructor also
|
/// here to make memory allocation more efficient. This constructor also
|
||||||
/// autoinserts at the end of the specified BasicBlock.
|
/// autoinserts at the end of the specified BasicBlock.
|
||||||
IndirectBrInst(Value *Address, unsigned NumDests, BasicBlock *InsertAtEnd);
|
IndirectBrInst(Value *Address, unsigned NumDests, BasicBlock *InsertAtEnd);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -3151,7 +3161,6 @@ public:
|
||||||
const Value *getAddress() const { return getOperand(0); }
|
const Value *getAddress() const { return getOperand(0); }
|
||||||
void setAddress(Value *V) { setOperand(0, V); }
|
void setAddress(Value *V) { setOperand(0, V); }
|
||||||
|
|
||||||
|
|
||||||
/// getNumDestinations - return the number of possible destinations in this
|
/// getNumDestinations - return the number of possible destinations in this
|
||||||
/// indirectbr instruction.
|
/// indirectbr instruction.
|
||||||
unsigned getNumDestinations() const { return getNumOperands()-1; }
|
unsigned getNumDestinations() const { return getNumOperands()-1; }
|
||||||
|
@ -3183,6 +3192,7 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BasicBlock *getSuccessorV(unsigned idx) const override;
|
BasicBlock *getSuccessorV(unsigned idx) const override;
|
||||||
unsigned getNumSuccessorsV() const override;
|
unsigned getNumSuccessorsV() const override;
|
||||||
|
@ -3195,7 +3205,6 @@ struct OperandTraits<IndirectBrInst> : public HungoffOperandTraits<1> {
|
||||||
|
|
||||||
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(IndirectBrInst, Value)
|
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(IndirectBrInst, Value)
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// InvokeInst Class
|
// InvokeInst Class
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -3238,6 +3247,7 @@ class InvokeInst : public TerminatorInst {
|
||||||
inline InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
|
inline InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
|
||||||
ArrayRef<Value *> Args, unsigned Values,
|
ArrayRef<Value *> Args, unsigned Values,
|
||||||
const Twine &NameStr, BasicBlock *InsertAtEnd);
|
const Twine &NameStr, BasicBlock *InsertAtEnd);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -3364,7 +3374,7 @@ public:
|
||||||
uint64_t getDereferenceableBytes(unsigned i) const {
|
uint64_t getDereferenceableBytes(unsigned i) const {
|
||||||
return AttributeList.getDereferenceableBytes(i);
|
return AttributeList.getDereferenceableBytes(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Extract the number of dereferenceable_or_null bytes for a call or
|
/// \brief Extract the number of dereferenceable_or_null bytes for a call or
|
||||||
/// parameter (0=unknown).
|
/// parameter (0=unknown).
|
||||||
uint64_t getDereferenceableOrNullBytes(unsigned i) const {
|
uint64_t getDereferenceableOrNullBytes(unsigned i) const {
|
||||||
|
@ -3557,6 +3567,7 @@ class ResumeInst : public TerminatorInst {
|
||||||
|
|
||||||
explicit ResumeInst(Value *Exn, Instruction *InsertBefore=nullptr);
|
explicit ResumeInst(Value *Exn, Instruction *InsertBefore=nullptr);
|
||||||
ResumeInst(Value *Exn, BasicBlock *InsertAtEnd);
|
ResumeInst(Value *Exn, BasicBlock *InsertAtEnd);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -3585,6 +3596,7 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BasicBlock *getSuccessorV(unsigned idx) const override;
|
BasicBlock *getSuccessorV(unsigned idx) const override;
|
||||||
unsigned getNumSuccessorsV() const override;
|
unsigned getNumSuccessorsV() const override;
|
||||||
|
@ -4209,6 +4221,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CleanupReturnInst, Value)
|
||||||
///
|
///
|
||||||
class UnreachableInst : public TerminatorInst {
|
class UnreachableInst : public TerminatorInst {
|
||||||
void *operator new(size_t, unsigned) = delete;
|
void *operator new(size_t, unsigned) = delete;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Note: Instruction needs to be a friend here to call cloneImpl.
|
// Note: Instruction needs to be a friend here to call cloneImpl.
|
||||||
friend class Instruction;
|
friend class Instruction;
|
||||||
|
@ -4231,6 +4244,7 @@ public:
|
||||||
static inline bool classof(const Value *V) {
|
static inline bool classof(const Value *V) {
|
||||||
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BasicBlock *getSuccessorV(unsigned idx) const override;
|
BasicBlock *getSuccessorV(unsigned idx) const override;
|
||||||
unsigned getNumSuccessorsV() const override;
|
unsigned getNumSuccessorsV() const override;
|
||||||
|
|
|
@ -118,6 +118,7 @@ class PassManagerPrettyStackEntry : public PrettyStackTraceEntry {
|
||||||
Pass *P;
|
Pass *P;
|
||||||
Value *V;
|
Value *V;
|
||||||
Module *M;
|
Module *M;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PassManagerPrettyStackEntry(Pass *p)
|
explicit PassManagerPrettyStackEntry(Pass *p)
|
||||||
: P(p), V(nullptr), M(nullptr) {} // When P is releaseMemory'd.
|
: P(p), V(nullptr), M(nullptr) {} // When P is releaseMemory'd.
|
||||||
|
@ -130,7 +131,6 @@ public:
|
||||||
void print(raw_ostream &OS) const override;
|
void print(raw_ostream &OS) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// PMStack
|
// PMStack
|
||||||
//
|
//
|
||||||
|
@ -158,7 +158,6 @@ private:
|
||||||
std::vector<PMDataManager *> S;
|
std::vector<PMDataManager *> S;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// PMTopLevelManager
|
// PMTopLevelManager
|
||||||
//
|
//
|
||||||
|
@ -228,12 +227,10 @@ public:
|
||||||
PMStack activeStack;
|
PMStack activeStack;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/// Collection of pass managers
|
/// Collection of pass managers
|
||||||
SmallVector<PMDataManager *, 8> PassManagers;
|
SmallVector<PMDataManager *, 8> PassManagers;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/// Collection of pass managers that are not directly maintained
|
/// Collection of pass managers that are not directly maintained
|
||||||
/// by this pass manager
|
/// by this pass manager
|
||||||
SmallVector<PMDataManager *, 8> IndirectPassManagers;
|
SmallVector<PMDataManager *, 8> IndirectPassManagers;
|
||||||
|
@ -262,8 +259,6 @@ private:
|
||||||
mutable DenseMap<AnalysisID, const PassInfo *> AnalysisPassInfos;
|
mutable DenseMap<AnalysisID, const PassInfo *> AnalysisPassInfos;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// PMDataManager
|
// PMDataManager
|
||||||
|
|
||||||
|
@ -271,7 +266,6 @@ private:
|
||||||
/// used by pass managers.
|
/// used by pass managers.
|
||||||
class PMDataManager {
|
class PMDataManager {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit PMDataManager() : TPM(nullptr), Depth(0) {
|
explicit PMDataManager() : TPM(nullptr), Depth(0) {
|
||||||
initializeAnalysisInfo();
|
initializeAnalysisInfo();
|
||||||
}
|
}
|
||||||
|
@ -319,7 +313,6 @@ public:
|
||||||
// passes that are managed by this manager.
|
// passes that are managed by this manager.
|
||||||
bool preserveHigherLevelAnalysis(Pass *P);
|
bool preserveHigherLevelAnalysis(Pass *P);
|
||||||
|
|
||||||
|
|
||||||
/// Populate UsedPasses with analysis pass that are used or required by pass
|
/// Populate UsedPasses with analysis pass that are used or required by pass
|
||||||
/// P and are available. Populate ReqPassNotAvailable with analysis pass that
|
/// P and are available. Populate ReqPassNotAvailable with analysis pass that
|
||||||
/// are required by pass P but are not available.
|
/// are required by pass P but are not available.
|
||||||
|
@ -375,7 +368,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Top level manager.
|
// Top level manager.
|
||||||
PMTopLevelManager *TPM;
|
PMTopLevelManager *TPM;
|
||||||
|
|
||||||
|
@ -442,7 +434,7 @@ public:
|
||||||
/// finalization tasks
|
/// finalization tasks
|
||||||
///
|
///
|
||||||
using ModulePass::doFinalization;
|
using ModulePass::doFinalization;
|
||||||
|
|
||||||
/// doFinalization - Run all of the finalizers for the function passes.
|
/// doFinalization - Run all of the finalizers for the function passes.
|
||||||
///
|
///
|
||||||
bool doFinalization(Module &M) override;
|
bool doFinalization(Module &M) override;
|
||||||
|
@ -474,7 +466,6 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
Timer *getPassTimer(Pass *);
|
Timer *getPassTimer(Pass *);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -100,6 +100,7 @@ template<> struct ilist_traits<NamedMDNode>
|
||||||
static void noteHead(NamedMDNode*, NamedMDNode*) {}
|
static void noteHead(NamedMDNode*, NamedMDNode*) {}
|
||||||
void addNodeToList(NamedMDNode *) {}
|
void addNodeToList(NamedMDNode *) {}
|
||||||
void removeNodeFromList(NamedMDNode *) {}
|
void removeNodeFromList(NamedMDNode *) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable ilist_node<NamedMDNode> Sentinel;
|
mutable ilist_node<NamedMDNode> Sentinel;
|
||||||
};
|
};
|
||||||
|
@ -654,7 +655,7 @@ public:
|
||||||
|
|
||||||
/// Dump the module to stderr (for debugging).
|
/// Dump the module to stderr (for debugging).
|
||||||
void dump() const;
|
void dump() const;
|
||||||
|
|
||||||
/// This function causes all the subinstructions to "let go" of all references
|
/// This function causes all the subinstructions to "let go" of all references
|
||||||
/// that they are maintaining. This allows one to 'delete' a whole class at
|
/// that they are maintaining. This allows one to 'delete' a whole class at
|
||||||
/// a time, even though there may be circular references... first all
|
/// a time, even though there may be circular references... first all
|
||||||
|
@ -701,7 +702,7 @@ DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Module, LLVMModuleRef)
|
||||||
inline Module *unwrap(LLVMModuleProviderRef MP) {
|
inline Module *unwrap(LLVMModuleProviderRef MP) {
|
||||||
return reinterpret_cast<Module*>(MP);
|
return reinterpret_cast<Module*>(MP);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -40,6 +40,7 @@ template <typename Ty> struct ilist_traits;
|
||||||
template<typename ValueSubClass, typename ItemParentClass>
|
template<typename ValueSubClass, typename ItemParentClass>
|
||||||
class SymbolTableListTraits : public ilist_default_traits<ValueSubClass> {
|
class SymbolTableListTraits : public ilist_default_traits<ValueSubClass> {
|
||||||
typedef ilist_traits<ValueSubClass> TraitsClass;
|
typedef ilist_traits<ValueSubClass> TraitsClass;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SymbolTableListTraits() {}
|
SymbolTableListTraits() {}
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ public:
|
||||||
|
|
||||||
/// isFloatTy - Return true if this is 'float', a 32-bit IEEE fp type.
|
/// isFloatTy - Return true if this is 'float', a 32-bit IEEE fp type.
|
||||||
bool isFloatTy() const { return getTypeID() == FloatTyID; }
|
bool isFloatTy() const { return getTypeID() == FloatTyID; }
|
||||||
|
|
||||||
/// isDoubleTy - Return true if this is 'double', a 64-bit IEEE fp type.
|
/// isDoubleTy - Return true if this is 'double', a 64-bit IEEE fp type.
|
||||||
bool isDoubleTy() const { return getTypeID() == DoubleTyID; }
|
bool isDoubleTy() const { return getTypeID() == DoubleTyID; }
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ public:
|
||||||
/// isFPOrFPVectorTy - Return true if this is a FP type or a vector of FP.
|
/// isFPOrFPVectorTy - Return true if this is a FP type or a vector of FP.
|
||||||
///
|
///
|
||||||
bool isFPOrFPVectorTy() const { return getScalarType()->isFloatingPointTy(); }
|
bool isFPOrFPVectorTy() const { return getScalarType()->isFloatingPointTy(); }
|
||||||
|
|
||||||
/// isLabelTy - Return true if this is 'label'.
|
/// isLabelTy - Return true if this is 'label'.
|
||||||
bool isLabelTy() const { return getTypeID() == LabelTyID; }
|
bool isLabelTy() const { return getTypeID() == LabelTyID; }
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ public:
|
||||||
/// integer types.
|
/// integer types.
|
||||||
///
|
///
|
||||||
bool isIntOrIntVectorTy() const { return getScalarType()->isIntegerTy(); }
|
bool isIntOrIntVectorTy() const { return getScalarType()->isIntegerTy(); }
|
||||||
|
|
||||||
/// isFunctionTy - True if this is an instance of FunctionType.
|
/// isFunctionTy - True if this is an instance of FunctionType.
|
||||||
///
|
///
|
||||||
bool isFunctionTy() const { return getTypeID() == FunctionTyID; }
|
bool isFunctionTy() const { return getTypeID() == FunctionTyID; }
|
||||||
|
@ -214,7 +214,7 @@ public:
|
||||||
/// pointer types.
|
/// pointer types.
|
||||||
///
|
///
|
||||||
bool isPtrOrPtrVectorTy() const { return getScalarType()->isPointerTy(); }
|
bool isPtrOrPtrVectorTy() const { return getScalarType()->isPointerTy(); }
|
||||||
|
|
||||||
/// isVectorTy - True if this is an instance of VectorType.
|
/// isVectorTy - True if this is an instance of VectorType.
|
||||||
///
|
///
|
||||||
bool isVectorTy() const { return getTypeID() == VectorTyID; }
|
bool isVectorTy() const { return getTypeID() == VectorTyID; }
|
||||||
|
@ -337,19 +337,19 @@ public:
|
||||||
// example) is shorthand for cast<VectorType>(Ty)->getNumElements(). This is
|
// example) is shorthand for cast<VectorType>(Ty)->getNumElements(). This is
|
||||||
// only intended to cover the core methods that are frequently used, helper
|
// only intended to cover the core methods that are frequently used, helper
|
||||||
// methods should not be added here.
|
// methods should not be added here.
|
||||||
|
|
||||||
unsigned getIntegerBitWidth() const;
|
unsigned getIntegerBitWidth() const;
|
||||||
|
|
||||||
Type *getFunctionParamType(unsigned i) const;
|
Type *getFunctionParamType(unsigned i) const;
|
||||||
unsigned getFunctionNumParams() const;
|
unsigned getFunctionNumParams() const;
|
||||||
bool isFunctionVarArg() const;
|
bool isFunctionVarArg() const;
|
||||||
|
|
||||||
StringRef getStructName() const;
|
StringRef getStructName() const;
|
||||||
unsigned getStructNumElements() const;
|
unsigned getStructNumElements() const;
|
||||||
Type *getStructElementType(unsigned N) const;
|
Type *getStructElementType(unsigned N) const;
|
||||||
|
|
||||||
Type *getSequentialElementType() const;
|
Type *getSequentialElementType() const;
|
||||||
|
|
||||||
uint64_t getArrayNumElements() const;
|
uint64_t getArrayNumElements() const;
|
||||||
Type *getArrayElementType() const { return getSequentialElementType(); }
|
Type *getArrayElementType() const { return getSequentialElementType(); }
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ public:
|
||||||
|
|
||||||
/// \brief Get the address space of this pointer or pointer vector type.
|
/// \brief Get the address space of this pointer or pointer vector type.
|
||||||
unsigned getPointerAddressSpace() const;
|
unsigned getPointerAddressSpace() const;
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// Static members exported by the Type class itself. Useful for getting
|
// Static members exported by the Type class itself. Useful for getting
|
||||||
// instances of Type.
|
// instances of Type.
|
||||||
|
@ -390,7 +390,7 @@ public:
|
||||||
static IntegerType *getInt32Ty(LLVMContext &C);
|
static IntegerType *getInt32Ty(LLVMContext &C);
|
||||||
static IntegerType *getInt64Ty(LLVMContext &C);
|
static IntegerType *getInt64Ty(LLVMContext &C);
|
||||||
static IntegerType *getInt128Ty(LLVMContext &C);
|
static IntegerType *getInt128Ty(LLVMContext &C);
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// Convenience methods for getting pointer types with one of the above builtin
|
// Convenience methods for getting pointer types with one of the above builtin
|
||||||
// types as pointee.
|
// types as pointee.
|
||||||
|
@ -433,7 +433,6 @@ template <> struct isa_impl<PointerType, Type> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Provide specializations of GraphTraits to be able to treat a type as a
|
// Provide specializations of GraphTraits to be able to treat a type as a
|
||||||
// graph of sub types.
|
// graph of sub types.
|
||||||
|
@ -476,7 +475,7 @@ inline Type **unwrap(LLVMTypeRef* Tys) {
|
||||||
inline LLVMTypeRef *wrap(Type **Tys) {
|
inline LLVMTypeRef *wrap(Type **Tys) {
|
||||||
return reinterpret_cast<LLVMTypeRef*>(const_cast<Type**>(Tys));
|
return reinterpret_cast<LLVMTypeRef*>(const_cast<Type**>(Tys));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
} // End llvm namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -55,7 +55,6 @@ public:
|
||||||
/// @name Constructors
|
/// @name Constructors
|
||||||
/// @{
|
/// @{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ValueSymbolTable() : vmap(0), LastUnique(0) {}
|
ValueSymbolTable() : vmap(0), LastUnique(0) {}
|
||||||
~ValueSymbolTable();
|
~ValueSymbolTable();
|
||||||
|
|
||||||
|
@ -63,7 +62,6 @@ public:
|
||||||
/// @name Accessors
|
/// @name Accessors
|
||||||
/// @{
|
/// @{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// This method finds the value with the given \p Name in the
|
/// This method finds the value with the given \p Name in the
|
||||||
/// the symbol table.
|
/// the symbol table.
|
||||||
/// @returns the value associated with the \p Name
|
/// @returns the value associated with the \p Name
|
||||||
|
@ -107,12 +105,12 @@ private:
|
||||||
/// If the inserted name conflicts, this renames the value.
|
/// If the inserted name conflicts, this renames the value.
|
||||||
/// @brief Add a named value to the symbol table
|
/// @brief Add a named value to the symbol table
|
||||||
void reinsertValue(Value *V);
|
void reinsertValue(Value *V);
|
||||||
|
|
||||||
/// createValueName - This method attempts to create a value name and insert
|
/// createValueName - This method attempts to create a value name and insert
|
||||||
/// it into the symbol table with the specified name. If it conflicts, it
|
/// it into the symbol table with the specified name. If it conflicts, it
|
||||||
/// auto-renames the name and returns that instead.
|
/// auto-renames the name and returns that instead.
|
||||||
ValueName *createValueName(StringRef Name, Value *V);
|
ValueName *createValueName(StringRef Name, Value *V);
|
||||||
|
|
||||||
/// This method removes a value from the symbol table. It leaves the
|
/// This method removes a value from the symbol table. It leaves the
|
||||||
/// ValueName attached to the value, but it is no longer inserted in the
|
/// ValueName attached to the value, but it is no longer inserted in the
|
||||||
/// symtab.
|
/// symtab.
|
||||||
|
|
|
@ -1644,7 +1644,6 @@ void MachineInstr::print(raw_ostream &OS, ModuleSlotTracker &MST,
|
||||||
FirstOp = false;
|
FirstOp = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (unsigned i = StartOp, e = getNumOperands(); i != e; ++i) {
|
for (unsigned i = StartOp, e = getNumOperands(); i != e; ++i) {
|
||||||
const MachineOperand &MO = getOperand(i);
|
const MachineOperand &MO = getOperand(i);
|
||||||
|
|
||||||
|
|
|
@ -2305,7 +2305,6 @@ unsigned TargetLowering::AsmOperandInfo::getMatchedOperand() const {
|
||||||
return atoi(ConstraintCode.c_str());
|
return atoi(ConstraintCode.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// ParseConstraints - Split up the constraint string from the inline
|
/// ParseConstraints - Split up the constraint string from the inline
|
||||||
/// assembly value into the specific constraints and their prefixes,
|
/// assembly value into the specific constraints and their prefixes,
|
||||||
/// and also tie in the associated operand values.
|
/// and also tie in the associated operand values.
|
||||||
|
@ -2490,14 +2489,12 @@ TargetLowering::ParseConstraints(const DataLayout &DL,
|
||||||
" incompatible type!");
|
" incompatible type!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ConstraintOperands;
|
return ConstraintOperands;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// getConstraintGenerality - Return an integer indicating how general CT
|
/// getConstraintGenerality - Return an integer indicating how general CT
|
||||||
/// is.
|
/// is.
|
||||||
static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) {
|
static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) {
|
||||||
|
|
|
@ -1536,7 +1536,6 @@ TwoAddressInstructionPass::processTiedPairs(MachineInstr *MI,
|
||||||
SrcRegMap[RegA] = RegB;
|
SrcRegMap[RegA] = RegB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (AllUsesCopied) {
|
if (AllUsesCopied) {
|
||||||
if (!IsEarlyClobber) {
|
if (!IsEarlyClobber) {
|
||||||
// Replace other (un-tied) uses of regB with LastCopiedReg.
|
// Replace other (un-tied) uses of regB with LastCopiedReg.
|
||||||
|
|
|
@ -403,7 +403,6 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(Triple T) {
|
||||||
EHSectionFlags |= ELF::SHF_WRITE;
|
EHSectionFlags |= ELF::SHF_WRITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ELF
|
// ELF
|
||||||
BSSSection = Ctx->getELFSection(".bss", ELF::SHT_NOBITS,
|
BSSSection = Ctx->getELFSection(".bss", ELF::SHT_NOBITS,
|
||||||
ELF::SHF_WRITE | ELF::SHF_ALLOC);
|
ELF::SHF_WRITE | ELF::SHF_ALLOC);
|
||||||
|
|
|
@ -78,7 +78,6 @@ uint64_t MachObjectWriter::getSymbolAddress(const MCSymbol &S,
|
||||||
dyn_cast<const MCConstantExpr>(S.getVariableValue()))
|
dyn_cast<const MCConstantExpr>(S.getVariableValue()))
|
||||||
return C->getValue();
|
return C->getValue();
|
||||||
|
|
||||||
|
|
||||||
MCValue Target;
|
MCValue Target;
|
||||||
if (!S.getVariableValue()->evaluateAsRelocatable(Target, &Layout, nullptr))
|
if (!S.getVariableValue()->evaluateAsRelocatable(Target, &Layout, nullptr))
|
||||||
report_fatal_error("unable to evaluate offset for variable '" +
|
report_fatal_error("unable to evaluate offset for variable '" +
|
||||||
|
@ -745,7 +744,7 @@ void MachObjectWriter::writeObject(MCAssembler &Asm,
|
||||||
++NumLoadCommands;
|
++NumLoadCommands;
|
||||||
LoadCommandsSize += ComputeLinkerOptionsLoadCommandSize(Option, is64Bit());
|
LoadCommandsSize += ComputeLinkerOptionsLoadCommandSize(Option, is64Bit());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute the total size of the section data, as well as its file size and vm
|
// Compute the total size of the section data, as well as its file size and vm
|
||||||
// size.
|
// size.
|
||||||
uint64_t SectionDataStart = (is64Bit() ? sizeof(MachO::mach_header_64) :
|
uint64_t SectionDataStart = (is64Bit() ? sizeof(MachO::mach_header_64) :
|
||||||
|
|
|
@ -1386,7 +1386,6 @@ iterator_range<export_iterator> MachOObjectFile::exports() const {
|
||||||
return exports(getDyldInfoExportsTrie());
|
return exports(getDyldInfoExportsTrie());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MachORebaseEntry::MachORebaseEntry(ArrayRef<uint8_t> Bytes, bool is64Bit)
|
MachORebaseEntry::MachORebaseEntry(ArrayRef<uint8_t> Bytes, bool is64Bit)
|
||||||
: Opcodes(Bytes), Ptr(Bytes.begin()), SegmentOffset(0), SegmentIndex(0),
|
: Opcodes(Bytes), Ptr(Bytes.begin()), SegmentOffset(0), SegmentIndex(0),
|
||||||
RemainingLoopCount(0), AdvanceAmount(0), RebaseType(0),
|
RemainingLoopCount(0), AdvanceAmount(0), RebaseType(0),
|
||||||
|
@ -1762,7 +1761,6 @@ int64_t MachOBindEntry::readSLEB128() {
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32_t MachOBindEntry::segmentIndex() const { return SegmentIndex; }
|
uint32_t MachOBindEntry::segmentIndex() const { return SegmentIndex; }
|
||||||
|
|
||||||
uint64_t MachOBindEntry::segmentOffset() const { return SegmentOffset; }
|
uint64_t MachOBindEntry::segmentOffset() const { return SegmentOffset; }
|
||||||
|
@ -2308,4 +2306,3 @@ ObjectFile::createMachOObjectFile(MemoryBufferRef Buffer) {
|
||||||
return EC;
|
return EC;
|
||||||
return std::move(Ret);
|
return std::move(Ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool classof(const AArch64MCExpr *) { return true; }
|
static bool classof(const AArch64MCExpr *) { return true; }
|
||||||
|
|
||||||
};
|
};
|
||||||
} // end namespace llvm
|
} // end namespace llvm
|
||||||
|
|
||||||
|
|
|
@ -499,7 +499,6 @@ void AMDGPUAsmPrinter::EmitAmdKernelCodeT(const MachineFunction &MF,
|
||||||
header.wavefront_sgpr_count = KernelInfo.NumSGPR;
|
header.wavefront_sgpr_count = KernelInfo.NumSGPR;
|
||||||
header.workitem_vgpr_count = KernelInfo.NumVGPR;
|
header.workitem_vgpr_count = KernelInfo.NumVGPR;
|
||||||
|
|
||||||
|
|
||||||
AMDGPUTargetStreamer *TS =
|
AMDGPUTargetStreamer *TS =
|
||||||
static_cast<AMDGPUTargetStreamer *>(OutStreamer->getTargetStreamer());
|
static_cast<AMDGPUTargetStreamer *>(OutStreamer->getTargetStreamer());
|
||||||
TS->EmitAMDKernelCodeT(header);
|
TS->EmitAMDKernelCodeT(header);
|
||||||
|
|
|
@ -40,6 +40,7 @@ class AMDGPUDAGToDAGISel : public SelectionDAGISel {
|
||||||
// Subtarget - Keep a pointer to the AMDGPU Subtarget around so that we can
|
// Subtarget - Keep a pointer to the AMDGPU Subtarget around so that we can
|
||||||
// make the right decision when generating code for different targets.
|
// make the right decision when generating code for different targets.
|
||||||
const AMDGPUSubtarget *Subtarget;
|
const AMDGPUSubtarget *Subtarget;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AMDGPUDAGToDAGISel(TargetMachine &TM);
|
AMDGPUDAGToDAGISel(TargetMachine &TM);
|
||||||
virtual ~AMDGPUDAGToDAGISel();
|
virtual ~AMDGPUDAGToDAGISel();
|
||||||
|
@ -585,7 +586,6 @@ SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) {
|
||||||
|
|
||||||
return getS_BFE(Signed ? AMDGPU::S_BFE_I32 : AMDGPU::S_BFE_U32, SDLoc(N),
|
return getS_BFE(Signed ? AMDGPU::S_BFE_I32 : AMDGPU::S_BFE_U32, SDLoc(N),
|
||||||
N->getOperand(0), OffsetVal, WidthVal);
|
N->getOperand(0), OffsetVal, WidthVal);
|
||||||
|
|
||||||
}
|
}
|
||||||
case AMDGPUISD::DIV_SCALE: {
|
case AMDGPUISD::DIV_SCALE: {
|
||||||
return SelectDIV_SCALE(N);
|
return SelectDIV_SCALE(N);
|
||||||
|
@ -611,7 +611,6 @@ SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) {
|
||||||
return SelectCode(N);
|
return SelectCode(N);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool AMDGPUDAGToDAGISel::checkType(const Value *Ptr, unsigned AS) {
|
bool AMDGPUDAGToDAGISel::checkType(const Value *Ptr, unsigned AS) {
|
||||||
assert(AS != 0 && "Use checkPrivateAddress instead.");
|
assert(AS != 0 && "Use checkPrivateAddress instead.");
|
||||||
if (!Ptr)
|
if (!Ptr)
|
||||||
|
@ -1082,7 +1081,6 @@ void AMDGPUDAGToDAGISel::SelectMUBUF(SDValue Addr, SDValue &Ptr,
|
||||||
VAddr = CurDAG->getTargetConstant(0, DL, MVT::i32);
|
VAddr = CurDAG->getTargetConstant(0, DL, MVT::i32);
|
||||||
Ptr = Addr;
|
Ptr = Addr;
|
||||||
Offset = CurDAG->getTargetConstant(0, DL, MVT::i16);
|
Offset = CurDAG->getTargetConstant(0, DL, MVT::i16);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AMDGPUDAGToDAGISel::SelectMUBUFAddr64(SDValue Addr, SDValue &SRsrc,
|
bool AMDGPUDAGToDAGISel::SelectMUBUFAddr64(SDValue Addr, SDValue &SRsrc,
|
||||||
|
@ -1367,7 +1365,6 @@ SDNode *AMDGPUDAGToDAGISel::SelectAddrSpaceCast(SDNode *N) {
|
||||||
CurDAG->getTargetConstant(AMDGPU::sub0, DL, MVT::i32));
|
CurDAG->getTargetConstant(AMDGPU::sub0, DL, MVT::i32));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (DestSize > SrcSize) {
|
if (DestSize > SrcSize) {
|
||||||
assert(SrcSize == 32 && DestSize == 64);
|
assert(SrcSize == 32 && DestSize == 64);
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@ class R600MCCodeEmitter : public AMDGPUMCCodeEmitter {
|
||||||
const MCRegisterInfo &MRI;
|
const MCRegisterInfo &MRI;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
R600MCCodeEmitter(const MCInstrInfo &mcii, const MCRegisterInfo &mri)
|
R600MCCodeEmitter(const MCInstrInfo &mcii, const MCRegisterInfo &mri)
|
||||||
: MCII(mcii), MRI(mri) { }
|
: MCII(mcii), MRI(mri) { }
|
||||||
|
|
||||||
|
@ -50,8 +49,8 @@ public:
|
||||||
uint64_t getMachineOpValue(const MCInst &MI, const MCOperand &MO,
|
uint64_t getMachineOpValue(const MCInst &MI, const MCOperand &MO,
|
||||||
SmallVectorImpl<MCFixup> &Fixups,
|
SmallVectorImpl<MCFixup> &Fixups,
|
||||||
const MCSubtargetInfo &STI) const override;
|
const MCSubtargetInfo &STI) const override;
|
||||||
private:
|
|
||||||
|
|
||||||
|
private:
|
||||||
void EmitByte(unsigned int byte, raw_ostream &OS) const;
|
void EmitByte(unsigned int byte, raw_ostream &OS) const;
|
||||||
|
|
||||||
void Emit(uint32_t value, raw_ostream &OS) const;
|
void Emit(uint32_t value, raw_ostream &OS) const;
|
||||||
|
@ -59,7 +58,6 @@ private:
|
||||||
|
|
||||||
unsigned getHWRegChan(unsigned reg) const;
|
unsigned getHWRegChan(unsigned reg) const;
|
||||||
unsigned getHWReg(unsigned regNo) const;
|
unsigned getHWReg(unsigned regNo) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End anonymous namespace
|
} // End anonymous namespace
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
|
||||||
#include "SIRegisterInfo.h"
|
#include "SIRegisterInfo.h"
|
||||||
#include "SIInstrInfo.h"
|
#include "SIInstrInfo.h"
|
||||||
#include "SIMachineFunctionInfo.h"
|
#include "SIMachineFunctionInfo.h"
|
||||||
|
|
|
@ -232,7 +232,6 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Adjust FP so it point to the stack slot that contains the previous FP.
|
// Adjust FP so it point to the stack slot that contains the previous FP.
|
||||||
if (HasFP) {
|
if (HasFP) {
|
||||||
FramePtrOffsetInBlock += MFI->getObjectOffset(FramePtrSpillFI)
|
FramePtrOffsetInBlock += MFI->getObjectOffset(FramePtrSpillFI)
|
||||||
|
|
|
@ -158,7 +158,7 @@ static const char *stripRegisterPrefix(const char *RegName) {
|
||||||
return RegName + 1;
|
return RegName + 1;
|
||||||
case 'c': if (RegName[1] == 'r') return RegName + 2;
|
case 'c': if (RegName[1] == 'r') return RegName + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return RegName;
|
return RegName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ void PPCAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
raw_ostream &O) {
|
raw_ostream &O) {
|
||||||
const DataLayout &DL = getDataLayout();
|
const DataLayout &DL = getDataLayout();
|
||||||
const MachineOperand &MO = MI->getOperand(OpNo);
|
const MachineOperand &MO = MI->getOperand(OpNo);
|
||||||
|
|
||||||
switch (MO.getType()) {
|
switch (MO.getType()) {
|
||||||
case MachineOperand::MO_Register: {
|
case MachineOperand::MO_Register: {
|
||||||
const char *RegName = PPCInstPrinter::getRegisterName(MO.getReg());
|
const char *RegName = PPCInstPrinter::getRegisterName(MO.getReg());
|
||||||
|
@ -316,7 +316,6 @@ bool PPCAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// lookUpOrCreateTOCEntry -- Given a symbol, look up whether a TOC entry
|
/// lookUpOrCreateTOCEntry -- Given a symbol, look up whether a TOC entry
|
||||||
/// exists for it. If not, create one. Then return a symbol that references
|
/// exists for it. If not, create one. Then return a symbol that references
|
||||||
/// the TOC entry.
|
/// the TOC entry.
|
||||||
|
@ -403,7 +402,6 @@ void PPCAsmPrinter::LowerPATCHPOINT(MCStreamer &OutStreamer, StackMaps &SM,
|
||||||
.addReg(PPC::X1));
|
.addReg(PPC::X1));
|
||||||
++EncodedBytes;
|
++EncodedBytes;
|
||||||
|
|
||||||
|
|
||||||
// If we're on ELFv1, then we need to load the actual function pointer
|
// If we're on ELFv1, then we need to load the actual function pointer
|
||||||
// from the function descriptor.
|
// from the function descriptor.
|
||||||
if (!Subtarget->isELFv2ABI()) {
|
if (!Subtarget->isELFv2ABI()) {
|
||||||
|
@ -500,7 +498,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||||
bool isDarwin = TM.getTargetTriple().isOSDarwin();
|
bool isDarwin = TM.getTargetTriple().isOSDarwin();
|
||||||
const Module *M = MF->getFunction()->getParent();
|
const Module *M = MF->getFunction()->getParent();
|
||||||
PICLevel::Level PL = M->getPICLevel();
|
PICLevel::Level PL = M->getPICLevel();
|
||||||
|
|
||||||
// Lower multi-instruction pseudo operations.
|
// Lower multi-instruction pseudo operations.
|
||||||
switch (MI->getOpcode()) {
|
switch (MI->getOpcode()) {
|
||||||
default: break;
|
default: break;
|
||||||
|
@ -538,7 +536,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||||
// bl L1$pb
|
// bl L1$pb
|
||||||
// L1$pb:
|
// L1$pb:
|
||||||
MCSymbol *PICBase = MF->getPICBaseSymbol();
|
MCSymbol *PICBase = MF->getPICBaseSymbol();
|
||||||
|
|
||||||
// Emit the 'bl'.
|
// Emit the 'bl'.
|
||||||
EmitToStreamer(*OutStreamer,
|
EmitToStreamer(*OutStreamer,
|
||||||
MCInstBuilder(PPC::BL)
|
MCInstBuilder(PPC::BL)
|
||||||
|
@ -656,7 +654,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||||
EmitToStreamer(*OutStreamer, TmpInst);
|
EmitToStreamer(*OutStreamer, TmpInst);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PPC::ADDIStocHA: {
|
case PPC::ADDIStocHA: {
|
||||||
// Transform %Xd = ADDIStocHA %X2, <ga:@sym>
|
// Transform %Xd = ADDIStocHA %X2, <ga:@sym>
|
||||||
LowerPPCMachineInstrToMCInst(MI, TmpInst, *this, isDarwin);
|
LowerPPCMachineInstrToMCInst(MI, TmpInst, *this, isDarwin);
|
||||||
|
@ -1131,7 +1129,6 @@ void PPCLinuxAsmPrinter::EmitFunctionEntryLabel() {
|
||||||
OutStreamer->SwitchSection(Current.first, Current.second);
|
OutStreamer->SwitchSection(Current.first, Current.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PPCLinuxAsmPrinter::doFinalization(Module &M) {
|
bool PPCLinuxAsmPrinter::doFinalization(Module &M) {
|
||||||
const DataLayout &DL = getDataLayout();
|
const DataLayout &DL = getDataLayout();
|
||||||
|
|
||||||
|
@ -1354,12 +1351,12 @@ EmitFunctionStubs(const MachineModuleInfoMachO::SymbolListTy &Stubs) {
|
||||||
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
||||||
OutStreamer->SwitchSection(StubSection);
|
OutStreamer->SwitchSection(StubSection);
|
||||||
EmitAlignment(4);
|
EmitAlignment(4);
|
||||||
|
|
||||||
MCSymbol *Stub = Stubs[i].first;
|
MCSymbol *Stub = Stubs[i].first;
|
||||||
MCSymbol *RawSym = Stubs[i].second.getPointer();
|
MCSymbol *RawSym = Stubs[i].second.getPointer();
|
||||||
MCSymbol *LazyPtr = GetLazyPtr(Stub, OutContext);
|
MCSymbol *LazyPtr = GetLazyPtr(Stub, OutContext);
|
||||||
MCSymbol *AnonSymbol = GetAnonSym(Stub, OutContext);
|
MCSymbol *AnonSymbol = GetAnonSym(Stub, OutContext);
|
||||||
|
|
||||||
OutStreamer->EmitLabel(Stub);
|
OutStreamer->EmitLabel(Stub);
|
||||||
OutStreamer->EmitSymbolAttribute(RawSym, MCSA_IndirectSymbol);
|
OutStreamer->EmitSymbolAttribute(RawSym, MCSA_IndirectSymbol);
|
||||||
|
|
||||||
|
@ -1464,11 +1461,10 @@ EmitFunctionStubs(const MachineModuleInfoMachO::SymbolListTy &Stubs) {
|
||||||
OutStreamer->EmitSymbolValue(DyldStubBindingHelper, 4);
|
OutStreamer->EmitSymbolValue(DyldStubBindingHelper, 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OutStreamer->AddBlankLine();
|
OutStreamer->AddBlankLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PPCDarwinAsmPrinter::doFinalization(Module &M) {
|
bool PPCDarwinAsmPrinter::doFinalization(Module &M) {
|
||||||
bool isPPC64 = getDataLayout().getPointerSizeInBits() == 64;
|
bool isPPC64 = getDataLayout().getPointerSizeInBits() == 64;
|
||||||
|
|
||||||
|
@ -1499,13 +1495,13 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) {
|
||||||
|
|
||||||
// Output stubs for dynamically-linked functions.
|
// Output stubs for dynamically-linked functions.
|
||||||
Stubs = MMIMacho.GetGVStubList();
|
Stubs = MMIMacho.GetGVStubList();
|
||||||
|
|
||||||
// Output macho stubs for external and common global variables.
|
// Output macho stubs for external and common global variables.
|
||||||
if (!Stubs.empty()) {
|
if (!Stubs.empty()) {
|
||||||
// Switch with ".non_lazy_symbol_pointer" directive.
|
// Switch with ".non_lazy_symbol_pointer" directive.
|
||||||
OutStreamer->SwitchSection(TLOFMacho.getNonLazySymbolPointerSection());
|
OutStreamer->SwitchSection(TLOFMacho.getNonLazySymbolPointerSection());
|
||||||
EmitAlignment(isPPC64 ? 3 : 2);
|
EmitAlignment(isPPC64 ? 3 : 2);
|
||||||
|
|
||||||
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
||||||
// L_foo$stub:
|
// L_foo$stub:
|
||||||
OutStreamer->EmitLabel(Stubs[i].first);
|
OutStreamer->EmitLabel(Stubs[i].first);
|
||||||
|
@ -1536,7 +1532,7 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) {
|
||||||
if (!Stubs.empty()) {
|
if (!Stubs.empty()) {
|
||||||
OutStreamer->SwitchSection(getObjFileLowering().getDataSection());
|
OutStreamer->SwitchSection(getObjFileLowering().getDataSection());
|
||||||
EmitAlignment(isPPC64 ? 3 : 2);
|
EmitAlignment(isPPC64 ? 3 : 2);
|
||||||
|
|
||||||
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
|
||||||
// L_foo$stub:
|
// L_foo$stub:
|
||||||
OutStreamer->EmitLabel(Stubs[i].first);
|
OutStreamer->EmitLabel(Stubs[i].first);
|
||||||
|
|
|
@ -361,7 +361,7 @@ bool PPCCTRLoops::mightUseCTR(const Triple &TT, BasicBlock *BB) {
|
||||||
true);
|
true);
|
||||||
if (VTy == MVT::Other)
|
if (VTy == MVT::Other)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (TLI->isOperationLegalOrCustom(Opcode, VTy))
|
if (TLI->isOperationLegalOrCustom(Opcode, VTy))
|
||||||
continue;
|
continue;
|
||||||
else if (VTy.isVector() &&
|
else if (VTy.isVector() &&
|
||||||
|
@ -685,4 +685,3 @@ bool PPCCTRLoopsVerify::runOnMachineFunction(MachineFunction &MF) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif // NDEBUG
|
#endif // NDEBUG
|
||||||
|
|
||||||
|
|
|
@ -523,7 +523,7 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
|
||||||
setOperationAction(ISD::MUL, MVT::v4i32, Legal);
|
setOperationAction(ISD::MUL, MVT::v4i32, Legal);
|
||||||
else
|
else
|
||||||
setOperationAction(ISD::MUL, MVT::v4i32, Custom);
|
setOperationAction(ISD::MUL, MVT::v4i32, Custom);
|
||||||
|
|
||||||
setOperationAction(ISD::MUL, MVT::v8i16, Custom);
|
setOperationAction(ISD::MUL, MVT::v8i16, Custom);
|
||||||
setOperationAction(ISD::MUL, MVT::v16i8, Custom);
|
setOperationAction(ISD::MUL, MVT::v16i8, Custom);
|
||||||
|
|
||||||
|
@ -1637,7 +1637,6 @@ static bool isIntS16Immediate(SDValue Op, short &Imm) {
|
||||||
return isIntS16Immediate(Op.getNode(), Imm);
|
return isIntS16Immediate(Op.getNode(), Imm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// SelectAddressRegReg - Given the specified addressed, check to see if it
|
/// SelectAddressRegReg - Given the specified addressed, check to see if it
|
||||||
/// can be represented as an indexed [r+r] operation. Returns false if it
|
/// can be represented as an indexed [r+r] operation. Returns false if it
|
||||||
/// can be more efficiently represented with [r+imm].
|
/// can be more efficiently represented with [r+imm].
|
||||||
|
@ -2491,7 +2490,6 @@ SDValue PPCTargetLowering::LowerVASTART(SDValue Op, SelectionDAG &DAG,
|
||||||
// */
|
// */
|
||||||
// } va_list[1];
|
// } va_list[1];
|
||||||
|
|
||||||
|
|
||||||
SDValue ArgGPR = DAG.getConstant(FuncInfo->getVarArgsNumGPR(), dl, MVT::i32);
|
SDValue ArgGPR = DAG.getConstant(FuncInfo->getVarArgsNumGPR(), dl, MVT::i32);
|
||||||
SDValue ArgFPR = DAG.getConstant(FuncInfo->getVarArgsNumFPR(), dl, MVT::i32);
|
SDValue ArgFPR = DAG.getConstant(FuncInfo->getVarArgsNumFPR(), dl, MVT::i32);
|
||||||
|
|
||||||
|
@ -3891,7 +3889,6 @@ struct TailCallArgumentInfo {
|
||||||
|
|
||||||
TailCallArgumentInfo() : FrameIdx(0) {}
|
TailCallArgumentInfo() : FrameIdx(0) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// StoreTailCallArgumentsToStackSlot - Stores arguments to their stack slot.
|
/// StoreTailCallArgumentsToStackSlot - Stores arguments to their stack slot.
|
||||||
|
@ -5999,7 +5996,7 @@ SDValue PPCTargetLowering::LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const {
|
||||||
SDNodeFlags Flags;
|
SDNodeFlags Flags;
|
||||||
Flags.setNoInfs(true);
|
Flags.setNoInfs(true);
|
||||||
Flags.setNoNaNs(true);
|
Flags.setNoNaNs(true);
|
||||||
|
|
||||||
ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(4))->get();
|
ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(4))->get();
|
||||||
|
|
||||||
EVT ResVT = Op.getValueType();
|
EVT ResVT = Op.getValueType();
|
||||||
|
@ -6308,7 +6305,7 @@ SDValue PPCTargetLowering::LowerINT_TO_FP(SDValue Op,
|
||||||
// into 0 (false) and 1 (true), add 1 and then divide by 2 (multiply by 0.5).
|
// into 0 (false) and 1 (true), add 1 and then divide by 2 (multiply by 0.5).
|
||||||
// This can be done with an fma and the 0.5 constant: (V+1.0)*0.5 = 0.5*V+0.5
|
// This can be done with an fma and the 0.5 constant: (V+1.0)*0.5 = 0.5*V+0.5
|
||||||
Value = DAG.getNode(PPCISD::QBFLT, dl, MVT::v4f64, Value);
|
Value = DAG.getNode(PPCISD::QBFLT, dl, MVT::v4f64, Value);
|
||||||
|
|
||||||
SDValue FPHalfs = DAG.getConstantFP(0.5, dl, MVT::f64);
|
SDValue FPHalfs = DAG.getConstantFP(0.5, dl, MVT::f64);
|
||||||
FPHalfs = DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v4f64, FPHalfs, FPHalfs,
|
FPHalfs = DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v4f64, FPHalfs, FPHalfs,
|
||||||
FPHalfs, FPHalfs);
|
FPHalfs, FPHalfs);
|
||||||
|
@ -6757,7 +6754,6 @@ static SDValue BuildIntrinsicOp(unsigned IID, SDValue Op0, SDValue Op1,
|
||||||
DAG.getConstant(IID, dl, MVT::i32), Op0, Op1, Op2);
|
DAG.getConstant(IID, dl, MVT::i32), Op0, Op1, Op2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// BuildVSLDOI - Return a VECTOR_SHUFFLE that is a vsldoi of the specified
|
/// BuildVSLDOI - Return a VECTOR_SHUFFLE that is a vsldoi of the specified
|
||||||
/// amount. The result has the specified value type.
|
/// amount. The result has the specified value type.
|
||||||
static SDValue BuildVSLDOI(SDValue LHS, SDValue RHS, unsigned Amt,
|
static SDValue BuildVSLDOI(SDValue LHS, SDValue RHS, unsigned Amt,
|
||||||
|
@ -6938,7 +6934,6 @@ SDValue PPCTargetLowering::LowerBUILD_VECTOR(SDValue Op,
|
||||||
if (SextVal >= -16 && SextVal <= 15)
|
if (SextVal >= -16 && SextVal <= 15)
|
||||||
return BuildSplatI(SextVal, SplatSize, Op.getValueType(), DAG, dl);
|
return BuildSplatI(SextVal, SplatSize, Op.getValueType(), DAG, dl);
|
||||||
|
|
||||||
|
|
||||||
// Two instruction sequences.
|
// Two instruction sequences.
|
||||||
|
|
||||||
// If this value is in the range [-32,30] and is even, use:
|
// If this value is in the range [-32,30] and is even, use:
|
||||||
|
@ -8038,7 +8033,6 @@ void PPCTargetLowering::ReplaceNodeResults(SDNode *N,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Other Lowering Code
|
// Other Lowering Code
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -9377,7 +9371,7 @@ static bool findConsecutiveLoad(LoadSDNode *LD, SelectionDAG &DAG) {
|
||||||
for (SmallSet<SDNode *, 16>::iterator I = LoadRoots.begin(),
|
for (SmallSet<SDNode *, 16>::iterator I = LoadRoots.begin(),
|
||||||
IE = LoadRoots.end(); I != IE; ++I) {
|
IE = LoadRoots.end(); I != IE; ++I) {
|
||||||
Queue.push_back(*I);
|
Queue.push_back(*I);
|
||||||
|
|
||||||
while (!Queue.empty()) {
|
while (!Queue.empty()) {
|
||||||
SDNode *LoadRoot = Queue.pop_back_val();
|
SDNode *LoadRoot = Queue.pop_back_val();
|
||||||
if (!Visited.insert(LoadRoot).second)
|
if (!Visited.insert(LoadRoot).second)
|
||||||
|
@ -10563,7 +10557,7 @@ SDValue PPCTargetLowering::PerformDAGCombine(SDNode *N,
|
||||||
case ISD::BRCOND: {
|
case ISD::BRCOND: {
|
||||||
SDValue Cond = N->getOperand(1);
|
SDValue Cond = N->getOperand(1);
|
||||||
SDValue Target = N->getOperand(2);
|
SDValue Target = N->getOperand(2);
|
||||||
|
|
||||||
if (Cond.getOpcode() == ISD::INTRINSIC_W_CHAIN &&
|
if (Cond.getOpcode() == ISD::INTRINSIC_W_CHAIN &&
|
||||||
cast<ConstantSDNode>(Cond.getOperand(1))->getZExtValue() ==
|
cast<ConstantSDNode>(Cond.getOperand(1))->getZExtValue() ==
|
||||||
Intrinsic::ppc_is_decremented_ctr_nonzero) {
|
Intrinsic::ppc_is_decremented_ctr_nonzero) {
|
||||||
|
@ -10944,7 +10938,6 @@ PPCTargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
|
||||||
return R;
|
return R;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
|
/// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
|
||||||
/// vector. If it is invalid, don't add anything to Ops.
|
/// vector. If it is invalid, don't add anything to Ops.
|
||||||
void PPCTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
void PPCTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
||||||
|
|
|
@ -200,7 +200,7 @@ BitVector PPCRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
|
||||||
Reserved.set(PPC::R2); // System-reserved register
|
Reserved.set(PPC::R2); // System-reserved register
|
||||||
Reserved.set(PPC::R13); // Small Data Area pointer register
|
Reserved.set(PPC::R13); // Small Data Area pointer register
|
||||||
}
|
}
|
||||||
|
|
||||||
// On PPC64, r13 is the thread pointer. Never allocate this register.
|
// On PPC64, r13 is the thread pointer. Never allocate this register.
|
||||||
if (TM.isPPC64()) {
|
if (TM.isPPC64()) {
|
||||||
Reserved.set(PPC::R13);
|
Reserved.set(PPC::R13);
|
||||||
|
@ -337,7 +337,7 @@ void PPCRegisterInfo::lowerDynamicAlloc(MachineBasicBlock::iterator II) const {
|
||||||
unsigned maxCallFrameSize = MFI->getMaxCallFrameSize();
|
unsigned maxCallFrameSize = MFI->getMaxCallFrameSize();
|
||||||
// Get the total frame size.
|
// Get the total frame size.
|
||||||
unsigned FrameSize = MFI->getStackSize();
|
unsigned FrameSize = MFI->getStackSize();
|
||||||
|
|
||||||
// Get stack alignments.
|
// Get stack alignments.
|
||||||
const PPCFrameLowering *TFI = getFrameLowering(MF);
|
const PPCFrameLowering *TFI = getFrameLowering(MF);
|
||||||
unsigned TargetAlign = TFI->getStackAlignment();
|
unsigned TargetAlign = TFI->getStackAlignment();
|
||||||
|
@ -354,7 +354,7 @@ void PPCRegisterInfo::lowerDynamicAlloc(MachineBasicBlock::iterator II) const {
|
||||||
const TargetRegisterClass *G8RC = &PPC::G8RCRegClass;
|
const TargetRegisterClass *G8RC = &PPC::G8RCRegClass;
|
||||||
const TargetRegisterClass *GPRC = &PPC::GPRCRegClass;
|
const TargetRegisterClass *GPRC = &PPC::GPRCRegClass;
|
||||||
unsigned Reg = MF.getRegInfo().createVirtualRegister(LP64 ? G8RC : GPRC);
|
unsigned Reg = MF.getRegInfo().createVirtualRegister(LP64 ? G8RC : GPRC);
|
||||||
|
|
||||||
if (MaxAlign < TargetAlign && isInt<16>(FrameSize)) {
|
if (MaxAlign < TargetAlign && isInt<16>(FrameSize)) {
|
||||||
BuildMI(MBB, II, dl, TII.get(PPC::ADDI), Reg)
|
BuildMI(MBB, II, dl, TII.get(PPC::ADDI), Reg)
|
||||||
.addReg(PPC::R31)
|
.addReg(PPC::R31)
|
||||||
|
@ -425,7 +425,7 @@ void PPCRegisterInfo::lowerDynamicAlloc(MachineBasicBlock::iterator II) const {
|
||||||
.addReg(PPC::R1)
|
.addReg(PPC::R1)
|
||||||
.addImm(maxCallFrameSize);
|
.addImm(maxCallFrameSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Discard the DYNALLOC instruction.
|
// Discard the DYNALLOC instruction.
|
||||||
MBB.erase(II);
|
MBB.erase(II);
|
||||||
}
|
}
|
||||||
|
@ -754,7 +754,7 @@ PPCRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
||||||
int FPSI = FI->getFramePointerSaveIndex();
|
int FPSI = FI->getFramePointerSaveIndex();
|
||||||
// Get the instruction opcode.
|
// Get the instruction opcode.
|
||||||
unsigned OpC = MI.getOpcode();
|
unsigned OpC = MI.getOpcode();
|
||||||
|
|
||||||
// Special case for dynamic alloca.
|
// Special case for dynamic alloca.
|
||||||
if (FPSI && FrameIndex == FPSI &&
|
if (FPSI && FrameIndex == FPSI &&
|
||||||
(OpC == PPC::DYNALLOC || OpC == PPC::DYNALLOC8)) {
|
(OpC == PPC::DYNALLOC || OpC == PPC::DYNALLOC8)) {
|
||||||
|
|
|
@ -54,13 +54,13 @@ inline static unsigned getCRFromCRBit(unsigned SrcReg) {
|
||||||
return Reg;
|
return Reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class PPCRegisterInfo : public PPCGenRegisterInfo {
|
class PPCRegisterInfo : public PPCGenRegisterInfo {
|
||||||
DenseMap<unsigned, unsigned> ImmToIdxMap;
|
DenseMap<unsigned, unsigned> ImmToIdxMap;
|
||||||
const PPCTargetMachine &TM;
|
const PPCTargetMachine &TM;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PPCRegisterInfo(const PPCTargetMachine &TM);
|
PPCRegisterInfo(const PPCTargetMachine &TM);
|
||||||
|
|
||||||
/// getPointerRegClass - Return the register class to use to hold pointers.
|
/// getPointerRegClass - Return the register class to use to hold pointers.
|
||||||
/// This is used for addressing modes.
|
/// This is used for addressing modes.
|
||||||
const TargetRegisterClass *
|
const TargetRegisterClass *
|
||||||
|
|
|
@ -61,6 +61,7 @@ class X86AsmParser : public MCTargetAsmParser {
|
||||||
const MCInstrInfo &MII;
|
const MCInstrInfo &MII;
|
||||||
ParseInstructionInfo *InstInfo;
|
ParseInstructionInfo *InstInfo;
|
||||||
std::unique_ptr<X86AsmInstrumentation> Instrumentation;
|
std::unique_ptr<X86AsmInstrumentation> Instrumentation;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SMLoc consumeToken() {
|
SMLoc consumeToken() {
|
||||||
MCAsmParser &Parser = getParser();
|
MCAsmParser &Parser = getParser();
|
||||||
|
@ -269,6 +270,7 @@ private:
|
||||||
bool StopOnLBrac, AddImmPrefix;
|
bool StopOnLBrac, AddImmPrefix;
|
||||||
InfixCalculator IC;
|
InfixCalculator IC;
|
||||||
InlineAsmIdentifierInfo Info;
|
InlineAsmIdentifierInfo Info;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IntelExprStateMachine(int64_t imm, bool stoponlbrac, bool addimmprefix) :
|
IntelExprStateMachine(int64_t imm, bool stoponlbrac, bool addimmprefix) :
|
||||||
State(IES_PLUS), PrevState(IES_ERROR), BaseReg(0), IndexReg(0), TmpReg(0),
|
State(IES_PLUS), PrevState(IES_ERROR), BaseReg(0), IndexReg(0), TmpReg(0),
|
||||||
|
@ -775,7 +777,7 @@ private:
|
||||||
unsigned FB = ComputeAvailableFeatures(
|
unsigned FB = ComputeAvailableFeatures(
|
||||||
STI.ToggleFeature(OldMode.flip(mode)));
|
STI.ToggleFeature(OldMode.flip(mode)));
|
||||||
setAvailableFeatures(FB);
|
setAvailableFeatures(FB);
|
||||||
|
|
||||||
assert(FeatureBitset({mode}) == (STI.getFeatureBits() & AllModes));
|
assert(FeatureBitset({mode}) == (STI.getFeatureBits() & AllModes));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2185,7 +2187,6 @@ bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
||||||
Name == "repne" || Name == "repnz" ||
|
Name == "repne" || Name == "repnz" ||
|
||||||
Name == "rex64" || Name == "data16";
|
Name == "rex64" || Name == "data16";
|
||||||
|
|
||||||
|
|
||||||
// This does the actual operand parsing. Don't parse any more if we have a
|
// This does the actual operand parsing. Don't parse any more if we have a
|
||||||
// prefix juxtaposed with an operation like "lock incl 4(%rax)", because we
|
// prefix juxtaposed with an operation like "lock incl 4(%rax)", because we
|
||||||
// just want to parse the "lock" as the first instruction and the "incl" as
|
// just want to parse the "lock" as the first instruction and the "incl" as
|
||||||
|
|
|
@ -1279,7 +1279,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
|
||||||
if (Subtarget->hasInt256())
|
if (Subtarget->hasInt256())
|
||||||
setOperationAction(ISD::VSELECT, MVT::v32i8, Legal);
|
setOperationAction(ISD::VSELECT, MVT::v32i8, Legal);
|
||||||
|
|
||||||
|
|
||||||
// Promote v32i8, v16i16, v8i32 select, and, or, xor to v4i64.
|
// Promote v32i8, v16i16, v8i32 select, and, or, xor to v4i64.
|
||||||
for (int i = MVT::v32i8; i != MVT::v4i64; ++i) {
|
for (int i = MVT::v32i8; i != MVT::v4i64; ++i) {
|
||||||
MVT VT = (MVT::SimpleValueType)i;
|
MVT VT = (MVT::SimpleValueType)i;
|
||||||
|
@ -1717,7 +1716,6 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
|
||||||
setOperationAction(ISD::UMULO, VT, Custom);
|
setOperationAction(ISD::UMULO, VT, Custom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!Subtarget->is64Bit()) {
|
if (!Subtarget->is64Bit()) {
|
||||||
// These libcalls are not available in 32-bit.
|
// These libcalls are not available in 32-bit.
|
||||||
setLibcallName(RTLIB::SHL_I128, nullptr);
|
setLibcallName(RTLIB::SHL_I128, nullptr);
|
||||||
|
@ -6472,7 +6470,6 @@ static SDValue LowerCONCAT_VECTORS(SDValue Op,
|
||||||
return LowerAVXCONCAT_VECTORS(Op, DAG);
|
return LowerAVXCONCAT_VECTORS(Op, DAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Vector shuffle lowering
|
// Vector shuffle lowering
|
||||||
//
|
//
|
||||||
|
@ -24860,7 +24857,6 @@ static SDValue PerformMLOADCombine(SDNode *N, SelectionDAG &DAG,
|
||||||
ISD::NON_EXTLOAD);
|
ISD::NON_EXTLOAD);
|
||||||
SDValue NewVec = DAG.getNode(X86ISD::VSEXT, dl, VT, WideLd);
|
SDValue NewVec = DAG.getNode(X86ISD::VSEXT, dl, VT, WideLd);
|
||||||
return DCI.CombineTo(N, NewVec, WideLd.getValue(1), true);
|
return DCI.CombineTo(N, NewVec, WideLd.getValue(1), true);
|
||||||
|
|
||||||
}
|
}
|
||||||
/// PerformMSTORECombine - Resolve truncating stores
|
/// PerformMSTORECombine - Resolve truncating stores
|
||||||
static SDValue PerformMSTORECombine(SDNode *N, SelectionDAG &DAG,
|
static SDValue PerformMSTORECombine(SDNode *N, SelectionDAG &DAG,
|
||||||
|
|
|
@ -227,7 +227,7 @@ void Float2Int::walkBackwards(const SmallPtrSetImpl<Instruction*> &Roots) {
|
||||||
seen(I, unknownRange());
|
seen(I, unknownRange());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Value *O : I->operands()) {
|
for (Value *O : I->operands()) {
|
||||||
if (Instruction *OI = dyn_cast<Instruction>(O)) {
|
if (Instruction *OI = dyn_cast<Instruction>(O)) {
|
||||||
// Unify def-use chains if they interfere.
|
// Unify def-use chains if they interfere.
|
||||||
|
@ -400,7 +400,7 @@ bool Float2Int::validateAndTransform() {
|
||||||
R.isFullSet() || R.isSignWrappedSet())
|
R.isFullSet() || R.isSignWrappedSet())
|
||||||
continue;
|
continue;
|
||||||
assert(ConvertedToTy && "Must have set the convertedtoty by this point!");
|
assert(ConvertedToTy && "Must have set the convertedtoty by this point!");
|
||||||
|
|
||||||
// The number of bits required is the maximum of the upper and
|
// The number of bits required is the maximum of the upper and
|
||||||
// lower limits, plus one so it can be signed.
|
// lower limits, plus one so it can be signed.
|
||||||
unsigned MinBW = std::max(R.getLower().getMinSignedBits(),
|
unsigned MinBW = std::max(R.getLower().getMinSignedBits(),
|
||||||
|
|
Loading…
Reference in New Issue