[llvm] 0577240 - [Utils] Use StringRef::ends_with (NFC) (#135934)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 16 08:39:11 PDT 2025


Author: Kazu Hirata
Date: 2025-04-16T08:39:07-07:00
New Revision: 05772406153c390e61809757643ad49bff7dc71d

URL: https://github.com/llvm/llvm-project/commit/05772406153c390e61809757643ad49bff7dc71d
DIFF: https://github.com/llvm/llvm-project/commit/05772406153c390e61809757643ad49bff7dc71d.diff

LOG: [Utils] Use StringRef::ends_with (NFC) (#135934)

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
index 4e37c587dc975..941e787f91eff 100644
--- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -1936,7 +1936,7 @@ static Value *optimizeDoubleFP(CallInst *CI, IRBuilderBase &B,
   bool IsIntrinsic = CalleeFn->isIntrinsic();
   if (!IsIntrinsic) {
     StringRef CallerName = CI->getFunction()->getName();
-    if (!CallerName.empty() && CallerName.back() == 'f' &&
+    if (CallerName.ends_with('f') &&
         CallerName.size() == (CalleeName.size() + 1) &&
         CallerName.starts_with(CalleeName))
       return nullptr;


        


More information about the llvm-commits mailing list