[SimplifyLibCalls] Use helper methods to query attributes (NFC)
authorNikita Popov <npopov@redhat.com>
Tue, 11 Oct 2022 09:41:28 +0000 (11:41 +0200)
committerNikita Popov <npopov@redhat.com>
Tue, 11 Oct 2022 09:41:28 +0000 (11:41 +0200)
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp

index 3616186..8f25e80 100644 (file)
@@ -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,