diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:43:56 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:43:56 +0000 |
commit | 590d96feea75246dee213cb528930df8f6234b87 (patch) | |
tree | f39c096d4be3f8a2f8ccefe3715fa7ed7eabc632 /contrib/llvm-project/llvm/include | |
parent | 5ffd83dbcc34f10e07f6d3e968ae6365869615f4 (diff) | |
parent | 2cedf089162d7ff08af2fb09e4adea44608e7233 (diff) | |
download | src-590d96feea75246dee213cb528930df8f6234b87.tar.gz src-590d96feea75246dee213cb528930df8f6234b87.zip |
Notes
Diffstat (limited to 'contrib/llvm-project/llvm/include')
4 files changed, 59 insertions, 14 deletions
diff --git a/contrib/llvm-project/llvm/include/llvm/IR/IRBuilder.h b/contrib/llvm-project/llvm/include/llvm/IR/IRBuilder.h index 4552ca016bd7..ffec4ff64ca6 100644 --- a/contrib/llvm-project/llvm/include/llvm/IR/IRBuilder.h +++ b/contrib/llvm-project/llvm/include/llvm/IR/IRBuilder.h @@ -782,11 +782,7 @@ public: /// Create an assume intrinsic call that allows the optimizer to /// assume that the provided condition will be true. - /// - /// The optional argument \p OpBundles specifies operand bundles that are - /// added to the call instruction. - CallInst *CreateAssumption(Value *Cond, - ArrayRef<OperandBundleDef> OpBundles = llvm::None); + CallInst *CreateAssumption(Value *Cond); /// Create a call to the experimental.gc.statepoint intrinsic to /// start a new statepoint sequence. @@ -2506,11 +2502,13 @@ public: private: /// Helper function that creates an assume intrinsic call that - /// represents an alignment assumption on the provided pointer \p PtrValue - /// with offset \p OffsetValue and alignment value \p AlignValue. + /// represents an alignment assumption on the provided Ptr, Mask, Type + /// and Offset. It may be sometimes useful to do some other logic + /// based on this alignment check, thus it can be stored into 'TheCheck'. CallInst *CreateAlignmentAssumptionHelper(const DataLayout &DL, - Value *PtrValue, Value *AlignValue, - Value *OffsetValue); + Value *PtrValue, Value *Mask, + Type *IntPtrTy, Value *OffsetValue, + Value **TheCheck); public: /// Create an assume intrinsic call that represents an alignment @@ -2519,9 +2517,13 @@ public: /// An optional offset can be provided, and if it is provided, the offset /// must be subtracted from the provided pointer to get the pointer with the /// specified alignment. + /// + /// It may be sometimes useful to do some other logic + /// based on this alignment check, thus it can be stored into 'TheCheck'. CallInst *CreateAlignmentAssumption(const DataLayout &DL, Value *PtrValue, unsigned Alignment, - Value *OffsetValue = nullptr); + Value *OffsetValue = nullptr, + Value **TheCheck = nullptr); /// Create an assume intrinsic call that represents an alignment /// assumption on the provided pointer. @@ -2530,11 +2532,15 @@ public: /// must be subtracted from the provided pointer to get the pointer with the /// specified alignment. /// + /// It may be sometimes useful to do some other logic + /// based on this alignment check, thus it can be stored into 'TheCheck'. + /// /// This overload handles the condition where the Alignment is dependent /// on an existing value rather than a static value. CallInst *CreateAlignmentAssumption(const DataLayout &DL, Value *PtrValue, Value *Alignment, - Value *OffsetValue = nullptr); + Value *OffsetValue = nullptr, + Value **TheCheck = nullptr); }; /// This provides a uniform API for creating instructions and inserting diff --git a/contrib/llvm-project/llvm/include/llvm/Support/RISCVTargetParser.def b/contrib/llvm-project/llvm/include/llvm/Support/RISCVTargetParser.def new file mode 100644 index 000000000000..28de6cd40132 --- /dev/null +++ b/contrib/llvm-project/llvm/include/llvm/Support/RISCVTargetParser.def @@ -0,0 +1,13 @@ +#ifndef PROC +#define PROC(ENUM, NAME, FEATURES, DEFAULT_MARCH) +#endif + +PROC(INVALID, {"invalid"}, FK_INVALID, {""}) +PROC(GENERIC_RV32, {"generic-rv32"}, FK_NONE, {""}) +PROC(GENERIC_RV64, {"generic-rv64"}, FK_64BIT, {""}) +PROC(ROCKET_RV32, {"rocket-rv32"}, FK_NONE, {""}) +PROC(ROCKET_RV64, {"rocket-rv64"}, FK_64BIT, {""}) +PROC(SIFIVE_E31, {"sifive-e31"}, FK_NONE, {"rv32imac"}) +PROC(SIFIVE_U54, {"sifive-u54"}, FK_64BIT, {"rv64gc"}) + +#undef PROC diff --git a/contrib/llvm-project/llvm/include/llvm/Support/TargetParser.h b/contrib/llvm-project/llvm/include/llvm/Support/TargetParser.h index a0bd88c153b6..f521d8f836b4 100644 --- a/contrib/llvm-project/llvm/include/llvm/Support/TargetParser.h +++ b/contrib/llvm-project/llvm/include/llvm/Support/TargetParser.h @@ -130,6 +130,32 @@ IsaVersion getIsaVersion(StringRef GPU); } // namespace AMDGPU +namespace RISCV { + +enum CPUKind : unsigned { +#define PROC(ENUM, NAME, FEATURES, DEFAULT_MARCH) CK_##ENUM, +#include "RISCVTargetParser.def" +}; + +enum FeatureKind : unsigned { + FK_INVALID = 0, + FK_NONE = 1, + FK_STDEXTM = 1 << 2, + FK_STDEXTA = 1 << 3, + FK_STDEXTF = 1 << 4, + FK_STDEXTD = 1 << 5, + FK_STDEXTC = 1 << 6, + FK_64BIT = 1 << 7, +}; + +bool checkCPUKind(CPUKind Kind, bool IsRV64); +CPUKind parseCPUKind(StringRef CPU); +StringRef getMArchFromMcpu(StringRef CPU); +void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64); +bool getCPUFeaturesExceptStdExt(CPUKind Kind, std::vector<StringRef> &Features); + +} // namespace RISCV + } // namespace llvm #endif diff --git a/contrib/llvm-project/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h b/contrib/llvm-project/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h index 10b6e1c6a21b..be119b8ab855 100644 --- a/contrib/llvm-project/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h +++ b/contrib/llvm-project/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h @@ -37,9 +37,9 @@ struct AlignmentFromAssumptionsPass ScalarEvolution *SE = nullptr; DominatorTree *DT = nullptr; - bool extractAlignmentInfo(CallInst *I, unsigned Idx, Value *&AAPtr, - const SCEV *&AlignSCEV, const SCEV *&OffSCEV); - bool processAssumption(CallInst *I, unsigned Idx); + bool extractAlignmentInfo(CallInst *I, Value *&AAPtr, const SCEV *&AlignSCEV, + const SCEV *&OffSCEV); + bool processAssumption(CallInst *I); }; } |