diff options
Diffstat (limited to 'llvm/include/llvm/IR/Intrinsics.h')
-rw-r--r-- | llvm/include/llvm/IR/Intrinsics.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/llvm/include/llvm/IR/Intrinsics.h b/llvm/include/llvm/IR/Intrinsics.h index f9b6c098a3f2..80a2f5a8cd3e 100644 --- a/llvm/include/llvm/IR/Intrinsics.h +++ b/llvm/include/llvm/IR/Intrinsics.h @@ -55,12 +55,23 @@ namespace Intrinsic { /// version of getName if overloads are required. StringRef getName(ID id); - /// Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx". - /// Note, this version of getName supports overloads, but is less efficient - /// than the StringRef version of this function. If no overloads are - /// requried, it is safe to use this version, but better to use the StringRef - /// version. - std::string getName(ID id, ArrayRef<Type*> Tys); + /// Return the LLVM name for an intrinsic, without encoded types for + /// overloading, such as "llvm.ssa.copy". + StringRef getBaseName(ID id); + + /// Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx" or + /// "llvm.ssa.copy.p0s_s.1". Note, this version of getName supports overloads. + /// This is less efficient than the StringRef version of this function. If no + /// overloads are required, it is safe to use this version, but better to use + /// the StringRef version. If one of the types is based on an unnamed type, a + /// function type will be computed. Providing FT will avoid this computation. + std::string getName(ID Id, ArrayRef<Type *> Tys, Module *M, + FunctionType *FT = nullptr); + + /// Return the LLVM name for an intrinsic. This is a special version only to + /// be used by LLVMIntrinsicCopyOverloadedName. It only supports overloads + /// based on named types. + std::string getNameNoUnnamedTypes(ID Id, ArrayRef<Type *> Tys); /// Return the function type for an intrinsic. FunctionType *getType(LLVMContext &Context, ID id, @@ -233,6 +244,8 @@ namespace Intrinsic { // Checks if the intrinsic name matches with its signature and if not // returns the declaration with the same signature and remangled name. + // An existing GlobalValue with the wanted name but with a wrong prototype + // or of the wrong kind will be renamed by adding ".renamed" to the name. llvm::Optional<Function*> remangleIntrinsicFunction(Function *F); } // End Intrinsic namespace |