diff options
Diffstat (limited to 'include/llvm/IR')
26 files changed, 227 insertions, 192 deletions
diff --git a/include/llvm/IR/Argument.h b/include/llvm/IR/Argument.h index 3efcc637b6ed..497dca44547c 100644 --- a/include/llvm/IR/Argument.h +++ b/include/llvm/IR/Argument.h @@ -120,7 +120,7 @@ public: bool hasAttribute(Attribute::AttrKind Kind) const; /// Method for support type inquiry through isa, cast, and dyn_cast. - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() == ArgumentVal; } }; diff --git a/include/llvm/IR/BasicBlock.h b/include/llvm/IR/BasicBlock.h index 7a35afcbafc3..6714f2c97473 100644 --- a/include/llvm/IR/BasicBlock.h +++ b/include/llvm/IR/BasicBlock.h @@ -326,7 +326,7 @@ public: ValueSymbolTable *getValueSymbolTable(); /// \brief Methods for support type inquiry through isa, cast, and dyn_cast. - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() == Value::BasicBlockVal; } diff --git a/include/llvm/IR/Constant.h b/include/llvm/IR/Constant.h index 82afd9a2691f..9daeac6ad6e7 100644 --- a/include/llvm/IR/Constant.h +++ b/include/llvm/IR/Constant.h @@ -116,7 +116,7 @@ public: void destroyConstant(); //// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() >= ConstantFirstVal && V->getValueID() <= ConstantLastVal; } diff --git a/include/llvm/IR/Constants.h b/include/llvm/IR/Constants.h index 003a6d5d075d..8b3a90fa065b 100644 --- a/include/llvm/IR/Constants.h +++ b/include/llvm/IR/Constants.h @@ -842,7 +842,7 @@ public: BasicBlock *getBasicBlock() const { return (BasicBlock*)Op<1>().get(); } /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() == BlockAddressVal; } }; @@ -1217,7 +1217,7 @@ public: Instruction *getAsInstruction(); /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() == ConstantExprVal; } diff --git a/include/llvm/IR/DerivedTypes.h b/include/llvm/IR/DerivedTypes.h index a92321a44511..6e5e085873ab 100644 --- a/include/llvm/IR/DerivedTypes.h +++ b/include/llvm/IR/DerivedTypes.h @@ -89,7 +89,7 @@ public: bool isPowerOf2ByteWidth() const; /// Methods for support type inquiry through isa, cast, and dyn_cast. - static inline bool classof(const Type *T) { + static bool classof(const Type *T) { return T->getTypeID() == IntegerTyID; } }; @@ -139,7 +139,7 @@ public: unsigned getNumParams() const { return NumContainedTys - 1; } /// Methods for support type inquiry through isa, cast, and dyn_cast. - static inline bool classof(const Type *T) { + static bool classof(const Type *T) { return T->getTypeID() == FunctionTyID; } }; @@ -171,7 +171,7 @@ public: bool indexValid(unsigned Idx) const; /// Methods for support type inquiry through isa, cast, and dyn_cast. - static inline bool classof(const Type *T) { + static bool classof(const Type *T) { return T->getTypeID() == ArrayTyID || T->getTypeID() == StructTyID || T->getTypeID() == VectorTyID; @@ -317,7 +317,7 @@ public: } /// Methods for support type inquiry through isa, cast, and dyn_cast. - static inline bool classof(const Type *T) { + static bool classof(const Type *T) { return T->getTypeID() == StructTyID; } }; @@ -360,7 +360,7 @@ public: Type *getElementType() const { return ContainedType; } /// Methods for support type inquiry through isa, cast, and dyn_cast. - static inline bool classof(const Type *T) { + static bool classof(const Type *T) { return T->getTypeID() == ArrayTyID || T->getTypeID() == VectorTyID; } }; @@ -380,7 +380,7 @@ public: static bool isValidElementType(Type *ElemTy); /// Methods for support type inquiry through isa, cast, and dyn_cast. - static inline bool classof(const Type *T) { + static bool classof(const Type *T) { return T->getTypeID() == ArrayTyID; } }; @@ -454,7 +454,7 @@ public: } /// Methods for support type inquiry through isa, cast, and dyn_cast. - static inline bool classof(const Type *T) { + static bool classof(const Type *T) { return T->getTypeID() == VectorTyID; } }; @@ -495,7 +495,7 @@ public: inline unsigned getAddressSpace() const { return getSubclassData(); } /// Implement support type inquiry through isa, cast, and dyn_cast. - static inline bool classof(const Type *T) { + static bool classof(const Type *T) { return T->getTypeID() == PointerTyID; } }; diff --git a/include/llvm/IR/Dominators.h b/include/llvm/IR/Dominators.h index 9be6acc33591..e10d14c19793 100644 --- a/include/llvm/IR/Dominators.h +++ b/include/llvm/IR/Dominators.h @@ -36,12 +36,22 @@ class raw_ostream; extern template class DomTreeNodeBase<BasicBlock>; extern template class DominatorTreeBase<BasicBlock>; +namespace DomTreeBuilder { extern template void Calculate<Function, BasicBlock *>( DominatorTreeBaseByGraphTraits<GraphTraits<BasicBlock *>> &DT, Function &F); + extern template void Calculate<Function, Inverse<BasicBlock *>>( DominatorTreeBaseByGraphTraits<GraphTraits<Inverse<BasicBlock *>>> &DT, Function &F); +extern template bool Verify<BasicBlock *>( + const DominatorTreeBaseByGraphTraits<GraphTraits<BasicBlock *>> &DT); + +extern template bool Verify<Inverse<BasicBlock *>>( + const DominatorTreeBaseByGraphTraits<GraphTraits<Inverse<BasicBlock *>>> + &DT); +} // namespace DomTreeBuilder + using DomTreeNode = DomTreeNodeBase<BasicBlock>; class BasicBlockEdge { diff --git a/include/llvm/IR/Function.h b/include/llvm/IR/Function.h index 3496806d9362..75fccc135dae 100644 --- a/include/llvm/IR/Function.h +++ b/include/llvm/IR/Function.h @@ -671,7 +671,7 @@ public: void viewCFGOnly() const; /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() == Value::FunctionVal; } diff --git a/include/llvm/IR/GlobalAlias.h b/include/llvm/IR/GlobalAlias.h index d4bf0d7e1ed4..450583baaa3c 100644 --- a/include/llvm/IR/GlobalAlias.h +++ b/include/llvm/IR/GlobalAlias.h @@ -88,7 +88,7 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() == Value::GlobalAliasVal; } }; diff --git a/include/llvm/IR/GlobalIFunc.h b/include/llvm/IR/GlobalIFunc.h index d90c7c78ed26..ef51315a6f5d 100644 --- a/include/llvm/IR/GlobalIFunc.h +++ b/include/llvm/IR/GlobalIFunc.h @@ -70,7 +70,7 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() == Value::GlobalIFuncVal; } }; diff --git a/include/llvm/IR/GlobalIndirectSymbol.h b/include/llvm/IR/GlobalIndirectSymbol.h index 212703af7101..22c00686c549 100644 --- a/include/llvm/IR/GlobalIndirectSymbol.h +++ b/include/llvm/IR/GlobalIndirectSymbol.h @@ -75,7 +75,7 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() == Value::GlobalAliasVal || V->getValueID() == Value::GlobalIFuncVal; } diff --git a/include/llvm/IR/GlobalObject.h b/include/llvm/IR/GlobalObject.h index fc38f698027b..278b193567f1 100644 --- a/include/llvm/IR/GlobalObject.h +++ b/include/llvm/IR/GlobalObject.h @@ -155,7 +155,7 @@ protected: public: // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() == Value::FunctionVal || V->getValueID() == Value::GlobalVariableVal; } diff --git a/include/llvm/IR/GlobalVariable.h b/include/llvm/IR/GlobalVariable.h index 8255a4f298c0..34ace6f2b4f4 100644 --- a/include/llvm/IR/GlobalVariable.h +++ b/include/llvm/IR/GlobalVariable.h @@ -241,7 +241,7 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() == Value::GlobalVariableVal; } }; diff --git a/include/llvm/IR/InlineAsm.h b/include/llvm/IR/InlineAsm.h index 7f03fcd19b65..59874b05b0ce 100644 --- a/include/llvm/IR/InlineAsm.h +++ b/include/llvm/IR/InlineAsm.h @@ -183,7 +183,7 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() == Value::InlineAsmVal; } diff --git a/include/llvm/IR/InstrTypes.h b/include/llvm/IR/InstrTypes.h index 76524b412456..d749077fd34a 100644 --- a/include/llvm/IR/InstrTypes.h +++ b/include/llvm/IR/InstrTypes.h @@ -73,10 +73,10 @@ public: void setSuccessor(unsigned idx, BasicBlock *B); // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->isTerminator(); } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -298,14 +298,14 @@ public: DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::Alloca || I->getOpcode() == Instruction::Load || I->getOpcode() == Instruction::VAArg || I->getOpcode() == Instruction::ExtractValue || (I->getOpcode() >= CastOpsBegin && I->getOpcode() < CastOpsEnd); } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -532,10 +532,10 @@ public: bool swapOperands(); // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->isBinaryOp(); } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -833,10 +833,10 @@ public: static bool castIsValid(Instruction::CastOps op, Value *S, Type *DstTy); /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->isCast(); } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -1062,11 +1062,11 @@ public: static bool isImpliedFalseByMatchingCmp(Predicate Pred1, Predicate Pred2); /// @brief Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::ICmp || I->getOpcode() == Instruction::FCmp; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -1152,8 +1152,8 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { return I->isFuncletPad(); } - static inline bool classof(const Value *V) { + static bool classof(const Instruction *I) { return I->isFuncletPad(); } + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; diff --git a/include/llvm/IR/Instruction.h b/include/llvm/IR/Instruction.h index d8db29e15886..8dc02111b866 100644 --- a/include/llvm/IR/Instruction.h +++ b/include/llvm/IR/Instruction.h @@ -556,7 +556,7 @@ public: /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return V->getValueID() >= Value::InstructionVal; } diff --git a/include/llvm/IR/Instructions.h b/include/llvm/IR/Instructions.h index e1620b3e7df5..dc5f37450b48 100644 --- a/include/llvm/IR/Instructions.h +++ b/include/llvm/IR/Instructions.h @@ -145,10 +145,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return (I->getOpcode() == Instruction::Alloca); } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -284,10 +284,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::Load; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -408,10 +408,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::Store; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -483,10 +483,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::Fence; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -639,10 +639,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::AtomicCmpXchg; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -788,10 +788,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::AtomicRMW; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -1048,10 +1048,10 @@ public: bool accumulateConstantOffset(const DataLayout &DL, APInt &Offset) const; // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return (I->getOpcode() == Instruction::GetElementPtr); } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -1226,10 +1226,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::ICmp; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -1334,10 +1334,10 @@ public: } /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::FCmp; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -1873,10 +1873,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::Call; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -2011,10 +2011,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::Select; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -2057,10 +2057,10 @@ public: static unsigned getPointerOperandIndex() { return 0U; } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == VAArg; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -2114,10 +2114,10 @@ public: DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::ExtractElement; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -2177,10 +2177,10 @@ public: DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::InsertElement; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -2276,10 +2276,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::ShuffleVector; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -2376,10 +2376,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::ExtractValue; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -2507,10 +2507,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::InsertValue; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -2747,10 +2747,10 @@ public: bool hasConstantOrUndefValue() const; /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::PHI; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -2856,10 +2856,10 @@ public: void reserveClauses(unsigned Size) { growOperands(Size); } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::LandingPad; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -2930,10 +2930,10 @@ public: unsigned getNumSuccessors() const { return 0; } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return (I->getOpcode() == Instruction::Ret); } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -3046,10 +3046,10 @@ public: void swapSuccessors(); // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return (I->getOpcode() == Instruction::Br); } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -3403,10 +3403,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::Switch; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -3501,10 +3501,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::IndirectBr; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -3977,10 +3977,10 @@ public: unsigned getNumSuccessors() const { return 2; } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return (I->getOpcode() == Instruction::Invoke); } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -4072,10 +4072,10 @@ public: unsigned getNumSuccessors() const { return 0; } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::Resume; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -4260,10 +4260,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::CatchSwitch; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -4306,10 +4306,10 @@ public: } /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::CleanupPad; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -4356,10 +4356,10 @@ public: } /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::CatchPad; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -4420,10 +4420,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return (I->getOpcode() == Instruction::CatchRet); } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -4516,10 +4516,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return (I->getOpcode() == Instruction::CleanupRet); } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -4577,10 +4577,10 @@ public: unsigned getNumSuccessors() const { return 0; } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::Unreachable; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } @@ -4627,10 +4627,10 @@ public: ); /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Trunc; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -4666,10 +4666,10 @@ public: ); /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == ZExt; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -4705,10 +4705,10 @@ public: ); /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == SExt; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -4744,10 +4744,10 @@ public: ); /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == FPTrunc; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -4783,10 +4783,10 @@ public: ); /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == FPExt; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -4822,10 +4822,10 @@ public: ); /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == UIToFP; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -4861,10 +4861,10 @@ public: ); /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == SIToFP; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -4900,10 +4900,10 @@ public: ); /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == FPToUI; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -4939,10 +4939,10 @@ public: ); /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == FPToSI; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -4982,10 +4982,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == IntToPtr; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -5033,10 +5033,10 @@ public: } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == PtrToInt; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -5072,10 +5072,10 @@ public: ); // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == BitCast; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } }; @@ -5112,10 +5112,10 @@ public: ); // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == AddrSpaceCast; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) && classof(cast<Instruction>(V)); } diff --git a/include/llvm/IR/IntrinsicInst.h b/include/llvm/IR/IntrinsicInst.h index e0dd3ca7d01e..944af57a7800 100644 --- a/include/llvm/IR/IntrinsicInst.h +++ b/include/llvm/IR/IntrinsicInst.h @@ -53,12 +53,12 @@ namespace llvm { } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const CallInst *I) { + static bool classof(const CallInst *I) { if (const Function *CF = I->getCalledFunction()) return CF->isIntrinsic(); return false; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<CallInst>(V) && classof(cast<CallInst>(V)); } }; @@ -72,7 +72,7 @@ namespace llvm { Value *getVariableLocation(bool AllowNullOp = true) const; // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { switch (I->getIntrinsicID()) { case Intrinsic::dbg_declare: case Intrinsic::dbg_value: @@ -80,7 +80,7 @@ namespace llvm { default: return false; } } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } }; @@ -107,10 +107,10 @@ namespace llvm { } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::dbg_declare; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } }; @@ -144,10 +144,10 @@ namespace llvm { } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::dbg_value; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } }; @@ -176,7 +176,7 @@ namespace llvm { ExceptionBehavior getExceptionBehavior() const; // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { switch (I->getIntrinsicID()) { case Intrinsic::experimental_constrained_fadd: case Intrinsic::experimental_constrained_fsub: @@ -199,7 +199,7 @@ namespace llvm { default: return false; } } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } }; @@ -288,10 +288,10 @@ namespace llvm { setArgOperand(ARG_ELEMENTSIZE, V); } - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::memcpy_element_unordered_atomic; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } }; @@ -358,7 +358,7 @@ namespace llvm { } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { switch (I->getIntrinsicID()) { case Intrinsic::memcpy: case Intrinsic::memmove: @@ -367,7 +367,7 @@ namespace llvm { default: return false; } } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } }; @@ -387,10 +387,10 @@ namespace llvm { } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::memset; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } }; @@ -419,11 +419,11 @@ namespace llvm { } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::memcpy || I->getIntrinsicID() == Intrinsic::memmove; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } }; @@ -432,10 +432,10 @@ namespace llvm { class MemCpyInst : public MemTransferInst { public: // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::memcpy; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } }; @@ -444,10 +444,10 @@ namespace llvm { class MemMoveInst : public MemTransferInst { public: // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::memmove; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } }; @@ -455,10 +455,10 @@ namespace llvm { /// This represents the llvm.va_start intrinsic. class VAStartInst : public IntrinsicInst { public: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::vastart; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } @@ -468,10 +468,10 @@ namespace llvm { /// This represents the llvm.va_end intrinsic. class VAEndInst : public IntrinsicInst { public: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::vaend; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } @@ -481,10 +481,10 @@ namespace llvm { /// This represents the llvm.va_copy intrinsic. class VACopyInst : public IntrinsicInst { public: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::vacopy; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } @@ -495,10 +495,10 @@ namespace llvm { /// This represents the llvm.instrprof_increment intrinsic. class InstrProfIncrementInst : public IntrinsicInst { public: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::instrprof_increment; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } @@ -524,10 +524,10 @@ namespace llvm { class InstrProfIncrementInstStep : public InstrProfIncrementInst { public: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::instrprof_increment_step; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } }; @@ -535,10 +535,10 @@ namespace llvm { /// This represents the llvm.instrprof_value_profile intrinsic. class InstrProfValueProfileInst : public IntrinsicInst { public: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::instrprof_value_profile; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } diff --git a/include/llvm/IR/IntrinsicsWebAssembly.td b/include/llvm/IR/IntrinsicsWebAssembly.td index 3a0957dfa39b..640ef627bc46 100644 --- a/include/llvm/IR/IntrinsicsWebAssembly.td +++ b/include/llvm/IR/IntrinsicsWebAssembly.td @@ -19,4 +19,8 @@ let TargetPrefix = "wasm" in { // All intrinsics start with "llvm.wasm.". def int_wasm_current_memory : Intrinsic<[llvm_anyint_ty], [], [IntrReadMem]>; def int_wasm_grow_memory : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>], []>; +// Exception handling intrinsics +def int_wasm_throw: Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty], [Throws]>; +def int_wasm_rethrow: Intrinsic<[], [], [Throws]>; + } diff --git a/include/llvm/IR/LLVMContext.h b/include/llvm/IR/LLVMContext.h index ad011fb72e6a..b27abad618c9 100644 --- a/include/llvm/IR/LLVMContext.h +++ b/include/llvm/IR/LLVMContext.h @@ -188,10 +188,19 @@ public: /// \brief Return if a code hotness metric should be included in optimization /// diagnostics. - bool getDiagnosticHotnessRequested() const; + bool getDiagnosticsHotnessRequested() const; /// \brief Set if a code hotness metric should be included in optimization /// diagnostics. - void setDiagnosticHotnessRequested(bool Requested); + void setDiagnosticsHotnessRequested(bool Requested); + + /// \brief Return the minimum hotness value a diagnostic would need in order + /// to be included in optimization diagnostics. If there is no minimum, this + /// returns None. + uint64_t getDiagnosticsHotnessThreshold() const; + + /// \brief Set the minimum hotness value a diagnostic needs in order to be + /// included in optimization diagnostics. + void setDiagnosticsHotnessThreshold(uint64_t Threshold); /// \brief Return the YAML file used by the backend to save optimization /// diagnostics. If null, diagnostics are not saved in a file but only diff --git a/include/llvm/IR/LegacyPassNameParser.h b/include/llvm/IR/LegacyPassNameParser.h index fd9d468b06cb..4cec08196408 100644 --- a/include/llvm/IR/LegacyPassNameParser.h +++ b/include/llvm/IR/LegacyPassNameParser.h @@ -81,15 +81,15 @@ public: // default implementation to sort the table before we print... void printOptionInfo(const cl::Option &O, size_t GlobalWidth) const override { PassNameParser *PNP = const_cast<PassNameParser*>(this); - array_pod_sort(PNP->Values.begin(), PNP->Values.end(), ValLessThan); + array_pod_sort(PNP->Values.begin(), PNP->Values.end(), ValCompare); cl::parser<const PassInfo*>::printOptionInfo(O, GlobalWidth); } private: - // ValLessThan - Provide a sorting comparator for Values elements... - static int ValLessThan(const PassNameParser::OptionInfo *VT1, - const PassNameParser::OptionInfo *VT2) { - return VT1->Name < VT2->Name; + // ValCompare - Provide a sorting comparator for Values elements... + static int ValCompare(const PassNameParser::OptionInfo *VT1, + const PassNameParser::OptionInfo *VT2) { + return VT1->Name.compare(VT2->Name); } }; diff --git a/include/llvm/IR/Metadata.h b/include/llvm/IR/Metadata.h index 80ed44be43eb..3462cc02fd27 100644 --- a/include/llvm/IR/Metadata.h +++ b/include/llvm/IR/Metadata.h @@ -660,6 +660,19 @@ struct AAMDNodes { /// \brief The tag specifying the noalias scope. MDNode *NoAlias; + + /// \brief Given two sets of AAMDNodes that apply to the same pointer, + /// give the best AAMDNodes that are compatible with both (i.e. a set of + /// nodes whose allowable aliasing conclusions are a subset of those + /// allowable by both of the inputs). However, for efficiency + /// reasons, do not create any new MDNodes. + AAMDNodes intersect(const AAMDNodes &Other) { + AAMDNodes Result; + Result.TBAA = Other.TBAA == TBAA ? TBAA : nullptr; + Result.Scope = Other.Scope == Scope ? Scope : nullptr; + Result.NoAlias = Other.NoAlias == NoAlias ? NoAlias : nullptr; + return Result; + } }; // Specialize DenseMapInfo for AAMDNodes. diff --git a/include/llvm/IR/ModuleSummaryIndexYAML.h b/include/llvm/IR/ModuleSummaryIndexYAML.h index 5d7b8b997d37..7f6cb5bee5a6 100644 --- a/include/llvm/IR/ModuleSummaryIndexYAML.h +++ b/include/llvm/IR/ModuleSummaryIndexYAML.h @@ -140,8 +140,6 @@ struct FunctionSummaryYaml { } // End yaml namespace } // End llvm namespace -LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint64_t) - namespace llvm { namespace yaml { @@ -188,7 +186,6 @@ template <> struct MappingTraits<FunctionSummaryYaml> { LLVM_YAML_IS_STRING_MAP(TypeIdSummary) LLVM_YAML_IS_SEQUENCE_VECTOR(FunctionSummaryYaml) -LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(std::string) namespace llvm { namespace yaml { diff --git a/include/llvm/IR/Operator.h b/include/llvm/IR/Operator.h index c7f4697e93e7..9df6bfc54cd4 100644 --- a/include/llvm/IR/Operator.h +++ b/include/llvm/IR/Operator.h @@ -54,9 +54,9 @@ public: return Instruction::UserOp1; } - static inline bool classof(const Instruction *) { return true; } - static inline bool classof(const ConstantExpr *) { return true; } - static inline bool classof(const Value *V) { + static bool classof(const Instruction *) { return true; } + static bool classof(const ConstantExpr *) { return true; } + static bool classof(const Value *V) { return isa<Instruction>(V) || isa<ConstantExpr>(V); } }; @@ -97,19 +97,19 @@ public: return (SubclassOptionalData & NoSignedWrap) != 0; } - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Instruction::Add || I->getOpcode() == Instruction::Sub || I->getOpcode() == Instruction::Mul || I->getOpcode() == Instruction::Shl; } - static inline bool classof(const ConstantExpr *CE) { + static bool classof(const ConstantExpr *CE) { return CE->getOpcode() == Instruction::Add || CE->getOpcode() == Instruction::Sub || CE->getOpcode() == Instruction::Mul || CE->getOpcode() == Instruction::Shl; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return (isa<Instruction>(V) && classof(cast<Instruction>(V))) || (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V))); } @@ -144,13 +144,13 @@ public: OpC == Instruction::LShr; } - static inline bool classof(const ConstantExpr *CE) { + static bool classof(const ConstantExpr *CE) { return isPossiblyExactOpcode(CE->getOpcode()); } - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return isPossiblyExactOpcode(I->getOpcode()); } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return (isa<Instruction>(V) && classof(cast<Instruction>(V))) || (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V))); } @@ -324,17 +324,17 @@ public: /// precision. float getFPAccuracy() const; - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getType()->isFPOrFPVectorTy() || I->getOpcode() == Instruction::FCmp; } - static inline bool classof(const ConstantExpr *CE) { + static bool classof(const ConstantExpr *CE) { return CE->getType()->isFPOrFPVectorTy() || CE->getOpcode() == Instruction::FCmp; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return (isa<Instruction>(V) && classof(cast<Instruction>(V))) || (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V))); } @@ -344,13 +344,13 @@ public: template<typename SuperClass, unsigned Opc> class ConcreteOperator : public SuperClass { public: - static inline bool classof(const Instruction *I) { + static bool classof(const Instruction *I) { return I->getOpcode() == Opc; } - static inline bool classof(const ConstantExpr *CE) { + static bool classof(const ConstantExpr *CE) { return CE->getOpcode() == Opc; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return (isa<Instruction>(V) && classof(cast<Instruction>(V))) || (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V))); } diff --git a/include/llvm/IR/PatternMatch.h b/include/llvm/IR/PatternMatch.h index 9e9c8ac75d2a..5b69e7855cc7 100644 --- a/include/llvm/IR/PatternMatch.h +++ b/include/llvm/IR/PatternMatch.h @@ -378,7 +378,7 @@ struct bind_const_intval_ty { template <typename ITy> bool match(ITy *V) { if (const auto *CV = dyn_cast<ConstantInt>(V)) - if (CV->getBitWidth() <= 64) { + if (CV->getValue().ule(UINT64_MAX)) { VR = CV->getZExtValue(); return true; } @@ -399,10 +399,7 @@ struct specific_intval { if (const auto *C = dyn_cast<Constant>(V)) CI = dyn_cast_or_null<ConstantInt>(C->getSplatValue()); - if (CI && CI->getBitWidth() <= 64) - return CI->getZExtValue() == Val; - - return false; + return CI && CI->getValue() == Val; } }; @@ -1363,6 +1360,11 @@ m_Intrinsic(const T0 &Op0, const T1 &Op1, const T2 &Op2, const T3 &Op3) { // Helper intrinsic matching specializations. template <typename Opnd0> +inline typename m_Intrinsic_Ty<Opnd0>::Ty m_BitReverse(const Opnd0 &Op0) { + return m_Intrinsic<Intrinsic::bitreverse>(Op0); +} + +template <typename Opnd0> inline typename m_Intrinsic_Ty<Opnd0>::Ty m_BSwap(const Opnd0 &Op0) { return m_Intrinsic<Intrinsic::bswap>(Op0); } diff --git a/include/llvm/IR/Statepoint.h b/include/llvm/IR/Statepoint.h index 630f30667272..ad9537e9762e 100644 --- a/include/llvm/IR/Statepoint.h +++ b/include/llvm/IR/Statepoint.h @@ -329,12 +329,12 @@ public: /// Currently, the only projections available are gc.result and gc.relocate. class GCProjectionInst : public IntrinsicInst { public: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate || I->getIntrinsicID() == Intrinsic::experimental_gc_result; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } @@ -373,11 +373,11 @@ public: /// Represents calls to the gc.relocate intrinsic. class GCRelocateInst : public GCProjectionInst { public: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::experimental_gc_relocate; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } @@ -408,11 +408,11 @@ public: /// Represents calls to the gc.result intrinsic. class GCResultInst : public GCProjectionInst { public: - static inline bool classof(const IntrinsicInst *I) { + static bool classof(const IntrinsicInst *I) { return I->getIntrinsicID() == Intrinsic::experimental_gc_result; } - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); } }; diff --git a/include/llvm/IR/User.h b/include/llvm/IR/User.h index 109a3d5e7be8..4dfa19cf241f 100644 --- a/include/llvm/IR/User.h +++ b/include/llvm/IR/User.h @@ -288,7 +288,7 @@ public: void replaceUsesOfWith(Value *From, Value *To); // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value *V) { + static bool classof(const Value *V) { return isa<Instruction>(V) || isa<Constant>(V); } }; |
