diff --git a/llvm/lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp b/llvm/lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp index 8d262a01e706..0d3f7d8cfe94 100644 --- a/llvm/lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp +++ b/llvm/lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp @@ -58,9 +58,8 @@ std::string MBlazeIntrinsicInfo::getName(unsigned IntrID, Type **Tys, unsigned MBlazeIntrinsicInfo:: lookupName(const char *Name, unsigned Len) const { - if (Len < 5 || Name[4] != '.' || Name[0] != 'l' || Name[1] != 'l' - || Name[2] != 'v' || Name[3] != 'm') - return 0; // All intrinsics start with 'llvm.' + if (!StringRef(Name, Len).startswith("llvm.")) + return 0; // All intrinsics start with 'llvm.' #define GET_FUNCTION_RECOGNIZER #include "MBlazeGenIntrinsics.inc" diff --git a/llvm/lib/Target/R600/AMDILIntrinsicInfo.cpp b/llvm/lib/Target/R600/AMDILIntrinsicInfo.cpp index 4ddb057d80a7..b92e528ff714 100644 --- a/llvm/lib/Target/R600/AMDILIntrinsicInfo.cpp +++ b/llvm/lib/Target/R600/AMDILIntrinsicInfo.cpp @@ -50,6 +50,9 @@ AMDGPUIntrinsicInfo::getName(unsigned int IntrID, Type **Tys, unsigned int AMDGPUIntrinsicInfo::lookupName(const char *Name, unsigned int Len) const { + if (!StringRef(Name, Len).startswith("llvm.")) + return 0; // All intrinsics start with 'llvm.' + #define GET_FUNCTION_RECOGNIZER #include "AMDGPUGenIntrinsics.inc" #undef GET_FUNCTION_RECOGNIZER