[llvm] df8264c - [SimplifyLibCalls] Use helper methods to query attributes (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 02:41:57 PDT 2022


Author: Nikita Popov
Date: 2022-10-11T11:41:28+02:00
New Revision: df8264c46ab1c554b2b0046122a28a40567d6b3f

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

LOG: [SimplifyLibCalls] Use helper methods to query attributes (NFC)

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 3616186851c12..8f25e80a6c5a9 100644
--- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -2515,8 +2515,7 @@ static bool isTrigLibCall(CallInst *CI) {
   // We can only hope to do anything useful if we can ignore things like errno
   // and floating-point exceptions.
   // We already checked the prototype.
-  return CI->hasFnAttr(Attribute::NoUnwind) &&
-         CI->hasFnAttr(Attribute::ReadNone);
+  return CI->doesNotThrow() && CI->doesNotAccessMemory();
 }
 
 static bool insertSinCosCall(IRBuilderBase &B, Function *OrigCallee, Value *Arg,


        


More information about the llvm-commits mailing list